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.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Class::PObject 2.17

    Download button

    No screenshots available
    Downloads: 403  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.3/5)
    3 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Sherzod B. Ruzmetov | More programs
    Perl Artistic License / FREE
    March 26th, 2008, 13:31 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Class::PObject description

    Class::PObject is a simple framework for programming persistent objects.

    Class::PObject is a simple framework for programming persistent objects.

    SYNOPSIS

    After loading Class::PObject with use, we can declare a class:

    pobject Person => {
    columns => ['id', 'name', 'email'],
    datasource => './data'
    };

    We can also declare the class in its own .pm file:

    package Person;
    use Class::PObject;
    pobject {
    columns => ['id', 'name', 'email'],
    datasource => './data'
    };

    We can now create an instance of above Person, fill it with data, and save it:

    $person = new Person();
    $person->name('Sherzod');
    $person->email('sherzodr[AT]cpan.org');
    $new_id = $person->save()

    We can access the saved Person later, make necessary changes and save back:

    $person = Person->load($new_id);
    $person->name('Sherzod Ruzmetov (The Geek)');
    $person->save()

    We can load multiple objects as well:

    @people = Person->load();
    for $person ( @people ) {
    printf("[d] %s < %s >n", $person->id, $person->name, $person->email)
    }

    or we can load all the objects based on some criteria and sort the list by column name in descending order, and limit the results to only the first 3 objects:

    @people = Person->load(
    {name => "Sherzod"},
    {sort => "name", direction => "desc", limit=>3});

    We can also seek into a specific point of the result set:

    @people = Person->load(undef, {offset=>10, limit=>10});

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    object programming | PObject class | Perl module | PObject | class | object

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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