Change 19873 by [EMAIL PROTECTED] on 2003/06/28 16:02:53

        Using $1 without testing success of the regexp, bad.

Affected files ...

... //depot/perl/pod/perlretut.pod#33 edit

Differences ...

==== //depot/perl/pod/perlretut.pod#33 (text) ====
Index: perl/pod/perlretut.pod
--- perl/pod/perlretut.pod#32~18299~    Thu Dec 12 12:35:29 2002
+++ perl/pod/perlretut.pod      Sat Jun 28 09:02:53 2003
@@ -689,10 +689,11 @@
 used just as ordinary variables:
 
     # extract hours, minutes, seconds
-    $time =~ /(\d\d):(\d\d):(\d\d)/;  # match hh:mm:ss format
-    $hours = $1;
-    $minutes = $2;
-    $seconds = $3;
+    if ($time =~ /(\d\d):(\d\d):(\d\d)/) {    # match hh:mm:ss format
+       $hours = $1;
+       $minutes = $2;
+       $seconds = $3;
+    }
 
 Now, we know that in scalar context,
 S<C<$time =~ /(\d\d):(\d\d):(\d\d)/> > returns a true or false
End of Patch.

Reply via email to