1ConstOptree(3)        User Contributed Perl Documentation       ConstOptree(3)
2
3
4

NAME

6       B::ConstOptree - Optree constant folding for $^O, $^V, and $]
7

SYNOPSIS

9        $ perl -MO=ConstOptree -MO=Deparse} -e \
10               'require ($^O eq "MSWin32" ? "Win32.pm" : "POSIX.pm")'
11        require 'POSIX.pm';
12        -e syntax OK
13

DESCRIPTION

15       This module propagates constant folding for $^O, $^V, and $] variables
16       by installing custom PL_check handlers for numeric and string
17       comparison opcodes.  In the handlers, references to $^O, $^V, and $]
18       arguments are replaced with constant terms like "linux", v5.16.1, and
19       5.016001, respectively.
20

CAVEATS

22       Since regexp matching is not subject to constant folding, expressions
23       like "$^O =~ /win32/i" will not be reduced.
24

AUTHOR

26       Written by Alexey Tourbin <at@altlinux.org>.
27

COPYING

29       Copyright (c) 2012 Alexey Tourbin
30
31       This is free software; you can redistribute it and/or modify it under
32       the terms of the GNU General Public License as published by the Free
33       Software Foundation; either version 2 of the License, or (at your
34       option) any later version.
35
36
37
38perl v5.30.0                      2019-07-26                    ConstOptree(3)
Impressum