Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Odd behaviour of chomp()

by hippo (Canon)
on Oct 20, 2015 at 13:36 UTC ( #1145433=note: print w/replies, xml ) Need Help??


in reply to Re: Odd behaviour of chomp()
in thread Odd behaviour of chomp()

$ perl -e 'my $v = "foo\n"; $foo = chomp($foo); print "$foo\n";' 0

What would you expect this to print given that $foo is undefined when chomped? I consider this output to be entirely the correct result of that code. Why would you have it differ and in what way?

Replies are listed 'Best First'.
Re^3: Odd behaviour of chomp()
by sundialsvc4 (Abbot) on Oct 21, 2015 at 14:06 UTC
    Oops, a tpyo.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2019-07-20 18:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?