Greetings,

I am using the following module

[module]
package My::GoldenRock::Utilities;

use strict;
use warnings;

use base 'Exporter';
our @EXPORT_OK = qw(foo bar);
our %EXPORT_TAGS = (all => \@EXPORT_OK);

our $VERSION = 0.1;

sub foo() { print "Inside foo\n"; }

sub bar { print "Inside bar\n"; }
[/module]
#Please note that I am not using a return value (1 in this case) as the last 
statement

[code]
use My::GoldenRock::Utilities 'bar';

print bar();
[/code]
 
[output]
Inside bar
1
[/output]

From where is the number 1 coming in the output. Earlier I mentioned '1' as the 
last statement in the module and I thought '1' is printed in the output owing 
to that. How to eliminate '1' from the output?

Please explain the intricacies of

use base 'Exporter';
our @EXPORT_OK = qw(foo bar);
our %EXPORT_TAGS = (all => \@EXPORT_OK);

Any pointers are greatly appreciated.

best,
Shaji 
-------------------------------------------------------------------------------
Your talent is God's gift to you. What you do with it is your gift back to God.
-------------------------------------------------------------------------------

Reply via email to