ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCallum" <mich...@spinsoftware.co.nz>
Subject Re: [PATCH] runant.pl
Date Thu, 24 Aug 2000 23:18:44 GMT
the perl one liner would be

<this>
  #add jar files. I am sure there is a perl one liner to do this.
  my $jarpattern="$HOME/lib/*.jar";  
  my @jarfiles =glob($jarpattern);
  print "jarfiles=@jarfiles\n" if ($debug);
  my $jar;
  foreach $jar (@jarfiles )
    {
      $localpath.="$s$jar";
    }
<becomes>
  $localpath .= "$s" . join( "$s", glob( $jarpattern ) );

 but for readabiliy you probably want...

   my $jarpattern = "$HOME/lib/*.jar";  
   my @jarfiles = glob( $jarpattern );
   $localpath .= "$s" . join( "$s", glob( @jarfiles ) );

p.s.

you should make you env safe...run with a -T -w tags eg
/usr/bin/perl -T -w
admittedly you get heaps more warning messages but it stops you making simples mistakes 
you might overlook.
Although you will have to resolve the insecure dependency using the glob. 
If you like I will submit a safer version later but have to work now :)

Michael

also to make it portable use /usr/bin/perl not /usr/local/perl most installations will have
it here.
--- BEGIN GEEK CODE BLOCK ---
Version 3.12
GCS d+(-) s:- a-- C++(+++)$ UL++++(H)(S)$ P+++$ L+++$>++++
E--- W++ N++ o++ K? !w() O? !M V? PS+ PE+++ Y+ t+ 5++ X++ 
R(+) !tv b++(++++) D++ G>++ e++> h--()(*) r+ y+()
--- END GEEK CODE BLOCK ---

Mime
View raw message