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

Re: pulling file name into perl

Thread Previous | Thread Next
Roger C Haslock
February 1, 2002 11:24
Re: pulling file name into perl
Message ID:
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" <>
To: ">" < <>
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?


To unsubscribe, e-mail:
For additional commands, e-mail:

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About