develooper Front page | perl.perl5.porters | Postings from February 2003

Re: Did the assertion patch/feature submission get overlooked?

From:
Salvador Fandiño
Date:
February 18, 2003 00:40
Subject:
Re: Did the assertion patch/feature submission get overlooked?
Message ID:
3E51FF8D.2090207@yahoo.com


hv@crypt.org wrote:

> :To be able to have two different 'import' methods as both packages are
> :'use' based.
> 
> But the assertions::activate is not normally directly used by anyone,

It can also be used on its own. I suppose most people prefers to use

   $ script_name arg1 arg2 ...

to run its scripts than

   $ perl script_name arg1 arg2 ...

and sometimes perl scripts are embedded in other scripts and so you can 
not use the '-A' switch easily, or even the perl interpreter could be 
embedded in another app and then you would not be able to use '-A' at all.

In those cases you can add

   use assertions::activate $ENV{MYAPPASSERT};

at the beginning of the script and then use MYAPPASSERT env var to 
activate assertions from the outside

On the other hand PERL5OPT can also be used to set -A but it's global to 
all the perl scripts


Bye,

   - Salva







nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About