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

Re: pulling file name into perl

Thread Previous
From:
Deen Hameed
Date:
January 31, 2002 19:42
Subject:
Re: pulling file name into perl
Message ID:
Pine.LNX.4.44.0202010905440.1709-100000@localhost.localdomain

Hi Russell,

It executes a command and returns the EXIT STATUS of the command. 

If you look in $date, you will find the exit status of "ls ..." as
returned by the wait() call.

deen

On Thu, 31 Jan 2002, Russell Boyd wrote:

> 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
> 
> 
> 

-- 
Deen Hameedd, Accidental Programmer hameedd@softhome.net



Thread Previous


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