in reply to Convert date into day and month
G'day Ma,
I find the builtin module Time::Piece is particularly good at handling this type of task:
#!/usr/bin/env perl -l use strict; use warnings; use Time::Piece; my $date_string = 'Oct 31 08:30'; my $t = Time::Piece->strptime($date_string, '%b %d %H:%M'); print 'Day=', $t->mday, ' Month=', $t->mon;
Output (exactly as requested):
Day=31 Month=10
-- Ken
|
|---|