Pod-Confluence

 view release on metacpan or  search on metacpan

t/lib/Pod/Confluence/TestUtil.pm  view on Meta::CPAN

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
    slurp
    spurt
    write_pod
);
 
sub slurp {
    my ($file) = @_;
 
    return $file
        ? do { local ( @ARGV, $/ ) = $file; <> }
        : do { local $/; <STDIN> };
}
 
sub spurt {
    my ( $content, $file, %options ) = @_;
    my $write_mode = $options{append} ? '>>' : '>';
    open( my $handle, $write_mode, $file )
        || croak("unable to open [$file]: $!");
    print( $handle $content );
    close($handle);



( run in 0.301 second using v1.01-cache-2.11-cpan-e9199f4ba4c )