develooper Front page | perl.perl5.porters | Postings from December 2007

Re: 5.11 (or 12) and strict

Thread Previous | Thread Next
From:
Aaron Crane
Date:
December 27, 2007 07:04
Subject:
Re: 5.11 (or 12) and strict
Message ID:
20071227150421.GA8670@aaroncrane.co.uk
demerphq writes:
> Years ago i proposed a new pragma 'caution' which was basically
> strict+warnings. I think this would be a good way to do what you want.
> Plus it would be cool to be able to put
> 
>   use caution;
> 
> at the top the script.

I believe this would work, and could be CPANned without any new
support from the core:

    package caution;

    sub import {
        strict->import;
        warnings->import;
    }

    sub unimport {
        strict->unimport;
        warnings->unimport;
    }

    1;

That said, I'm strongly in favour of C<use 5.012> enabling strictures
automatically.

-- 
Aaron Crane

Thread Previous | Thread Next


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