in reply to Print array values

I wonder why you cannot just do a simple print command? What is wrong with this?
while($i < scalar(@filename)) { ... print qq{grep -c "$datas[$i]" $filename[$i]\n}; ...
And you might want to change your while loop into a for loop instead.

Replies are listed 'Best First'.
Re^2: Print array values
by ikegami (Patriarch) on Aug 12, 2009 at 15:01 UTC
    If the array doesn't change size,
    my $i = 0; while ($i < @filename) { ... ++$i; }
    is a weird way of doing
    for my $i (0..$#filename) { ... }