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;
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |