Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Directory name as command line argument

by Pancho (Pilgrim)
on Mar 27, 2008 at 17:54 UTC ( [id://676815]=note: print w/replies, xml ) Need Help??


in reply to Directory name as command line argument

use strict; use warnings; my $dir = shift @ARGV; # Get first command line argument opendir DIR, $dir or die $!; # Open Directory for my $file ( readdir(DIR) ){ # Loop through reading each file print "$file \n"; }
Pancho

Replies are listed 'Best First'.
Re^2: Directory name as command line argument
by max210 (Novice) on Mar 27, 2008 at 18:03 UTC
    Great Help. You are life saver :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://676815]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-07-23 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.