Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Looped around my neck (help with my poor little loops!)

by pfaut (Priest)
on Mar 15, 2003 at 20:43 UTC ( [id://243342]=note: print w/replies, xml ) Need Help??


in reply to Looped around my neck (help with my poor little loops!)

The loop in &guessing is not really a loop at all. It will either exit (bad form to exit from a subroutine) or execute the last statement on the first pass. I think that while really wants to be an if.

--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';

Replies are listed 'Best First'.
Re: Re: Looped around my neck (help with my poor little loops!)
by jdporter (Paladin) on Mar 17, 2003 at 02:50 UTC
    bad form to exit from a subroutine

    Baloney! Programs should exit wherever it makes sense to exit.
    Sometimes — yea, most of the time — that is in a subroutine.

    (Update)

    For fun, see the Single Function Exit Point anti-pattern.

    jdporter
    The 6th Rule of Perl Club is -- There is no Rule #6.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-24 18:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found