diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2003-10-19 18:42:56 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2003-10-19 18:42:56 +0000 |
commit | e380d718ff827092ee64d19268e9d643e0dd0f47 (patch) | |
tree | 17c1713570163b8904e80731c57f124cef951689 /usr.sbin/pkg_add/OpenBSD/PackingList.pm | |
parent | 4d17b19c65526769e339f93939fb98ede968953f (diff) |
plist's has/get methods for accessing elements: perl ->{} has quirks
that make it unusable for looking up constants correctly.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingList.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingList.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm index 24b3786a6e9..28b4e10851c 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm @@ -1,4 +1,4 @@ -# $OpenBSD: PackingList.pm,v 1.1 2003/10/16 17:43:34 espie Exp $ +# $OpenBSD: PackingList.pm,v 1.2 2003/10/19 18:42:55 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -128,6 +128,18 @@ sub addunique $plist->{$category} = $object; } +sub has +{ + my ($plist, $name) = @_; + return defined $plist->{$name}; +} + +sub get +{ + my ($plist, $name) = @_; + return $plist->{$name}; +} + sub pkgname($) { my $self = shift; |