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

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

Rafael Garcia-Suarez
February 17, 2003 06:28
Re: Did the assertion patch/feature submission get overlooked?
Message ID: wrote:
> :In the new version, the -A switch is used with a list of tags:
> :
> :     perl -Afoo,bar ...
> :
> :and what it really does is:
> :
> :     use assertions::activate split(/,/,{foo,bar});
> :
> :in a similar fashion to '-M' or '-d:' switches.
> I think it would be useful to permit activation of all assertions,
> one way or another: perhaps with a bare -A, or perhaps with something
> like -A:all. I tried testing with:
>   perl -A'.*' -wle 'sub foo : assertion { print "assert"; } foo(); print "ok"'
> .. and the assertion was not activated.

It wasn't activated because you didn't "use assertions" at all.
And BTW I think that 'use assertions' without an import list should be
But I agree that having a bare -A equivalent to '-A.*' would be nice.

I have one concern :
if you say "use assertions qw/foo bar/" you need to pass -Afoo,bar to activate
the assertions in the corresponding block. I'd have expected that -Afoo and -Abar
work too (i.e. that assertion groups are or-ed, not and-ed). Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About