Hydrogen::Topic::Counter - functions from Hydrogen::Counter applied to $_
$_
This documentation is for Hydrogen::Topic::Counter 0.016, which is based on Sub::HandlesVia::HandlerLibrary::Counter 0.037.
Each function implicitly operates on $_, expecting it to be an integer.
dec( $amount? )
Operates on $_, which must be an integer.
Arguments: Optional[Int].
Decrements the counter by $amount, or by 1 if no value is given.
$amount
inc( $amount? )
Increments the counter by $amount, or by 1 if no value is given.
reset()
Sets the counter to its default value, or 0 if it has no default.
set( $value )
Arguments: Int.
Sets the counter to the given value.
No functions are exported by this module by default. To import them all (this is usually a bad idea), use:
use Hydrogen::Topic::Counter -all;
To import a particular function, use:
use Hydrogen::Topic::Counter 'reset';
To rename functions:
use Hydrogen::Topic::Counter 'reset' => { -as => 'myfunc' };
On Perl 5.37.2+, you can import lexically:
use Hydrogen::Topic::Counter -lexical, 'reset';
See Exporter::Tiny::Manual::Importing for more hints on importing.
Please report any bugs to http://github.com/tobyink/p5-hydrogen/issues.
Hydrogen, Hydrogen::Counter, Hydrogen::Curry::Counter, Sub::HandlesVia::HandlerLibrary::Counter.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2022 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install Hydrogen, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hydrogen
CPAN shell
perl -MCPAN -e shell install Hydrogen
For more information on module installation, please visit the detailed CPAN module installation guide.