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

Split function

Thread Next
Kevin Butters
February 12, 2002 17:16
Split function
Message ID:
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!

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About