Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: implementing 'push' in Class:MakeMethods

by YuckFoo (Abbot)
on Apr 28, 2005 at 20:20 UTC ( #452457=note: print w/ replies, xml ) Need Help??


in reply to implementing 'push' in Class:MakeMethods

When you set up the slot as type 'list', you will have all the list methods.

ListFoo

#!/usr/bin/perl use strict; my $stuff = Todo::List->new(); $stuff->todo_push('I really need to read the docs.'); $stuff->todo_push('I will use the perldoc command.'); $stuff->todo_push('perldoc Class::MethodMaker'); while (my $todo = $stuff->todo_shift()) { print "$todo\n"; } #----------------------------------------------------------- package Todo::List; use strict; use Class::MethodMaker new_hash_init => [qw(new)], list => [qw(todo)];


Comment on Re: implementing 'push' in Class:MakeMethods
Download Code
Re^2: implementing 'push' in Class:MakeMethods
by water (Chaplain) on May 01, 2005 at 16:09 UTC
    errrrr....  Class::MakeMethods, not  Class::MethodMaker .

    The names are realy similar, but the modules aren't.

    ?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2014-07-29 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (217 votes), past polls