Show
Ignore:
Timestamp:
12/02/07 00:20:47 (12 months ago)
Author:
yappo
Message:

lang/perl/Acme-StrictAndWarnings?: もっと空気読んだ

Location:
lang/perl/Acme-StrictAndWarnings/trunk
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Acme-StrictAndWarnings/trunk/lib/Acme/StrictAndWarnings.pm

    r2244 r2258  
    55 
    66our $VERSION = '0.01'; 
    7 use Filter::Simple; 
    87 
    9 FILTER {  $_ = 'use strict; use warnings;' . $_ ; } 
     8my %strict_bitmask = ( 
     9refs => 0x00000002, 
     10subs => 0x00000200, 
     11vars => 0x00000400 
     12); 
     13 
     14sub import { 
     15    shift; 
     16 
     17    my @strict; 
     18    my @warnings; 
     19    for my $word (@_) { 
     20        if ($strict_bitmask{$word}) { 
     21            push @strict, $word; 
     22        } else { 
     23            push @warnings, $word; 
     24        } 
     25    } 
     26 
     27    strict->import(@strict); 
     28    warnings->import(@warnings); 
     29} 
     30 
     31sub unimport { 
     32    shift; 
     33    strict->unimport; 
     34    warnings->unimport; 
     35} 
     36 
    1037 
    11381; 
     
    3259Do not foget to use strict and warnings! 
    3360 
     61=head1 METHODS 
     62 
     63=over 4 
     64 
     65=item import 
     66 
     67=item unimport 
     68 
     69=back 
     70 
    3471=head1 AUTHOR 
    3572 
    36 Tomohiro Teranishi, C<< <tomohiro.teranishi at gmail.com> >> 
     73Tomohiro Teranishi, C<< <tomohiro.teranishi at gmail.com> >>, 
     74Yappo 
    3775 
    3876=head1 COPYRIGHT & LICENSE