Date: Sat, 01 Jun 1996 00:31:05 +0700 From: neumann@nestroy.wi-inf.uni-essen.de To: plexus-dev@earth.com Subject: small fixes for plexus and Perl 5.002 List-Admin: plexus-dev-request@earth.com (subscribe/unsubscribe requests) Originator: plexus-dev@earth.com Maybe some of you might find the patches below useful These fix the following problems: - bookmarks were broken (other image maps as well): util/decode.pl - dir returned only the first two entries of an directory; overwriting @_ seems not a good idea: libplex.pl - less memory usage in dir (removing an array, moving local variable definitions ouf of a loop): dir.pl Regards -gustaf -- Wirtschaftsinformatik und Softwaretechnik Universitaet GH Essen, FB5 Altendorfer Strasse 97-101, Eingang B, D-45143 Essen Tel.: +49 (0201) 81003-74, Fax: +49 (0201) 81003-73 Gustaf.Neumann@uni-essen.de http://mohegan.wi-inf.uni-essen.de/Neumann.html ============================================================================= --- dir.pl.ORIG Mon May 20 22:12:16 1996 +++ dir.pl Sat Jun 1 00:30:03 1996 @@ -1,3 +1,4 @@ +# -*- perl -*- # dir.pl -- directory browser (with filter) # # dir.pl,v 2.21 1994/11/08 23:57:57 sanders Exp @@ -184,18 +185,22 @@ printf("%39sParent Directory\n", "", $count++, $parent, (length($parent)?"/":"")); + # Get directory listing + local($date); + local($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, + $atime, $mtime, $ctime, $blksize, $blocks); + &main'set_timeout(); opendir(DH, $dir) || &error('not_found', "$dir: $!"); - @dirs = sort(readdir(DH)); - while ($_ = shift @dirs) { + foreach (sort readdir(DH)) { &main'set_timeout(); next if /^\.$/ || /^\.\.$/; next if defined($hidden{"$dir/$_"}) || defined($hidden{$_}); # hidden next unless /$filter/; - local($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, - $atime, $mtime, $ctime, $blksize, $blocks) = stat("$dir/$_"); - local($date) = &ctime($mtime); chop $date; + ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, + $atime, $mtime, $ctime, $blksize, $blocks) = stat("$dir/$_"); + $date = &ctime($mtime); chop $date; printf "%s %9d ", $date, $size; $_ .= "/" if &S_ISDIR($mode); $file = &main'printable($_); --- libplex.pl.ORIG Fri May 31 23:02:32 1996 +++ libplex.pl Fri May 31 23:03:42 1996 @@ -15,9 +15,9 @@ # usage: $string = &main'printable($data); # sub printable { - local(@_, $_) = @_; - foreach (@_) { s/([^0-9A-Za-z])/sprintf('%%%02x',ord($1))/eg; } - join("/",@_); + local(@line, $_) = @_; + foreach (@line) { s/([^0-9A-Za-z])/sprintf('%%%02x',ord($1))/eg; } + join("/",@line); } # --- util/decode.pl.ORIG Thu Nov 2 20:51:58 1995 +++ util/decode.pl Fri May 10 20:20:01 1996 @@ -128,9 +128,9 @@ defined($a = $imgatom{$file}) || do { $a = $imgatom{$file} = $imgatom++; # string increment eval " - \$$a{'filename'} = \$file; - \$$a{'width'} = \$width; - \$$a{'height'} = \$height; + \$$a\{'filename'\} = \$file; + \$$a\{'width'\} = \$width; + \$$a\{'height'\} = \$height; &main'loadmask(*$a);"; die $@ if $@; };