summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1997-04-07 00:00:00 +0000
committerChip Salzenberg <chip@atlantic.net>1997-04-07 00:00:00 +0000
commit8cc95fdbe3687330bd987cea170494b4cd263d90 (patch)
treee3a830736fef94663b44fc7cf30f0755de3e09c5 /pod
parent1061146bbd7c9a40c4288ec63427c8327cc0d5fa (diff)
downloadperl-8cc95fdbe3687330bd987cea170494b4cd263d90.tar.gz
[inseparable changes from match from perl-5.003_97b to perl-5.003_97c]
BUILD PROCESS Subject: Fix syntax error in Configure comment(!) From: Chip Salzenberg <chip@perl.com> Files: Configure Subject: For Solaris, if -DDEBUGGING, default to '-KPIC', not '-Kpic' From: Chip Salzenberg <chip@perl.com> Files: Configure Subject: Fix usage of dXSUB_SYS, esp. in ExtUtils::Miniperl From: Chip Salzenberg <chip@perl.com> Files: dosish.h minimod.pl os2/os2ish.h plan9/plan9ish.h vms/vmsish.h CORE LANGUAGE CHANGES Subject: Refine setgroups() behavior of C<$)> From: Chip Salzenberg <chip@perl.com> Files: mg.c pod/perldelta.pod pod/perlvar.pod Subject: Forbid -[Mm] on #! line From: Chip Salzenberg <chip@perl.com> Files: pod/perldelta.pod pod/perldiag.pod toke.c CORE PORTABILITY Subject: Special mkdir() for VMS Date: Tue, 08 Apr 1997 12:33:56 -0400 (EDT) From: Charles Bailey <bailey@hmivax.humgen.upenn.edu> Files: dosish.h lib/ExtUtils/MM_Unix.pm lib/File/Path.pm os2/os2ish.h plan9/plan9ish.h pp_sys.c unixish.h vms/vms.c vms/vmsish.h Msg-ID: 01IHGOXN6MZM0004K3@hmivax.humgen.upenn.edu (applied based on p5p patch as commit ebec1d4b2ca9c08d24035a369c7aa782aa058e66) DOCUMENTATION Subject: IO::Socket doc fix Date: Tue, 08 Apr 1997 15:30:43 -0400 From: Roderick Schertler <roderick@argon.org> Files: ext/IO/lib/IO/Socket.pm Msg-ID: 28383.860527843@eeyore.ibcinc.com (applied based on p5p patch as commit 4a51304ce091cb6d1ccc9f25e11753bd7d985b32) LIBRARY AND EXTENSIONS Subject: Replace Class::Template with improved Class::Struct From: Jim Miner <jfm@winternet.com> Files: MANIFEST lib/Class/Struct.pm lib/Class/Template.pm lib/File/stat.pm lib/Net/hostent.pm lib/Net/netent.pm lib/Net/protoent.pm lib/Net/servent.pm lib/Time/gmtime.pm lib/Time/localtime.pm lib/Time/tm.pm lib/User/grent.pm lib/User/pwent.pm pod/perldelta.pod pod/perlfaq7.pod pod/perlmod.pod pod/perltoot.pod Subject: MakeMaker pathname patch Date: Wed, 9 Apr 1997 20:08:23 +0100 From: Nick Ing-Simmons <nik@tiuk.ti.com> Files: lib/ExtUtils/MM_Unix.pm lib/ExtUtils/MakeMaker.pm Msg-ID: 199704091908.UAA00877@ni-s.u-net.com (applied based on p5p patch as commit 9cbbd68ff8edc7de96e3471de49538d0b2b98173) Subject: Fix configuration of new socket From: Chip Salzenberg <chip@perl.com> Files: ext/IO/lib/IO/Socket.pm
Diffstat (limited to 'pod')
-rw-r--r--pod/perldelta.pod67
-rw-r--r--pod/perldiag.pod14
-rw-r--r--pod/perlfaq7.pod2
-rw-r--r--pod/perlmod.pod4
-rw-r--r--pod/perltoc.pod33
-rw-r--r--pod/perltoot.pod33
-rw-r--r--pod/perlvar.pod33
7 files changed, 123 insertions, 63 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 1447fd4959..4aa05edc82 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -35,6 +35,29 @@ variable as if its contents had appeared on a "#!perl" line at the
beginning of your script, except that hyphens are optional. PERL5OPT
may only be used to set the following switches: B<-[DIMUdmw]>.
+=head2 Limitations on B<-M>, and C<-m>, and B<-T> options
+
+The C<-M> and C<-m> options are no longer allowed on the C<#!> line of
+a script. If a script needs a module, it should invoke it with the
+C<use> pragma.
+
+The B<-T> option is also forbidden on the C<#!> line of a script,
+unless it was present on the Perl command line. Due to the way C<#!>
+works, this usually means that B<-T> must be in the first argument.
+Thus:
+
+ #!/usr/bin/perl -T -w
+
+will probably work for an executable script invoked as C<scriptname>,
+while:
+
+ #!/usr/bin/perl -w -T
+
+will probably fail under the same conditions. (Non-Unix systems will
+probably not follow this rule.) But C<perl scriptname> is guaranteed
+to fail, since then there is no chance of B<-T> being found on the
+command line before it is found on the C<#!> line.
+
=head2 More precise warnings
If you removed the B<-w> option from your Perl 5.003 scripts because it
@@ -84,18 +107,18 @@ After this code executes in Perl 5.004, $a{b} exists but $a[2] does
not. In Perl 5.002 and 5.003, both $a{b} and $a[2] would have existed
(but $a[2]'s value would have been undefined).
-=head2 C<$)> is writable
+=head2 Group vector changeable with C<$)>
The C<$)> special variable has always (well, in Perl 5, at least)
-reflected not only the current effective group, but also the group
-list as returned by the C<getgroups()> C function (if there is one).
-However, due to an oversight, assigning to C<$)> has not called
-C<setgroups()>, only C<setegid()>.
+reflected not only the current effective group, but also the group list
+as returned by the C<getgroups()> C function (if there is one).
+However, until this release, there has not been a way to call the
+C<setgroups()> C function from Perl.
-In Perl 5.004, assigning to C<$)> is exactly symmetrical with
-examining it: The first number in its string value is used as the
-effective gid, and all the others are passed to the C<setgroups()> C
-function (if there is one).
+In Perl 5.004, assigning to C<$)> is exactly symmetrical with examining
+it: The first number in its string value is used as the effective gid;
+if there are any numbers after the first one, they are passed to the
+C<setgroups()> C function (if there is one).
=head2 Fixed parsing of $$<digit>, &$<digit>, etc.
@@ -127,9 +150,9 @@ calculation of a return value if it isn't going to be used.
=head2 Changes to tainting checks
A bug in previous versions may have failed to detect some insecure
-conditions when taint checks are turned on. (Taint checks are used
+conditions when taint checks are turned on. (Taint checks are used
in setuid or setgid scripts, or when explicitly turned on with the
-C<-T> invocation option.) Although it's unlikely, this may cause a
+C<-T> invocation option.) Although it's unlikely, this may cause a
previously-working script to now fail -- which should be construed
as a blessing, since that indicates a potentially-serious security
hole was just plugged.
@@ -662,17 +685,17 @@ alphabetically:
FindBin.pm Find path of currently executing program
- Class/Template.pm Structure/member template builder
- File/stat.pm Object-oriented wrapper around CORE::stat
- Net/hostent.pm Object-oriented wrapper around CORE::gethost*
- Net/netent.pm Object-oriented wrapper around CORE::getnet*
- Net/protoent.pm Object-oriented wrapper around CORE::getproto*
- Net/servent.pm Object-oriented wrapper around CORE::getserv*
- Time/gmtime.pm Object-oriented wrapper around CORE::gmtime
- Time/localtime.pm Object-oriented wrapper around CORE::localtime
- Time/tm.pm Perl implementation of "struct tm" for {gm,local}time
- User/grent.pm Object-oriented wrapper around CORE::getgr*
- User/pwent.pm Object-oriented wrapper around CORE::getpw*
+ Class/Struct.pm Declare struct-like datatypes as Perl classes
+ File/stat.pm By-name interface to Perl's built-in stat
+ Net/hostent.pm By-name interface to Perl's built-in gethost*
+ Net/netent.pm By-name interface to Perl's built-in getnet*
+ Net/protoent.pm By-name interface to Perl's built-in getproto*
+ Net/servent.pm By-name interface to Perl's built-in getserv*
+ Time/gmtime.pm By-name interface to Perl's built-in gmtime
+ Time/localtime.pm By-name interface to Perl's built-in localtime
+ Time/tm.pm Internal object for Time::{gm,local}time
+ User/grent.pm By-name interface to Perl's built-in getgr*
+ User/pwent.pm By-name interface to Perl's built-in getpw*
Tie/RefHash.pm Base class for tied hashes with references as keys
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 0543595527..cdc7c59c1a 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -2263,10 +2263,10 @@ system call to call, silly dilly.
=item Too late for "B<-T>" option
(X) The #! line (or local equivalent) in a Perl script contains the
-B<-T> option, but Perl was not invoked with B<-T> in its argument
-list. This is an error because, by the time Perl discovers a B<-T> in
-a script, it's too late to properly taint everything from the
-environment. So Perl gives up.
+B<-T> option, but Perl was not invoked with B<-T> in its command line.
+This is an error because, by the time Perl discovers a B<-T> in a
+script, it's too late to properly taint everything from the environment.
+So Perl gives up.
If the Perl script is being executed as a command using the #!
mechanism (or its local equivalent), this error can usually be fixed
@@ -2276,6 +2276,12 @@ first argument: e.g. change C<perl -n -T> to C<perl -T -n>.
If the Perl script is being executed as C<perl scriptname>, then the
B<-T> option must appear on the command line: C<perl -T scriptname>.
+=item Too late for "-%s" option
+
+(X) The #! line (or local equivalent) in a Perl script contains the
+B<-M> or B<-m> option. This is an error because B<-M> and B<-m> options
+are not intended for use inside scripts. Use the C<use> pragma instead.
+
=item Too many ('s
=item Too many )'s
diff --git a/pod/perlfaq7.pod b/pod/perlfaq7.pod
index c272c91e31..1047b28634 100644
--- a/pod/perlfaq7.pod
+++ b/pod/perlfaq7.pod
@@ -539,7 +539,7 @@ Why do you want to do that? :-)
If you want to override a predefined function, such as open(),
then you'll have to import the new definition from a different
module. See L<perlsub/"Overriding Builtin Functions">. There's
-also an example in L<perltoot/"Class::Template">.
+also an example in L<perltoot/"Class::Struct">.
If you want to overload a Perl operator, such as C<+> or C<**>,
then you'll want to use the C<use overload> pragma, documented
diff --git a/pod/perlmod.pod b/pod/perlmod.pod
index 0b384ab35c..cfdcdda939 100644
--- a/pod/perlmod.pod
+++ b/pod/perlmod.pod
@@ -502,9 +502,9 @@ run CPAN while avoiding compiled extensions
warn of errors (from perspective of caller)
-=item Class::Template
+=item Class::Struct
-struct/member template builder
+declare struct-like datatypes
=item Config
diff --git a/pod/perltoc.pod b/pod/perltoc.pod
index ce590dcb8d..ae5f768c47 100644
--- a/pod/perltoc.pod
+++ b/pod/perltoc.pod
@@ -827,13 +827,15 @@ file on another machine?
=item $PERL5OPT environment variable
+=item Limitations on B<-M>, and C<-m>, and B<-T> options
+
=item More precise warnings
=item Deprecated: Inherited C<AUTOLOAD> for non-methods
=item Subroutine arguments created only when they're modified
-=item C<$)> is writable
+=item Group vector changeable with C<$)>
=item Fixed parsing of $$<digit>, &$<digit>, etc.
@@ -1322,7 +1324,7 @@ strict, subs, vmsish, vars
=item Standard Modules
AnyDBM_File, AutoLoader, AutoSplit, Benchmark, CPAN, CPAN::FirstTime,
-CPAN::Nox, Carp, Class::Template, Config, Cwd, DB_File, Devel::SelfStubber,
+CPAN::Nox, Carp, Class::Struct, Config, Cwd, DB_File, Devel::SelfStubber,
DirHandle, DynaLoader, English, Env, Exporter, ExtUtils::Embed,
ExtUtils::Install, ExtUtils::Liblist, ExtUtils::MM_OS2, ExtUtils::MM_Unix,
ExtUtils::MM_VMS, ExtUtils::MakeMaker, ExtUtils::Manifest,
@@ -1696,7 +1698,7 @@ more elaborate constructs
=over
-=item Class::Template
+=item Class::Struct
=item Data Members as Variables
@@ -3112,17 +3114,28 @@ module
=item DESCRIPTION
-=head2 Class::Template - struct/member template builder
+=head2 Class::Struct - declare struct-like datatypes as Perl classes
=item SYNOPSIS
=item DESCRIPTION
+=over
+
+=item The C<struct()> function
+
+=item Element Types and Accessor Methods
+
+Scalar (C<'$'> or C<'*$'>), Array (C<'@'> or C<'*@'>), Hash (C<'%'> or
+C<'*%'>), Class (C<'Class_Name'> or C<'*Class_Name'>)
+
+=back
+
=item EXAMPLES
Example 1, Example 2
-=item NOTES
+=item Author and Modification History
=head2 Config - access Perl configuration information
@@ -3801,8 +3814,9 @@ new (), new_from_fd ( FD, MODE )
=item METHODS
-$fh->getline, $fh->getlines, $fh->fdopen ( FD, MODE ), $fh->write ( BUF,
-LEN [, OFFSET }\] ), $fh->opened, $fh->untaint
+$fh->fdopen ( FD, MODE ), $fh->opened, $fh->getline, $fh->getlines,
+$fh->ungetc ( ORD ), $fh->write ( BUF, LEN [, OFFSET }\] ), $fh->flush,
+$fh->error, $fh->clearerr, $fh->untaint
=item NOTE
@@ -3935,8 +3949,9 @@ new (), new_from_fd ( FD, MODE )
=item METHODS
-$fh->getline, $fh->getlines, $fh->fdopen ( FD, MODE ), $fh->write ( BUF,
-LEN [, OFFSET }\] ), $fh->opened, $fh->untaint
+$fh->fdopen ( FD, MODE ), $fh->opened, $fh->getline, $fh->getlines,
+$fh->ungetc ( ORD ), $fh->write ( BUF, LEN [, OFFSET }\] ), $fh->flush,
+$fh->error, $fh->clearerr, $fh->untaint
=item NOTE
diff --git a/pod/perltoot.pod b/pod/perltoot.pod
index c23591245a..0c5b418c04 100644
--- a/pod/perltoot.pod
+++ b/pod/perltoot.pod
@@ -1467,12 +1467,12 @@ as detailed above.
Perl programmers have responded to this by creating several different
class construction classes. These metaclasses are classes
that create other classes. A couple worth looking at are
-Class::Template and Alias. These and other related metaclasses can be
+Class::Struct and Alias. These and other related metaclasses can be
found in the modules directory on CPAN.
-=head2 Class::Template
+=head2 Class::Struct
-One of the older ones is Class::Template. In fact, its syntax and
+One of the older ones is Class::Struct. In fact, its syntax and
interface were sketched out long before perl5 even solidified into a
real thing. What it does is provide you a way to "declare" a class
as having objects whose fields are of a specific type. The function
@@ -1481,11 +1481,11 @@ structures or records are not base types in Perl, each time you want to
create a class to provide a record-like data object, you yourself have
to define a new() method, plus separate data-access methods for each of
that record's fields. You'll quickly become bored with this process.
-The Class::Template::struct() function alleviates this tedium.
+The Class::Struct::struct() function alleviates this tedium.
Here's a simple example of using it:
- use Class::Template qw(struct);
+ use Class::Struct qw(struct);
use Jobbie; # user-defined; see below
struct 'Fred' => {
@@ -1520,7 +1520,7 @@ act like structs in the C sense.
printf "perl.com's real name is %s, address %s\n",
$h->name, inet_ntoa($h->addr);
-Here's how to do this using the Class::Template module.
+Here's how to do this using the Class::Struct module.
The crux is going to be this call:
struct 'Net::hostent' => [ # note bracket
@@ -1544,7 +1544,7 @@ We could also have implemented our object this way:
addr_list => '@',
};
-and then Class::Template would have used an anonymous hash as the object
+and then Class::Struct would have used an anonymous hash as the object
type, instead of an anonymous array. The array is faster and smaller,
but the hash works out better if you eventually want to do inheritance.
Since for this struct-like object we aren't planning on inheritance,
@@ -1557,8 +1557,7 @@ Here's the whole implementation:
BEGIN {
use Exporter ();
- use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
- @ISA = qw(Exporter);
+ use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS);
@EXPORT = qw(gethostbyname gethostbyaddr gethost);
@EXPORT_OK = qw(
$h_name @h_aliases
@@ -1569,7 +1568,10 @@ Here's the whole implementation:
}
use vars @EXPORT_OK;
- use Class::Template qw(struct);
+ # Class::Struct forbids use of @ISA
+ sub import { goto &Exporter::import }
+
+ use Class::Struct qw(struct);
struct 'Net::hostent' => [
name => '$',
aliases => '@',
@@ -1582,7 +1584,7 @@ Here's the whole implementation:
sub populate (@) {
return unless @_;
- my $hob = new(); # Class::Template made this!
+ my $hob = new(); # Class::Struct made this!
$h_name = $hob->[0] = $_[0];
@h_aliases = @{ $hob->[1] } = split ' ', $_[1];
$h_addrtype = $hob->[2] = $_[2];
@@ -1615,9 +1617,10 @@ Here's the whole implementation:
We've snuck in quite a fair bit of other concepts besides just dynamic
class creation, like overriding core functions, import/export bits,
-function prototyping, and short-cut function call via C<&whatever>.
-These all mostly make sense from the perspective of a traditional module,
-but as you can see, we can also use them in an object module.
+function prototyping, short-cut function call via C<&whatever>, and
+function replacement with C<goto &whatever>. These all mostly make
+sense from the perspective of a traditional module, but as you can see,
+we can also use them in an object module.
You can look at other object-based, struct-like overrides of core
functions in the 5.004 release of Perl in File::stat, Net::hostent,
@@ -1695,7 +1698,7 @@ they're still considered global variables with temporary values, just
as with any other local().
It would be nice to combine Alias with
-something like Class::Template or Class::MethodMaker.
+something like Class::Struct or Class::MethodMaker.
=head2 NOTES
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index 00b97bad1e..198e5c12a3 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -490,8 +490,9 @@ The effective uid of this process. Example:
$< = $>; # set real to effective uid
($<,$>) = ($>,$<); # swap real and effective uid
-(Mnemonic: it's the uid you went I<TO>, if you're running setuid.) Note:
-"C<$E<lt>>" and "C<$E<gt>>" can be swapped on only machines supporting setreuid().
+(Mnemonic: it's the uid you went I<TO>, if you're running setuid.)
+Note: "C<$E<lt>>" and "C<$E<gt>>" can be swapped only on machines
+supporting setreuid().
=item $REAL_GROUP_ID
@@ -503,8 +504,14 @@ The real gid of this process. If you are on a machine that supports
membership in multiple groups simultaneously, gives a space separated
list of groups you are in. The first number is the one returned by
getgid(), and the subsequent ones by getgroups(), one of which may be
-the same as the first number. (Mnemonic: parentheses are used to I<GROUP>
-things. The real gid is the group you I<LEFT>, if you're running setgid.)
+the same as the first number.
+
+However, a value assigned to "C<$(>" must be a single number used to
+set the real gid. So the value given by "C<$(>" should I<not> be assigned
+back to "C<$(>" without being forced numeric, such as by adding zero.
+
+(Mnemonic: parentheses are used to I<GROUP> things. The real gid is the
+group you I<LEFT>, if you're running setgid.)
=item $EFFECTIVE_GROUP_ID
@@ -516,15 +523,21 @@ The effective gid of this process. If you are on a machine that
supports membership in multiple groups simultaneously, gives a space
separated list of groups you are in. The first number is the one
returned by getegid(), and the subsequent ones by getgroups(), one of
-which may be the same as the first number. (Mnemonic: parentheses are
-used to I<GROUP> things. The effective gid is the group that's I<RIGHT> for
-you, if you're running setgid.)
+which may be the same as the first number.
+
+Similarly, a value assigned to "C<$)>" must also be a space-separated
+list of numbers. The first number is used to set the effective gid, and
+the rest (if any) are passed to setgroups(). To get the effect of an
+empty list for setgroups(), just repeat the new effective gid; that is,
+to force an effective gid of 5 and an effectively empty setgroups()
+list, say C< $) = "5 5" >.
+
+(Mnemonic: parentheses are used to I<GROUP> things. The effective gid
+is the group that's I<RIGHT> for you, if you're running setgid.)
Note: "C<$E<lt>>", "C<$E<gt>>", "C<$(>" and "C<$)>" can be set only on
machines that support the corresponding I<set[re][ug]id()> routine. "C<$(>"
-and "C<$)>" can be swapped on only machines supporting setregid(). Because
-Perl doesn't currently use initgroups(), you can't set your group vector to
-multiple groups.
+and "C<$)>" can be swapped only on machines supporting setregid().
=item $PROGRAM_NAME