J
Jeremy Henty
I created a subclass of CGI:retty and it instantly dies:
$ /data/www-jeremy/cgi-bin/cgi-jeremy
Undefined subroutine Jeremy::CGI::delete
at /data/www-jeremy/cgi-bin/cgi-jeremy line 9
Line 9 is:
my $query = Jeremy::CGI->new;
If I modify the class to inherit from CGI then it works.
Is this a bug or a feature?
Is there a workaround?
Are there any other pitfalls if I inherit from CGI instead of
CGI:retty ? (I plan to use object-oriented style exclusively.)
Details:
Perl 5.8.7 on Linux 2.6.17.14 , gcc 3.4.3 .
The CGI subclass (works as given but fails if I replace CGI with
CGI:retty):
use strict;
use warnings;
package Jeremy::CGI;
use CGI;
our @ISA;
@ISA = qw( CGI );
1; # success
The CGI script:
#!/usr/bin/perl
use strict;
use warnings;
use lib qw( /home/jeremy/Personal/Geeky/Perl/Lib );
use Jeremy::CGI;
my $query = Jeremy::CGI->new;
print
$query->header,
$query->start_html("Hi!"),
$query->p("boink"),
$query->ul($query->li("foo"),
$query->li("bar"),);
$query->end_html,
;
Full output of "perl -V":
Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
Platform:
osname=linux, osvers=2.6.9, archname=i686-linux
uname='linux knoppix 2.6.9 #2 smp tue oct 19 23:51:10 cest 2004 i686 athlon-4 i386 gnulinux '
config_args='-ds -e -Dprefix=/usr -Dpager=/bin/less -isR'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='3.4.3', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.3.4.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under linux
Compiled at Dec 5 2005 05:39:47
@INC:
/usr/lib/perl5/5.8.7/i686-linux
/usr/lib/perl5/5.8.7
/usr/lib/perl5/site_perl/5.8.7/i686-linux
/usr/lib/perl5/site_perl/5.8.7
/usr/lib/perl5/site_perl
$ /data/www-jeremy/cgi-bin/cgi-jeremy
Undefined subroutine Jeremy::CGI::delete
at /data/www-jeremy/cgi-bin/cgi-jeremy line 9
Line 9 is:
my $query = Jeremy::CGI->new;
If I modify the class to inherit from CGI then it works.
Is this a bug or a feature?
Is there a workaround?
Are there any other pitfalls if I inherit from CGI instead of
CGI:retty ? (I plan to use object-oriented style exclusively.)
Details:
Perl 5.8.7 on Linux 2.6.17.14 , gcc 3.4.3 .
The CGI subclass (works as given but fails if I replace CGI with
CGI:retty):
use strict;
use warnings;
package Jeremy::CGI;
use CGI;
our @ISA;
@ISA = qw( CGI );
1; # success
The CGI script:
#!/usr/bin/perl
use strict;
use warnings;
use lib qw( /home/jeremy/Personal/Geeky/Perl/Lib );
use Jeremy::CGI;
my $query = Jeremy::CGI->new;
$query->header,
$query->start_html("Hi!"),
$query->p("boink"),
$query->ul($query->li("foo"),
$query->li("bar"),);
$query->end_html,
;
Full output of "perl -V":
Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
Platform:
osname=linux, osvers=2.6.9, archname=i686-linux
uname='linux knoppix 2.6.9 #2 smp tue oct 19 23:51:10 cest 2004 i686 athlon-4 i386 gnulinux '
config_args='-ds -e -Dprefix=/usr -Dpager=/bin/less -isR'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='3.4.3', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.3.4.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under linux
Compiled at Dec 5 2005 05:39:47
@INC:
/usr/lib/perl5/5.8.7/i686-linux
/usr/lib/perl5/5.8.7
/usr/lib/perl5/site_perl/5.8.7/i686-linux
/usr/lib/perl5/site_perl/5.8.7
/usr/lib/perl5/site_perl