X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=perl-module%2Flib%2FPSPP.pm;h=6fbae803a9b250cf3d0aa8aaccaebaaace00aba5;hb=b8e182acade7dc6f008d79221f1274fa1e3003dc;hp=a000b0115adbbd60a066787cdb6fec2f7cd19c6a;hpb=6ef31dd13db451889d03408cf07ed04d47000b06;p=pspp-builds.git diff --git a/perl-module/lib/PSPP.pm b/perl-module/lib/PSPP.pm index a000b011..6fbae803 100644 --- a/perl-module/lib/PSPP.pm +++ b/perl-module/lib/PSPP.pm @@ -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;