1Mixin::Linewise::ReaderUss(e3r)Contributed Perl DocumentMaitxiionn::Linewise::Readers(3)
2
3
4

NAME

6       Mixin::Linewise::Readers - get linewise readers for strings and
7       filenames
8

VERSION

10       version 0.004
11

SYNOPSIS

13         package Your::Pkg;
14         use Mixin::Linewise::Readers -readers;
15
16         sub read_handle {
17           my ($self, $handle) = @_;
18
19           LINE: while (my $line = $handle->getline) {
20             next LINE if $line =~ /^#/;
21
22             print "non-comment: $line";
23           }
24         }
25
26       Then:
27
28         use Your::Pkg;
29
30         Your::Pkg->read_file($filename);
31
32         Your::Pkg->read_string($string);
33
34         Your::Pkg->read_handle($fh);
35

EXPORTS

37       "read_file" and "read_string" are exported by default.  Either can be
38       requested individually, or renamed.  They are generated by
39       Sub::Exporter, so consult its documentation for more information.
40
41       Both can be generated with the option "method" which requests that a
42       method other than "read_handle" is called with the created IO::Handle.
43
44   read_file
45         Your::Pkg->read_file($filename);
46
47       If generated, the "read_file" export attempts to open the named file
48       for reading, and then calls "read_handle" on the opened handle.
49
50       Any arguments after $filename are passed along after to "read_handle".
51
52   read_string
53         Your::Pkg->read_string($string);
54
55       If generated, the "read_string" creates an IO::String handle from the
56       given string, and then calls "read_handle" on the opened handle.
57
58       Any arguments after $string are passed along after to "read_handle".
59

AUTHOR

61       Ricardo SIGNES <rjbs@cpan.org>
62
64       This software is copyright (c) 2008 by Ricardo SIGNES.
65
66       This is free software; you can redistribute it and/or modify it under
67       the same terms as the Perl 5 programming language system itself.
68
69
70
71perl v5.16.3                      2013-06-18       Mixin::Linewise::Readers(3)
Impressum