summaryrefslogtreecommitdiff
path: root/pod/perlfunc.pod
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2022-12-24 15:18:18 +0000
committerPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2023-02-10 12:07:02 +0000
commitfd11211b37c20262922903f6435c1c09ac046e5c (patch)
treeff8e696a1813889bbe6493d6f3c7550476cda464 /pod/perlfunc.pod
parentca8d92cfddc9cc3d4904712f7e0dfc3b2598561d (diff)
downloadperl-fd11211b37c20262922903f6435c1c09ac046e5c.tar.gz
Initial attack at pod/perlclass.pod
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r--pod/perlfunc.pod71
1 files changed, 64 insertions, 7 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 0643db5463..c69da92cae 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -262,6 +262,7 @@ L<C<dump>|/dump LABEL>, L<C<eval>|/eval EXPR>,
L<C<evalbytes>|/evalbytes EXPR>, L<C<exit>|/exit EXPR>,
L<C<__FILE__>|/__FILE__>, L<C<goto>|/goto LABEL>,
L<C<last>|/last LABEL>, L<C<__LINE__>|/__LINE__>,
+L<C<method>|/method NAME BLOCK>,
L<C<next>|/next LABEL>, L<C<__PACKAGE__>|/__PACKAGE__>,
L<C<redo>|/redo LABEL>, L<C<return>|/return EXPR>,
L<C<sub>|/sub NAME BLOCK>, L<C<__SUB__>|/__SUB__>,
@@ -293,9 +294,15 @@ current scope.
=for Pod::Functions =Namespace
-L<C<caller>|/caller EXPR>, L<C<import>|/import LIST>,
-L<C<local>|/local EXPR>, L<C<my>|/my VARLIST>, L<C<our>|/our VARLIST>,
-L<C<package>|/package NAMESPACE>, L<C<state>|/state VARLIST>,
+L<C<caller>|/caller EXPR>,
+L<C<class>|/class NAMESPACE>,
+L<C<field>|/field VARNAME>,
+L<C<import>|/import LIST>,
+L<C<local>|/local EXPR>,
+L<C<my>|/my VARLIST>,
+L<C<our>|/our VARLIST>,
+L<C<package>|/package NAMESPACE>,
+L<C<state>|/state VARLIST>,
L<C<use>|/use Module VERSION LIST>
L<C<state>|/state VARLIST> is available only if the
@@ -343,11 +350,18 @@ X<object> X<class> X<package>
=for Pod::Functions =Objects
-L<C<bless>|/bless REF,CLASSNAME>, L<C<dbmclose>|/dbmclose HASH>,
+L<C<bless>|/bless REF,CLASSNAME>,
+L<C<class>|/class NAMESPACE>,
+L<C<dbmclose>|/dbmclose HASH>,
L<C<dbmopen>|/dbmopen HASH,DBNAME,MASK>,
-L<C<package>|/package NAMESPACE>, L<C<ref>|/ref EXPR>,
-L<C<tie>|/tie VARIABLE,CLASSNAME,LIST>, L<C<tied>|/tied VARIABLE>,
-L<C<untie>|/untie VARIABLE>, L<C<use>|/use Module VERSION LIST>
+L<C<field>|/field VARNAME>,
+L<C<method>|/method NAME BLOCK>,
+L<C<package>|/package NAMESPACE>,
+L<C<ref>|/ref EXPR>,
+L<C<tie>|/tie VARIABLE,CLASSNAME,LIST>,
+L<C<tied>|/tied VARIABLE>,
+L<C<untie>|/untie VARIABLE>,
+L<C<use>|/use Module VERSION LIST>
=item Low-level socket functions
X<socket> X<sock>
@@ -426,6 +440,7 @@ L<C<time>|/time>, L<C<times>|/times>
=for Pod::Functions =!Non-functions
+C<ADJUST>,
C<and>,
C<AUTOLOAD>,
C<BEGIN>,
@@ -1317,6 +1332,21 @@ may be outside of the new root.
Portability issues: L<perlport/chroot>.
+=item class NAMESPACE
+
+=item class NAMESPACE VERSION
+
+=item class NAMESPACE BLOCK
+
+=item class NAMESPACE VERSION BLOCK
+
+=for Pod::Functions declare a separate global namespace that is an object class
+
+Declares the BLOCK or the rest of the compilation unit as being in the given
+namespace, which implements an object class. This behaves similarly to
+L<C<package>|/package NAMESPACE>, except that the newly-created package behaves
+as a class.
+
=item close FILEHANDLE
X<close>
@@ -2788,6 +2818,15 @@ A special token that returns the name of the file in which it occurs.
It can be altered by the mechanism described at
L<perlsyn/"Plain Old Comments (Not!)">.
+=item field VARNAME
+X<field>
+
+=for Pod::Functions declare a field variable of the current class
+
+Declares a new field variable within the current class. Methods and
+C<ADJUST> blocks of the class will have access to this variable as if it
+was a lexical in scope at that point.
+
=item fileno FILEHANDLE
X<fileno>
@@ -4352,6 +4391,16 @@ or to force an anon hash constructor use C<+{>:
to get a list of anonymous hashes each with only one entry apiece.
+=item method NAME BLOCK
+X<method>
+
+=item method NAME : ATTRS BLOCK
+
+=for Pod::Functions declare a method of a class
+
+Creates a new named method in the scope of the class that it appears within.
+This is only valid inside a L<C<class>|/class NAMESPACE> declaration.
+
=item mkdir FILENAME,MODE
X<mkdir> X<md> X<directory, create>
@@ -10714,4 +10763,12 @@ documented in L<perlsyn/"defer blocks">.
=back
+=over
+
+=item ADJUST
+
+This class-related phaser block is documented in L<perlclass>.
+
+=back
+
=cut