in reply to problem printing array elements -- printing # of lines in array instead

I am not sure that your data looks like, but consider this:
while (<FILE>) { chomp; my ($first_thing, @cmds) = split(/:/,$_); print "$first_thing\n"; print "Individual Elements\n\n"; foreach my $cmd (@cmds) { print " $cmd\n"; } }
Update: don't "slurp" a file into a @var unless you need to do that.
process line by line instead.
I think Corion already pointed out that split works on a scalar, not a @var
  • Comment on Re: problem printing array elements -- printing # of lines in array instead
  • Download Code