in reply to stringified references
The format you expected is still correct, although the document didn't say so, but ..., not just you can be cheated, even UNIVERSAL::isa can be cheated, try this:
use IO::Socket::INET; use strict; my $socket = new IO::Socket::INET(); print $socket, "\n"; print "is INET\n" if UNIVERSAL::isa($socket, "IO::Socket::INET"); print "is Socket\n" if UNIVERSAL::isa($socket, "IO::Socket"); print "is IO\n" if UNIVERSAL::isa($socket, "IO"); print "is GLOB\n" if UNIVERSAL::isa($socket, "GLOB"); print "is HASH\n" if UNIVERSAL::isa($socket, "HASH"); $socket =~ s/GLOB/HASH/; print "after s///\n"; print $socket, "\n"; print "is INET\n" if UNIVERSAL::isa($socket, "IO::Socket::INET"); print "is Socket\n" if UNIVERSAL::isa($socket, "IO::Socket"); print "is IO\n" if UNIVERSAL::isa($socket, "IO"); print "is GLOB\n" if UNIVERSAL::isa($socket, "GLOB"); print "is HASH\n" if UNIVERSAL::isa($socket, "HASH");
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: stringified references
by demerphq (Chancellor) on Dec 05, 2002 at 00:22 UTC |
In Section
Seekers of Perl Wisdom