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

Re^4: Programming in Perl without semicolon

by ikegami (Patriarch)
on Jan 31, 2009 at 18:54 UTC ( [id://740460]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Programming in Perl without semicolon
in thread Programming in Perl without semicolon

That's only a bonus if you can switch packages without a semicolon.

Oh yeah. Well, no bonus, but it still makes it more readable.

I'm surprised this works.

Me too, but it makes sense. It allows for

our $state = $next_states{$state};

Unfortunally, it's not a general technique.

Oops! Just replace the and op with a list op or replace the sassign op with an aassign op.

(local our $n = shift), ...

or

(local (our $n) = shift) && ...

The former is simpler. The latter has the advantage that it doesn't affect the return value in list context.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 10:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found