in reply to for mistake with shift

I'm a little late to the party, but I thought this was a good use for some of the more obscure operators.
sub article_title1 { shift(@text); @text = grep { print "# TEXT-1 = '$_'\n" if ?^?../^$/; /^$/..0; } @text; print "# TEXT-2 = '$_'\n" for @text; }
Here's a shortcircuiting version that avoids unshifting:
sub article_title2 { shift(@text); while (@text) { print "# TEXT-1 = '$text[0]'\n"; last if ($text[0] eq ''); shift(@text); } print "# TEXT-2 = '$_'\n" for @text; }

The PerlMonk tr/// Advocate