App-Dex

 view release on metacpan or  search on metacpan

scripts/dex  view on Meta::CPAN

  sub cb_end_document_empty {
      my ($self, $token) = @_;
      $self->end_document(0);
  }
  
  sub cb_doc_start_implicit {
      my ($self, $token) = @_;
      $self->start_document(1);
  }
  
  sub cb_doc_start_explicit {
      my ($self, $token) = @_;
      $self->start_document(0);
  }
  
  sub cb_end_doc_start_document {
      my ($self, $token) = @_;
      $self->end_document(1);
      $self->start_document(0);
  }
  
  sub cb_tag_directive {
      my ($self, $token) = @_;
      my ($name, $tag_alias, $tag_url) = split ' ', $token->{value};
      $self->tagmap->{ $tag_alias } = $tag_url;
  }
  
  sub cb_reserved_directive {
  }
  
  sub cb_set_yaml_version_directive {
      my ($self, $token) = @_;
      if ($self->yaml_version_directive) {
          croak "Found duplicate YAML directive";
      }
      my ($version) = $token->{value} =~ m/^%YAML (1\.[12])/;
      $self->set_yaml_version($version);
      $self->set_yaml_version_directive(1);
  }
  
  1;
YAML_PP_PARSER

$fatpacked{"YAML/PP/Perl.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'YAML_PP_PERL';
  use strict;
  use warnings;
  package YAML::PP::Perl;
  
  our $VERSION = '0.027'; # VERSION
  
  use base 'Exporter';
  use base 'YAML::PP';
  our @EXPORT_OK = qw/ Load Dump LoadFile DumpFile /;
  
  use YAML::PP;
  use YAML::PP::Schema::Perl;
  
  sub new {
      my ($class, %args) = @_;
      $args{schema} ||= [qw/ Core Perl /];
      $class->SUPER::new(%args);
  }
  
  sub Load {
      my ($yaml) = @_;
      __PACKAGE__->new->load_string($yaml);
  }
  
  sub LoadFile {
      my ($file) = @_;
      __PACKAGE__->new->load_file($file);
  }
  
  sub Dump {
      my (@data) = @_;
      __PACKAGE__->new->dump_string(@data);
  }
  
  sub DumpFile {
      my ($file, @data) = @_;
      __PACKAGE__->new->dump_file($file, @data);
  }
  
  1;
  
  __END__
  
  =pod
  
  =encoding utf-8
  
  =head1 NAME
  
  YAML::PP::Perl - Convenience module for loading and dumping Perl objects
  
  =head1 SYNOPSIS
  
      use YAML::PP::Perl;
      my @docs = YAML::PP::Perl->new->load_string($yaml);
      my @docs = YAML::PP::Perl::Load($yaml);
  
      # same as
      use YAML::PP;
      my $yp = YAML::PP->new( schema => [qw/ Core Perl /] );
      my @docs = $yp->load_string($yaml);
  
  =head1 DESCRIPTION
  
  This is just for convenience. It will create a YAML::PP object using the
  default schema (C<Core>) and the L<YAML::PP::Schema::Perl> schema.
  
  See L<YAML::PP::Schema::Perl> for documentation.
  
  =head1 METHODS
  
  =over
  
  =item Load, Dump, LoadFile, DumpFile
  
  These work like the functions in L<YAML::PP>, just adding the C<Perl> schema.
  



( run in 1.465 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )