Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: print last array element without a new line

by ikegami (Pope)
on Oct 19, 2011 at 23:02 UTC ( #932521=note: print w/ replies, xml ) Need Help??


in reply to Re^3: print last array element without a new line
in thread print last array element without a new line

That means you had a carriage return in the middle of the line.

A better solution would be to change

chomp(my $record = $_);
to
s/\r?\n//; my $record = $_;
or even
s/\s+\z//; my $record = $_;


Comment on Re^4: print last array element without a new line
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2015-07-03 12:03 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 (51 votes), past polls