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 (<DATA>){
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 splitting on an array anyway. you
should be using $_ there which is assigned in the while(<DATA>) line.
Use of uninitialized value $line in concatenation (.) or string at
foundins.pl line 9, <DATA> line 1.
it is .
Use of uninitialized value $line in concatenation (.) or string at
foundins.pl line 9, <DATA> line 2.
it is .
how can I correct my perl script?
uri