GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Jifty::DBI::Filter::YAML(3) User Contributed Perl Documentation Jifty::DBI::Filter::YAML(3)

Jifty::DBI::Filter::YAML - This filter stores arbitrary Perl via YAML

  use Jifty::DBI::Record schema {
      column my_data =>
          type is 'text',
          filters are qw/ Jifty::DBI::Filter::YAML /;
  };

  my $thing = __PACKAGE__->new;
  $thing->create( my_data => { foo => 'bar', baz => [ 1, 2, 3 ] } );

  my $my_data = $thing->my_data;
  while (my ($key, $value) = %$my_data) {
      # do something...
  }

This filter provides the ability to store arbitrary data structures into a database column using YAML. This is very similar to the Jifty::DBI::Filter::Storable filter except that the YAML format remains human-readable in the database. You can store virtually any Perl data, scalar, hash, array, or object into the database using this filter.

In addition, YAML (at least the storage of scalars, hashes, and arrays) is compatible with data structures written in other languages, so you may store or read data between applications written in different languages.

This method is used to encode the Perl data structure into YAML formatted text.

This method is used to decode the YAML formatted text from the database into the Perl data structure.

This class will attempt to use YAML::Syck if it is available and then fall back upon YAML. This has been done because the Syck library is written in C and is considerably faster.

Jifty::DBI::Filter, YAML, YAML::Syck

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

This program is free software and may be modified or distributed under the same terms as Perl itself.
2014-05-29 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.