/
usr
/
share
/
perl5
/
/usr/share/perl5
mkdir
upload
Name
Size
Mode
Actions
B/
-
0755
rm
Class/
-
0755
rm
Config/
-
0755
rm
DBM_Filter/
-
0755
rm
encoding/
-
0755
rm
ExtUtils/
-
0755
rm
File/
-
0755
rm
Getopt/
-
0755
rm
I18N/
-
0755
rm
IPC/
-
0755
rm
Math/
-
0755
rm
Net/
-
0755
rm
overload/
-
0755
rm
Pod/
-
0755
rm
pod/
-
0755
rm
Search/
-
0755
rm
Term/
-
0755
rm
Text/
-
0755
rm
Thread/
-
0755
rm
Tie/
-
0755
rm
Time/
-
0755
rm
Unicode/
-
0755
rm
unicore/
-
0755
rm
URI/
-
0755
rm
User/
-
0755
rm
vendor_perl/
-
0755
rm
warnings/
-
0755
rm
AnyDBM_File.pm
2618
0644
edit
dl
rm
AutoLoader.pm
15797
0644
edit
dl
rm
AutoSplit.pm
19637
0644
edit
dl
rm
autouse.pm
4238
0644
edit
dl
rm
base.pm
10980
0644
edit
dl
rm
Benchmark.pm
31025
0644
edit
dl
rm
blib.pm
2086
0644
edit
dl
rm
bytes.pm
3754
0644
edit
dl
rm
bytes_heavy.pl
758
0644
edit
dl
rm
charnames.pm
20867
0644
edit
dl
rm
CORE.pod
3188
0644
edit
dl
rm
DB.pm
18922
0644
edit
dl
rm
DBM_Filter.pm
14385
0644
edit
dl
rm
deprecate.pm
3079
0644
edit
dl
rm
diagnostics.pm
19038
0644
edit
dl
rm
DirHandle.pm
1556
0644
edit
dl
rm
Dumpvalue.pm
17556
0644
edit
dl
rm
dumpvar.pl
15555
0644
edit
dl
rm
English.pm
4761
0644
edit
dl
rm
feature.pm
17085
0644
edit
dl
rm
fields.pm
9489
0644
edit
dl
rm
FileCache.pm
5572
0644
edit
dl
rm
FileHandle.pm
6784
0644
edit
dl
rm
filetest.pm
4003
0644
edit
dl
rm
FindBin.pm
4561
0644
edit
dl
rm
if.pm
3340
0644
edit
dl
rm
integer.pm
3254
0644
edit
dl
rm
Internals.pod
2576
0644
edit
dl
rm
less.pm
3204
0644
edit
dl
rm
locale.pm
4855
0644
edit
dl
rm
meta_notation.pm
2117
0644
edit
dl
rm
NEXT.pm
18846
0644
edit
dl
rm
overload.pm
53314
0644
edit
dl
rm
overloading.pm
1808
0644
edit
dl
rm
perl5db.pl
316420
0644
edit
dl
rm
PerlIO.pm
10459
0644
edit
dl
rm
Safe.pm
25082
0644
edit
dl
rm
SelectSaver.pm
1076
0644
edit
dl
rm
sigtrap.pm
7606
0644
edit
dl
rm
sort.pm
6081
0644
edit
dl
rm
strict.pm
4738
0644
edit
dl
rm
subs.pm
848
0644
edit
dl
rm
Symbol.pm
4799
0644
edit
dl
rm
Thread.pm
8287
0644
edit
dl
rm
UNIVERSAL.pm
6594
0644
edit
dl
rm
URI.pm
34790
0644
edit
dl
rm
utf8.pm
9116
0644
edit
dl
rm
utf8_heavy.pl
31615
0644
edit
dl
rm
vars.pm
2414
0644
edit
dl
rm
vmsish.pm
4313
0644
edit
dl
rm
warnings.pm
44756
0644
edit
dl
rm
XSLoader.pm
11267
0644
edit
dl
rm
_charnames.pm
33166
0644
edit
dl
rm
Edit:
/usr/share/perl5/less.pm
(3204B)
package less; use strict; use warnings; our $VERSION = '0.03'; sub _pack_tags { return join ' ', @_; } sub _unpack_tags { return grep { defined and length } map { split ' ' } grep {defined} @_; } sub stash_name { $_[0] } sub of { my $class = shift @_; # If no one wants the result, don't bother computing it. return unless defined wantarray; my $hinthash = ( caller 0 )[10]; my %tags; @tags{ _unpack_tags( $hinthash->{ $class->stash_name } ) } = (); if (@_) { exists $tags{$_} and return !!1 for @_; return; } else { return keys %tags; } } sub import { my $class = shift @_; my $stash = $class->stash_name; @_ = 'please' if not @_; my %tags; @tags{ _unpack_tags( @_, $^H{ $stash } ) } = (); $^H{$stash} = _pack_tags( keys %tags ); return; } sub unimport { my $class = shift @_; if (@_) { my %tags; @tags{ _unpack_tags( $^H{$class} ) } = (); delete @tags{ _unpack_tags(@_) }; my $new = _pack_tags( keys %tags ); if ( not length $new ) { delete $^H{ $class->stash_name }; } else { $^H{ $class->stash_name } = $new; } } else { delete $^H{ $class->stash_name }; } return; } 1; __END__ =head1 NAME less - perl pragma to request less of something =head1 SYNOPSIS use less 'CPU'; =head1 DESCRIPTION This is a user-pragma. If you're very lucky some code you're using will know that you asked for less CPU usage or ram or fat or... we just can't know. Consult your documentation on everything you're currently using. For general suggestions, try requesting C<CPU> or C<memory>. use less 'memory'; use less 'CPU'; use less 'fat'; If you ask for nothing in particular, you'll be asking for C<less 'please'>. use less 'please'; =head1 FOR MODULE AUTHORS L<less> has been in the core as a "joke" module for ages now and it hasn't had any real way to communicating any information to anything. Thanks to Nicholas Clark we have user pragmas (see L<perlpragma>) and now C<less> can do something. You can probably expect your users to be able to guess that they can request less CPU or memory or just "less" overall. If the user didn't specify anything, it's interpreted as having used the C<please> tag. It's up to you to make this useful. # equivalent use less; use less 'please'; =head2 C<< BOOLEAN = less->of( FEATURE ) >> The class method C<< less->of( NAME ) >> returns a boolean to tell you whether your user requested less of something. if ( less->of( 'CPU' ) ) { ... } elsif ( less->of( 'memory' ) ) { } =head2 C<< FEATURES = less->of() >> If you don't ask for any feature, you get the list of features that the user requested you to be nice to. This has the nice side effect that if you don't respect anything in particular then you can just ask for it and use it like a boolean. if ( less->of ) { ... } else { ... } =head1 CAVEATS =over =item This probably does nothing. =item This works only on 5.10+ At least it's backwards compatible in not doing much. =back =cut
Save
cmd:
run