Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > use Net::protoent no longer works w/ FreeBSD perl 5.6.1

Reply
Thread Tools

use Net::protoent no longer works w/ FreeBSD perl 5.6.1

 
 
Paul Southworth
Guest
Posts: n/a
 
      02-23-2004
use Net:rotoent;

This statement works with FreeBSD 4.8's default perl 5.005_03 but not with
perl 5.6.1 (built from FreeBSD ports). What happened and where can
I learn about the changes?

# uname -r
4.8-RELEASE-p13

[Trying perl 5.005_03]

# use.perl system
# perl -e 'use Net:rotoent;'

[Trying perl 5.6.1]

# use.perl port
# perl -e 'use Net:rotoent;'
'getproto' is not a valid variable name at /usr/local/lib/perl5/5.6.1/Net/protoent.pm line 12
BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.6.1/Net/protoent.pm line 12.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

Email Cc: of any clues would be appreciated.

--Paul
 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      02-23-2004

http://www.velocityreviews.com/forums/(E-Mail Removed) (Paul Southworth) wrote:
> use Net:rotoent;
>
> This statement works with FreeBSD 4.8's default perl 5.005_03 but not with
> perl 5.6.1 (built from FreeBSD ports). What happened and where can
> I learn about the changes?
>
> # uname -r
> 4.8-RELEASE-p13
>
> [Trying perl 5.005_03]
>
> # use.perl system
> # perl -e 'use Net:rotoent;'
>
> [Trying perl 5.6.1]
>
> # use.perl port
> # perl -e 'use Net:rotoent;'
> 'getproto' is not a valid variable name at /usr/local/lib/perl5/5.6.1/Net/protoent.pm line 12
> BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.6.1/Net/protoent.pm line 12.
> Compilation failed in require at -e line 1.
> BEGIN failed--compilation aborted at -e line 1.


Can you show us about the first 20 lines of /usr/local/.../protoent.pm?

> Email Cc: of any clues would be appreciated.


No, sorry. This is Usenet.

Ben

--
perl -e'print map {/.(.)/s} sort unpack "a2"x26, pack "N"x13,
qw/1632265075 1651865445 1685354798 1696626283 1752131169 1769237618
1801808488 1830841936 1886550130 1914728293 1936225377 1969451372
2047502190/' # (E-Mail Removed)
 
Reply With Quote
 
 
 
 
Paul Southworth
Guest
Posts: n/a
 
      02-23-2004
In article <c1bqn7$oa8$(E-Mail Removed)>,
Ben Morrow <(E-Mail Removed)> wrote:
>
>(E-Mail Removed) (Paul Southworth) wrote:
>> use Net:rotoent;
>>
>> This statement works with FreeBSD 4.8's default perl 5.005_03 but not with
>> perl 5.6.1 (built from FreeBSD ports). What happened and where can
>> I learn about the changes?
>>
>> # uname -r
>> 4.8-RELEASE-p13
>>
>> [Trying perl 5.005_03]
>>
>> # use.perl system
>> # perl -e 'use Net:rotoent;'
>>
>> [Trying perl 5.6.1]
>>
>> # use.perl port
>> # perl -e 'use Net:rotoent;'
>> 'getproto' is not a valid variable name at /usr/local/lib/perl5/5.6.1/Net/protoent.pm line 12
>> BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.6.1/Net/protoent.pm line 12.
>> Compilation failed in require at -e line 1.
>> BEGIN failed--compilation aborted at -e line 1.

>
>Can you show us about the first 20 lines of /usr/local/.../protoent.pm?


Yes!

$ head -20 /usr/local/lib/perl5/5.6.1/Net/protoent.pm
package Net:rotoent;
use strict;

use 5.005_64;
our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS);
BEGIN {
use Exporter ();
@EXPORT = qw(getprotobyname getprotobynumber getprotoent);
@EXPORT_OK = qw( $p_name @p_aliases $p_proto getproto );
%EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] );
}
use vars @EXPORT_OK;

# Class::Struct forbids use of @ISA
sub import { goto &Exporter::import }

use Class::Struct qw(struct);
struct 'Net:rotoent' => [
name => '$',
aliases => '@',

 
Reply With Quote
 
Sam Holden
Guest
Posts: n/a
 
      02-23-2004
On Mon, 23 Feb 2004 03:30:09 GMT,
Paul Southworth <(E-Mail Removed)> wrote:
> In article <c1bqn7$oa8$(E-Mail Removed)>,
> Ben Morrow <(E-Mail Removed)> wrote:
>>
>>(E-Mail Removed) (Paul Southworth) wrote:
>>> use Net:rotoent;
>>>
>>> This statement works with FreeBSD 4.8's default perl 5.005_03 but not with
>>> perl 5.6.1 (built from FreeBSD ports). What happened and where can
>>> I learn about the changes?
>>>
>>> # uname -r
>>> 4.8-RELEASE-p13
>>>
>>> [Trying perl 5.005_03]
>>>
>>> # use.perl system
>>> # perl -e 'use Net:rotoent;'
>>>
>>> [Trying perl 5.6.1]
>>>
>>> # use.perl port
>>> # perl -e 'use Net:rotoent;'
>>> 'getproto' is not a valid variable name at /usr/local/lib/perl5/5.6.1/Net/protoent.pm line 12
>>> BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.6.1/Net/protoent.pm line 12.
>>> Compilation failed in require at -e line 1.
>>> BEGIN failed--compilation aborted at -e line 1.

>>
>>Can you show us about the first 20 lines of /usr/local/.../protoent.pm?

>
> Yes!
>
> $ head -20 /usr/local/lib/perl5/5.6.1/Net/protoent.pm
> package Net:rotoent;
> use strict;
>
> use 5.005_64;
> our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS);
> BEGIN {
> use Exporter ();
> @EXPORT = qw(getprotobyname getprotobynumber getprotoent);
> @EXPORT_OK = qw( $p_name @p_aliases $p_proto getproto );
> %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] );
> }



> use vars @EXPORT_OK;


Due to @EXPORT_OK being used as a list of variable names it can't include
the function, moving the function to @EXPORT seems the simplest solution.

On the perl 5.6.1 on both linux and Solaris machines here the same problem
exists, the 5.8.3 install of perl works fine, and looking at its copy
of that file "getproto" has been moved to @EXPORT.

On the perl 5.005_02 here the "getproto" function also isn't in the
@EXPORT_OK list (though it also isn't in the @EXPORT list), so I guess you've
stumbled across a bug that was fixed sometime between 5.6.1 and 5.8.3 and
intoduced sometime between 5.005_03 and 5.6.1... I'd take a stab and guess
at the 5.005 -> 5.6 and 5.6 -> 5.8 points if I had to start looking...

So upgrade

Or just move it from @EXPORT_OK to @EXPORT...

--
Sam Holden
 
Reply With Quote
 
Anno Siegel
Guest
Posts: n/a
 
      02-23-2004
Sam Holden <(E-Mail Removed)> wrote in comp.lang.perl.misc:
> On Mon, 23 Feb 2004 03:30:09 GMT,
> Paul Southworth <(E-Mail Removed)> wrote:
> > In article <c1bqn7$oa8$(E-Mail Removed)>,
> > Ben Morrow <(E-Mail Removed)> wrote:
> >>(E-Mail Removed) (Paul Southworth) wrote:


[...]

> > $ head -20 /usr/local/lib/perl5/5.6.1/Net/protoent.pm
> > package Net:rotoent;
> > use strict;
> >
> > use 5.005_64;
> > our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS);
> > BEGIN {
> > use Exporter ();
> > @EXPORT = qw(getprotobyname getprotobynumber getprotoent);
> > @EXPORT_OK = qw( $p_name @p_aliases $p_proto getproto );
> > %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] );
> > }

>
>
> > use vars @EXPORT_OK;

>
> Due to @EXPORT_OK being used as a list of variable names it can't include
> the function, moving the function to @EXPORT seems the simplest solution.


Or leave it in @EXPORT_OK and say

use vars grep /^[$@%]/, @EXPORT_OK;

That's still pretty readable.

Anno
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I turn on my PC, it works, works, works. Problem! Fogar Computer Information 1 01-17-2006 12:57 AM
Programs taking longer and longer to start up. Help please. Goforit Computer Information 9 07-25-2004 06:34 AM
does not work on freeBSD but works on linux, and windows John fabiani Python 14 07-02-2004 04:23 PM
After rebooting my PC works, works, works! Antivirus problem? Adriano Computer Information 1 12-15-2003 05:30 AM
GDBM_file install problems (perl 5.8.0, freebsd 4.8-stable) Mike Hunter Perl Misc 0 10-01-2003 11:31 PM



Advertisments