# Define a global variable, the compatible way use vars qw($foo); # Define a global variable, the Perl 5.6.x way our $foo; # Define a "lexical" variable my $foo; #### undef $/; # Enables whole file mode open (FH, $filename); # Opens the file while() { # Contains the whole file blah } #### { undef local $/; open (FH, $filename); while() { blah } }