Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!jato!lwall From: lwall@jato.Jpl.Nasa.Gov (Larry Wall) Newsgroups: alt.sources Subject: perl 3.0 beta to gamma upgrade kit [5/4] Message-ID: <1753@jato.Jpl.Nasa.Gov> Date: 17 Sep 89 01:10:26 GMT Reply-To: lwall@jato.Jpl.Nasa.Gov (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 61 Here's a missing piece from the patch kits. Also, you can delete hdef and munch, since they are replaced by makelib. Larry Wall lwall@jpl-devvax.jpl.nasa.gov #!/bin/sh : make a subdirectory, cd to it, and run this through sh. echo 'If this kit is complete, "End of kit" will echo at the end' echo Extracting getopts.pl sed >getopts.pl <<'!STUFFY!FUNK!' -e 's/X//' X;# getopts.pl - a better getopt.pl X X;# Usage: X;# do Getopts('a:bc'); # -a takes arg. -b & -c not. Sets opt_* as a X;# # side effect. X Xsub Getopts { X local($argumentative) = @_; X local(@args,$_,$first,$rest); X X @args = split( / */, $argumentative ); X while(($_ = $ARGV[0]) =~ /^-(.)(.*)/) { X ($first,$rest) = ($1,$2); X $pos = index($argumentative,$first); X if($pos >= $[) { X if($args[$pos+1] eq ':') { X shift; X if($rest eq '') { X $rest = shift; X } X eval "\$opt_$first = \$rest;"; X } X else { X eval "\$opt_$first = 1"; X if($rest eq '') { X shift; X } X else { X $ARGV[0] = "-$rest"; X } X } X } X else { X print stderr "Unknown option: $first\n"; X if($rest ne '') { X $ARGV[0] = "-$rest"; X } X else { X shift; X } X } X } X} X X1; !STUFFY!FUNK! echo "" echo "End of kit" : I do not append .signature, but someone might mail this. exit