develooper Front page | perl.beginners | Postings from February 2002

Split function

Thread Next
From:
Kevin Butters
Date:
February 12, 2002 17:16
Subject:
Split function
Message ID:
20020213011625.28310.qmail@web21206.mail.yahoo.com
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

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About