OO perl in CGI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I’ve just recently upgraded my mac to the new Yosemite.
My app was working before this upgrade.  I had no Idea that it would destroy so much, but I’ve got most of it back.
It’s the inheritance between perl modules that is killing me.
I know my machine candles inheritance(see example below).

Yesterday I was running Apache 2.2, today I’m running 2.4.9

I have a hierarchy like this
index.html 
	cp.cgi

cp.cgi
	use CP; 
	$cp = CP->new();

CP.pm
	use base “Base”;
        sub new { # tried this out of desperation
		my $self = shift;
  		$self->SUPER::new();
	}
	1;
	__END__

Base.pm
	use base ‘CGI::Application’;
        sub new {
		my $self = shift;
  		$self->SUPER::new();
	}
	1;
	__END__


I’m getting the error message
Can't locate object method "new" via package "CP" at /Users/bpatto/tool_box/cportal/App/CP.pm line 21.

Just to make sure it is working on my mac I created the following and it works perfectly
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
package Dad { sub new {  my $pkg = shift @_;  my $self = {};  bless $self ,  $pkg;   }}
package Mom {   use base "Dad”; }
package Baby {   use base "Mom”; }
my $stuff = new Baby;
print Dumper $stuff;


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux