Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: reading files from a directory

by kevyt (Scribe)
on Oct 28, 2010 at 05:49 UTC ( [id://867911]=note: print w/replies, xml ) Need Help??


in reply to Re: reading files from a directory
in thread reading files from a directory

Thanks very much. I am not able to print the contents of the file. I'll read about glob and the explanation in the perlop. Thank you!
my $dir = 'input_files'; die "can't opendir $!" unless opendir DIR, $dir; while (defined(my $file = readdir DIR)) { do { print "The directory and file are $dir/$file\n"; die "Can't open input file $!" unless open IN, "< $dir/$file"; use File::Glob (); while (defined($_ = glob(' IN '))) { print $_; } }; } closedir DIR;
Output
perl create_indivo_schemas.pl Name "main::IN" used only once: possible typo at create_indivo_schemas +.pl line 18. The directory and file are input_files/allergies INThe directory and file are input_files/immunizations INThe directory and file are input_files/.. INThe directory and file are input_files/.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (1)
As of 2026-01-18 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (121 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.