v32i004: perlref - Perl Reference Guide 4.035.1, Part04/04 
Author Message
 v32i004: perlref - Perl Reference Guide 4.035.1, Part04/04


Posting-number: Volume 32, Issue 4
Archive-name: perlref/part04
Supersedes: perlref: Volume 28, Issue 77-79
Environment: Perl v4.035

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then feed it
# into a shell via "sh file" or similar.  To overwrite existing files,
# type "sh file -c".
# Contents:  ChangeLog parr

PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo '          "shar: End of archive 4 (of 4)."'
if test -f 'ChangeLog' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'ChangeLog'\"
else
  echo shar: Extracting \"'ChangeLog'\" \(4079 characters\)
  sed "s/^X//" >'ChangeLog' <<'END_OF_FILE'
XWed Sep  2 15:18:08 1992  Johan Vromans  (jv at largo)
X
X       * Makefile 2.7:
X         Updated to 4.035.
X         Add symbols for{*filter*}and DVIPS.
X         Add entry for guide-test.ps.
X         Add chapter 27.
X         Do not run psneat since it produces incorrect code.
X
X       * ch22.tex 2.5:
X         Refer to manual for scalar return values.
X         Change 'Info is' to 'Returns'.
X
X       * ch00.tex 2.4:
X         Decrease space before the table of contents.
X         Add chapter 27.
X
X       * ch99.tex 2.3:
X         Eliminate \newpage (moved to refmaster.tex).
X
X       * ch27.tex 1.2:
X         New chapter 'Environment variables'.
X
X       * ch24.tex 2.3:
X         $^L: New in 4.035.
X
X       * ch16.tex 2.3:
X         s: Note bracketing quotes. Not a 4.035 feature.
X
X       * ch13.tex 2.3:
X         stat: Indicate return of null list if the call fails.
X
X       * ch11.tex 2.3:
X         eval: Fix typo run-time.
X         rindex: Shorten description so substr fits on the same page.
X
X       * ch07.tex 2.3:
X         Add gid to -rR/wW/xX. Separate -oO.
X         -s: Make separate entry. Indicate that it returns the
X         size. Not a 4.035 feature.
X
X       * ch04.tex 2.3:
X         Make semicolon at end of BLOCK optional.
X
X       * ch02.tex 2.4:
X         numeric: Add '1_2345' format (blech).
X
X       * ch01.tex 2.4:
X         -0: Change 'See also -L'to 'See also '-l' (typo).
X
X       * refbase.sty 2.5:
X         Updated to 4.035. Add \makeupspace.
X
X       * refmaster.tex 2.3:
X         Add chapter 27. Change makeups.
X
X       * README 2.5:
X         Updated to 4.035.
X
XFri May 22 09:14:22 1992  Johan Vromans  (jv at largo)
X
X       * refbase.sty 2.4:
X         Michael Jaegermann, who donated the NFSS code, used his wife's
X         account for mailing me, so his wife got the credits instead.
X
XThu Apr  9 16:25:29 1992  Johan Vromans  (jv at largo)
X
X       * ch22:
X         "...does include not OK."  You may want to change it to read
X         "...does not include OK."

X
XTue Mar  3 12:46:00 1992  Johan Vromans  (jv at largo)
X
X       * ch01: Correct '-L' to '-l'.

X
X       * ch10: Add v/V to TEMPLATE.

X
XWed Feb 19 15:02:26 1992  Johan Vromans  (jv at largo)
X
X       * Released to USEnet. Official version is 4.019.1.
X
X       * refbase.sty: add support for new font selection scheme.
X         Get rid of overfull hboxes.
X
X       * refbase.sty, refmaster.tex, ch*.tex: update for 4.019.

X         Describe "eval { ... }" .

X         Small corrections.
X
X       * Makefile: new kit assembly.
X
XTue Aug 27 18:41:42 1991  Johan Vromans  (jv at largo)
X
X       * ch22: add 'gethostbyaddr'
X
XFri Aug  2 09:44:47 1991  Johan Vromans  (jv at largo)
X
X       * parr: add code for duplex printing.
X
X       * README: describe duplex printing, version number.
X
XSat Jul 27 15:23:01 1991  Johan Vromans  (jv at pronto)
X
X       * parr: Adjusted '%%Pages:' to reflect actual number of sheets.
X
XFri Jul 26 23:10:00 1991  Johan Vromans  (jv at pronto)
X
X       * Add Layout document that describes in more detail how the
X         Reference Guide should look like.
X
X       * Makefile/README: Incorporate Layout.
X
XFri Jul 26 09:15:58 1991  Johan Vromans  (jv at largo)
X
X       * Released to USEnet (patch). Official version is 4.010.2.1.
X
X       * ch04: typo: | -> || (two locations)
X
X       * parr: slightly increase $topmargin for US paper.
X
X       * ch06: typo: log or/and | & -> || &&
X
XThu Jul 25 11:11:24 1991  Johan Vromans  (jv at largo)
X
X       * Makefile/README: Clarify the use of guide-{odd,even?}.ps.
X
X       * parr: Suppress extraneous %%Page comments to obtain more
X         conformant postscript. Some PS viewers and printers (or
X         print-spoolers) seem to {*filter*}in these extraneous comments.
X
X         Set $leftmargin to 0 for US-Letter format. According to most
X         respondents this seems to be the correct value.
X
XTue Jul 23 18:32:54 1991  Johan Vromans  (jv at largo)
X
X       * Makefile: allow MASTER=test for testing.
X
X       * ch03: typo: $var -> $#var is last element of array.
X
X       * ch00: move front page info a bit down/right.
X
XMon Jul 22 22:05:57 1991  Johan Vromans  (jv at pronto)
X
X       * ch00: typo: deigned -> designed.
X
XSat Jul 20 00:31:47 1991  Johan Vromans  (jv at pronto)
X
X       * Released to USEnet. Official version is 4.010.1.8.
X
X       * This is a brand new version.
X
END_OF_FILE
  if test 4079 -ne `wc -c <'ChangeLog'`; then
    echo shar: \"'ChangeLog'\" unpacked with wrong size!
  fi
  # end of 'ChangeLog'
fi
if test -f 'parr' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'parr'\"
else
  echo shar: Extracting \"'parr'\" \(4291 characters\)
  sed "s/^X//" >'parr' <<'END_OF_FILE'
X#!/usr/bin/perl
X

X
X# rearrange conforming PS code to print the pages in an arbitrary
X# order.  The -o option takes a list of ranges, like this:
X#      1-5    1-10,11-20    11-,1-10
X# usage: parr [-a4] [-o list] [file]
X#


X
X$order='';
X$signFlag='';
X$signCount=0;
X$DEBUG=0;
X$TMPDIR='/usr/tmp';
X
Xwhile ($_ = $ARGV[0],/^-/) {
X       shift;
X       last if /^-\-$/;
X       /^-o(rder)?$/ && ($order = shift,next);
X       /^-a4$/ && ($a4flag++,next);
X       die "usage: parr [-a4] [-order list] [file]\n";
X}
X

X$sheet=0;
Xopen(FILE,">$file") || die "$file: $!\n";
Xwhile (<>) {
X       #
X       # hack to use NeXT Preview: strip old '%%Pages:' lines
X       #
X       next if /^%%Pages:/;
X       if (/^%%Page:/) {
X               $sheet++;
X               $pagemap{$sheet} = $1 if /%%Page:\s+(\S+)\s+\S+/;
X               close(FILE);
X               $file = "$TMPDIR/p$$.$sheet";

X               open(FILE,">$file") || die "$file: $!\n";
X       }
X       if (/^%%Trailer/) {
X               close(FILE);
X               $file = "$TMPDIR/p$$.trailer";

X               open(FILE,">$file") || die "$file: $!\n";
X       }

X               # Insert twoup before switching to TeXDict
X               &twoup;
X               $twoup++;
X               &double_sided;

X               next;
X       }
X       print FILE $_;
X}
Xclose(FILE);
Xdie "twoup insertion error\n" unless $twoup == 1;

Xif ($order) {
X       foreach $range (split(/,/,$order)) {
X               ($start,$sep,$end) = split(/(-)/,$range);
X               $start = 1 unless $start;
X               $end = $sheet unless $end;
X               if ($sep) {

X               }else{

X               }
X       }
X}elsif ($signFlag) {
X       if (! $signCount) {
X               $signCount = $sheet;
X               $signCount += (4 - $sheet % 4) if ($sheet % 4);
X       }else{
X               $signCount *=4;
X       }
X       for($base=0;$base<$sheet;$base+=$signCount) {


X               while ($tmp[3] > $base) {


X               }
X       }
X}else{

X}



X}
X
Xopen(FILE,"$TMPDIR/p$$.header");
X$_ = <FILE>;
Xprint $_,"%%Pages: (atend)\n";
Xprint while <FILE>;
Xclose(FILE);
X
X$count = 0;

X       $count++;
X       $num = "?";
X       $num = $pagemap{$page} if defined $pagemap{$page};
X       $num .= "/" . $pagemap{$order[$count]}
X               if defined $pagemap{$order[$count]};
X       print "%%Page: $num ", ($count+1)/2, "\n" if $count & 1;
X       print "%%OldPage: $page\n";
X       if ($page eq "B") {
X               print "showpage\n";
X       }else{
X               open(FILE,"$TMPDIR/p$$.$page");
X               while (<FILE>) {
X                       print unless /^%%Page:/;
X               }
X               close(FILE);
X       }
X}
Xopen(FILE,"$TMPDIR/p$$.trailer");
Xprint while <FILE>;
Xclose(FILE);
Xprint "%%Pages: ", int(($count+1)/2), " 0\n";
X

Xexit(0);
X
Xsub twoup {
X$factor = 0.707106781187;
X
X# Measurements are in 1/100 inch approx.
Xif ( $a4flag) {
X       $topmargin = -57;
X       $leftmargin = 28;
X       $othermargin = 445;     # do not change -- relative to $leftmargin
X}
Xelse {
X       $topmargin = -30;
X       $leftmargin = 0;
X       $othermargin = 445;     # do not change -- relative to $leftmargin
X}
X$vsize = -1 - $factor;
Xprint FILE <<EOD;
X/isoddpage true def
X/orig-showpage /showpage load def
X/showpage {
X        isoddpage not { orig-showpage } if
X        /isoddpage isoddpage not store
X    } def
X
X/bop-hook {
X       /vsize $vsize def
X        isoddpage
X       { $factor $factor scale $topmargin $leftmargin translate }
X        { 0 $othermargin translate}
X       ifelse
X    } def
X
X/end-hook{ isoddpage not { orig-showpage } if } def
XEOD
X}
X
Xsub double_sided {
X

X    #
X    # You may be interested in the following problem, and fix, that we
X    # found when attempting to print the reference card on our Hewlett
X    # Packard Laser-Jet IIISi printer.
X    #
X    # On this printer, refguide.ps prints double-sided with the
X    # reverse side of each sheet upside down.  We fixed it with the
X    # following patch, applied before printing.
X

X    #
X    # Okay -- consider this an unsupported feature.
X
X    print FILE <<EOD;
Xstatusdict /setduplexmode known { statusdict begin true setduplexmode end } if
Xstatusdict /settumble known { statusdict begin true settumble end } if
XEOD
X}
X
X# Local Variables:
X# mode:(perl)
X# End:
END_OF_FILE
  if test 4291 -ne `wc -c <'parr'`; then
    echo shar: \"'parr'\" unpacked with wrong size!
  fi
  # end of 'parr'
fi
echo shar: End of archive 4 \(of 4\).
cp /dev/null ark4isdone
MISSING=""
for I in 1 2 3 4 ; do
    if test ! -f ark${I}isdone ; then
        MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 4 archives.
    rm -f ark[1-9]isdone
else
    echo You still must unpack the following archives:
    echo "        " ${MISSING}
fi
exit 0
exit 0 # Just in case...



Tue, 21 Feb 1995 10:39:51 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. v32i001: perlref - Perl Reference Guide 4.035.1, Part01/04

2. v32i002: perlref - Perl Reference Guide 4.035.1, Part02/04

3. Perl Reference Guide 4.035.1 has been posted to comp.sources.misc

4. magic(1) - file(1) in perl, BETA release, part04/04

5. SoftList 2.0 - manage Software Version List - Part 04/04

6. Q about perlref (ex. from man perlref)

7. perlref - Symbolic references

8. Perl QRG(Perl Quick Reference Guide)

9. compile errors perl-4.035 help

10. Trouble compiling perl-4.035 on ULTRIX 4.3

11. Installing perl-4.035 in 386BSD

12. perl-4.035 on linux0.98.1

 

 
Powered by phpBB® Forum Software