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.