Gregg O'Donnell wrote:
> 
> I use this line of code:
> my $datetime = join ' ', (split ' ', localtime)[0,2,1,4,3];
> 
> To create this result:
> Mon 9 Apr 2007 09:15:05
> 
> How can I add a comma to this result to get:
> Mon, 9 Apr 2007 09:15:05

( my $datetime = localtime ) =~ s{(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)}
                                 {$1, $3 $2 $5 $4};



John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to