my $fh = IO::File->new; *{$fh} = \ "foo"; # we'll split at foo $fh->open("< $file") or die "barf: $!"; my @ary; { local $/ = ${*{$fh}{SCALAR}}; @ary = <$fh>; } #### { local $/ = $$$fh; @ary = <$fh>; } #### *{$fh} = \ { input_record_separator => "foo" }; { local $/ = $$$fh->{input_record_separator}; @ary = <$fh>; }
## { local $/ = $$$fh; @ary = <$fh>; } ##
## *{$fh} = \ { input_record_separator => "foo" }; { local $/ = $$$fh->{input_record_separator}; @ary = <$fh>; }