{ local $/=\"1024"; open FILE, 'c:\space\sp.txt' or die $!; $_=; # } # now $/ is back to its original value # another way (note that quotes are not needed): open FILE, $name or die $!; $_ = do { local $/ = \1024; };