perl to hardcode a static value in a field -


i still learning perl , have got program written. question, simple may be, if want hardcode string field below that? thank :).

$out[45]="vus"; 

in other lines use below define values passed `$[out], 1 in question hardcoded , others come split.

  @vals = split/\t/; # splits line @ tabs   @mutations=split/,/,$vals[9]; # splits on comma create array of mutations   ($gene,$transcript,$exon,$coding,$aa);   (@mutations)   {          ($gene,$transcript,$exon,$coding,$aa) = split/\:/; # takes col ab , splits @ colons         grep {$transcript eq $_} keys %nms or next;     }     @out=($.,@colsleft,$_,@colsright);     $out[2]=$gene;     $out[3]=$nms{$transcript};     $out[4]=$transcript;     $out[15]=$coding;     $out[17]=$aa; 

your line of code: $out[45]="vus"; correct in defining 46th element of array @out string, "vus". trying understand code, why want that? usually, better practice not hardcode if @ possible. want make goal make program dynamic possible.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -