Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Why does default $_ only work

by haukex (Archbishop)
on Aug 10, 2020 at 19:43 UTC ( [id://11120558]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Why does default $_ only work
in thread Why does default $_ only work

I do not believe chomp is taking the LHS of the assignment and working with it that scalar.

No, that's incorrect, chomp does modify its argument and the return value of the assignment my $selection = <STDIN> is the lvalue $selection, which chomp operates on. The use of chomp in this code is correct and has nothing to do with the problem, it's a = vs =~ problem.

Replies are listed 'Best First'.
Re^4: Why does default $_ only work
by perlfan (Vicar) on Aug 10, 2020 at 19:48 UTC
    Yes, corrected this while you were likely replying. I should have confirmed before I sent the original guess. :) Thank you.

Log In?
Username:
Password:

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

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

    No recent polls found