Link to home
Start Free TrialLog in
Avatar of derekl
derekl

asked on

Module definition problem

I'm trying to define a module:

package Foo;

use strict;

require Exporter;

our @ISA = qw(Exporter);
our @EXPORT = qw(bar);
our $VERSION = "1.0";

sub bar() {
    my $val = shift;

    print $val;
}

1;

However when I try to use the bar function as follows:

use strict;

use lib 'E:/Programming/Perl/libs';
use Foo;

bar("Test");

I get the following error:

Too many arguments for Foo::bar at test.pl line 6, near ""Test")"
Execution of test.pl aborted due to compilation errors.

What's going on here?
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of derekl
derekl

ASKER

Thank I would have stared at that for 4 or 5 more hours before picking it up.