MT#61459 Do not use Perl indirect object syntax

This syntax is discouraged, and it is not enabled by default any longer
starting with the 5.36 feature bundles. Stop using it so that we can
eventually bump our minimum required Perl version.

Fixes: Objects::ProhibitIndirectSyntax
Warned-by: perlcritic
Ref: https://metacpan.org/pod/feature#The-'indirect'-feature
Change-Id: I3f89ce74908a896027efa825d90eab3d2e53b1ee
mr13.1
Guillem Jover 2 years ago
parent 598f7dbaf4
commit bdbd12613c

@ -30,7 +30,7 @@ sub render {
my $output = '';
my $t = new Template({
my $t = Template->new({
ABSOLUTE => 1,
INCLUDE_PATH => [
'/usr/share/ngcp-panel/templates',

@ -30,7 +30,7 @@ sub render {
my $output = '';
my $t = new Template({
my $t = Template->new({
ABSOLUTE => 1,
INCLUDE_PATH => [
'/usr/share/ngcp-panel/templates',

@ -51,7 +51,7 @@ sub render_element {
};
ref $self->adjust_datatable_vars eq 'CODE' and $self->adjust_datatable_vars->($self, $vars);
my $t = new Template({
my $t = Template->new({
ABSOLUTE => 1,
INCLUDE_PATH => [
'/usr/share/ngcp-panel/templates',

@ -25,7 +25,7 @@ sub render_element {
errors => $self->errors,
language_file => $self->language_file,
};
my $t = new Template({
my $t = Template->new({
ABSOLUTE => 1,
INCLUDE_PATH => [
'/usr/share/ngcp-panel/templates',

@ -47,7 +47,7 @@ sub render_element {
wrapper_class => $self->wrapper_class,
field => $self
};
my $t = new Template({
my $t = Template->new({
ABSOLUTE => 1,
INCLUDE_PATH => [
'/usr/share/ngcp-panel/templates',

@ -27,7 +27,7 @@ sub render_element {
errors => $self->errors,
language_file => $self->language_file,
};
my $t = new Template({
my $t = Template->new({
ABSOLUTE => 1,
INCLUDE_PATH => [
'/usr/share/ngcp-panel/templates',

@ -44,7 +44,7 @@ sub draw_arrow {
$c->moveTo($from_x, $from_y);
$c->penSize($width, $width);
$c->lineTo($to_x, $to_y);
my $poly = new GD::Polygon;
my $poly = GD::Polygon->new;
$poly->addPt($to_x, $to_y);
my $dir = ($to_x > $from_x) ? -1 : 1;
$poly->addPt($to_x + 4*$width*$dir, $to_y - 2*$width-(($width%2)?0:1));

@ -36,7 +36,7 @@ sub send_fax {
my @hosts = split(/,\s*/, $c->config->{faxserver}{hosts});
my $port = $c->config->{faxserver}{port};
$c->log->debug("faxserver port $port hosts: " . join(',',@hosts));
my $ping = new Net::Ping('tcp', 1);
my $ping = Net::Ping->new('tcp', 1);
$ping->port_number($port);
do {
my $host = $hosts[rand @hosts];
@ -98,7 +98,7 @@ sub send_fax {
my $text = Encode::encode('UTF-8', $args{data});
$sendfax_args{input} = [\$text];
}
my $client = new NGCP::Fax;
my $client = NGCP::Fax->new;
use Data::Dumper;
$c->log->debug('invoke send_fax with args: ' . Dumper(\%sendfax_args));
my $res = $client->send_fax(\%sendfax_args);
@ -158,7 +158,7 @@ sub get_fax {
}
if ($format) {
my $client = new NGCP::Fax;
my $client = NGCP::Fax->new;
my $fh = $client->convert_file({}, $filepath, $format);
my $rs_old = $RS;
local $RS = undef;

@ -70,7 +70,7 @@ defining the colors).
$img->line(50); # 50 pixel line
# draw a cyan polygon edged in blue
my $poly = new GD::Polygon;
my $poly = GD::Polygon->new;
$poly->addPt(150,100);
$poly->addPt(199,199);
$poly->addPt(100,199);

@ -7,7 +7,7 @@ use Test::Collection;
use Data::Dumper;
use URI::Escape;
my$test_collection = new Test::Collection(
my $test_collection = Test::Collection->new(
name => 'pbxdeviceprofiles',
DEBUG => 1,
);

@ -2142,13 +2142,13 @@ sub _get_allow_fake_client_time {
# use Project::Gantt;
# use Project::Gantt::Skin;
#
# my $skin= new Project::Gantt::Skin(
# my $skin = Project::Gantt::Skin->new(
# doTitle => 0);
#
# my $filename = $req_identifier;
# $filename =~ s/[^a-z0-9_\-]/_/i;
# $filename = '/home/rkrenn/test/gantt/' . $filename . '.png';
# my $gantt = new Project::Gantt(
# my $gantt = Project::Gantt->new(
# file => $filename,
# skin => $skin,
# mode => 'months',
@ -2280,8 +2280,8 @@ sub _create_gantt {
#
# # Create a XYChart object of size 620 x 280 pixels. Set background color to light blue (ccccff),
# # with 1 pixel 3D border effect.
# #my $c = new XYChart(700, 365, 0xccccff, 0x000000, 1);
# my $c = new XYChart(1300, 700, 0xccccff, 0x000000, 1);
# #my $c = XYChart->new(700, 365, 0xccccff, 0x000000, 1);
# my $c = XYChart->new(1300, 700, 0xccccff, 0x000000, 1);
#
# # Set the plotarea at (140, 55) and of size 460 x 200 pixels. Use alternative white/grey background.
# # Enable both horizontal and vertical grids by setting their colors to grey (c0c0c0). Set vertical

Loading…
Cancel
Save