Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Help with Net::IP::Match and mod_perl
I'm having trouble getting  this to work
under mod_perl 1.29/Apache 1.3.31

#!/usr/local/bin/perl -w
use strict;
use warnings;

use CGI qw(:standard :html3 -no_xhtml -newstyle_urls );

use Net::IP::Match;

my ($search, $q);
$q = new CGI;
$search = $q->param('search');

if ( __MATCH_IP($search, qw{ 10.0.0.0/8 169.254.0.0/16 172.16.0.0/12
192.168.0.0/16 223.0.0.0/8 224.0.0.0/3 127.0.0.0/8 }))
{
print $q->header;
print $q->start_html;
print $q->blockquote("Looks like it works");
print $q->end_html;
}


running this from command line works fine, however when run via
http://host/cgi-bin/test.pl?search=10.1.1.1 gives an internal server
error:

PerlRun: `Undefined subroutine
& Apache::ROOT::cgi_2dbin::test_2epl::__MA
TCH_IP called at /usr/loc
al/apache/cgi-bin//test.pl line 14.\n'




Report this thread to moderator Post Follow-up to this message
Old Post
Allen Wooden
09-13-04 08:56 PM


Re: Help with Net::IP::Match and mod_perl
On Wed, 08 Sep 2004 19:13:31 GMT, Allen Wooden
<allen.wooden@educate.invalid> wrote:

>I'm having trouble getting  this to work
>under mod_perl 1.29/Apache 1.3.31
>

I found an alternative module Net::Subnets which works as expected.

I am still curious as to why the orginal didn't work so if anyone
wishes to enlighten me I'd appreciate it.

Allen


Report this thread to moderator Post Follow-up to this message
Old Post
Allen Wooden
09-14-04 01:57 PM


Re: Help with Net::IP::Match and mod_perl

Allen Wooden wrote:
> I'm having trouble getting  this to work
> under mod_perl 1.29/Apache 1.3.31
>
> #!/usr/local/bin/perl -w
> use strict;
> use warnings;
>
> use CGI qw(:standard :html3 -no_xhtml -newstyle_urls );
>
> use Net::IP::Match;
>
> my ($search, $q);
> $q = new CGI;
> $search = $q->param('search');
>
> if ( __MATCH_IP($search, qw{ 10.0.0.0/8 169.254.0.0/16 172.16.0.0/12
>                 192.168.0.0/16 223.0.0.0/8 224.0.0.0/3 127.0.0.0/8 }))
> {
>         print $q->header;
>         print $q->start_html;
>         print $q->blockquote("Looks like it works");
>         print $q->end_html;
> }
>
>
> running this from command line works fine, however when run via
> http://host/cgi-bin/test.pl?search=10.1.1.1 gives an internal server
> error:
>
> PerlRun: `Undefined subroutine
> & Apache::ROOT::cgi_2dbin::test_2epl::__MA
TCH_IP called at /usr/loc
> al/apache/cgi-bin//test.pl line 14.\n'

It looks to me like source filters and eval() don't mix well.

(Apache::Registry uses eval to compile test.pl as a module.)

(Net::IP::Match uses source filters)


Report this thread to moderator Post Follow-up to this message
Old Post
Brian McCauley
09-18-04 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Modules archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:10 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.