Howdy, I'm trying to clean up this code so that the output will be more usefull. Here is the current output:
Date: Tuesday, August 14, 2001 01:57 PM Nasty website: <A HREF="http://www.fde.com/myaccount/mymail.asp?eID= a1542199776964498e">http://www.fde.com/myaccount/mymail.asp?eID=a15219 +897 76964498e</A> Date: Tue, 14 Aug 01 03:53:06 Pacific Daylight Time <div align=left><FONT face=verdana size=1>To change or remove your sub +scription click here -- <a href="<A HREF="http://www.fde.com/myaccount/mymail.as +p?eID =a1542189776964498e">http://www.fde.com/myaccount/mymail.asp?eID=a1521 +989 776964498e</A>">
Here is the Desired output:
Date: Tuesday, August 14, 2001 01:57 PM http://www.fde.com/myaccount/mymail.asp?eID=a15421989776964498e Date: Tue, 14 Aug 01 03:53:06 Pacific Daylight Time http://www.fde.com/myaccount/mymail.asp? eID=a15421989776964498e
And last but not least, here is the Code.
#!/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=<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./=\?-]+)#<A HREF=\"$1\">$1</A>#sgi and !$flag an +d (/myaccount/)) { # grab the url print; $flag = 1; } }
As always, any advice will be much appreciated. Peace, amearse

In reply to Help getting desired output by amearse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.