diff options
author | Modestas Vainius <modestas@vainius.eu> | 2009-07-15 19:38:45 +0300 |
---|---|---|
committer | Raphael Hertzog <hertzog@debian.org> | 2009-07-15 20:33:16 +0200 |
commit | e411b5732dd76a157a50778ce96c81115b49332a (patch) | |
tree | 447aaeffa36177e34f6ddeaf6fb9bdfe69accba1 /scripts | |
parent | 77f7292128f315e0cd95177241184252604347ce (diff) | |
download | dpkg-e411b5732dd76a157a50778ce96c81115b49332a.tar.gz |
Replace local with my in SymbolFile::load() and use strict.
Rather than creating an alias with local, manually do $current_object_ref
re-referencing. This allows to use 'my $object' and to enable 'use strict'.
Signed-off-by: Modestas Vainius <modestas@vainius.eu>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Dpkg/Shlibs/SymbolFile.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm b/scripts/Dpkg/Shlibs/SymbolFile.pm index 4355ce4aa..978815dd5 100644 --- a/scripts/Dpkg/Shlibs/SymbolFile.pm +++ b/scripts/Dpkg/Shlibs/SymbolFile.pm @@ -17,6 +17,8 @@ package Dpkg::Shlibs::SymbolFile; +use strict; +use warnings; use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Version qw(vercmp); @@ -139,7 +141,7 @@ sub load { my $obj; $current_object_ref = \$obj; } - local *object = $current_object_ref; + my $object = $$current_object_ref; while (defined($_ = <$sym_file>)) { chomp($_); @@ -166,7 +168,7 @@ sub load { $new_base_symbol->parse_tagspec($tagspec); } $dir =~ s{[^/]+$}{}; # Strip filename - $self->load("$dir$filename", $seen, $current_object_ref, $new_base_symbol); + $self->load("$dir$filename", $seen, \$object, $new_base_symbol); } elsif (/^#/) { # Skip possible comments } elsif (/^\|\s*(.*)$/) { @@ -177,7 +179,7 @@ sub load { $self->{objects}{$object}{fields}{capit($1)} = $2; } elsif (/^(\S+)\s+(.*)$/) { # New object and dependency template - $object = $1; + $$current_object_ref = $object = $1; if (exists $self->{objects}{$object}) { # Update/override infos only $self->{objects}{$object}{deps} = [ "$2" ]; |