in reply to Better way to perform "double split" ?
Is there a better way to extract the date from the table?
How about:
use strict; use warnings; use 5.010; my $str = 'Timestamp 10.72.218.82:cpu_busy ---------------------------------- 2009-11-05 17:59:52 1.501 '; my ($date) = $str =~ /(^\d{4}-\d{2}-\d{2})/m; say "-->$date<--"; --output:-- -->2009-11-05<--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Better way to perform "double split" ?
by 7stud (Deacon) on Nov 10, 2009 at 09:37 UTC | |
by 7stud (Deacon) on Nov 10, 2009 at 09:48 UTC |