The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Sport::Analytics::NHL::Util - Simple system-independent utilities

SYNOPSIS

Provides simple system-independent utilities. For system-dependent utilities see Sports::Analytics::NHL::Tools .

  use Sport::Analytics::NHL::Util
  debug "This is a debug message";
  verbose "This is a verbose message";
  my $content = read_file('some.file');
  write_file($content, 'some.file');
  $table = read_tab_file('some.tab.file');

FUNCTIONS

debug

Produces message to the STDERR if the DEBUG level is set ($ENV{HOCKEYDB_DEBUG})

verbose

Produces message to the STDERR if the VERBOSE ($ENV{HOCKEYDB_VERBOSE})or the DEBUG level are set.

read_file
 Reads a file into a scalar
 Arguments: the filename
 Returns: the scalar with the filename contents
write_file
 Writes a file from a scalar, usually replacing the non-breaking space with regular space
 Arguments: the content scalar
            the filename
 Returns: the filename written
read_tab_file
 Reads a tabulated file into an array of arrays
 Arguments: the tabulated file
 Returns: array of arrays with the data
fill_broken

Fills a hash (player, event, etc.) with preset values. Usually happens with broken items. Arguments: * the item to fill * the hash with the preset values to use Returns: void.

get_seconds
 Get the number of seconds in MM:SS string
 Arguments: the MM:SS string
 Returns: the number of seconds
my_uniq

An expansion of List::MoreUtils::uniq function that filters the items not only by their value, but by applying a function to that value. Effectively:

 uniq @list == my_uniq { $_ } @list
normalize_string

Performs a string cleanup: replaces multiple whitespaces with one, trims edge whitespaces and converts the string to upper-case.

 Argument: the string
 Returns: the normalize string

AUTHOR

More Hockey Stats, <contact at morehockeystats.com>

BUGS

Please report any bugs or feature requests to contact at morehockeystats.com, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sport::Analytics::NHL::Util. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Sport::Analytics::NHL::Util

You can also look for information at: