arcnon has asked for the wisdom of the Perl Monks concerning the following question:
the error says 'Undefined subroutine &Temp::Tool' what is the correct way to call this? is it possible?#!/usr/bin/perl use strict; use Temp::Tool; my $page = 'test'; my $obj; my %states = ( module => \&Temp::Tool->new, ); if ($states{$page}){ $obj = $states{$page}->(); } package Temp::Tool; sub new{ print "test"; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: howto reference to a external sub/object/constructor thingy
by GrandFather (Saint) on Feb 23, 2006 at 04:20 UTC | |
by chromatic (Archbishop) on Feb 23, 2006 at 04:37 UTC | |
|
Re: howto reference to a external sub/object/constructor thingy
by ikegami (Patriarch) on Feb 23, 2006 at 06:43 UTC |