Thursday, March 7, 2013

How could you disable strict for a block of code in Perl?

It can be disabled with "no strict".

#!/usr/bin/perl
use strict;
 
my $me=$0;
print "$me\n";
 
open (FH, "< $0") or die "$!";  
while (<FH>)
{
no strict;
  $count=0;  
print "$_" . ++$count;
}

No comments :