NAME

Hydrogen::Topic::CodeRef - functions from Hydrogen::CodeRef applied to $_

VERSION

This documentation is for Hydrogen::Topic::CodeRef 0.020000, which is based on Sub::HandlesVia::HandlerLibrary::Code 0.046.

FUNCTIONS

Each function implicitly operates on $_, expecting it to be a reference to a sub.

execute( @args )

Operates on $_, which must be a reference to a sub.

Calls the coderef, passing it any arguments.

execute_list( @args )

Operates on $_, which must be a reference to a sub.

Calls the coderef, passing it any arguments, and forcing list context. If called in scalar context, returns an arrayref.

execute_scalar( @args )

Operates on $_, which must be a reference to a sub.

Calls the coderef, passing it any arguments, and forcing scalar context.

execute_void( @args )

Operates on $_, which must be a reference to a sub.

Calls the coderef, passing it any arguments, and forcing void context. Returns undef.

EXPORT

No functions are exported by this module by default. To import them all (this is usually a bad idea), use:

use Hydrogen::Topic::CodeRef -all;

To import a particular function, use:

use Hydrogen::Topic::CodeRef 'execute_scalar';

To rename functions:

use Hydrogen::Topic::CodeRef 'execute_scalar' => { -as => 'myfunc' };

On Perl 5.37.2+ (or if Lexical::Sub is installed) you can import lexically:

use Hydrogen::Topic::CodeRef -lexical, 'execute_scalar';

See Exporter::Tiny::Manual::Importing for more hints on importing.

BUGS

Please report any bugs to http://github.com/tobyink/p5-hydrogen/issues.

SEE ALSO

Hydrogen, Hydrogen::CodeRef, Hydrogen::Code, Hydrogen::Curry::CodeRef, Sub::HandlesVia::HandlerLibrary::Code, Sub::Util.

AUTHOR

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

This software is copyright (c) 2022-2023 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.

DISCLAIMER OF WARRANTIES

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.