in reply to undef $/ to null

I assume that what you want to do is read the entire contents of a file to a scalar in a single read operation. This is commonly referred to as "slurping a file".

A common Perl idiom for this is (the change to  $/ is localized to the do block):

my $filename = 'file.name'; open my $fh '<', $filename or die "opening $filename: $!"; my $contents = do { local $/; <$fh> };
There is even a module: File::Slurp.