Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Perl templating/macro creating using 'BEGIN'...

by Corion (Patriarch)
on Sep 27, 2010 at 18:11 UTC ( [id://862260]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl templating/macro creating using 'BEGIN'...
in thread Perl templating/macro creating using 'BEGIN'...

Some of the steps you take are somewhat clear, but I'm really wondering about the goal you're trying to reach by these steps. To me, it really seems as if you're trying to duplicate the functionality of Class::Accessor. The usage of Class::Accessor would be:

package MyPackage; use parent qw(Class::Accessor); __PACKAGE__->mk_accessors(qw(two three)); package main; use strict; my $f = MyPackage->new({three => 3}); $f->two(1); printf "two=%d, three=%d\n",$f->two, $f->three;

This seems to be your use case, so why reinvent the wheel?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://862260]
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: (4)
As of 2024-03-29 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found