Hi perl, newbie here, I am working on a legacy system which has been developed in perl and postgres. I am trying to get time stamp values from the db and use them for calculations.
I do the appropriate select * from table name, and then bind the values of the columns to perl variables. The time column I want is called start and I can output is value as a print statement. The output looked like this
2006-04-18 13:21:53
What i want to do is strip the above information into vairables and then do calculations based on the time.
I tried this code
When I try the above and do a print statement on one of the variables I get a blank result. What do I need to alter toget the result I need?
I do the appropriate select * from table name, and then bind the values of the columns to perl variables. The time column I want is called start and I can output is value as a print statement. The output looked like this
2006-04-18 13:21:53
What i want to do is strip the above information into vairables and then do calculations based on the time.
I tried this code
Code:
my ($year,$month,$day,$hour,$min,$sec) = ( $start =~ /^ (\d\d\d\d) (\d\d) (\d\d) (\d\d) (\d\d) (\d\d) /);
When I try the above and do a print statement on one of the variables I get a blank result. What do I need to alter toget the result I need?