Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Problem printing @arrays

by tybalt89 (Monsignor)
on Sep 04, 2021 at 07:08 UTC ( [id://11136435]=note: print w/replies, xml ) Need Help??


in reply to Problem printing @arrays

Try replacing

chomp (my @words = <$fh>);
with
tr/\r\n//d for my @words = <$fh>;
which will also remove the \r if present.

Replies are listed 'Best First'.
Re^2: Problem printing @arrays
by sbrothy (Acolyte) on Sep 04, 2021 at 15:45 UTC

    Thank you Tybalt89. That did the trick. I'ts kinda funny though, I had a working script based on one of your older posts here.

    At that time it worked fine. Possibly I downloaded the file from somewhere else this time.

    I have other issues now but I will give 'em a go before asking for help again.

    Thank you!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-28 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found