my $infile =$ARGV[0]; open(IN, $infile) or die "Can't open input file: $!"; $/ = "\/\/\n"; $counter=1; while (){ # Read the entry print "Entry $counter\n"; print "Hallo to you....\n"; # do something $counter++ }