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

Re: process a file and reading a line and passing the values to another sub function

by LanX (Canon)
on Dec 12, 2012 at 16:28 UTC ( #1008524=note: print w/ replies, xml ) Need Help??


in reply to process a file and reading a line and passing the values to another sub function

please try to condense code to the relevant parts or mark them better.

I really started counting the lines till 35 before I saw your comment.

something like:

$line = <FILE>; # <---------- 35 # this line doesn't work. don't know what's wrong here..

is easier to find.

anyway, you did it twice:

@buf = <FILE>; # you reading all lines of FILE i +nto @buf foreach $line (@buf) { # OK! (well, "my $line" would be +better) $line = <FILE>; # but now reading again a single +line !?! # which is undef after EOF

please less cargo cult programming!

Don't c&p different approaches from other snippets, better try to understand what's happening.

Cheers Rolf


Comment on Re: process a file and reading a line and passing the values to another sub function
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2015-07-05 20:47 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 (68 votes), past polls