Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I want to print all the data between for example "42.95 and cache."
I have tried the two my ($vals) below.
my ($vals) = $_ =~ /\b\s\d+\.\d+\b|\b\d+\.\d+\b(.*?)\bcache\b/; my ($vals) = $_ =~ /\b\s|\d+\.\d+\b(.*?)\bcache\b/; __DATA__ 42.95 7712 15:20:05 08:30 23684 cache -s/usr/cachesys/mgr -cj -p +374 JOB^CCJOB or 2.18 7712 03:31:27 11:57:08 27747 cache -s/usr/cachesys/mgr -cj -p +91 JOB^CCJOB __OUTPUT__ perl test.plx Use of uninitialized value in print at test.plx line 34, <$ps> line 52 +7. Use of uninitialized value in print at test.plx line 34, <$ps> line 62 +9. Use of uninitialized value in print at test.plx line 34, <$ps> line 63 +1. Use of uninitialized value in print at test.plx line 34, <$ps> line 63 +4. Use of uninitialized value in print at test.plx line 34, <$ps> line 63 +5. 7712 00:47:40 14:44:41 12051 7712 00:47:42 14:44:39 12052 7712 00:47:44 14:44:37 12055 7712 00:47:49 14:44:32 12090 . . . .
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: print data between with regexp...again
by kennethk (Abbot) on Nov 02, 2010 at 19:46 UTC | |
by Anonymous Monk on Nov 02, 2010 at 19:52 UTC | |
by kennethk (Abbot) on Nov 02, 2010 at 20:09 UTC | |
by Anonymous Monk on Nov 02, 2010 at 20:34 UTC |