Re: Parse::RecDescent and Moose (answers)

[email protected] (Tod Hagan)
Newsgroups perl.moose
Message-ID <[email protected]>
[Answering my own questions -- what a difference a few hours can make.]

On Thu, 2008-03-27 at 14:56 -0400, Tod Hagan wrote:
> ...but surely there must be a better way to inspect the object
> to determine if it defines the pr() method.

'man UNIVERSAL' and see the 'can' method.


>         Can't locate object method "pr" via package "fielddec" at ./test_ParseTree line 78, <$TFILE> line 1.

Fixed by moving the code for the two Moose objects to the front of the
file followed by 'package main;'.

So if everything's in a single file, make sure the Moose objects are
defined early, before the code that will end up using them.

Tod

-- 
Tod Hagan
Information Technologist
AIRMAP/Climate Change Research Center
Institute for the Study of Earth, Oceans, and Space
University of New Hampshire
Durham, NH 03824
Phone: 603-862-3116
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.