The question is simple, but fun. :-)
What can I say, I'm a curious sort.
Assuming your module has a ->new() and ->printme() method, and you want to pass options into it, what is your favorite method of doing so and why? I would still say that these are options that are getting passed after the core parameters for a method are passed.
my $foo = Foo->new(autothis => 1, delimthat => '::'); $foo->printme('text', align => 'vertical', font => 'Arial'); package Foo; sub new { my ($class, %args) = @_; ... }; sub printme { my ($self, $text, %args) = @_; ... };
my $foo = Foo->new( {autothis => 1, delimthat => '::'} ); $foo->printme('text', {align => 'vertical', font => 'Arial'}); package Foo; sub new { my ($class, $args) = @_; }; sub printme { my ($self, $text, $args) = @_; ... };
Is this strictly a form over function issue, or are there and good reasons to prefer one over the other?
edited: Mon Aug 19 23:26:50 2002 by jeffa - closed ul tag
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |