/[cvs]/nfo/perl/libs/libp.pm
ViewVC logotype

Diff of /nfo/perl/libs/libp.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by joko, Thu Dec 19 16:27:17 2002 UTC revision 1.13 by joko, Mon Dec 23 04:25:13 2002 UTC
# Line 3  Line 3 
3  #  $Id$  #  $Id$
4  #  #
5  #  $Log$  #  $Log$
6    #  Revision 1.13  2002/12/23 04:25:13  joko
7    #  + sub bool2status
8    #
9    #  Revision 1.12  2002/12/22 14:15:02  joko
10    #  + sub mkObject
11    #
12  #  Revision 1.11  2002/12/19 16:27:17  joko  #  Revision 1.11  2002/12/19 16:27:17  joko
13  #  +- renamed 'cmd' to 'run_cmd'  #  +- renamed 'cmd' to 'run_cmd'
14  #  #
# Line 62  our @EXPORT_OK = qw( Line 68  our @EXPORT_OK = qw(
68      deep_copy      deep_copy
69      getNewPerlObjectByPkgName      getNewPerlObjectByPkgName
70      run_cmd run_cmds      run_cmd run_cmds
71        mkObject
72        bool2status
73  );  );
74    
75  use Data::Dumper;  use Data::Dumper;
# Line 238  sub getNewPerlObjectByPkgName { Line 246  sub getNewPerlObjectByPkgName {
246    return $pkgname->new($args);    return $pkgname->new($args);
247  }  }
248    
249    sub mkObject {
250      my $pkgname = shift;
251      #my $args = shift;
252      #$logger->debug( __PACKAGE__ . "->getNewPerlObjectByPkgName( pkgname $pkgname args $args )" );
253      my $evstring = "use $pkgname;";
254      eval($evstring);
255      #$@ && $logger->error( __PACKAGE__ . ':' . __LINE__ . " Error in eval $evstring: " .  $@ );
256      $@ && print( __PACKAGE__ . ':' . __LINE__ . " Error in eval \"$evstring\": " .  $@ );
257      return $pkgname->new(@_);
258    }
259    
260  sub run_cmd {  sub run_cmd {
261    my $cmd = shift;    my $cmd = shift;
262    $cmd = 'perl ' . $cmd;    $cmd = 'perl ' . $cmd;
# Line 255  sub run_cmds { Line 274  sub run_cmds {
274    }    }
275  }  }
276    
277    sub bool2status {
278      my $bool = shift;
279      return ($bool ? 'ok' : 'failed');
280    }
281    
282  1;  1;

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.13

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed