Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: add double quotes to a perl variable

by Kenosis (Priest)
on Nov 15, 2013 at 20:49 UTC ( #1062794=note: print w/ replies, xml ) Need Help??


in reply to Re^2: add double quotes to a perl variable
in thread add double quotes to a perl variable

An input record separator (found in Perl's variable $/ and usually set to \n) determines the end of a line ('record') when reading from a file--like you were doing in your while loop. It's kept on the end of the line, unless you do something like chomping the line. In your case, not removing the input record separator produced undesirable results in your final output. (Sometimes, however, the very last line of a file may not terminate with an input record separator, because the line ends at the end of the file.)


Comment on Re^3: add double quotes to a perl variable
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-04-20 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls