Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: My habitual errors

by shmem (Chancellor)
on Apr 15, 2007 at 15:52 UTC ( [id://610207]=note: print w/replies, xml ) Need Help??


in reply to My habitual errors

Mine is forgetting semicolons after inline blocks
$foo = sub { my $var = shift; ... } for my $bar(@quux) { ... }

since blocks which aren't inline don't need semicolons.

Happens often while making named subroutines into anonymous ones, and also with do blocks. Often I get bitten for omitting a semicolon on the last line in a block:

sub foo { my $ret = bar($_[0]) * quux($_[1]) }

Later, I add more statements

sub foo { my $ret = bar($_[0]) * quux($_[1]) $ret *= 1024 }

bummer...!

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-19 13:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found