Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Using $_ as a temp var, especially in functions

by bprew (Monk)
on Oct 24, 2002 at 03:59 UTC ( [id://207620]=note: print w/replies, xml ) Need Help??


in reply to Using $_ as a temp var, especially in functions

From what I understand from a Perl 6 meeting a couple of weeks ago, it will have a "topic", which allows you to specify a value for the temporary value as its passed in... (ie

for @list -> $foo; # $foo can now be used in place of $_ for the rest +of the block

Also, $foo defaults to read-only, so you have to specificly specify read-write mode.

PS I'm sure I've made a mockery of Allison's speech, so please forgive me. Also, the minutes of our meeting should be up soon at Portland Perlmongers.

Topics and topicalizers are also explained in more detail in exegesis 4.
--
Ben
"Naked I came from my mother's womb, and naked I will depart."

Replies are listed 'Best First'.
Re^2: Using $_ as a temp var, especially in functions
by Aristotle (Chancellor) on Oct 26, 2002 at 02:29 UTC
    Which is what in Perl5 lingo is for my $foo (@list) { ... } except the read-only bit of course. ;-) Perl6 will offer additional abilities on top of this.

    Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-20 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found