Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Embed: Using load_module

by polettix (Vicar)
on May 24, 2006 at 10:10 UTC ( [id://551318]=note: print w/replies, xml ) Need Help??


in reply to Embed: Using load_module

Does My::Module use Carp? Consider a simple module (Example.pm):
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;
and a script using it:
#!/usr/bin/perl use strict; use warnings; use Example; Example::with_warn(); Example::with_carp(); warn "inside main script";
We get:
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.
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.

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

Replies are listed 'Best First'.
Re^2: Embed: Using load_module
by sjfloat (Novice) on May 24, 2006 at 15:02 UTC
    As you may see in my reply above, I am indeed using Carp. The problem is that I have succeeded in executing a file of code in a such a way that the interpretter has no knowledge of it's textual/source context, e.g. line numbers and file names, etc.

    I often succeed in doing things like that. A dubious gift, that.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://551318]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 14:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found