I have a Perl program that gets the date of a file using '*ctime*' from
"*use Time::localtime;*" But this program must also convert an Epoch
time to a date and time using '*localtime*' from "*use Time::Local;*".
The problem is it appears that only one of these modules can be used in
a single program. Not both since a *localtime* subroutine exist as the
same name in both modules. How can I support using both modules in the
same program?. Here are the snippits:
#!/usr/bin/perl
*use Time:localtime;
use Time:Local;
*
*#needs Time::Local........*
sub convertEPOCHtime ($) {
my $time = $_[0];
my ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday,
$yday, $isdst) = *localtime ($time)*;
$year += 1900;
my @themonths =
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
my @weekdays = ("xxx", "Sat", "Sun", "Mon", "Tue", "Wed", "Thr",
"Fri", );
if ($hours < 10) {
$hours = '0' . "$hours";
}
my $datestring = "$weekdays[$wday] $themonths[$month] $day_of_month
${hours}:${minutes} $year";
return ($datestring);
}
*# needs Time::localtime........*
sub FILEdate ($) {
my $filename = $_[0];
my $as_of_date = *ctime(stat("$filename")->mtime)*;
return ($as_of_date);
}

Signature
------------------------------------------------------------------------
*Michael Barto*
Software Architect
LogiQwest Circle
LogiQwest Inc.
16458 Bolsa Chica Street, # 15
Huntington Beach, CA 92649
http://www.logiqwest.com/
mbarto@logiqwest.com <mailto:mbarto@logiqwest.com>
Tel: 714 377 3705
Fax: 714 840 3937
Cell: 714 883 1949
*'tis a gift to be simple*
------------------------------------------------------------------------
This e-mail may contain LogiQwest proprietary information and should be
treated as confidential.
Sherm Pendley - 31 Dec 2006 18:04 GMT
> I have a Perl program that gets the date of a file using 'ctime'
> from "use Time::localtime;" But this program must also convert an
[quoted text clipped - 8 lines]
> use Time:localtime;
> use Time:Local;
You're importing everything by default. Instead, only import the
specific functions you need from each module:
#!/usr/bin/perl
use Time::localtime qw(ctime);
use Time::Local qw(localtime);
Have a look at "perldoc Exporter" for more, especially the section
titled "How to Import".
sherm--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net