/[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.10 by joko, Thu Dec 19 01:05:35 2002 UTC revision 1.12 by joko, Sun Dec 22 14:15:02 2002 UTC
# Line 3  Line 3 
3  #  $Id$  #  $Id$
4  #  #
5  #  $Log$  #  $Log$
6    #  Revision 1.12  2002/12/22 14:15:02  joko
7    #  + sub mkObject
8    #
9    #  Revision 1.11  2002/12/19 16:27:17  joko
10    #  +- renamed 'cmd' to 'run_cmd'
11    #
12  #  Revision 1.10  2002/12/19 01:05:35  joko  #  Revision 1.10  2002/12/19 01:05:35  joko
13  #  + sub today  #  + sub today
14  #  #
# Line 50  our @EXPORT_OK = qw( Line 56  our @EXPORT_OK = qw(
56      md5 md5_hex md5_base64      md5 md5_hex md5_base64
57      ParseDate UnixDate      ParseDate UnixDate
58      strftime      strftime
     stripHtml stripSpaces stripNewLines toReal trim  
59      croak      croak
60    
61        stripHtml stripSpaces stripNewLines toReal trim
62      array_getDifference      array_getDifference
63      getDirList      getDirList
64      now      now today
65      deep_copy      deep_copy
66      getNewPerlObjectByPkgName      getNewPerlObjectByPkgName
67      cmd      run_cmd run_cmds
68      run_cmds      mkObject
     today  
69  );  );
70    
71  use Data::Dumper;  use Data::Dumper;
# Line 236  sub getNewPerlObjectByPkgName { Line 242  sub getNewPerlObjectByPkgName {
242    return $pkgname->new($args);    return $pkgname->new($args);
243  }  }
244    
245  sub cmd ($) {  sub mkObject {
246      my $pkgname = shift;
247      #my $args = shift;
248      #$logger->debug( __PACKAGE__ . "->getNewPerlObjectByPkgName( pkgname $pkgname args $args )" );
249      my $evstring = "use $pkgname;";
250      eval($evstring);
251      #$@ && $logger->error( __PACKAGE__ . ':' . __LINE__ . " Error in eval $evstring: " .  $@ );
252      $@ && print( __PACKAGE__ . ':' . __LINE__ . " Error in eval \"$evstring\": " .  $@ );
253      return $pkgname->new(@_);
254    }
255    
256    sub run_cmd {
257    my $cmd = shift;    my $cmd = shift;
258    $cmd = 'perl ' . $cmd;    $cmd = 'perl ' . $cmd;
259    my $sep = "-" x 90;    my $sep = "-" x 90;
# Line 249  sub cmd ($) { Line 266  sub cmd ($) {
266    
267  sub run_cmds {  sub run_cmds {
268    foreach (@_) {    foreach (@_) {
269      cmd($_);      run_cmd($_);
270    }    }
271  }  }
272    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.12

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