In reply to your message from the not too distant future: next Friday AD
Reply-to: [EMAIL PROTECTED]
Return-receipt-to: [EMAIL PROTECTED]
Organization: a) Discordia b) none c) what's that?
Content-Typo: gibberish, charset=ascii-art
Date: Fri, 18 Aug 2000 14:47:44 EDT
From: Jerrad Pierce <belg4mit>

That's pretty damn nifty, too problems though:

        print SCALAR $hashref->{key}, "\n";
        is bogus, SCALAR eats the newline as an argument.
        Granted this could be fixed with parens, but somehwat disappointing.

        In this context it's hard to tell if SCALAR is a handle or a function
        (again parens are the solution).

        I was unable to conceive of a way to allow the {}. You get a hash ref
        back, which when dereferenced %{} contains your reference.
        That, when dereferenced returns nothing.

sub ARRAY {
    return @{ shift() };
}

sub SCALAR {
#    my $ref = shift();
#    if( ref($ref) eq "HASH" ){
#        $ref = (each %{$ref})[0]; }
#    return ${ $ref };
    return ${ shift() };
}

$hashref = {
    scl=>\value,
    ary=>[1,2] };

print SCALAR $hashref->{scl};
print "\n";
print join(',', ARRAY $hashref->{ary}), "\n";
-- 
                                                  *             __    *      .
           \     |     /           .        . .           .  . ((_
               _____                       .                         .     .
          --  /     \  --           .        .      .   +    .   .     _/\
      oooooooooo.   |               * .       .   .           *       / ;M\_ .
   .oooooooooooo.oo.                  .  .    .       . /\    .      /  :IMM\
  ..oooooooooooo..oo.   Jerrad Pierce              /\  /  \         /   ;IIWMM
  ..oooooooooo.......   209 North Street     +    /  \ /  \  .     /   ;IIIIWM
  ...ooooooooo.......   Randolph, MA 02368        /  \     \  ___/   :;IIIIIWM
  ....ooo....o.......                            /    \    \ /  ::     ;;IIIMI
   .....ooo.........    http://www.pthbb.org     /    \     \   :     :::;IIIM
     ..ooooooo....      __________________________ ||   ||       ::.....::::::
MOTD on Setting Orange, the 11st of Bureaucracy, in the YOLD 3166:

This statement is false.

Reply via email to