Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Open a directory and recursively process files

by BrowserUk (Pope)
on Jan 09, 2013 at 12:38 UTC ( #1012469=note: print w/ replies, xml ) Need Help??


in reply to Reaped: Open a directory and recursively process files

Neither, it is my $line = @_; that is the problem. An array assigned to a scalar gives the number of elements in the array.

What you should do is either the assignment you weren't sure about (but aren't actually using):my $line = $_[0];

Or, a list assignment: my( $line ) = @_;

Or, use shift:my $line = shift;

You should also drop the & from your subroutine calls. Ie. &process_file ($file); should be process_file( $file );


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Open a directory and recursively process files
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-09-20 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls