home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_54f4784d11a7d40284c36b3924755c05
< prev
next >
Wrap
Text File
|
2000-03-23
|
3KB
|
90 lines
<HTML>
<HEAD>
<TITLE>Set::Scalar::Valued - valued sets</TITLE>
<LINK REL="stylesheet" HREF="../../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Set::Scalar::Valued - valued sets</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#author">AUTHOR</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="name">NAME</A></H1>
<P>Set::Scalar::Valued - valued sets</P>
<P>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
use Set::Scalar::Valued;
$s = Set::Scalar::Valued->new;
$s->insert(a => 12, 'b c' => $d);
$s->delete('b c' => $d);
$t = Set::Scalar->new(x => $y, y => $z);</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>Valued sets are an extension of the traditional set concept. In
addition to a member just existing in the set, the member also has a
distinct value. You can think of this a combination of a traditional
set and a Perl hash.</P>
<P>The used methods are as for the traditional of Set::Scalar, with
the difference that when creating (new()) or modifying (insert(),
delete(), invert()), you must supply twice the number of arguments:
the member-value pairs, instead of just the members. Note, though,
that in the current implementation of <A HREF="../../../../lib/Pod/perlfunc.html#item_delete"><CODE>delete()</CODE></A> the value half is
unused, the deletion is by the member. In future implementation
this behavior may change so that also the value matters.</P>
<P>There are a couple of additional methods:</P>
<PRE>
%ve = $s->valued_members;</PRE>
<P>which returns the member-value pairs, and</P>
<PRE>
@v = $s->values;</PRE>
<P>which returns just the values (in the same order as the <CODE>members()</CODE>
method would return the members), and</P>
<PRE>
$v = $s->value($member);</PRE>
<P>which returns the value of the member.</P>
<P>The display format of a valued set is the member-value pairs separated
by `` => '', the pairs separated by ``, '' and enclosed in curly brackets {}.</P>
<P>
<HR>
<H1><A NAME="author">AUTHOR</A></H1>
<P>Jarkko Hietaniemi <<A HREF="mailto:jhi@iki.fi">jhi@iki.fi</A>></P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Set::Scalar::Valued - valued sets</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>