Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Passing a filehandle to subroutine

by GotToBTru (Prior)
on Aug 10, 2017 at 18:02 UTC ( #1197197=note: print w/replies, xml ) Need Help??


in reply to Passing a filehandle to subroutine

What do you mean by losing the line? That it does not print or that it does not get stored in @ref? Consider the following suggestions:

  1. Use tell to remember the position in the file before you read each line, and use seek to reposition the pointer to there before calling SubOut
  2. Print $line before calling SubOut or pass $line to SubOut and push it onto @ref there

But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2020-09-24 12:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (133 votes). Check out past polls.

    Notices?