- or download this
for(my $i = 0; $i < @filecontents; $i++)
{
...
#
@line = split(/\,/, $filecontents[$i]);
# XXX ^------ do you really mean comma?
- or download this
# [] constructs an anonymous array, so we use that.
# several ways to do it - choose any (not all :-)
...
# the array @matrix
push(@matrix, [split(/\s+/, $filecontents[$i])]);
}
- or download this
my @matrix;
while (<INPUT>) {
chomp; # you forgot that - remove trailing newline char
push(@matrix, [split]);
}
- or download this
#!/usr/bin/perl
...
chomp; # you forgot that - remove trailing newline char
push(@matrix, [split]);
}
- or download this
$#ARGV = 0; # @ARGV now holds only one element (the first at index 0)
- or download this
print $matrix[7]->[4],"\n";