Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Here's the offending line of code, HTH

by lclemmer (Initiate)
on Dec 04, 2002 at 23:28 UTC ( #217626=note: print w/replies, xml ) Need Help??


in reply to The -add does nothing different...
in thread ActiveState's PerlApp is causing an odd problem with IO:Socket

From Socket.pm:

    my $sel = new IO::Select $sock;

This code works fine when I use socket functions in runtime perl, and it works fine with PerlApp compiled code that is "dependent" on Perl being on the system. It's the freestanding version only that doesn't work.

The modules are getting added to the .exe when it's compiled, and they're explicitly use'd in the program.

I'm going to go dig up a newer version of PerlApp if I have it here and see what happens.

Lee

Replies are listed 'Best First'.
Re: Here's the offending line of code, HTH
by jand (Friar) on Jan 21, 2003 at 01:44 UTC
    I think you may need to use a later version of ActivePerl as well (at least build 628 or later). I believe your problem is related to the overriding of CORE::GLOBAL::require by PerlApp. The require statement has both runtime and compiletime aspects, and in earlier versions the compiletime aspects are suppressed when require has been overriden.

    The problem is that the statement

    my $sel = new IO::Select $sock;

    uses indirect object syntax. Directly above is the require statement:

    require IO::Select;

    With a non-overridden require, it will create the IO::Select package at compile time and the statement above is compiled as

    my $sel = IO::Select->new($sock);

    Without the compiletime definition of the IO::Select package, Perl compiles it as

    my $sel = new($sock->IO::Select());

    because the IO::Socket module had already defined a new() sub at this time.

    Another "fix" would be to add a

    use IO::Select;

    line to the top of your script.

Re: Here's the offending line of code, HTH
by chinman (Monk) on Dec 05, 2002 at 03:55 UTC
      Thanks for the reference. I was headed over to ActiveState next. I bet the upgrade addresses this, I got the notice about the new version.
RESOLVED
by lclemmer (Initiate) on Dec 06, 2002 at 19:02 UTC
    Updating to the latest Perl Dev Kit from ActiveState resolves the problem with "finding" included library functions. It works properly now. Of course I found a major problem with my code... so, off to the races...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://217626]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2022-10-01 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (3 votes). Check out past polls.

    Notices?