Linux cpanel.rrshost.in 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 x86_64
Apache
: 109.123.238.221 | : 172.69.6.245
128 Domain
8.2.28
aev999
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
perl /
5.34.0 /
[ HOME SHELL ]
Name
Size
Permission
Action
App
[ DIR ]
drwxr-xr-x
Archive
[ DIR ]
drwxr-xr-x
Attribute
[ DIR ]
drwxr-xr-x
B
[ DIR ]
drwxr-xr-x
CPAN
[ DIR ]
drwxr-xr-x
Carp
[ DIR ]
drwxr-xr-x
Class
[ DIR ]
drwxr-xr-x
Compress
[ DIR ]
drwxr-xr-x
Config
[ DIR ]
drwxr-xr-x
DBM_Filter
[ DIR ]
drwxr-xr-x
Devel
[ DIR ]
drwxr-xr-x
Digest
[ DIR ]
drwxr-xr-x
Encode
[ DIR ]
drwxr-xr-x
Exporter
[ DIR ]
drwxr-xr-x
ExtUtils
[ DIR ]
drwxr-xr-x
File
[ DIR ]
drwxr-xr-x
Filter
[ DIR ]
drwxr-xr-x
Getopt
[ DIR ]
drwxr-xr-x
HTTP
[ DIR ]
drwxr-xr-x
I18N
[ DIR ]
drwxr-xr-x
IO
[ DIR ]
drwxr-xr-x
IPC
[ DIR ]
drwxr-xr-x
JSON
[ DIR ]
drwxr-xr-x
Locale
[ DIR ]
drwxr-xr-x
Math
[ DIR ]
drwxr-xr-x
Memoize
[ DIR ]
drwxr-xr-x
Module
[ DIR ]
drwxr-xr-x
Net
[ DIR ]
drwxr-xr-x
Params
[ DIR ]
drwxr-xr-x
Parse
[ DIR ]
drwxr-xr-x
Perl
[ DIR ]
drwxr-xr-x
PerlIO
[ DIR ]
drwxr-xr-x
Pod
[ DIR ]
drwxr-xr-x
Search
[ DIR ]
drwxr-xr-x
TAP
[ DIR ]
drwxr-xr-x
Term
[ DIR ]
drwxr-xr-x
Test
[ DIR ]
drwxr-xr-x
Test2
[ DIR ]
drwxr-xr-x
Text
[ DIR ]
drwxr-xr-x
Thread
[ DIR ]
drwxr-xr-x
Tie
[ DIR ]
drwxr-xr-x
Time
[ DIR ]
drwxr-xr-x
Unicode
[ DIR ]
drwxr-xr-x
User
[ DIR ]
drwxr-xr-x
autodie
[ DIR ]
drwxr-xr-x
encoding
[ DIR ]
drwxr-xr-x
overload
[ DIR ]
drwxr-xr-x
pod
[ DIR ]
drwxr-xr-x
unicore
[ DIR ]
drwxr-xr-x
version
[ DIR ]
drwxr-xr-x
warnings
[ DIR ]
drwxr-xr-x
AnyDBM_File.pm
2.56
KB
-rw-r--r--
AutoLoader.pm
15.43
KB
-rw-r--r--
AutoSplit.pm
19.18
KB
-rw-r--r--
Benchmark.pm
30.3
KB
-rw-r--r--
CORE.pod
3.11
KB
-rw-r--r--
CPAN.pm
143.09
KB
-rw-r--r--
Carp.pm
35.14
KB
-rw-r--r--
DB.pm
18.48
KB
-rw-r--r--
DBM_Filter.pm
14.05
KB
-rw-r--r--
Digest.pm
10.96
KB
-rw-r--r--
DirHandle.pm
2.04
KB
-rw-r--r--
Dumpvalue.pm
17.25
KB
-rw-r--r--
English.pm
4.65
KB
-rw-r--r--
Env.pm
5.44
KB
-rw-r--r--
Exporter.pm
18.33
KB
-rw-r--r--
Fatal.pm
57.7
KB
-rw-r--r--
FileCache.pm
5.42
KB
-rw-r--r--
FileHandle.pm
6.63
KB
-rw-r--r--
FindBin.pm
4.54
KB
-rw-r--r--
Internals.pod
2.51
KB
-rw-r--r--
Memoize.pm
35.34
KB
-rw-r--r--
NEXT.pm
18.54
KB
-rw-r--r--
PerlIO.pm
14.1
KB
-rw-r--r--
Safe.pm
24.76
KB
-rw-r--r--
SelectSaver.pm
1.05
KB
-rw-r--r--
SelfLoader.pm
17.27
KB
-rw-r--r--
Symbol.pm
4.79
KB
-rw-r--r--
Test.pm
29.34
KB
-rw-r--r--
Test2.pm
6.24
KB
-rw-r--r--
Thread.pm
8.09
KB
-rw-r--r--
UNIVERSAL.pm
6.44
KB
-rw-r--r--
XSLoader.pm
10.99
KB
-rw-r--r--
_charnames.pm
33.35
KB
-rw-r--r--
autodie.pm
12.14
KB
-rw-r--r--
autouse.pm
4.14
KB
-rw-r--r--
base.pm
10.7
KB
-rw-r--r--
bigint.pm
22.85
KB
-rw-r--r--
bignum.pm
20.64
KB
-rw-r--r--
bigrat.pm
15.78
KB
-rw-r--r--
blib.pm
2.01
KB
-rw-r--r--
bytes.pm
3.69
KB
-rw-r--r--
bytes_heavy.pl
758
B
-rw-r--r--
charnames.pm
20.44
KB
-rw-r--r--
constant.pm
14.38
KB
-rw-r--r--
deprecate.pm
4.92
KB
-rw-r--r--
diagnostics.pm
18.85
KB
-rw-r--r--
dumpvar.pl
15.19
KB
-rw-r--r--
experimental.pm
7.42
KB
-rw-r--r--
feature.pm
22.11
KB
-rw-r--r--
fields.pm
9.25
KB
-rw-r--r--
filetest.pm
3.91
KB
-rw-r--r--
if.pm
3.54
KB
-rw-r--r--
integer.pm
3.18
KB
-rw-r--r--
less.pm
3.13
KB
-rw-r--r--
locale.pm
4.77
KB
-rw-r--r--
meta_notation.pm
2.07
KB
-rw-r--r--
ok.pm
967
B
-rw-r--r--
open.pm
8.31
KB
-rw-r--r--
overload.pm
52.1
KB
-rw-r--r--
overloading.pm
1.77
KB
-rw-r--r--
parent.pm
2.64
KB
-rw-r--r--
perl5db.pl
309.86
KB
-rw-r--r--
perlfaq.pm
77
B
-rw-r--r--
sigtrap.pm
8.53
KB
-rw-r--r--
sort.pm
3.82
KB
-rw-r--r--
strict.pm
4.67
KB
-rw-r--r--
subs.pm
945
B
-rw-r--r--
utf8.pm
10.5
KB
-rw-r--r--
vars.pm
2.4
KB
-rw-r--r--
version.pm
1.93
KB
-rw-r--r--
version.pod
9.6
KB
-rw-r--r--
vmsish.pm
4.21
KB
-rw-r--r--
warnings.pm
51.97
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : if.pm
package if; use strict; our $VERSION = '0.0609'; sub work { my $method = shift() ? 'import' : 'unimport'; unless (@_ >= 2) { my $type = ($method eq 'import') ? 'use' : 'no'; die "Too few arguments to '$type if' (some code returning an empty list in list context?)" } return unless shift; # CONDITION my $p = $_[0]; # PACKAGE (my $file = "$p.pm") =~ s!::!/!g; require $file; # Works even if $_[0] is a keyword (like open) my $m = $p->can($method); goto &$m if $m; } sub import { shift; unshift @_, 1; goto &work } sub unimport { shift; unshift @_, 0; goto &work } 1; __END__ =head1 NAME if - C<use> a Perl module if a condition holds =head1 SYNOPSIS use if CONDITION, "MODULE", ARGUMENTS; no if CONDITION, "MODULE", ARGUMENTS; =head1 DESCRIPTION =head2 C<use if> The C<if> module is used to conditionally load another module. The construct: use if CONDITION, "MODULE", ARGUMENTS; ... will load C<MODULE> only if C<CONDITION> evaluates to true; it has no effect if C<CONDITION> evaluates to false. (The module name, assuming it contains at least one C<::>, must be quoted when C<'use strict "subs";'> is in effect.) If the CONDITION does evaluate to true, then the above line has the same effect as: use MODULE ARGUMENTS; For example, the F<Unicode::UCD> module's F<charinfo> function will use two functions from F<Unicode::Normalize> only if a certain condition is met: use if defined &DynaLoader::boot_DynaLoader, "Unicode::Normalize" => qw(getCombinClass NFD); Suppose you wanted C<ARGUMENTS> to be an empty list, I<i.e.>, to have the effect of: use MODULE (); You can't do this with the C<if> pragma; however, you can achieve exactly this effect, at compile time, with: BEGIN { require MODULE if CONDITION } =head2 C<no if> The C<no if> construct is mainly used to deactivate categories of warnings when those categories would produce superfluous output under specified versions of F<perl>. For example, the C<redundant> category of warnings was introduced in Perl-5.22. This warning flags certain instances of superfluous arguments to C<printf> and C<sprintf>. But if your code was running warnings-free on earlier versions of F<perl> and you don't care about C<redundant> warnings in more recent versions, you can call: use warnings; no if $] >= 5.022, q|warnings|, qw(redundant); my $test = { fmt => "%s", args => [ qw( x y ) ] }; my $result = sprintf $test->{fmt}, @{$test->{args}}; The C<no if> construct assumes that a module or pragma has correctly implemented an C<unimport()> method -- but most modules and pragmata have not. That explains why the C<no if> construct is of limited applicability. =head1 BUGS The current implementation does not allow specification of the required version of the module. =head1 SEE ALSO L<Module::Requires> can be used to conditionally load one or modules, with constraints based on the version of the module. Unlike C<if> though, L<Module::Requires> is not a core module. L<Module::Load::Conditional> provides a number of functions you can use to query what modules are available, and then load one or more of them at runtime. The L<provide> module from CPAN can be used to select one of several possible modules to load based on the version of Perl that is running. =head1 AUTHOR Ilya Zakharevich L<mailto:ilyaz@cpan.org>. =head1 COPYRIGHT AND LICENCE This software is copyright (c) 2002 by Ilya Zakharevich. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut
Close