Next Tricks of the Wizards 200

%! Implementation

        package Errno;
        sub ENOENT () { 2 }
        sub EACCES () { 13 }
        sub ENOTDIR () { 20 }
        # ... many more ...
        sub TIEHASH { bless [] }                # Dummy object
        sub FETCH {
          my ($self, $errname) = @_;
          return $! == &$errname;
        }
        sub STORE {
          croak("ERRNO hash is read only!");
        }


Next Copyright © 2003 M. J. Dominus