Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Require input reading files recursively in perl

by kcott (Abbot)
on Apr 17, 2013 at 13:19 UTC ( #1029145=note: print w/ replies, xml ) Need Help??


in reply to Require input reading files recursively in perl

G'day jesuashok,

How about you add these lines to your code and let Perl tell you what's wrong:

use strict; use warnings;

strict should tell you about $file in while( defined ($file = readdir SCR) ) which, I believe, is your immediate problem.

warnings may pick up something I haven't spotted.

Please endeavour to add these two lines to all your scripts.

-- Ken


Comment on Re: Require input reading files recursively in perl
Select or Download Code
Re^2: Require input reading files recursively in perl
by educated_foo (Vicar) on Apr 17, 2013 at 14:06 UTC
    This standard chunk of cargo-cult programming won't actually fix the OP's problem, since the global SCR directory handle will still get overwritten. A dose of "local" or "my" will fix it, and an explanation of what is happening would lead to the right solution.
    Just another Perler interested in Algol Programming.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-09-01 12:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (6 votes), past polls