[EMAIL PROTECTED] wrote:
> I guess, you're the man!
>
> Your code works. I did not know of the Exporter.
>
> What happens if there are several package with the same name and exported?
>
> thanks,
> rkl
Then you have to prepend the name. For some reason the term is slipping my
mind, but a sub dec
I guess, you're the man!
Your code works. I did not know of the Exporter.
What happens if there are several package with the same name and exported?
thanks,
rkl
> [EMAIL PROTECTED] wrote:
>
>> > my $return = do_wrap('hello');
>>
>> Doesn't this have to be MyCommon::do_wrap('hello'); ?
>
> No.
[EMAIL PROTECTED] wrote:
> > my $return = do_wrap('hello');
>
> Doesn't this have to be MyCommon::do_wrap('hello'); ?
No. You do not have to prepend the package name when Exporter is properly
invoked. That proper invocation can be a bit tricky, though. That is why it
sat for a few days, while
> my $return = do_wrap('hello');
Doesn't this have to be MyCommon::do_wrap('hello'); ?
When running it, the error: Undefined subroutine &main::do_wrap
thanks,
-rkl
> [EMAIL PROTECTED] wrote:
>
>> How can I reuse a subroutine?
>>
>> My environment is redhat 9, apache2, perl-5.8.0-88, mod_perl-1.
[EMAIL PROTECTED] wrote:
> How can I reuse a subroutine?
>
> My environment is redhat 9, apache2, perl-5.8.0-88, mod_perl-1.99_07-5.
> I've tried to put the sub in a separate file and call it from another as
> below. Please modify the snipet below to make it work.
>
> mycommon.pl
> ---
> #
Zanardi2k3 wrote:
> [EMAIL PROTECTED] wrote:
>
> > OK, I added the return line to sub. But I'm getting an error on the
> > line require "mycommon.pl" of the tst.pl file. It say something about
> > @INC cannot find mycommon.pl
>
> You have two choices:
>
> 1. Your required file must be in @INC, i.e
[EMAIL PROTECTED] wrote:
> OK, I added the return line to sub. But I'm getting an error on the
> line require "mycommon.pl" of the tst.pl file. It say something about
> @INC cannot find mycommon.pl
You have two choices:
1. Your required file must be in @INC, i.e. in the path where perl.exe
look
OK, I added the return line to sub. But I'm getting an error on the line
require "mycommon.pl" of the tst.pl file. It say something about @INC
cannot find mycommon.pl
any help here?
How can I reuse a subroutine?
My environment is redhat 9, apache2, perl-5.8.0-88, mod_perl-1.99_07-5.
I've tried t
On Sep 26, [EMAIL PROTECTED] said:
>#!/usr/bin/perl
>#return a value wrapped by single quotes
>#should this be declare package something?
>sub doWrap
>{ my $retval;
>
> if(length($_[0]) == 0) { $retval = "null"; }
> else { $retval = "'" . $_[0] . "'"; }
>}
You need to RETURN $retval. It's alwa