Skip Menu |
Report information
Id: 129067
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: kes-kes [at] yandex.ru
Cc:
AdminCc:

Operating System: Linux
PatchStatus: (no value)
Severity: low
Type: core
Perl Version: 5.14.2
Fixed In: (no value)



To: perlbug [...] perl.org
Subject: Use of inherited AUTOLOAD for non-method is deprecated
From: KES <kes-kes [...] yandex.ru>
Date: Wed, 24 Aug 2016 17:20:03 +0300
Download (untitled) / with headers
text/plain 6.9k
This is a bug report for perl from kes-kes@yandex.ru, generated with the help of perlbug 1.39 running under perl 5.14.2. ----------------------------------------------------------------- [Please describe your issue here] It seems my problem is related to https://rt.perl.org/Public/Bug/Display.html?id=47047 Now I am extending existing mojolicious application. I just add method to one of our modules and get error when process request to application: Use of inherited AUTOLOAD for non-method FH::Controller::Cart::promo() is deprecated at ... /usr/local/share/perl/5.14.2/Mojolicious/Routes.pm x161: if (my $sub = $app->can('routes')) { x162: my $r = $app->$sub; x163: weaken $r->parent($c->match->endpoint)->{parent} unless $r->parent; 164: } x165: $app->$sub($c); x166: $c->stash->{'mojo.routed'}++; 167: } 168: 169: # Action x170: elsif (my $method = $self->_method($c, $field)) { x171: $log->debug(qq{Routing to controller "$class" and action "$method".}); 172: 173: # Try to call action x174: if (my $sub = $app->can($method)) { x175: $c->stash->{'mojo.routed'}++ unless $staging; Show quoted text
>>176: $continue = $app->$sub;
177: } 178: 179: # Action not found x180: else { $log->debug('Action not found in controller.') } 181: } 182: x183: return !$staging || $continue ? 1 : undef; 184: } 185: 186: sub _load { x187: my ($self, $app) = @_; 188: 189: # Load unless already loaded x190: return 1 if $self->{loaded}{$app}; x191: if (my $e = Mojo::Loader->new->load($app)) { ref $e ? die $e : return undef } Show quoted text
DBG>$method
promo Show quoted text
DBG>$app
FH::Controller::Cart=HASH(0x9ef96f8) Show quoted text
DBG>$app->can($method)
CODE(0x9df12e0) Show quoted text
DBG>\&{ FH::Controller::Cart::promo }
CODE(0x9df12e0) But deparsing subroutine by this reference with B::Deparse just shows ';' Show quoted text
DBG>l $sub
; Step into the sub brings me into AUTOLOAD instead of target method: Show quoted text
DBG>s
/usr/local/share/perl/5.14.2/Mojolicious/Controller.pm x14: use Scalar::Util (); 15: x16: has app => sub { Mojolicious->new }; 17: has match => sub { x18: Mojolicious::Routes::Match->new(GET => '/')->root(shift->app->routes); x19: }; x20: has tx => sub { Mojo::Transaction::HTTP->new }; 21: 22: # Reserved stash values x23: my %RESERVED = map { $_ => 1 } ( 24: qw(action app cb controller data extends format handler json layout), 25: qw(namespace partial path status template text) 26: ); 27: 28: sub AUTOLOAD { Show quoted text
>>29: my $self = shift;
30: x31: my ($package, $method) = our $AUTOLOAD =~ /^([\w:]+)::(\w+)$/; x32: Carp::croak "Undefined subroutine &${package}::$method called" 33: unless Scalar::Util::blessed $self && $self->isa(__PACKAGE__); 34: 35: # Call helper with current controller x36: Carp::croak qq{Can't locate object method "$method" via package "$package"} 37: unless my $helper = $self->app->renderer->helpers->{$method}; x38: return $self->$helper(@_); 39: } 40: x41: sub DESTROY { } 42: 43: sub cookie { x44: my ($self, $name, $value, $options) = @_; The target method is here: package FH::Controller::Cart; use Mojo::Base 'FH::Controller'; use Encode qw(encode); use List::Util qw(first sum pairmap ); use Mojo::Util qw(quote); use Data::Dumper; use FH::Form::Handler (); use FH::Error qw/ERROR_MINIMAL_ORDER/; .... sub promo { my( $self ) = @_; } [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=core severity=low --- Site configuration information for perl 5.14.2: Configured by Debian Project at Tue Mar 1 18:43:59 UTC 2016. Summary of my perl5 (revision 5 version 14 subversion 2) configuration: Platform: osname=linux, osvers=2.6.53-79-generic, archname=x86_64-linux-gnu-thread-multi uname='linux lcy01-28 2.6.53-79-generic #123-ubuntu smp fri feb 19 14:27:58 utc 2016 x86_64 x86_64 x86_64 gnulinux ' config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=x86_64-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.14 -Darchlib=/usr/lib/perl/5.14 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.14.2 -Dsitearch=/usr/local/lib/perl/5.14.2 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Duse64bitint -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Ui_libutil -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.14.2 -des' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -g', cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.6.3', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt perllibs=-ldl -lm -lpthread -lc -lcrypt libc=, so=so, useshrplib=true, libperl=libperl.so.5.14.2 gnulibc_version='2.15' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector' Locally applied patches: --- @INC for perl 5.14.2: /home/kes/perl_lib/lib/perl5/x86_64-linux-gnu-thread-multi /home/kes/perl_lib/lib/perl5 /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl . --- Environment for perl 5.14.2: HOME=/home/kes LANG=en_US.UTF-8 LANGUAGE=en LC_MESSAGES=en_US.UTF-8 LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/kes/perl_lib/bin:/home/kes/bin:/home/kes/perl_lib/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games PERL5LIB=/home/kes/perl_lib/lib/perl5 PERL_BADLANG (unset) PERL_MB_OPT=--install_base "/home/kes/perl_lib" PERL_MM_OPT=INSTALL_BASE=/home/kes/perl_lib SHELL=/bin/bash
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 543b
On Wed Aug 24 07:20:32 2016, kes-kes@yandex.ru wrote: Show quoted text
> This is a bug report for perl from kes-kes@yandex.ru, > generated with the help of perlbug 1.39 running under perl 5.14.2. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > It seems my problem is related to > https://rt.perl.org/Public/Bug/Display.html?id=47047
Which was not re-opened when the patch was reverted. I have just re-opened it, as it is still a problem in current blead (v5.25.4). -- Father Chrysostomos
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 663b
On Wed Aug 24 16:56:02 2016, sprout wrote: Show quoted text
> On Wed Aug 24 07:20:32 2016, kes-kes@yandex.ru wrote:
> > This is a bug report for perl from kes-kes@yandex.ru, > > generated with the help of perlbug 1.39 running under perl 5.14.2. > > > > > > ----------------------------------------------------------------- > > [Please describe your issue here] > > > > It seems my problem is related to > > https://rt.perl.org/Public/Bug/Display.html?id=47047
> > Which was not re-opened when the patch was reverted. I have just re- > opened it, as it is still a problem in current blead (v5.25.4).
The problem is now fixed as of commit 1de22db27a9.. -- Father Chrysostomos
Download (untitled) / with headers
text/plain 313b
Thank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been resolved. Perl 5.26.0 may be downloaded via: https://metacpan.org/release/XSAWYERX/perl-5.26.0 If you find that the problem persists, feel free to reopen this ticket.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org