Bug 36826 - Incorrect instantiations of CGI ::->
Summary: Incorrect instantiations of CGI ::->
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-10 09:08 UTC by Jonathan Druart
Modified: 2024-05-21 23:38 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2024-05-10 09:08:33 UTC
Koha/Uploader.pm:    my $query = CGI::->new( sub { $self->_hook(@_); }, {}, 0 );
opac/opac-retrieve-file.pl:my $input = CGI::->new;
tools/upload.pl:my $input  = CGI::->new;

This ::-> looks wrong
Comment 1 Marcel de Rooy 2024-05-13 07:24:02 UTC
(In reply to Jonathan Druart from comment #0)
> Koha/Uploader.pm:    my $query = CGI::->new( sub { $self->_hook(@_); }, {},
> 0 );
> opac/opac-retrieve-file.pl:my $input = CGI::->new;
> tools/upload.pl:my $input  = CGI::->new;
> 
> This ::-> looks wrong

It is not wrong. And theoretically perhaps even safer. But not consistent.
Comment 2 Julian Maurice 2024-05-13 07:33:03 UTC
Indeed it is correct: https://perldoc.perl.org/perlobj#Invoking-Class-Methods
Comment 3 Jonathan Druart 2024-05-21 09:55:00 UTC
Marking as invalid or we update for consistency?
Comment 4 Marcel de Rooy 2024-05-21 11:24:45 UTC
(In reply to Jonathan Druart from comment #3)
> Marking as invalid or we update for consistency?

If those three are the only ones, I would not mind updating.
Comment 5 David Cook 2024-05-21 23:38:16 UTC
(In reply to Julian Maurice from comment #2)
> Indeed it is correct: https://perldoc.perl.org/perlobj#Invoking-Class-Methods

Learn something new every day...