Re: problem with simple perl Regular Expression match

2008-11-11 Thread JC Janos
On Tue, Nov 11, 2008 at 4:23 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > From http://search.cpan.org/dist/libwww-perl/lib/LWP/Simple.pm#mirror Sure. I've read the manual. I asked my question because the manual wasn't clear to me. It still isn't. But anyway, I figured out what happens by trial

Re: problem with simple perl Regular Expression match

2008-11-11 Thread Chas. Owens
On Tue, Nov 11, 2008 at 15:38, JC Janos <[EMAIL PROTECTED]> wrote: > Chas, > >> my $status = mirror($url, $file); >> >> if ($status == RC_OK) { >>print "got file\n"; >> } elsif ($status == RC_NOT_MODIFIED) { >>print "didn't need to get the file\n"; > > That's a good example, thanks.

Re: problem with simple perl Regular Expression match

2008-11-11 Thread JC Janos
Chas, > my $status = mirror($url, $file); > > if ($status == RC_OK) { >print "got file\n"; > } elsif ($status == RC_NOT_MODIFIED) { >print "didn't need to get the file\n"; That's a good example, thanks. LWP looks like a good alternative; one question ... As I use "wget --timesta

Re: problem with simple perl Regular Expression match

2008-11-11 Thread Chas. Owens
On Tue, Nov 11, 2008 at 11:38, JC Janos <[EMAIL PROTECTED]> wrote: > I stumbled on an answer. Adding "2>&1" apparently works, i.e., > > $result = `2>&1 $WGET $file`; > > Not sure if it's the only/best way. snip Well, the best way would be to use LWP*, LWP::Simple**, or WWW::Mechanize*** to allow

Re: problem with simple perl Regular Expression match

2008-11-11 Thread JC Janos
I stumbled on an answer. Adding "2>&1" apparently works, i.e., $result = `2>&1 $WGET $file`; Not sure if it's the only/best way. --JC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: problem with simple perl Regular Expression match

2008-11-11 Thread JC Janos
Hi Rob, On Tue, Nov 11, 2008 at 8:14 AM, Rob Coops <[EMAIL PROTECTED]> wrote: > I am not 100% certain but I would say because in the first instance $WGET > $file does not result in anything, the printed line is not printed by your > program but by the wget command. > > Try modifying your script to

Re: problem with simple perl Regular Expression match

2008-11-11 Thread Rob Coops
On Tue, Nov 11, 2008 at 5:03 PM, JC Janos <[EMAIL PROTECTED]> wrote: > When I run this script, > >$result = `$WGET $file`; >print $result . "\n"; >if ( $result =~ m/saved/ ){ >print "MATCH\n"; >} else { >print "NO MATCH\n"; >} > > It