[sf-perl] Net::Domain and system()
David Alban
extasia at extasia.org
Wed Feb 7 13:24:24 PST 2007
Actually, is there any kind of groovy symbol table or other trick I
can use in programs that use my module that will have the effect of
telling the compiler that any call like:
system ... ;
is CORE::system(), and thus avoid having to type CORE::system in the
code every place "system" would normally be used? I thought maybe
something like this would work:
*system = CORE::system;
It didn't. I still got the warning. I tried this:
sub system { &CORE::system; };
system "ls";
and got:
Prototype mismatch: sub main::system () vs none at junk.perl line 10.
Subroutine system redefined at junk.perl line 10.
Ambiguous call resolved as CORE::system(), qualify as such or use & at
junk.perl line 12.
followed by a directory listing.
If not, are there any other fairly simple tricks I can tell users they
can use to avoid typing CORE::system all over the place?
Assume I can't upgrade the ancient perl we're using.
On 1/29/07, David Alban <extasia at extasia.org> wrote:
> On 1/29/07, Bill Moseley <moseley at hank.org> wrote:
> > Isn't 5.8.0 from about 2002? Maybe that's the problem?
>
> Quite possibly. The code experiencing the problem is at work. At
> home I fail, as you did, to reproduce the problem on mac os x running
> perl 5.8.6.
>
> O.K. I'll just tell folks at work that they have to use:
>
> CORE::system ...;
>
> when they use my module, if they don't want the error.
>
> Thanks.
>
> P.S. system( ... ); didn't solve the problem on the work machine.
> Only adding CORE:: did.
--
Live in a world of your own, but always welcome visitors.
More information about the SanFrancisco-pm
mailing list