Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Array problem......PLEASE HELP!

by kennethk (Abbot)
on Jan 05, 2009 at 20:37 UTC ( [id://734272]=note: print w/replies, xml ) Need Help??


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
    I have updated the question.can you check if that helps to understand the problem. Thanks in advance.
      You have not updated your question since I updated my response.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://734272]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found