forgotten how to run a script

forgotten how to run a script

am 26.10.2006 00:04:57 von Michael Redbourn

Hi,

a year or so ago someone wrote a short script for me to and it worked
well.

I am no longer in contact with him and have forgotten how to use it -
silly me :-)

The idea is that I have a list of urls followed by a description in
one folder and when I run the script it puts the combined perl script
and my list in another folder.

the script is #!/usr/bin/perl -w

open(AFILE,"text.txt");
$h=0;
while($kline=) {
$malines[$h]=$kline;
chomp($malines[$h]);
($cate[$h],$catr[$h])=split(' ',$malines[$h],2);

$u1=$cate[$h];
$u2=$catr[$h];

open(FILE,">>text2.txt");
my($k)=' onmouseover="window.status=\''.$u1.'\'; return true"
onfocus="window.status=\''.$u1.'\'; return true"
onmouseout="window.status=\'\'; return true"
target="_blank">'.$u2.'

';
print $k,"\n";
print FILE $k,"\n";
close (FILE);

}
close (AFILE);

If you could please remind me what I have to do it would be much
appreciated. And also tell me which perl program to download for use
with Windows XP

many thanks,

Michael


--
Posted via a free Usenet account from http://www.teranews.com

Re: forgotten how to run a script

am 01.11.2006 09:31:57 von m.brugman

Hi Michael,

>
> The idea is that I have a list of urls followed by a description in
> one folder and when I run the script it puts the combined perl script
> and my list in another folder.
>
> the script is #!/usr/bin/perl -w
>
> open(AFILE,"text.txt");
> $h=0;
> while($kline=) {
> $malines[$h]=$kline;
> chomp($malines[$h]);
> ($cate[$h],$catr[$h])=split(' ',$malines[$h],2);
>
> $u1=$cate[$h];
> $u2=$catr[$h];
>
> open(FILE,">>text2.txt");
> my($k)=' > onmouseover="window.status=\''.$u1.'\'; return true"
> onfocus="window.status=\''.$u1.'\'; return true"
> onmouseout="window.status=\'\'; return true"
> target="_blank">'.$u2.'

';
> print $k,"\n";
> print FILE $k,"\n";
> close (FILE);
>
> }
> close (AFILE);
>
> If you could please remind me what I have to do it would be much
> appreciated.

That seems to be an easy one, I guess you used to have your file (called
text.txt in the same folder as your script. Run the script by entering
perl NAME_OF_THE_SCRIPT_GOES_HERE and it will create a file called
text2.txt with your output. If the text2.txt file already exists, the
script will append the new data to it.

And also tell me which perl program to download for use
> with Windows XP

You can get the ActiveState Perl build for windows here: (for free)
http://www.activestate.com/Products/ActivePerl/?mp=1

Have fun,

MHB