- or download this
chomp $_;
my $line = $_;
...
$_ # return the modified string
}
split '\s+', $line;
- or download this
my @array = split;
- or download this
print @array."\n"; # prints number of elements instead of whole array
- or download this
print @array, "\n";
- or download this
$hash->{$line_num}=@array; # does not works because of previous issue
- or download this
$hash->{ $line_num } = \@array;
- or download this
$hash->{ $line_num } = [ @array ];
- or download this
while ( <FH> ) {
$hash->{ $. } = [ split ];
}
- or download this
my @data;
while ( <FH> ) {
push @data, [ split ];
}
- or download this
my @data = map [ split ], <FH>;