X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl-module%2Flib%2FPSPP.pm;h=a56ff4b756d81dcd6fd3136f775ddb615a8b0bff;hb=0fc5ac957f04c06ab30b990600684d41c68fe1e5;hp=a000b0115adbbd60a066787cdb6fec2f7cd19c6a;hpb=6ef31dd13db451889d03408cf07ed04d47000b06;p=pspp diff --git a/perl-module/lib/PSPP.pm b/perl-module/lib/PSPP.pm index a000b0115a..a56ff4b756 100644 --- a/perl-module/lib/PSPP.pm +++ b/perl-module/lib/PSPP.pm @@ -21,7 +21,7 @@ None by default. =cut BEGIN { - do 'pspp-vers.pl' || die "No version set"; + $PSPP::VERSION='0.7.0'; require XSLoader; XSLoader::load('PSPP', $PSPP::VERSION); } @@ -106,6 +106,28 @@ sub get_var return $var; } +=pod + +=head3 get_var_by_name ($name) + +Returns the variable from the dictionary whose name is C. +If there is no such variable, a null reference will be returned. + +=cut + +sub get_var_by_name +{ + my $dict = shift; + my $name = shift; + my $var = pxs_get_var_by_name ($dict, $name); + + if ( ref $var ) + { + bless ($var, "PSPP::Var"); + } + return $var; +} + package PSPP::Fmt; @@ -333,6 +355,12 @@ sub set_value_labels Sets the missing values for the variable. No more than three missing values may be specified. +=head3 get_attributes() + +Returns a reference to a hash of the custom variable attributes. +Each value of the hash is a reference to an array containing the +attribute values. + =head3 get_name () Returns the name of the variable. @@ -435,7 +463,7 @@ Opens a system file for reading. Open is used to read data from an existing system file. It creates and returns a PSPP::Reader object which can be used to read -data and dictionary information from filename. +data and dictionary information from C. =cut @@ -461,7 +489,7 @@ Returns the dictionary associated with the reader. Retrieves the next case from the reader. This method returns an array of scalars, each of which are the values of the data in the system file. -The first call to get_next_case after open has been called retrieves +The first call to C after C has been called retrieves the first case in the system file. Each subsequent call retrieves the next case. If there are no more cases to be read, the function returns undef. @@ -497,7 +525,7 @@ John Darrington, Ejohn@darrington.wattle.id.auE =head1 COPYRIGHT AND LICENSE -Copyright (C) 2007, 2008 by Free Software Foundation +Copyright (C) 2007, 2008, 2009 by Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by