Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Newline's creep in, while using Tie::File

by choroba (Cardinal)
on Nov 16, 2020 at 20:34 UTC ( [id://11123713]=note: print w/replies, xml ) Need Help??


in reply to Newline's creep in, while using Tie::File

It seems Tie::File stores the lines without final newlines. Run chomp at the top of the while loop to remove newlines from the lines you want to store.

Update: After reading the documentation, I can confirm the behaviour. You can use the autochomp option to turn this behaviour off.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Newline's creep in, while using Tie::File
by always_coys (Novice) on Nov 16, 2020 at 20:51 UTC
    Thanks a lot! It has worked.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-24 03:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found