From ab822df75cf6884051525b61dd3e21f2254994b4 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 12 Feb 2003 11:26:15 +0000 Subject: perl_checker compliance ("ref" now need parentheses in many case) --- perl-install/any.pm | 2 +- perl-install/commands.pm | 4 ++-- perl-install/diskdrake/interactive.pm | 2 +- perl-install/install_steps.pm | 4 ++-- perl-install/install_steps_auto_install.pm | 4 ++-- perl-install/install_steps_gtk.pm | 2 +- perl-install/install_steps_interactive.pm | 2 +- perl-install/install_steps_newt.pm | 2 +- perl-install/install_steps_stdio.pm | 2 +- perl-install/interactive.pm | 4 ++-- perl-install/interactive/gtk.pm | 2 +- perl-install/modules.pm | 2 +- perl-install/network/netconnect.pm | 2 +- perl-install/partition_table.pm | 2 +- perl-install/raid.pm | 2 +- perl-install/run_program.pm | 4 ++-- perl-install/ugtk2.pm | 12 ++++++------ 17 files changed, 27 insertions(+), 27 deletions(-) (limited to 'perl-install') diff --git a/perl-install/any.pm b/perl-install/any.pm index cdd24ffc6..c7cbafe02 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -419,7 +419,7 @@ N("Here are the entries on your boot menu so far. You can create additional entries or change the existing ones."), [ { format => sub { my ($e) = @_; - ref $e ? + ref($e) ? "$e->{label} ($e->{kernel_or_dev})" . ($b->{default} eq $e->{label} && " *") : translate($e); }, list => $b->{entries}, diff --git a/perl-install/commands.pm b/perl-install/commands.pm index 9e1d9b95c..ab8ab4885 100644 --- a/perl-install/commands.pm +++ b/perl-install/commands.pm @@ -267,8 +267,8 @@ sub dd { $h{$1} = $2; } local (*IF, *OF); my ($tmp, $nb, $read); - ref $h{if} eq 'GLOB' ? (*IF = $h{if}) : sysopen(IF, $h{if}, 0) || die "error: can't open file $h{if}\n"; - ref $h{of} eq 'GLOB' ? (*OF = $h{of}) : sysopen(OF, $h{of}, 0x41) || die "error: can't open file $h{of}\n"; + ref($h{if}) eq 'GLOB' ? (*IF = $h{if}) : sysopen(IF, $h{if}, 0) || die "error: can't open file $h{if}\n"; + ref($h{of}) eq 'GLOB' ? (*OF = $h{of}) : sysopen(OF, $h{of}, 0x41) || die "error: can't open file $h{of}\n"; $h{bs} = removeXiBSuffix($h{bs}); diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index 2656f06b6..82a49bd30 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -790,7 +790,7 @@ sub Add2LVM { write_partitions($in, $_) or return foreach isRAID($part) ? @{$all_hds->{hds}} : $hd; my $lvm = $in->ask_from_listf_('', N("Choose an existing LVM to add to"), - sub { ref $_[0] ? $_[0]{VG_name} : $_[0] }, + sub { ref($_[0]) ? $_[0]{VG_name} : $_[0] }, [ @$lvms, N_("new") ]) or return; require lvm; if (!ref $lvm) { diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 0d5a2a78a..5c1c1d817 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -36,7 +36,7 @@ use fs; sub new($$) { my ($type, $o) = @_; - bless $o, ref $type || $type; + bless $o, ref($type) || $type; return $o; } @@ -63,7 +63,7 @@ sub leavingStep { my $reachable = 1; if (my $needs = $o->{steps}{$s}{needs}) { - my @l = ref $needs ? @$needs : $needs; + my @l = ref($needs) ? @$needs : $needs; $reachable = min(map { $o->{steps}{$_}{done} || 0 } @l); } $o->{steps}{$s}{reachable} = 1 if $reachable; diff --git a/perl-install/install_steps_auto_install.pm b/perl-install/install_steps_auto_install.pm index bc2a07fe6..d13accd73 100644 --- a/perl-install/install_steps_auto_install.pm +++ b/perl-install/install_steps_auto_install.pm @@ -33,7 +33,7 @@ sub new { goto &{$::{$interactiveClass . "::"}{new}}; } else { @ISA = ('install_steps_auto_install_non_interactive', @ISA); - (bless {}, ref $type || $type)->install_steps::new($o); + (bless {}, ref($type) || $type)->install_steps::new($o); } } @@ -87,7 +87,7 @@ sub rebootNeeded { } sub ask_warn { - log::l(ref $_[1] ? join " ", @{$_[1]} : $_[1]); + log::l(ref($_[1]) ? join " ", @{$_[1]} : $_[1]); } sub wait_message {} diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index a4577c7df..cc6b2e168 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -135,7 +135,7 @@ sub new($$) { }; $ugtk2::force_center = [ $::rootwidth - $::windowwidth, $::logoheight, $::windowwidth, $::windowheight ]; - $o = (bless {}, ref $type || $type)->SUPER::new($o); + $o = (bless {}, ref($type) || $type)->SUPER::new($o); $o->interactive::gtk::new; $o; } diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index c38ba4449..82590c618 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -137,7 +137,7 @@ sub selectInstallClass { my $p = $o->ask_from_listf(N("Install/Upgrade"), N("Is this an install or an upgrade?"), sub { - ref $_[0] ? (@l > 1 ? + ref($_[0]) ? (@l > 1 ? N("Upgrade %s", $_[0]{release}) : N("Upgrade")) : translate($_[0]); diff --git a/perl-install/install_steps_newt.pm b/perl-install/install_steps_newt.pm index e3d10243e..36c6ec8cf 100644 --- a/perl-install/install_steps_newt.pm +++ b/perl-install/install_steps_newt.pm @@ -32,7 +32,7 @@ sub new { #-PO This string must fit in a 80-char wide text screen Newt::PushHelpLine(N(" / between elements | selects | next screen ")); - (bless {}, ref $type || $type)->SUPER::new($o); + (bless {}, ref($type) || $type)->SUPER::new($o); } sub enteringStep { diff --git a/perl-install/install_steps_stdio.pm b/perl-install/install_steps_stdio.pm index 66b104147..223c2f2b5 100644 --- a/perl-install/install_steps_stdio.pm +++ b/perl-install/install_steps_stdio.pm @@ -14,7 +14,7 @@ use lang; sub new($$) { my ($type, $o) = @_; - (bless {}, ref $type || $type)->SUPER::new($o); + (bless {}, ref($type) || $type)->SUPER::new($o); } sub enteringStep { diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index 5d311b0ad..55c1d5c45 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -80,7 +80,7 @@ use common; sub new($) { my ($type) = @_; - bless {}, ref $type || $type; + bless {}, ref($type) || $type; } sub vnew { @@ -311,7 +311,7 @@ sub ask_from_normalize { $e->{type} ||= 'combo'; if (!$e->{not_edit}) { - die q(when using "not_edit" you must use strings, not a data structure) if ref ${$e->{val}} || any { ref $_ } @$li; + die q(when using "not_edit" you must use strings, not a data structure) if ref(${$e->{val}}) || any { ref $_ } @$li; } if ($e->{type} ne 'combo' || $e->{not_edit}) { ${$e->{val}} = $li->[0] if !member(may_apply($e->{format}, ${$e->{val}}), map { may_apply($e->{format}, $_) } @$li); diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 935e8372a..cc065ec01 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -648,7 +648,7 @@ sub ask_fromW { my $widget_to_focus = $common->{focus_cancel} ? $mainw->{cancel} : - @widgets && ($common->{focus_first} || !$mainw->{ok} || @widgets == 1 && member(ref $widgets[0]{focus_w}, "Gtk2::TreeView", "Gtk2::RadioButton")) ? + @widgets && ($common->{focus_first} || !$mainw->{ok} || @widgets == 1 && member(ref($widgets[0]{focus_w}), "Gtk2::TreeView", "Gtk2::RadioButton")) ? $widgets[0]{focus_w} : $mainw->{ok}; $widget_to_focus->grab_focus() if $widget_to_focus; diff --git a/perl-install/modules.pm b/perl-install/modules.pm index 764575341..b852c7e8e 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -28,7 +28,7 @@ sub load { #- keeping the order of modules my %options; my @l = map { - my ($name, @options) = ref $_ ? @$_ : $_; + my ($name, @options) = ref($_) ? @$_ : $_; $options{$name} = \@options; dependencies_closure($name); } @_; diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index 37336a153..84fe157fe 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -466,7 +466,7 @@ sub get_net_device { my $connect_file = "/etc/sysconfig/network-scripts/net_cnx_up"; my $network_file = "/etc/sysconfig/network"; if (cat_("$prefix$connect_file") =~ /network/) { - ${ { getVarsFromSh("$prefix$network_file") } }{GATEWAYDEV}; + ${{ getVarsFromSh("$prefix$network_file") }}{GATEWAYDEV}; } else { "ppp+"; }; diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 8051142a8..0cd11e489 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -783,7 +783,7 @@ sub load { } $@ and die N("Restoring from file %s failed: %s", $file, $@); - ref $h eq 'ARRAY' or die N("Bad backup file"); + ref($h) eq 'ARRAY' or die N("Bad backup file"); my %h; @h{@fields2save} = @$h; diff --git a/perl-install/raid.pm b/perl-install/raid.pm index c59bc3021..83d5e7dd4 100644 --- a/perl-install/raid.pm +++ b/perl-install/raid.pm @@ -17,7 +17,7 @@ sub max_nb { 31 } sub nb { my ($nb) = @_; - first((ref $nb ? $nb->{device} : $nb) =~ /(\d+)/); + first((ref($nb) ? $nb->{device} : $nb) =~ /(\d+)/); } sub new { diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index bb28acda3..025feae2d 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -40,13 +40,13 @@ sub rooted { sub raw { my ($options, $name, @args) = @_; my $root = $options->{root} || ''; - my $str = ref $name ? $name->[0] : $name; + my $str = ref($name) ? $name->[0] : $name; log::l("running: $str @args" . ($root ? " with root $root" : "")); return 1 if $root && $<; $root ? ($root .= '/') : ($root = ''); - install_any::check_prog(ref $name ? $name->[0] : $name) if !$root && $::isInstall; + install_any::check_prog(ref($name) ? $name->[0] : $name) if !$root && $::isInstall; my ($stdout_raw, $stdout_mode, $stderr_raw, $stderr_mode); diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index 200374451..3ddf0b56d 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -285,7 +285,7 @@ sub create_scrolled_window { my $w = Gtk2::ScrolledWindow->new(undef, undef); $policy ||= [ 'automatic', 'automatic' ]; $w->set_policy(@{$policy}); - if (member(ref $W, qw(Gtk2::Layout Gtk2::Text Gtk2::TextView Gtk2::TreeView))) { + if (member(ref($W), qw(Gtk2::Layout Gtk2::Text Gtk2::TextView Gtk2::TreeView))) { $w->add($W) } else { $w->add_with_viewport($W); @@ -336,10 +336,10 @@ sub create_box_with_title { 1, gtkpack_($o->{box_title} = Gtk2::VBox->new(0,0), 1, Gtk2::HBox->new(0,0), (map { - my $w = ref $_ ? $_ : Gtk2::Label->new($_); + my $w = ref($_) ? $_ : Gtk2::Label->new($_); $::isWizard and $w->set_justify("left"); (0, gtkset_name($w, "Title")); - } map { ref $_ ? $_ : warp_text($_) } @_), + } map { ref($_) ? $_ : warp_text($_) } @_), 1, Gtk2::HBox->new(0,0), ) ), @@ -348,10 +348,10 @@ sub create_box_with_title { } else { gtkpack__($box, (map { - my $w = ref $_ ? $_ : Gtk2::Label->new($_); + my $w = ref($_) ? $_ : Gtk2::Label->new($_); $::isWizard and $w->set_justify("left"); gtkset_name($w, "Title"); - } map { ref $_ ? $_ : warp_text($_) } @_), + } map { ref($_) ? $_ : warp_text($_) } @_), if_($a, Gtk2::HSeparator->new) ) } @@ -1225,7 +1225,7 @@ sub ask_browse_tree_info_given_widgets { $common->{display_info} = sub { gtktext_insert($w->{info}, $common->{get_info}($curr)); 0 }; my $children = sub { map { my $v = $w->{tree_model}->get($_, 0); $_->free; $v } gtktreeview_children($w->{tree_model}, $_[0]) }; my $toggle = sub { - if (ref $curr && !$_[0]) { + if (ref($curr) && !$_[0]) { $w->{tree}->toggle_expansion(my $path = $w->{tree_model}->get_path($curr)); $path->free; } else { -- cgit v1.2.1