http://www.perlmonks.org?node_id=836531


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! :-)