12 return grep { defined and length }
20 # If no one wants the result, don't bother computing it.
21 return unless defined wantarray;
23 my $hinthash = ( caller 0 )[10];
25 @tags{ _unpack_tags( $hinthash->{$class} ) } = ();
28 exists $tags{$_} and return !!1 for @_;
39 @_ = 'please' if not @_;
41 @tags{ _unpack_tags( @_, $^H{$class} ) } = ();
43 $^H{$class} = _pack_tags( keys %tags );
52 @tags{ _unpack_tags( $^H{$class} ) } = ();
53 delete @tags{ _unpack_tags(@_) };
54 my $new = _pack_tags( keys %tags );
56 if ( not length $new ) {
76 less - perl pragma to request less of something
84 This is a user-pragma. If you're very lucky some code you're using
85 will know that you asked for less CPU usage or ram or fat or... we
86 just can't know. Consult your documentation on everything you're
89 For general suggestions, try requesting C<CPU> or C<memory>.
95 If you ask for nothing in particular, you'll be asking for C<less
100 =head1 FOR MODULE AUTHORS
102 L<less> has been in the core as a "joke" module for ages now and it
103 hasn't had any real way to communicating any information to
104 anything. Thanks to Nicholas Clark we have user pragmas (see
105 L<perlpragma>) and now C<less> can do something.
107 You can probably expect your users to be able to guess that they can
108 request less CPU or memory or just "less" overall.
110 If the user didn't specify anything, it's interpreted as having used
111 the C<please> tag. It's up to you to make this useful.
117 =head2 C<< BOOLEAN = less->of( FEATURE ) >>
119 The class method C<< less->of( NAME ) >> returns a boolean to tell you
120 whether your user requested less of something.
122 if ( less->of( 'CPU' ) ) {
125 elsif ( less->of( 'memory' ) ) {
129 =head2 C<< FEATURES = less->of() >>
131 If you don't ask for any feature, you get the list of features that
132 the user requested you to be nice to. This has the nice side effect
133 that if you don't respect anything in particular then you can just ask
134 for it and use it like a boolean.
147 =item This probably does nothing.
149 =item This works only on 5.10+
151 At least it's backwards compatible in not doing much.