Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 meditating upon the Monastery: (6)
As of 2015-07-31 01:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls