<snip
href="http://www.tuxedo.org/~esr/jargon/html/entry/sanity-check.html";>
sanity check
sanity check n. [very common] 1. The act of checking a piece of code (or
anything else, e.g., a Usenet posting) for completely stupid mistakes.
Implies that the check is to make sure the author was sane when it was
written; e.g., if a piece of scientific software relied on a particular
formula and was giving unexpected results, one might first look at the
nesting of parentheses or the coding of the formula, as a `sanity
check', before looking at the more complex I/O or data structure
manipulation routines, much less the algorithm itself. Compare reality
check. 2. A run-time test, either validating input or ensuring that the
program hasn't screwed up internally (producing an inconsistent value or
state).
</snip>

In this case you need to insure what sort of pathes the regex is
returning to you.


On 20 Jul 2001 09:41:53 -0400, Sparkle Williams wrote:
> I apologize, but I'm a real beginner and thus must ask...what is a sanity 
> check and better yet, how do I add one?
> 
> 
> >From: "Jos I. Boumans" <[EMAIL PROTECTED]>
> >To: "Sparkle Williams" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> >Subject: Re: perl and internet files
> >Date: Fri, 20 Jul 2001 14:45:52 +0200
> >
> >you'll need to build a regexp that fetches all the image files, and then an
> >lwp thingie that goes and retrieves them
> >
> >think of something like this:
> >
> >### $res->content is the return value of a LWP request
> >my @images = $res->content =~ |<img.+?src=\"?(.+?)\"|sig;
> >
> >you'll have to add a sanity check to see if the matches you get are full
> >paths, or relative paths tho.
> >
> >then say something like:
> >
> >for (@images) {
> >     my $url = ... #something with $_ and a sanity check for path
> >
> >     $req = new HTTP::Request('GET', $url);
> >
> >     # then do whatever you want with your images... remmeber you pobably
> >need binmode set if you want to do something with them in perl
> >}
> >
> >hth
> >Jos Boumans
> >
> >
> >----- Original Message -----
> >From: "Sparkle Williams" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Friday, July 20, 2001 2:30 PM
> >Subject: perl and internet files
> >
> >
> > > I have written a perl script that retrieves in html style text from
> >internet
> > > files.  I need to also retrieve the images that accompany the text. Is
> >there
> > > a module I can use to do this? I also was wondering, if I desired to 
> >open
> > > the files retrieved in a browser window, is there any way I can write a
> > > construct into my script to automatically do that?
> > >
> > > _________________________________________________________________
> > > Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp
> > >
> > >
> > > --
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> 
> 
> _________________________________________________________________
> Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
--
Today is Sweetmorn, the 55th day of Confusion in the YOLD 3167
Kallisti!



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to