in reply to Re: Can we do without auxiliary variable here?
in thread Can we do without auxiliary variable here?

This would not cope when there are "\n" in between. See the comment by ikegami.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^3: Can we do without auxiliary variable here?
by roboticus (Chancellor) on Mar 01, 2011 at 11:38 UTC

    rovf:

    Yeah, I clearly missed on that one. I then tried:

    sub print_prefix { local $/="\nPrefix: "; print @_; }

    But that didn't work. On first guess, I thought it would do OK. After reading the documentation, I thought it would print it at least once. But what I got was...nothing. It never printed prefix at all. The only other methods I could think of had already been covered.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.