Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by pfaut (Priest)
on Mar 15, 2003 at 20:43 UTC ( #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 (Canon) 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
Node Status?
node history
Node Type: note [id://243342]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2021-04-23 07:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?