Melissa Stranzl wrote:
Hi all,

This is part of a perl program I wrote that doesn't
compile. I am trying to get my database to search by
date- to have current and past events come up. Anyway, based on the following code, I get an error
message that reads:

can't locate object method "new" via package
Date::Range

package Date::Range;

my $range = Date::Range -> new ($date1, $date2);

This code creates a package called Date::Range rather than importing it. I am assuming you should do something like:

use Date::Range;
my $range = Date::Range->new($date1, $date2);

Obviously if you name your package Date::Range and then don't create a method called 'new' it won't exist :-).

perldoc -f package
perldoc -f use

http://danconia.org



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to