On Tue, Jun 24, 2003 at 01:52:20PM -0500 Dan Muey wrote:

> I'm writing a simple module to return a few variables and functions.
> 
> The perldoc perlmod* stuff says I should use Carp; and call that
> instead of warn().
> So..
> 1)
> If I use Carp shoud I still use warnings; in the package?

Those two are independent of each other. Carp provides ways for you, the
programmer, do emit warnings and error messages. They'll show up no
matter whether warnings are in effect. Warnings on the other hand will
make the Perl interpreter emit messages when it has encountered
something warnings-worthy. It's the same as with warn(): You use that
indepently from warnings, too.

> 2)
> If I understand it correctly the preffered way would be to do:
> 
> use Carp;
> ...
> carp("Watch your monkey");
> 
> Instead of:
> ...
> warn("Watch your monkey");
> 
> Is that a correct assumption?

Yes, this is correct.

> 3)
> Should I just do 
> 
> use Carp(carp);
> Since I'll only be calling carp() ( assuming carp() is warn()'s
> replacement in Carp.pm )

That's up to you. Carp exports carp() and croak(). I usually end up
needing both after a while. 

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to