11 Aug 2011 02:55:56 UTC
- Distribution: Lucy
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (3 / 16 / 0)
- KwaliteeBus factor: 1
- License: apache_2_0
- Perl: v5.8.3
- Activity24 month
- Download (1.02MB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:6 non-PAUSE usersCREAMYG Marvin Humphreyand 1 contributors
- The Apache Lucy Project <lucy-dev at incubator dot apache dot org>
Clownfish::Util - Miscellaneous helper functions.
Clownfish::Util provides a few convenience functions used internally by other Clownfish modules.
my $foo_contents = slurp_text('foo.txt');
Open a file, read it in (as text), return its contents.
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).