Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Behaving appropriately based on ref() result

by bsb (Priest)
on Jan 09, 2006 at 07:52 UTC ( [id://521864]=note: print w/replies, xml ) Need Help??


in reply to Behaving appropriately based on ref() result

Data::Rmap has code doing something like this and may meet your needs. It just uses Scalar::Utils::reftype and if/elses.

ref() can return anything for blessed objects

perl -le 'print ref(bless{},"Hello World")'

Scalar util's reftype is better for this job.

Replies are listed 'Best First'.
Re^2: Behaving appropriately based on ref() result
by demerphq (Chancellor) on Jan 09, 2006 at 08:46 UTC

    Except that it (Scalar::Util::reftype()) can't tell a regexp from a ref to a scalar.

    ---
    $world=~s/war/peace/g

Log In?
Username:
Password:

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

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

    No recent polls found