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

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.

Log In?

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

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

    Results (297 votes). Check out past polls.