NAME Hydrogen - utilities for the simplest elements of Perl SYNOPSIS Normal version of the function: use feature 'say'; use Hydrogen::HashRef { prefix => 'hhr_' }, qw( get set ); my %hash; hhr_set( \%hash, Alice => 123 ); hhr_set( \%hash, Bob => 456 ); say $hash{Alice}; ## ==> 123 say hhr_get( \%hash, 'Bob' ); ## ==> 456 Version of the function which uses prototypes: use feature 'say'; use Hydrogen::Hash { prefix => 'hh_' }, qw( get set ); my %hash; hh_set( %hash, Alice => 123 ); hh_set( %hash, Bob => 456 ); say $hash{Alice}; ## ==> 123 say hh_get( %hash, 'Bob' ); ## ==> 456 Currying: use feature 'say'; use Hydrogen::Curry::HashRef qw( curry_get curry_set ); my %hash; my $setter = curry_set( \%hash ); my $getter = curry_get( \%hash ); $setter->( Alice => 123 ); $setter->( Bob => 456 ); say $hash{Alice}; ## ==> 123 say $getter->( 'Bob' ); ## ==> 456 Using the $_ topic variable: use feature 'say'; use Hydrogen::Topic::HashRef qw( get set ); local $_ = {}; set( Alice => 123 ); set( Bob => 456 ); say $_->{Alice}; ## ==> 123 say get( 'Bob' ); ## ==> 456 DESCRIPTION Hydrogen provides a standard library for doing really simple things in Perl. And I mean *really* simple things. Things which are often Perl builtin functions, operators, and even just part of Perl syntax like accessing keys within hashes. What is the point in having functions to do these simple things? Well, you can make a coderef pointing to `\&Hydrogen::Number::add` but you can't make a coderef pointing to Perl's `+=` operator! THE HYDROGEN LIBRARY * Hydrogen::ArrayRef * Hydrogen::Bool * Hydrogen::CodeRef * Hydrogen::Counter * Hydrogen::HashRef * Hydrogen::Number * Hydrogen::Scalar * Hydrogen::String Prototyped Functions * Hydrogen::Array * Hydrogen::Code * Hydrogen::Hash Curry Functions * Hydrogen::Curry::ArrayRef * Hydrogen::Curry::Bool * Hydrogen::Curry::CodeRef * Hydrogen::Curry::Counter * Hydrogen::Curry::HashRef * Hydrogen::Curry::Number * Hydrogen::Curry::Scalar * Hydrogen::Curry::String Topicalized Functions * Hydrogen::Topic::ArrayRef * Hydrogen::Topic::Bool * Hydrogen::Topic::CodeRef * Hydrogen::Topic::Counter * Hydrogen::Topic::HashRef * Hydrogen::Topic::Number * Hydrogen::Topic::Scalar * Hydrogen::Topic::String BONUS FUNCTIONS Hydrogen uses the following functions internally, but they may also be useful to you. `Hydrogen::croak( $message, @args? )` Acts like `croak` from Carp, but if @args is provided, will `sprintf` first. If @args contains references, those will be dumped using Data::Dumper. `Hydrogen::fc( $string? )` Acts like `CORE::fc` if that function is available, and `CORE::lc` otherwise. If no $string is provided, operates on $_. BUGS Please report any bugs to . SEE ALSO This standard library is autogenerated from Sub::HandlesVia which provides the same functionality as methods which objects can delegate to attributes. AUTHOR Toby Inkster . COPYRIGHT AND LICENCE 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. 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.