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

Re: perl equivalent of python's underscore?

by mojotoad (Monsignor)
on Oct 28, 2010 at 07:44 UTC ( #867929=note: print w/replies, xml ) Need Help??


in reply to perl equivalent of python's underscore?

Your question has more to do with scoping and syntax.
Scope:
Python scoping is not like Perl's. It's similar, but forget about 'brackets'. It's about function defs and where they happen.
Syntax:
The underscore '_' in Python is not special, it just happens to be a valid variable name. In conjunction with scoping, this has become short-hand for for a 'disposable' variable. Given the 'fill the slots' nature of assignment in Python, this turns out to be pretty useful, and therefore an idiomatic pythonic thing to do.

And yes, I've had to go play on the dark side here and there.

Cheers,
Matt

  • Comment on Re: perl equivalent of python's underscore?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://867929]
help
Chatterbox?
[Tux]: [ttps://metacpan. org/source/ MLEHMANN/Canary- Stability-2012/ Stability.pm#L124| this is the main reason] never ever to use anything he wrote ever again
[Tux]: [htps://metacpan. org/source/ MLEHMANN/Canary- Stability-2012/ Stability.pm#L124| this is the main reason] never ever to use anything he wrote ever again
[Discipulus]: you are almoste there..retry ;=)
[Tux]: Hmm, that must be something in pm_cb_g
[Tux]: in the dialog area it shows correct, but the url is broken in the CB
[Discipulus]: you still need to put href:// , no?
[Tux]: [htps://metacpan. org/source/ MLEHMANN/Canary- Stability-2012/ Stability.pm#L124| this] is the same link posted on the PM side inside the CB
[Discipulus]: and you wrote ttps and then htps
[Tux]: new try

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-09-20 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (234 votes). Check out past polls.

    Notices?