Changeset 2258
- Timestamp:
- 12/02/07 00:20:47 (13 months ago)
- Location:
- lang/perl/Acme-StrictAndWarnings/trunk
- Files:
-
- 1 added
- 1 modified
-
lib/Acme/StrictAndWarnings.pm (modified) (2 diffs)
-
t/02-no.t (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Acme-StrictAndWarnings/trunk/lib/Acme/StrictAndWarnings.pm
r2244 r2258 5 5 6 6 our $VERSION = '0.01'; 7 use Filter::Simple;8 7 9 FILTER { $_ = 'use strict; use warnings;' . $_ ; } 8 my %strict_bitmask = ( 9 refs => 0x00000002, 10 subs => 0x00000200, 11 vars => 0x00000400 12 ); 13 14 sub 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 31 sub unimport { 32 shift; 33 strict->unimport; 34 warnings->unimport; 35 } 36 10 37 11 38 1; … … 32 59 Do not foget to use strict and warnings! 33 60 61 =head1 METHODS 62 63 =over 4 64 65 =item import 66 67 =item unimport 68 69 =back 70 34 71 =head1 AUTHOR 35 72 36 Tomohiro Teranishi, C<< <tomohiro.teranishi at gmail.com> >> 73 Tomohiro Teranishi, C<< <tomohiro.teranishi at gmail.com> >>, 74 Yappo 37 75 38 76 =head1 COPYRIGHT & LICENSE
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)