Thanks haukex for help.
It will be grateful if you can help to correct below two queries :
Want to calculate the Time Stamp between date now and timereceived .
Getting error in pattern not matching ,can u share the correct pattern for "10/10/2017 11:35 PM"
#Begin###Calculate the time difference my $dtnow = DateTime->now; my $timereceived = "10/10/2017 11:35 PM"; my $strp = DateTime::Format::Strptime->new(on_error=>'croak',pattern = +> '%m/%d/%Y %H:%M %t', time_zone=>'UTC'); my $dtevent = $strp->parse_datetime($timereceived); my $diff_sec = $dtnow->subtract_datetime_absolute($dtevent)->in_units( +'seconds'); my $diff_hours = sprintf("%.0f" , $diff_sec/(60*60)); #End###Calculate the time difference
Another query in expression formatting ---
my name = 'greenfield (Glossary) (100)' foreach ( $name =~ /\((.*?)\)/ ) { $appID = $1; }
variable $name is having two value in two different brackets (Glossary) and (100) with below regular expression i am getting output as
'appid' => 'Glossary'
But i want 'appid' => '100'
it should avoid the first bracket (Glossary) values and only last (100) bracket vales it should pick
-Thanks.In reply to Re^2: XML data extraction (updated x2)
by snehit.ar
in thread XML data extraction
by snehit.ar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |