| EVDB-API documentation | Contained in the EVDB-API distribution. |
EVDB::API::YAML - Use the YAML flavor of the Eventful API
my $evdb = EVDB::API->new(app_key => $app_key, flavor => 'yaml');
my $results = $evdb->call('events/get', { id => 'E0-001-001336058-5' });
Parses YAML from the Eventful API.
Return the flavor name.
Return a checkstring for the expected return content type.
Parse YAML data from the Eventful API using YAML::Syck or YAML.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| EVDB-API documentation | Contained in the EVDB-API distribution. |
package EVDB::API::YAML; use strict; use warnings; use Carp;
sub flavor { 'yaml' }
sub ctype { 'yaml' }
sub parse { my ($class, $data, $force_array) = @_; carp "Forcing arrays is not supported for API flavor " . $class->flavor if $force_array; eval { require YAML::Syck }; if ($@) { require YAML; return YAML::Load($data); } else { return YAML::Syck::Load($data); } }
1;