in reply to problem printing array elements -- printing # of lines in array instead
Update: don't "slurp" a file into a @var unless you need to do that.while (<FILE>) { chomp; my ($first_thing, @cmds) = split(/:/,$_); print "$first_thing\n"; print "Individual Elements\n\n"; foreach my $cmd (@cmds) { print " $cmd\n"; } }
|
|---|