Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Parse::FieldPath 0.004

    Download button

    No screenshots available
    Downloads: 99  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Paul Boyd | More programs
    Perl Artistic License / FREE
    November 4th, 2011, 05:57 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Parse::FieldPath description

    Parses an XPath inspired field list and extracts those fields from an object hierarchy

    Parse::FieldPath is a Perl module that parses an XPath inspired field list and extracts those fields from an object hierarchy.

    Based on the "fields" parameter for the Google+ API: http://developers.google.com/+/api/

    SYNOPSIS

    Say you have an object, with some sub-objects, that's initialized like this:

     my $cow = Cow->new();
     $cow->color("black and white");
     $cow->tail(Cow::Tail->new(floppy => 1));
     $cow->mouth(Cow::Tounge->new(
     tounge => Cow::Tounge->new,
     teeth => Cow::Teeth->new,
     );


    And you want a hash containing some of those fields (perhaps to pass to JSON::XS, or something). Then you can do this:

     use Parse::FieldPath qw/extract_fields/;

     my $cow_hash = extract_fields($cow, "color,tail/floppy");
     # $cow_hash is now:
     # {
     # color => 'black and white',
     # tail => {
     # floppy => 1,
     # }
     # }



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    XPath field | field parser | Perl module | Perl | XPath | field

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM