changed or removed in future releases of Perl. It should not be
relied upon.
-The only currently recognized attribute is C<shared> which indicates
+The only currently recognized attribute is C<unique> which indicates
that a single copy of the global is to be used by all interpreters
should the program happen to be running in a multi-interpreter
environment. (The default behaviour would be for each interpreter to
attribute also has the effect of making the global readonly.
Examples:
- our @EXPORT : shared = qw(foo);
- our %EXPORT_TAGS : shared = (bar => [qw(aa bb cc)]);
- our $VERSION : shared = "1.00";
+ our @EXPORT : unique = qw(foo);
+ our %EXPORT_TAGS : unique = (bar => [qw(aa bb cc)]);
+ our $VERSION : unique = "1.00";
Multi-interpreter environments can come to being either through the
fork() emulation on Windows platforms, or by embedding perl in a
-multi-threaded application. The C<shared> attribute does nothing in
+multi-threaded application. The C<unique> attribute does nothing in
all other environments.
=item pack TEMPLATE,LIST
=item semop KEY,OPSTRING
Calls the System V IPC function semop to perform semaphore operations
-such as signaling and waiting. OPSTRING must be a packed array of
+such as signalling and waiting. OPSTRING must be a packed array of
semop structures. Each semop structure can be generated with
-C<pack("sss", $semnum, $semop, $semflag)>. The number of semaphore
+C<pack("s!3", $semnum, $semop, $semflag)>. The number of semaphore
operations is implied by the length of OPSTRING. Returns true if
successful, or false if there is an error. As an example, the
following code waits on semaphore $semnum of semaphore id $semid:
- $semop = pack("sss", $semnum, -1, 0);
+ $semop = pack("s!3", $semnum, -1, 0);
die "Semaphore trouble: $!\n" unless semop($semid, $semop);
To signal the semaphore, replace C<-1> with C<1>. See also