develooper Front page | perl.perl5.porters | Postings from October 1999

Assignment to tied glob

Thread Next
From:
Gisle Aas
Date:
October 29, 1999 10:53
Subject:
Assignment to tied glob
Message ID:
19991029175208.23691.qmail@eik.g.aas.no
When I assign something to a tied glob, the the STORE method is
invoked, but the value passed as second argument is the glob not the
value assigned.  This does not seem right.

Don't ask me why I do this :-)

Regards,
Gisle



tie *foo, "main";
*foo = \42;
print "$foo\n";

sub TIEHANDLE { bless {}; }

sub STORE
{
    my($self, $val) = @_;
    print "STORE $self, $val\n";
}

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About