Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Flipin good, or a total flop?

by ysth (Canon)
on Jan 26, 2006 at 03:25 UTC ( [id://525632]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Flipin good, or a total flop?
in thread Flipin good, or a total flop?

I'm pretty sure that works the same way
my $i = 13 if $expr;
does, and is not to be trusted to continue to do what you mean.

No, maybe I'm wrong. Hmm.

Update: as long as you don't modify $start or $end except in cases where they were already set, I think you can count on this continuing to work, even if the my $foo if bar thing is "fixed". But I'd expect that if a warning is added for the my $foo if bar thing, that you'd get the warning with your code also.

Replies are listed 'Best First'.
Re^4: Flipin good, or a total flop?
by chibiryuu (Beadle) on Jan 27, 2006 at 21:53 UTC

    bar() if my $foo;
    is different from
    my $foo if bar(); # don't do this!

    The first case is equivalent to

    if (my $foo) { # $foo is lexically scoped to this block bar(); }
    just like how
    for my $foo (@foo) { # $foo is lexically scoped to this block baz(); }

    So if ((my $start =~ /start/) .. (my $end =~ /end/)) is perfectly happy.

Log In?
Username:
Password:

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

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

    No recent polls found