Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: subclassing Action_install

5 views
Skip to first unread message

Eric Wilhelm

unread,
Oct 23, 2012, 12:49:07 PM10/23/12
to module...@perl.org
# from Boyd Duffee on Thursday 11 October 2012:
>When I run
> perl Build.PL
>I get
> Can't use string as a HASH ref while "strict refs" in use
>when I call the create_build_script() method. I've attached the
>Build.PL file. What am I doing wrong?

Hi Boyd,

I get `Can't use string ("Module::Build::Custom") as a HASH ref...`
(perl 5.10 shiny feature: tells you the string.) Note that the cookbook
example says `$class->new(...)->create_build_script` and your code
essentially says `$class->new(...); $class->create_build_script`, which
loses the newly constructed object and tries to call an object method on
a class.

("Can't string as hash" is not the best error message for "Cannot call
object method with class." -- but newer Perl versions might have more
helpful error messages.)

--Eric
--
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------

Boyd Duffee

unread,
Oct 31, 2012, 11:22:11 AM10/31/12
to module...@perl.org
On 10/23/2012 05:49 PM, Eric Wilhelm wrote:
>
> I get `Can't use string ("Module::Build::Custom") as a HASH ref...`
> (perl 5.10 shiny feature: tells you the string.) Note that the cookbook
> example says `$class->new(...)->create_build_script` and your code
> essentially says `$class->new(...); $class->create_build_script`, which
> loses the newly constructed object and tries to call an object method on
> a class.

Thanks, Eric. That fixed the error.
--
Boyd Duffee Keele University (01782) 734225
Student Facing Systems
Life is like an analogy.

0 new messages