getting the date fields in Perl

I get the perl date in the following format:

Mon Jan 31 06:01:37 2005

How can I extract each field in a single line using a regular expression??

I dont want to use "split".

Any other way out??

JP :slight_smile:

Why the limitation? Why dont you want to use split?

I'm confused.

perl manuals all document the various Time:: modules. They all return an array which contains all of the fields you show above:

use Time::localtime;
$lt = localtime();
print $lt->mon;
print $lt->mday;
print $lt->year;