diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/dumpvar.pl')
-rw-r--r-- | Master/tlpkg/tlperl/lib/dumpvar.pl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Master/tlpkg/tlperl/lib/dumpvar.pl b/Master/tlpkg/tlperl/lib/dumpvar.pl index 523bda815c9..7aadba1854e 100644 --- a/Master/tlpkg/tlperl/lib/dumpvar.pl +++ b/Master/tlpkg/tlperl/lib/dumpvar.pl @@ -37,7 +37,7 @@ sub main::dumpValue { # This one is good for variable names: sub unctrl { - local($_) = @_; + for (my($dummy) = shift) { local($v) ; return \$_ if ref \$_ eq "GLOB"; @@ -47,7 +47,8 @@ sub unctrl { } else { s/([\001-\037\177])/'^'.pack('c',ord($1)^64)/eg; } - $_; + return $_; + } } sub uniescape { @@ -57,7 +58,8 @@ sub uniescape { } sub stringify { - local($_,$noticks) = @_; + (my $__, local $noticks) = @_; + for ($__) { local($v) ; my $tick = $tick; @@ -101,9 +103,10 @@ sub stringify { } $_ = uniescape($_); s/([\200-\377])/'\\'.sprintf('%3o',ord($1))/eg if $quoteHighBit; - ($noticks || /^\d+(\.\d*)?\Z/) + return ($noticks || /^\d+(\.\d*)?\Z/) ? $_ : $tick . $_ . $tick; + } } # Ensure a resulting \ is escaped to be \\ @@ -165,8 +168,7 @@ sub unwrap { # Match type and address. # Unblessed references will look like TYPE(0x...) # Blessed references will look like Class=TYPE(0x...) - ($start_part, $val) = split /=/,$val; - $val = $start_part unless defined $val; + $val =~ s/^.*=//; # suppress the Class part, just keep TYPE(0x...) ($item_type, $address) = $val =~ /([^\(]+) # Keep stuff that's # not an open paren @@ -343,7 +345,7 @@ sub unctrlSet { if ($in eq 'unctrl' or $in eq 'quote') { $unctrl = $in; } else { - print "Unknown value for `unctrl'.\n"; + print "Unknown value for 'unctrl'.\n"; } } $unctrl; |