summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2008-04-07 12:03:00 +0000
committerMarc Espie <espie@cvs.openbsd.org>2008-04-07 12:03:00 +0000
commit5637085c0e52c9515e97340c8af3e44171c5d7a2 (patch)
tree3dc93df1be299fa1545d8c0035edc525ef95e5c2
parentaed4443713c49d94066dcd9ef2f17726891ad213 (diff)
likewise for the hash itself
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Subst.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Subst.pm b/usr.sbin/pkg_add/OpenBSD/Subst.pm
index bc772d96054..665defa5bee 100644
--- a/usr.sbin/pkg_add/OpenBSD/Subst.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Subst.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Subst.pm,v 1.2 2008/04/07 11:55:22 espie Exp $
+# $OpenBSD: Subst.pm,v 1.3 2008/04/07 12:02:59 espie Exp $
#
# Copyright (c) 2008 Marc Espie <espie@openbsd.org>
#
@@ -27,6 +27,11 @@ sub new
bless {}, shift;
}
+sub hash
+{
+ shift;
+}
+
sub add
{
my ($self, $k, $v) = @_;
@@ -57,7 +62,7 @@ sub do
my $self = shift;
local $_ = shift;
return $_ unless m/\$/o; # optimization
- while (my ($k, $v) = each %$self) {
+ while (my ($k, $v) = each %{$self->hash}) {
s/\$\{\Q$k\E\}/$v/g;
}
s/\$\\/\$/go;