open(FILE1, $ARGV[0]); $c=0; while () { $line=$_; printf("line %2d: %s", $c++, $line); $ref=$1 if /^Referer: (.*)/; }