in reply to $var as accessor name?
(The above code has been tested on Perl 5.8.0/Solaris9)package Foo; sub foo { print "Foo\n"; } sub bar { print "Bar\n"; } sub new { bless {}, shift } package main; my $foo = Foo->new; foreach my $method (qw( foo bar )) { $foo->$method; }
------
We are the carpenters and bricklayers of the Information Age.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: $var as accessor name?
by simonm (Vicar) on Mar 11, 2004 at 17:44 UTC |