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

Re^7: A wholly inadequate reply to an Anonymous Monk

by audreyt (Hermit)
on Apr 23, 2010 at 14:25 UTC ( #836531=note: print w/replies, xml ) Need Help??

in reply to Re^6: A wholly inadequate reply to an Anonymous Monk
in thread A wholly inadequate reply to an Anonymous Monk

And as for the type-based multi-dispatch case, we can observe below that Perl 5 does have the notion of runtime types:

A:~ au$ perl -MDevel::Peek -e 'Dump 3' SV = IV(0x100827190) at 0x100827198 REFCNT = 1 FLAGS = (IOK,READONLY,pIOK) IV = 3 A:~ au$ perl -MDevel::Peek -e 'Dump "3"' SV = PV(0x100801258) at 0x1008271b0 REFCNT = 1 FLAGS = (POK,READONLY,pPOK) PV = 0x100207f60 "3"\0 CUR = 1 LEN = 16

Note that the IV above refers to an integer type, and PV refers a stringish type. (cf. perlguts for details...)

As for the casting functions, Perl 5 has them built-in:

"".$x # to string 0+$x # to number int($x) # to integer

Hope that helps! :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://836531]
[stevieb]: ...especially the lengthening of days has been beautiful. In dead winter (solstace) we had ~5 or less hours of daylight. Suddenly, here at sprint, we've got 12+.
[stevieb]: sprint =~ s/t/g/;

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2018-03-22 00:30 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (272 votes). Check out past polls.