27 Aug 2010 01:10:56 UTC
- Development release
- Distribution: KinoSearch
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (5)
- Testers (49 / 4 / 1)
- KwaliteeBus factor: 0
- License: perl_5
- Activity24 month
- Download (890.91KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionCREAMYG Marvin Humphreyand 1 contributors
- Marvin Humphrey <marvin at rectangular dot com>
- COPYRIGHT AND LICENSE
Clownfish::Util - Miscellaneous helper functions.
Clownfish::Util provides a few convenience functions used internally by other Clownfish modules.
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.
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( \%defaults, @_ ) or confess $@;
Verify that named parameters exist in a defaults hash. Returns false and sets $@ if a problem is detected.
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( $path, $content );
Test whether there's a file at
$pathwhich already matches
$contentexactly. If something has changed, write the file. Otherwise do nothing (and avoid bumping the file's modification time).
Copyright 2008-2010 Marvin Humphrey
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.