-
-
17 Sep 2021 07:10:23 UTC
- Distribution: Catmandu
- Module version: 1.2016
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (36)
- Testers (205 / 25 / 3)
- Kwalitee
Bus factor: 4- 87.53% Coverage
- License: perl_5
- Perl: v5.10.1
- Activity
24 month- Tools
- Download (813.62KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 18 contributors- Nicolas Steenlant, C<< <nicolas.steenlant at ugent.be> >>
-
Christian Pietsch
-
Dave Sherohman
-
Doug Bell
-
EC2 Default User
-
Jakob Voß
-
Johann Rolschewski
-
Magnus Enger
-
Matthias Vandermaesen
-
Mohammad S Anwar
-
Nicolas Franck
-
Patrick Hochstenbach
-
Pieter De Praetere
-
Snorri Briem
-
Stefan Weil
-
Tom Hukins
-
Upasana Shukla
-
Vitali Peil
- Dependencies
- Any::URI::Escape
- App::Cmd
- CGI::Expand
- Class::Method::Modifiers
- Clone
- Config::Onion
- Cpanel::JSON::XS
- Data::Compare
- Data::Util
- HTTP::Request
- Hash::Merge::Simple
- IO::Handle::Util
- LWP::UserAgent
- List::MoreUtils
- Log::Any
- Log::Any::Adapter
- MIME::Types
- Module::Build
- Module::Info
- Moo
- MooX::Aliases
- Package::Stash
- Parser::MGC
- Path::Iterator::Rule
- Path::Tiny
- Role::Tiny
- Role::Tiny::With
- String::CamelCase
- Sub::Exporter
- Sub::Quote
- Text::CSV
- Text::Hogan::Compiler
- Throwable
- Time::HiRes
- Try::Tiny::ByClass
- URI
- URI::Template
- UUID::Tiny
- Unicode::Normalize
- YAML::XS
- asa
- namespace::clean
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Catmandu::Importer::YAML - Package that imports YAML data
SYNOPSIS
# From the command line $ catmandu convert YAML to JSON < data.yaml # In a Perl script use Catmandu; my $importer = Catmandu->importer('YAML',file => "/foo/bar.yaml"); my $n = $importer->each(sub { my $hashref = $_[0]; # ... }); The YAML input file needs to be separated into records: --- - recordno: 1 - name: Alpha --- - recordno: 2 - name: Beta ... where '---' is the record separator and '...' the EOF indicator.
CONFIGURATION
- file
-
Read input from a local file given by its path. Alternatively a scalar reference can be passed to read from a string.
- fh
-
Read input from an IO::Handle. If not specified, Catmandu::Util::io is used to create the input stream from the
file
argument or by using STDIN. - encoding
-
Binmode of the input stream
fh
. Set to:utf8
by default. - fix
-
An ARRAY of one or more fixes or file scripts to be applied to imported items.
METHODS
Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. The Catmandu::Importer::YAML methods are not idempotent: YAML feeds can only be read once.
SEE ALSO
Module Install Instructions
To install Catmandu, copy and paste the appropriate command in to your terminal.
cpanm Catmandu
perl -MCPAN -e shell install Catmandu
For more information on module installation, please visit the detailed CPAN module installation guide.