line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IngyPrelude; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
57504
|
use v5.10; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use base 'Exporter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
263
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.0.1'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = qw( file_read file_write ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub file_read { |
14
|
1
|
|
|
1
|
0
|
251
|
my ($path) = @_; |
15
|
1
|
50
|
|
|
|
32
|
open my $fh, '<', $path or die $!; |
16
|
1
|
|
|
|
|
4
|
local $/; |
17
|
1
|
|
|
|
|
29
|
return <$fh>; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub file_write { |
21
|
1
|
|
|
1
|
0
|
565
|
my ($path, $text) = @_; |
22
|
1
|
50
|
|
|
|
58
|
open my $fh, '>', $path or die $!; |
23
|
1
|
|
|
|
|
73
|
print $fh $text; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=encoding utf8 |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Ingy döt Net's Standard Prelude |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SYNOPSIS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
use IngyPrelude; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
my $text = file_read 'foo.txt'; |
39
|
|
|
|
|
|
|
file_write 'FOO.TXT', uc($text); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
This module exports a number of common functions. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 AUTHOR |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Ingy döt Net |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Copyright 2022. Ingy döt Net. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under |
54
|
|
|
|
|
|
|
the same terms as Perl itself. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
See L |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |