Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Answer: How do I assign & substitute in one statement?

by Roy Johnson (Monsignor)
on Nov 13, 2004 at 22:22 UTC ( #407637=categorized answer: print w/replies, xml ) Need Help??

Q&A > strings > How do I assign & substitute in one statement? - Answer contributed by Roy Johnson

Predicate-for allows you to declare and modify a lexical in the same statement:
s[][] for (my $dirfilename = $url);
Using block-for does not put the lexical in the surrounding scope. This is an interesting difference, particularly since -MO=Deparse indicates that the above statement is translated into the block form.

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2016-10-23 06:34 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (300 votes). Check out past polls.