summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2009-11-30 11:42:14 +0100
committerRafael Garcia-Suarez <rgs@consttype.org>2009-11-30 11:42:14 +0100
commitc362798e2bfee6dd58e97b97c7f3aa37c2c6af9f (patch)
tree76d944b466b70efb2cf4245f4977981507fb82d0 /pod
parent71eaafb1e6768e777bc805cc8490b55c6e77da64 (diff)
downloadperl-c362798e2bfee6dd58e97b97c7f3aa37c2c6af9f.tar.gz
Document if.pm in perlfunc
Diffstat (limited to 'pod')
-rw-r--r--pod/perlfunc.pod9
1 files changed, 9 insertions, 0 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 540b7233f3..188647c5ea 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -7060,6 +7060,15 @@ block scope (like C<strict> or C<integer>, unlike ordinary modules,
which import symbols into the current package (which are effective
through the end of the file).
+Because C<use> takes effect at compile time, it doesn't respect the
+ordinary flow control of the code being compiled. In particular, putting
+a C<use> inside the false branch of a conditional doesn't prevent it
+from being processed. If a module or pragma needs to be loaded only
+conditionally, this can be done using the L<if> pragma:
+
+ use if $] < 5.008, "utf8";
+ use if WANT_WARNINGS, warnings => qw(all);
+
There's a corresponding C<no> command that unimports meanings imported
by C<use>, i.e., it calls C<unimport Module LIST> instead of C<import>.
It behaves exactly as C<import> does with respect to VERSION, an