Thank-you. I don't recall that Camel mentioning the white-space subtlety,
but I also haven't hit chapter 5 yet. /(.*?):/ gives me what I needed.
At 09:17 PM 08/23/01, you wrote:
>On Aug 23, Rob Waggoner said:
>
> >while ($line = <LOGFILE>) {
> > $line =~ /\[(.+)\] /; # get date time value between []
> > $ThisDateTime = $1; # should look like 19/Aug/2001:06:28:45
> -0600
> >
> > # this works
> > #($ThisDate, $Junk) = split(/:/, $ThisDateTime);
> >
> > # this is more elegant? Turn 19/Aug/2001:06:28:45 -0600 into
> >19/Aug/2001
> > $ThisDateTime =~ / (^.*?:) /; # is this pattern bad?
> > $ThisDate = $1; # or does $1 need to be 'reset'?
>
>Your whitespace is killing the regex. The regex
>
> / ^/
>
>can never match -- there can never be ANYTHING BEFORE the beginning of the
>line.
>
>Also, the $DIGIT variables are not set to undef on a failed match -- they
>retain their previous values.
>
>--
>Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
>RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
>** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
Rob Waggoner
Master Applications Craftsman
WAGGS
Web based Advanced Graphics and Graphing Solutions
http://www.waggs.net
"Applying Old world craftsmanship to New world technologies"
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]