Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Overloading for List Context

by Zaxo (Archbishop)
on May 31, 2002 at 14:04 UTC ( [id://170716]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
        my $class = shift;
        bless [@_], $class;
    }
    
  2. or download this
    package main;
    
    ...
             Jack Queen King/)[$card % 13],
            (qw/Clubs Diamonds Hearts Spades/)[$card / 13];
    }
    
  3. or download this
    package LuckyDeck;
    use overload
    ...
    print 'List Context',$/;
    print for <$quux>;
    print $/;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://170716]
Approved by jlk
Front-paged by educated_foo
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-20 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found