http://qs1969.pair.com?node_id=570396


in reply to Re: Flip-flop reset?
in thread Flip-flop reset?

Nice idea sgifford. I think that what I may do is actually put the newline at the end
foreach (@arr, "\n") {
They should work identically, as far as I can tell, but I can verify that the operator flops before leaving the subroutine now. This should work for both cases of input as I stated above.

Thanks for everyone's input.

Replies are listed 'Best First'.
Re^3: Flip-flop reset?
by ysth (Canon) on Aug 30, 2006 at 20:55 UTC
    That will only work if you are certain nothing in your for loop will bail out early, including something throwing an exception that's caught by a caller of your sub. Putting the dummy "\n" at the beginning of the loop is safer.