Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Require input reading files recursively in perl

by kcott (Canon)
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

Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2016-10-27 13:31 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (362 votes). Check out past polls.