in reply to PERL $/variable

$/ doesn't work that way.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^2: PERL $/variable
by Anonymous Monk on Mar 11, 2010 at 18:40 UTC
    Well it worked for me until I realized suspicious solution with $/ = value. Still it does what I want for file 1 :)
      It works for file 1 because records are separated by multiple new lines. The regular expression returned "" and, as per the provided link ($/):

      Setting to "" will treat two or more consecutive empty lines as a single empty line.
        If I do now:$/==""; it doesn't work for file1. I have to write $/=""; to make it work. So to conclude the best solution for me is to set different $/ for file1 ($/="";) and file2 (default $/). Am I not right ?