http://www.perlmonks.org?node_id=496292


in reply to If I was forced to use only one kind of loop for the rest of my days it would be a

while ($bastard -> state() =~ /^alive$/i) { $bastard -> beat(severity => $max); } $cool_looping_constructs -> restore();
  • Comment on Re: If I was forced to use only one kind of loop for the rest of my days it would be a
  • Download Code

Replies are listed 'Best First'.
Re^2: If I was forced to use only one kind of loop for the rest of my days it would be a
by saskaqueer (Friar) on Oct 08, 2005 at 15:31 UTC

    I'm always picky when it comes to using regexes where a simple eq comparison would be fine (but then again, that's just me):

    $bastard->beat(severity => $max) while ( lc($bastard->state()) eq 'alive' ); $cool_looping_constructs->restore();