develooper Front page | perl.beginners | Postings from February 2002

Re: pulling file name into perl

Thread Previous | Thread Next
From:
Roger C Haslock
Date:
February 1, 2002 11:24
Subject:
Re: pulling file name into perl
Message ID:
000901c1ab56$49423f20$5a867ed4@neliac
I don't think this is the right way to approach this. I suggest you look at
opendir, readdir in perlfunc.

opendir DIR, '/' or die "$0: no top level directory $!";
my @dirlist = readdir DIR;

- Roger -
----- Original Message -----
From: "Russell Boyd" <RBOYD@tnrcc.state.tx.us>
To: ">" < <beginners@perl.org>
Sent: Thursday, January 31, 2002 8:16 PM
Subject: pulling file name into perl


I am wanting to get a unix directory file listing and put it into a Perl
array. I attempted

$date = system "ls -al | grep filename.txt";

However all this did was send it to <STDOUT>.

What am I missing?

Thanks,
Russell


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org







Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About