Next Tricks of the Wizards 203

no underscore

        package underscore;
        use Carp;
        sub TIESCALAR {        
            my $class = shift;
            my $dummy;
            return bless \$dummy => $class;
        } 
        sub FETCH { croak "Read access to \$_ forbidden"  } 
        sub STORE { croak "Write access to \$_ forbidden" } 
        sub unimport { tie $_ => __PACKAGE__ }
        sub import { untie $_ } 
        1;


Next Copyright © 2003 M. J. Dominus