Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Is "ref $date eq 'ARRAY'" wrong?

by gmpassos (Priest)
on Dec 20, 2003 at 03:24 UTC ( [id://315983]=note: print w/replies, xml ) Need Help??


in reply to Re: Is "ref $date eq 'ARRAY'" wrong?
in thread Is "ref $date eq 'ARRAY'" wrong?

Humm, you are making 2 things wrong!

Take a look in this code:

package foo ; my $bless = bless({},foo); print "AS STRING: $bless\n" ; print "AS REF: ". ref($bless) ."\n" ; __END__ ## OUTPUT: AS STRING: foo=HASH(0x1a7f04c) AS REF: foo
ref just return in what package the object is blessed or the data type of the reference. If you want to know if the blessed reference is an ARRAY, HASH, SCALAR... you can use:
if ( UNIVERSAL::isa($bless , 'HASH') ) { print "mohhh\n" ; }
And forget the REGEXP for that!

Graciliano M. P.
"Creativity is the expression of the liberty".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://315983]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (1)
As of 2024-04-19 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found