Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Fun with implicit type conversions

by kikuchiyo (Hermit)
on Aug 30, 2019 at 14:17 UTC ( [id://11105306]=note: print w/replies, xml ) Need Help??


in reply to Fun with implicit type conversions

$orry, I couldn't resist.

#!/usr/bin/perl package Sorry; use overload '-' => sub { "@_\n" }, '!' => sub { __PACKAGE__->new("Perl Hacker"); }, '""' => sub { $_[0]->[0] }; sub new { bless [$_[1] // "Just Another"] } package main; my $orry = Sorry->new; print $orry - not $orry;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-23 18:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found