sub reader { my $stream = "$somefile"; open( FILE, $stream ) or die "Cant open File:$!\n"; while () { if ( $_ =~ m/[\^A\cA\]{1}/g ) { @split= split /[\^A\cA\]+/g, $_; foreach my $line (@split) { foreach my $line (@split) { ( $line =~ s/[\s\n]{1,}//g ); } } } else { my $url = "http:/xxxxx.com/error.html"; my $t = 0; # time until redirect activates print "\n"; last; } }