in reply to About $/

G'day lddzjwwy,

Perhaps something along these lines:

$ perl -Mstrict -Mwarnings -E ' # Create test data use autodie qw{:all}; use File::Temp; my $fh = File::Temp->new(UNLINK => 1); print $fh "qwe\rasd\003zxc\r123"; seek $fh, 0, 0; # Read data splitting on "\r" or "\003" say for split /(?>\r|\003)/ => do { local $/; <$fh> }; ' qwe asd zxc 123

I assume you've picked "\003" purely as an example; I've used the same in the code above. However, using constructs like \o{...}, \x{...}, etc. may save you some interpolation issues down the track (see escape sequences in perlop - Quote and Quote-like Operators).

-- Ken