Heya Richard,
Looks like your problem is the newline that date sticks on the end of
its output. I suggest using the POSIX function strftime, or chomping
the \n off of the date
$d = `date "+%b %d"`;
chomp $d;
print "$d\n";
or
use POSIX;
$d = strftime("%d %b", localtime());
print "$d\n";
Cheers,
C.J.
On Tue, 11 Sep 2001, Richard Brust wrote:
> I am trying to print lines from an HTML page that have a certain
> date(today). The following works:
>
> lynx -dump http://www.tbri.com/News/pgPubCal.asp | grep "Sep 11"
>
> I have tried this in two perl scripts, and nothing is returned. The date is
> being parsed correctly, I believe, I was wondering if there is an extra char
> somewhere in the date string that I am missing. The main parts of the code
> are below:
>
> <example 1>
>
> $d = `date "+%b %d"`;
> print "$d"; #just to test - it looks like it works
>
> @lines = `lynx -dump http://www.tbri.com/News/pgPubCal.asp`;
> foreach (@lines) {
> print if (/$d/i);
> }
>
> </example 1>
>
> <example 2>
>
> @lines = `lynx -dump http://www.tbri.com/News/pgPubCal.asp`;
> foreach (@lines) {
> print if (/Sep 11/i);
> }
>
> </example 2>
>
> thanks for any assistance...
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]