in reply to one line programs

your example would be easier to follow if enclosed in
<code></code> blocks.

It works similar to the PRE tags in HTML.

I imagine you were downvoted because the code is hard
to read:
{ while(/A\s+HREF\s*=\s*"(^"+)"/ig) { $foo{$1}=1; } } for(keys %foo) { print "\n"; }
Is this the code you had in mind?

Replies are listed 'Best First'.
Re: (Buzzcutbuddha - Formatting of question) - Re: one line programs
by lorenw14 (Initiate) on Apr 16, 2001 at 05:45 UTC
    Sorry about that, this is the first time that I have used this site and I was not quite sure how to use the but I think that I got it now. Yeah, the code that I was trying to convert to a one-liner was
    while(<>) { while(/A\s+HREF\s*=\s*"([^"]+)"/ig){ $foo{$1}=1; } } for(keys %foo){ print "<img src=\"$_\"><br>\n"; }
    Thanks for your help.
Re: (Buzzcutbuddha - Formatting of question) - Re: one line programs
by lorenw14 (Initiate) on Apr 16, 2001 at 05:48 UTC
    Sorry about that, this is the first time that I have used this site and I was not quite sure how to write in the code but I think that I got it now. Yeah, the code that I was trying to convert to a one-liner was
    while(<>) { while(/A\s+HREF\s*=\s*"([^"]+)"/ig){ $foo{$1}=1; } } for(keys %foo){ print "<img src=\"$_\"><br>\n"; }
    Thanks for your help.