Updated copyright notices with the year 2009
[pspp-builds.git] / perl-module / lib / PSPP.pm
index dde62f5b56638d0b569cb6fa7676d5394c58c8fc..2ca942c208d4771c0616016b76c435018692b82d 100644 (file)
@@ -4,7 +4,7 @@ use warnings;
 
 =head1 NAME
 
-PSPP - Perl extension to PSPP
+PSPP-Perl - Perl extension to PSPP
 
 =head1 SYNOPSIS
 
@@ -12,8 +12,8 @@ PSPP - Perl extension to PSPP
 
 =head1 DESCRIPTION
 
-PSPP:: provides an interface to the libraries used by pspp to create
-system files.  
+PSPP-Perl provides an interface to the libraries used by pspp to read and
+write system files.  
 
 =head1 EXPORT
 
@@ -87,9 +87,9 @@ sub new
 
 =pod
 
-=head3 get_var ()
+=head3 get_var ($idx)
 
-Returns a variable from a dictionary.
+Returns the C<idx>th variable from the dictionary.
 
 =cut
 
@@ -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<name>.
+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.
@@ -497,7 +525,7 @@ John Darrington, E<lt>john@darrington.wattle.id.auE<gt>
 
 =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