.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Internals 3pm" .TH Internals 3pm "2022-10-21" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Internals \- Write\-protect variables, manipulate refcounts .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Internals qw(IsWriteProtected SetReadOnly SetReadWrite GetRefCount SetRefCount); \& \& use Internals qw(:all); \& \& $object = My::Class\->new(@parameters); \& \& SetReadOnly($object); \& \& SetReadWrite($object); \& \& if (IsWriteProtected($object)) { ... } \& \& $value = GetRefCount($object); \& \& SetRefCount($object,$value); .Ve .PP or .PP .Vb 1 \& package My::Class; \& \& use Internals; \& \& @ISA = qw(Internals); \& \& $object = My::Class\->new(@parameters)\->SetReadOnly(); \& \& $object\->SetReadWrite(); \& \& if ($object\->IsWriteProtected()) { ... } \& \& $value = $object\->GetRefCount(); \& \& $object\->SetRefCount($value); .Ve .PP or .PP .Vb 1 \& use Internals qw(IsWriteProtected SetReadOnly SetReadWrite GetRefCount SetRefCount); \& \& use Internals qw(:all); \& \& SetReadOnly(\e$scalar); \& \& SetReadOnly(\e@array); \& \& SetReadOnly(\e%hash); \& \& SetReadOnly(\e$hash{$element}); \& \& SetReadOnly(\e$reference); .Ve .PP etc. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module allows you to write-protect and write-enable your Perl variables, objects and data structures. .PP Moreover, the reference count of any Perl variable can be read and set. .PP You can never pass the object directly on which to perform the desired action, you always have to pass a reference to the variable or data structure in question. .PP This comes in handy for objects and anonymous data structures, where you only have a reference anyway! .PP \&\s-1BEWARE:\s0 This module is \s-1DANGEROUS\s0! .PP \&\s-1DO NOT\s0 attempt to unlock Perl's built-in variables! .PP \&\s-1DO NOT\s0 manipulate reference counts unless you know exactly what you're doing! .PP \&\s-1ANYTHING\s0 might happen! Hell might break loose! \f(CW\*(C`:\-)\*(C'\fR .PP \&\s-1YOU HAVE BEEN WARNED\s0! .SH "VERSION" .IX Header "VERSION" This man page documents \*(L"Internals\*(R" version 1.1. .SH "AUTHOR" .IX Header "AUTHOR" .Vb 3 \& Steffen Beyer \& mailto:sb@engelschall.com \& http://www.engelschall.com/u/sb/download/ .Ve .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2001 by Steffen Beyer. All rights reserved. .SH "LICENSE" .IX Header "LICENSE" This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e., under the terms of the \*(L"Artistic License\*(R" or the \*(L"\s-1GNU\s0 General Public License\*(R". .PP Please refer to the files \*(L"Artistic.txt\*(R" and \*(L"\s-1GNU_GPL\s0.txt\*(R" in this distribution for details! .SH "DISCLAIMER" .IX Header "DISCLAIMER" This package is distributed in the hope that it will be useful, but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 .PP See the \*(L"\s-1GNU\s0 General Public License\*(R" for more details.