/[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.7 by joko, Fri Nov 29 04:44:53 2002 UTC revision 1.9 by joko, Thu Dec 5 13:54:00 2002 UTC
# Line 3  Line 3 
3  #  $Id$  #  $Id$
4  #  #
5  #  $Log$  #  $Log$
6    #  Revision 1.9  2002/12/05 13:54:00  joko
7    #  + fix: let 'deep_copy' print its message out (instead of die)
8    #
9    #  Revision 1.8  2002/12/01 22:11:35  joko
10    #  + sub cmd
11    #  + sub run_cmds
12    #
13  #  Revision 1.7  2002/11/29 04:44:53  joko  #  Revision 1.7  2002/11/29 04:44:53  joko
14  #  - sub array_getRelations  #  - sub array_getRelations
15  #  + sub getNewPerlObjectByPkgName  #  + sub getNewPerlObjectByPkgName
# Line 47  our @EXPORT_OK = qw( Line 54  our @EXPORT_OK = qw(
54      now      now
55      deep_copy      deep_copy
56      getNewPerlObjectByPkgName      getNewPerlObjectByPkgName
57        cmd
58        run_cmds
59  );  );
60    
61  use Data::Dumper;  use Data::Dumper;
# Line 204  sub deep_copy { Line 213  sub deep_copy {
213      +{map { $_ => deep_copy($this->{$_}) } keys %$this};      +{map { $_ => deep_copy($this->{$_}) } keys %$this};
214    } elsif (ref $this eq "CODE") {    } elsif (ref $this eq "CODE") {
215      $this;      $this;
216    } else { die "what type is $_?" }    #} else { die "deep_copy asks: what type is $this?" }
217      } else { print "deep_copy asks: what type is $this?", "\n"; }
218  }  }
219    
220  sub getNewPerlObjectByPkgName {  sub getNewPerlObjectByPkgName {
# Line 218  sub getNewPerlObjectByPkgName { Line 228  sub getNewPerlObjectByPkgName {
228    return $pkgname->new($args);    return $pkgname->new($args);
229  }  }
230    
231    sub cmd ($) {
232      my $cmd = shift;
233      $cmd = 'perl ' . $cmd;
234      my $sep = "-" x 90;
235      print $sep, "\n";
236      print "  ", $cmd, "\n";
237      print $sep, "\n";
238      system($cmd);
239      print "\n";
240    }
241    
242    sub run_cmds {
243      foreach (@_) {
244        cmd($_);
245      }
246    }
247    
248  1;  1;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.9

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