localtime() actually returns an array, so if you do this:
@date = localtime(); Then your array will be populated with the information you're looking for. Personally, I prefer to do it this way: ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); Just remember that you have to add 1 to the $mon variable, and 1900 to the $year variable. -----Original Message----- From: Kevin Butters [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 5:16 PM To: [EMAIL PROTECTED] Subject: Split function I am difficulty in using the split function to extract the current date from the @date_time variable. #! /usr/bin/perl -w #Class 4 assignment # define hash use strict; my %days; %days = ( 'mon' => 'Monday', 'tue' => 'Tuesday', 'wed' => 'Wednesday', 'thu' => 'Thursday', 'fri' => 'Friday', 'sat' => 'Saturday', 'sun' => 'Sunday', ); # Define $date_time varible my $date_time = localtime; print "$date_time"; split $date_time,/ /; __________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -------------------------------------------------------------------------------- This email may contain confidential and privileged material for the sole use of the intended recipient. If you are not the intended recipient, please contact the sender and delete all copies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]