Help for this page

Select Code to Download


  1. or download this
    *{main::open} = sub { print "Ho\n"; };
    
  2. or download this
    my $glob_ref = do { no strict 'refs'; \*{'main::open'} };
    *$glob_ref = sub { print "Ho\n"; };
    
  3. or download this
    BEGIN {
            # Deleting and remaking the sub fails! ;(
    ...
            *{main::open} = sub { print "Ho\n"; };
            use subs 'open';
    }
    
  4. or download this
    BEGIN {
            # Deleting and remaking the sub fails! ;(
    ...
                    import subs 'open';
            }
    }
    
  5. or download this
    use strict;
    use warnings;
    ...
    }
    
    open(my $fh5, '<', $0);  # Calls CORE::open