[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PERL



PureBytes Links

Trading Reference Links

Jim, thanks- this is helpful.  I have never created a script or run a macro
except in Word Perfect, and that doesn't count.

Thanks for the urls.


Al Stephens
astephen@xxxxxxxx



> -----Original Message-----
> From: owner-metastock@xxxxxxxxxxxxx
> [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of Jim Michael
> Sent: Friday, January 08, 1999 6:10 PM
> To: metastock@xxxxxxxxxxxxx
> Subject: RE: http's
>
>
>
>
> On Fri, 8 Jan 1999, Alton Stephens wrote:
>
> > what is PERL?
>
> Perl is a programming language. It's strong point is the productivity it
> gives you in terms of results per line of code. Here is an example from
> yesterday. I was downloading some charts from a site and after a few,
> started wondering how many there were going to be. I got 404 errors at 100
> and 90 (the charts were numbered like chart34.gif etc.). It turns out
> there were about 80 to download. So rather than do this manually, I used
> this script:
>
> #!/usr/bin/perl -w
> $u = 'http://www.someserver.com/chart';
> use LWP::Simple;
> for ($i = 1; $i < 84; $i++) {
> 	$v = $u . $i . '.gif';
> 	$f = 'chart' . $i . '.gif';
> 	getstore($v,$f);
> 	sleep 1;
> }
>
> The power comes from the LWP module, which permits me to download and
> store a file with 2 lines of code, the rest is just the loop to form the
> next file name (the . is a concatenation operator) and initialization.
>
> An excellent resource for further info is http://www.perl.com/
> Modules may be found on CPAN (http://www.perl.com/CPAN-local). HTH.
>
> Cheers,
>
> Jim
>