Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: a sub within a sub -- revisiting

by punkish (Priest)
on Apr 10, 2010 at 06:13 UTC ( [id://833955]=note: print w/replies, xml ) Need Help??


in reply to Re: a sub within a sub -- revisiting
in thread a sub within a sub -- revisiting

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: a sub within a sub -- revisiting
by chromatic (Archbishop) on Apr 10, 2010 at 06:46 UTC
    The provided code is actually visually very helpful, as it leads (mind you, leads, not misleads) the reader to think that bar() makes sense in the context of foo().

    Maybe that code documents that its author intended such a thing, but to an experienced Perl programmer, I suspect that the code instead reads as if the author doesn't know how lexicals and sub declarations work in Perl.

Re^3: a sub within a sub -- revisiting
by AnomalousMonk (Archbishop) on Apr 10, 2010 at 07:16 UTC
    The ... code [of the OP] ... leads ... the reader to think that bar() makes sense in the context of foo().

    But does the code lead the reader to think that foo() does not make sense in the context of bar()? (See ikegami's Re: a sub within a sub -- revisiting.) If the code does not alert the reader to the subtle (side?) effect pointed out in that reply, it is not helpful and should either be heavily commented or another, more straightforward approach should be chosen to achieve the same effect. (Of course, this assumes the effect is intended in the first place!)

Log In?
Username:
Password:

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

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

    No recent polls found