Re: Use of uninitialized value for perl

2017-11-05 Thread John W. Krahn
On Sun, 2017-11-05 at 00:43 +, Dong Liu wrote: > I try used perl script to get characters from data: > > #!/usr/bin/perl -w > use v5.14; > while (){ > chomp; > my $line = ''; > $line = (split //,@_)[5]; At no point in your script do you or perl assign a value to the array @_ so th

Re: Use of uninitialized value for perl

2017-11-04 Thread Uri Guttman
On 11/04/2017 08:43 PM, Dong Liu wrote: I try used perl script to get characters from data: #!/usr/bin/perl -w use v5.14; while (){ chomp; my $line = ''; $line = (split //,@_)[5]; You are using @_ which is the array of args to a sub. you aren't in a sub there. also you shouldn't be

Use of uninitialized value for perl

2017-11-04 Thread Dong Liu
I try used perl script to get characters from data: #!/usr/bin/perl -w use v5.14; while (){ chomp; my $line = ''; $line = (split //,@_)[5]; print "it is $line.\n"; } __DATA__ Danio rerio strain Tuebingen chromosome 1 GRCz11 Primary Assembly Danio rerio strain Tuebingen chromos