in reply to Embed: Using load_module
and a script using it:package Example; use strict; use warnings; use Carp; sub with_warn { warn "inside with_warn"; return; } sub with_carp { carp "inside with_carp"; return; } 1;
We get:#!/usr/bin/perl use strict; use warnings; use Example; Example::with_warn(); Example::with_carp(); warn "inside main script";
The second warn is issued by the module, but the perspective is that of the original caller. Of course, I could be totally missing the differences with respect the embedding world.inside with_warn at Example.pm line 5. inside with_carp at /path/to/warn_carp.pl line 7 inside main script at /path/to/warn_carp.pl line 8.
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Embed: Using load_module
by sjfloat (Novice) on May 24, 2006 at 15:02 UTC |