Help for this page

Select Code to Download


  1. or download this
    use vars qw( $x );      # a package global
    
    ...
    # to 'inner' and in both cases, the value of $x is restored when the
    # block exits, except in the 'local' case, it is not necessary to
    # explicitly restore $x
    
  2. or download this
    # need to 'slurp' in an entire file
    {
    ...
      # (read the file, etc.)
    }
    # $/ is now restored to whatever it was before