in reply to Array problem......PLEASE HELP!
The code:
use strict; my @files = ("08","09"); for my $file (@files) { my @command = `ls -l|grep $file`; print "$file $#command\n"; }
works as expected on my box. Your problem is probably in the ".....rest of the script...."
Update:Please create responses, rather than modifying your question. As it stands, your posted code will not work because the $file you pass to your system statement is not a file name. If you swap it for a command element, it still won't work because your ls -l returns more than just file names.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Array problem......PLEASE HELP!
by green_lakers (Novice) on Jan 05, 2009 at 22:04 UTC | |
by kennethk (Abbot) on Jan 05, 2009 at 22:07 UTC |