in reply to Advantage of while(<>){while()}?

I think you meant

local $/; my $file = <IN>; while( $file=~/$regex/gm ) { ... }

There are three differences:

Update: Added third difference.

Replies are listed 'Best First'.
Re^2: Advantage of while(<>){while()}?
by Argel (Prior) on May 18, 2011 at 21:56 UTC
    Yes, you're correct about $/. My fault for leaving too much out (wasn't going to include the open statements, etc).

    Elda Taluta; Sarks Sark; Ark Arks