[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] confused about use/require and package declarations



Before MacPerl 5.14r4, this worked:
<main file>
  require 'ctime.pl';
  require 'DateUtil.pl'
<DateUtil.pl>
  require 'ctime.pl';
  package DateUtil;
  sub getDate {
	my ($wkday, $mon, $date, $t, $yr) = split(' ', &ctime::ctime($_[0]));
	return "$MoY_map{$mon}/$date/$yr";
  }

Now, perl complains:
# Undefined subroutine &ctime::ctime called.
File 'BotDates.pl'; Line 4

It seens that no matter where I put the require (before or after the package
declaration) and whether I refer to &ctime::ctime() or just &ctime(), I get
some error message or another such as:
# Undefined subroutine &ctime::ctime called.
# Undefined subroutine &DateUtil::ctime called.

How is one supposed to declare requires across multiple files so that
they are understood in all files?  I feel like I've had to move these
around from perl4 to perl5 now from an earlier perl5 to the current
perl5.  I don't get it.



_______
Will Neuhauser              willn@quando.com
Chief Technical Officer, VP Development
Quando, Inc.                Tel: 1 (503) 225-1988
520 NW Davis Street         Fax: 1 (503) 225-1987
Portland, OR  97209 USA



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch