Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The out file contains a single line: Time: 04:18:02 I get an error message stating: Use of unintialized value in pattern match (m//) at test.pl line 8. What am I doing wrong? If I can get this case to work, maybe I can get the first and more complicated case working. Thanks, Bruce$out_file = out1; open (OUT. "$out_file"); while (OUT) { if (/Time: (..):(..):(..)/) { $hours = $1; $mins = $2; $secs = $3; } } close (OUT); print "hours =: $hours";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: extracting number from middle of string
by Ovid (Cardinal) on Apr 12, 2002 at 20:44 UTC | |
|
Re: extracting number from middle of string
by joealba (Hermit) on Apr 12, 2002 at 20:41 UTC | |
|
Re: extracting number from middle of string
by ehdonhon (Curate) on Apr 12, 2002 at 20:52 UTC |