-
-
16 Apr 2012 21:20:13 UTC
- Distribution: KinoSearch
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (5)
- Testers (536 / 132 / 8)
- Kwalitee
Bus factor: 0- 85.27% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (852.87KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Marvin Humphrey <marvin at rectangular dot com>
- Dependencies
- JSON::XS
- Lingua::Stem::Snowball
- Lingua::StopWords
- Parse::RecDescent
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Clownfish::Util - Miscellaneous helper functions.
DESCRIPTION
Clownfish::Util provides a few convenience functions used internally by other Clownfish 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.
write_if_changed
write_if_changed( $path, $content );
Test whether there's a file at
$path
which already matches$content
exactly. If something has changed, write the file. Otherwise do nothing (and avoid bumping the file's modification time).COPYRIGHT AND LICENSE
Copyright 2008-2011 Marvin Humphrey
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install KSx::Simple, copy and paste the appropriate command in to your terminal.
cpanm KSx::Simple
perl -MCPAN -e shell install KSx::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.