Author image Marvin Humphrey
and 1 contributors

NAME

Boilerplater::Util - Miscellaneous helper functions.

DESCRIPTION

Boilerplater::Util provides a few convenience functions used internally by other Boilerplater modules.

FUNCTIONS

slurp_file

    my $foo_contents = slurp_file('foo.txt');

Open a file, read it in, return its contents. Assumes either binary data or text with an encoding of Latin-1.

current

    compile('foo.c') unless current( 'foo.c', 'foo.o' );

Given two elements, which may be either scalars or arrays, verify that everything in the second group exists and was created later than anything in the first group.

verify_args

    verify_args( \%defaults, @_ ) or confess $@;

Verify that named parameters exist in a defaults hash. Returns false and sets $@ if a problem is detected.

strip_c_comments

    my $c_minus_comments = strip_c_comments($c_source_code);

Quick 'n' dirty stripping of C comments. Will massacre stuff like comments embedded in string literals, so watch out.

COPYRIGHT

Copyright 2008-2009 Marvin Humphrey

LICENSE, DISCLAIMER, BUGS, etc.

See KinoSearch version 0.30.