open (XMLFILE,"exportB.xml") || die "Can't open export.xml file :$!\n"; while(){ $ctr++; # do something here ... print $ctr;