On Sun Jun 21 2009 @  7:40, AndrewMcHorney wrote:
> Hello
>
> I have written a perl script and I am in the debugging and imroving the 
> code. The first improvement is want to make is to replace the  
> system("Dir c:/s") call because it is not portable. So I was told to use 
> the File package. 

I think you want File::Find, not just File. You can start by looking at
perldoc File::Find, but for many people, that module isn't intuitive at
first. I would recommend that you also read this article:
http://www.stonehenge.com/merlyn/LinuxMag/col45.html

In terms of replacing system("Dir c:/s"), you should also look at these
functions:

perldoc -f opendir
perldoc -f readdir

But in a case like this, you probably want to leverage File::Find rather
than writing all the code yourself.

Hope this helps.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to