#!/usr/bin/perl -w use strict; # What file to use my $goober = "rfl.txt"; # Open File and pop it into an array open GOOB, $goober or die "Can't open $goober"; my @goob=; close(GOOB); # Make a flag to prevent dupes and start loop my $flag = 0; foreach (@goob) { if (/Date:/){ #grab and print the date print; $flag = 0; } if (s#(http://[\w./=\?-]+)#$1#sgi and !$flag and (/myaccount/)) { # grab the url print; $flag = 1; } }