while(1) { # pick up start position $position= index($content,'something.htm?',$temp_position); print"\n\n"; $temp_position=$position; # pick up till quote position while($arr[$temp_position] ne '"' ) { $page .= $arr[$temp_position]; $temp_position++; } print "\n\n"; # Printing URL print "Page: $page"; # Writing URL to a file print TXT "$page\n"; #RE-Initialization $page=$home; print" \n\nPosition: $position \n"; print"Temp_position: $temp_position \n"; if($reverse == $position) { last } }