radhika wrote:
Hi,
I need to parse this string: 2005-03-11 13:49:41.19
to just get the hour and minute.
my program has:
if( $string = /([\d]+)-([\d]+)-([\d]+)\s([\d\d):(\d\d):(\w+)/ )
I guess it should have been =~ instead of =
{
print("Hour:Minute = $4:$5\n");
}
if ( $string =~ /.*\s+(\d\d):(\d\d):.*$/ ){
print("Hour:Minute = $1:$2\n");
}
This should work.
Ankur
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>