#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Milton Keynes, Bucks, England
    Posts
    4
    Rep Power
    0
    I was hoping I could use a command like

    $onefile = 'ls -l $names[$loop]';

    where $names[$loop] holds the name of a file

    It does not work though. Obviously what I am trying to do is get a listing for a single file.

    Anyone tell me why the above line does not work or an alternative method.

    Thanks

    ------------------
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    ca, usa
    Posts
    10
    Rep Power
    0
    my @files = ('file1', 'file2', 'etc');

    foreach my $file (@files) {
    my $onefile = `ls -l $file`;
    }

    (i'm assuming your problems was interpolation of the array elemenent and not single quotes vs. tick ( ' vs. ` )

IMN logo majestic logo threadwatch logo seochat tools logo