diff options
author | Larry Wall <larry@wall.org> | 1999-09-24 14:59:37 -0700 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-09-25 06:44:47 +0000 |
commit | 77ca0c92d2c0e47301d906d355d9ab3afb6f6bcb (patch) | |
tree | b60e0c33e2b10b0977fb99fb6da0dcad45134146 /pod/perlxstut.pod | |
parent | 84e30d1a3b7cc368d7f93dd2b009e9fd64756759 (diff) | |
download | perl-77ca0c92d2c0e47301d906d355d9ab3afb6f6bcb.tar.gz |
Re: [PATCH 5.005_61] "our" declarations
Message-Id: <199909250459.VAA27506@kiev.wall.org>
p4raw-id: //depot/perl@4227
Diffstat (limited to 'pod/perlxstut.pod')
-rw-r--r-- | pod/perlxstut.pod | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/pod/perlxstut.pod b/pod/perlxstut.pod index 4200140833..632f417496 100644 --- a/pod/perlxstut.pod +++ b/pod/perlxstut.pod @@ -92,19 +92,18 @@ The file Mytest.pm should start with something like this: package Mytest; use strict; - use vars qw($VERSION @ISA @EXPORT); require Exporter; require DynaLoader; - @ISA = qw(Exporter DynaLoader); + our @ISA = qw(Exporter DynaLoader); # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. - @EXPORT = qw( + our @EXPORT = qw( ); - $VERSION = '0.01'; + our $VERSION = '0.01'; bootstrap Mytest $VERSION; @@ -563,8 +562,7 @@ the following three lines: mylib/mylib.h To keep our namespace nice and unpolluted, edit the .pm file and change -the variable C<@EXPORT> to C<@EXPORT_OK> (there are two: one in the line -beginning "use vars" and one setting the array itself). Finally, in the +the variable C<@EXPORT> to C<@EXPORT_OK>. Finally, in the .xs file, edit the #include line to read: #include "mylib/mylib.h" |