#!/usr/bin/perl -w
$str="BATCATDATEFEAT";
$A=0;$T=0;
while ($str=~ /A/ig) {$A++;# Line 4
print"\n A=$A ends at ",pos $str,"\n";}
while ($str=~ /T/ig) {$T++;
print"\n T=$T ends at ",pos $str,"\n";}
$output="Results .txt"; # Line 8
unless (open(RESULT,">$output")){
print"Cannot open file\"$output\".\n\n";
exit; # Line 11
} # Line 12
print RESULT"\n A=$A ends at ",pos $str,"\n
T=$T ends at ",pos $str,"\n\n";
close(RESULT); # Line 17
exit;
####
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\xx>cd desktop
C:\Users\xx\Desktop>at.pl
A=1 ends at 2
A=2 ends at 5
A=3 ends at 8
A=4 ends at 13
T=1 ends at 3
T=2 ends at 6
T=3 ends at 9
T=4 ends at 14
Use of uninitialized value in print at C:\Users\DR-SUPRIYO\Desktop\at.pl line 13.
Use of uninitialized value in print at C:\Users\DR-SUPRIYO\Desktop\at.pl line 13.
####
A=4 ends at
T=4 ends at