markcsmith has asked for the wisdom of the Perl Monks concerning the following question:
I saw this example in the camel book, but Larry (or Tom or that other guy), had access to the name of the hash, where I don't (well, I'm sure I do, but I don't know how to get it) since I'm inside of an object that hasn't been created yet. I'm getting an error that says: Bad name after :: at Criteria.pm line 68 (line 68 has the foreach in it) when I run 'perl -c Criteria.pm.' ] Thanks in advance! Marksub runTests { my ($self) = @_; foreach $symname (sort keys %{$self}::) { local *sym = ${$self}::{$symname}; &$symname if ((definined &sym) && ($symname =~ /_\.*/)); } } # sub runTests
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: running unknown methods
by elusion (Curate) on Oct 03, 2002 at 23:29 UTC | |
|
Re: running unknown methods
by Ovid (Cardinal) on Oct 03, 2002 at 23:45 UTC | |
|
Re: running unknown methods
by sauoq (Abbot) on Oct 04, 2002 at 00:03 UTC | |
|
Re: running unknown methods
by rbc (Curate) on Oct 03, 2002 at 23:21 UTC | |
by markcsmith (Novice) on Oct 04, 2002 at 17:00 UTC |