in reply to Problem in using Exporter
The solution is, I think, that Perl looks up the function names at run-time not at compile-time! The call to first_method() is compiled in but where/what this function exactly is is only interpreted at run-time, which isn't executed when using the -c switch.
Also your code is incomplete because you are missing a main file which uses this two modules:
When I run this script I get the following error:#!/usr/bin/perl use warnings; use strict; use Second; Second::second_method();
But I figured out that you missed the following line in First.pm:Inside second_method Undefined subroutine &Second::first_method called at Second.pm line 11 +.
Otherwise nothing will be exported.our @ISA = qw(Exporter);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem in using Exporter
by praveenkumar (Novice) on Apr 22, 2008 at 06:05 UTC |