home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume18 / perl / part36 < prev    next >
Encoding:
Internet Message Format  |  1991-04-20  |  42.6 KB

  1. From: lwall@netlabs.com (Larry Wall)
  2. Newsgroups: comp.sources.misc
  3. Subject: v18i054:  perl - The perl programming language, Part36/36
  4. Message-ID: <1991Apr19.015019.5277@sparky.IMD.Sterling.COM>
  5. Date: 19 Apr 91 01:50:19 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: 8d9245f6 f3b5cf17 dd001411 a93566c4
  8.  
  9. Submitted-by: Larry Wall <lwall@netlabs.com>
  10. Posting-number: Volume 18, Issue 54
  11. Archive-name: perl/part36
  12.  
  13. [There are 36 kits for perl version 4.0.]
  14.  
  15. #! /bin/sh
  16.  
  17. # Make a new directory for the perl sources, cd to it, and run kits 1
  18. # thru 36 through sh.  When all 36 kits have been run, read README.
  19.  
  20. echo "This is perl 4.0 kit 36 (of 36).  If kit 36 is complete, the line"
  21. echo '"'"End of kit 36 (of 36)"'" will echo at the end.'
  22. echo ""
  23. export PATH || (echo "You didn't use sh, you clunch." ; kill $$)
  24. mkdir eg eg/g eg/van h2pl h2pl/eg hints lib msdos os2 os2/eg t t/base t/cmd t/comp t/io t/op usub x2p 2>/dev/null
  25. echo Extracting t/comp/cpp.t
  26. sed >t/comp/cpp.t <<'!STUFFY!FUNK!' -e 's/X//'
  27. X#!./perl -P
  28. X
  29. X# $Header: cpp.t,v 4.0 91/03/20 01:50:05 lwall Locked $
  30. X
  31. Xprint "1..3\n";
  32. X
  33. X#this is a comment
  34. X#define MESS "ok 1\n"
  35. Xprint MESS;
  36. X
  37. X#If you capitalize, it's a comment.
  38. X#ifdef MESS
  39. X    print "ok 2\n";
  40. X#else
  41. X    print "not ok 2\n";
  42. X#endif
  43. X
  44. Xopen(TRY,">Comp.cpp.tmp") || die "Can't open temp perl file.";
  45. X
  46. X($prog = <<'END') =~ s/X//g;
  47. XX$ok = "not ok 3\n";
  48. XX#include "Comp.cpp.inc"
  49. XX#ifdef OK
  50. XX$ok = OK;
  51. XX#endif
  52. XXprint $ok;
  53. XEND
  54. Xprint TRY $prog;
  55. Xclose TRY;
  56. X
  57. Xopen(TRY,">Comp.cpp.inc") || (die "Can't open temp include file.");
  58. Xprint TRY '#define OK "ok 3\n"' . "\n";
  59. Xclose TRY;
  60. X
  61. X$pwd=`pwd`;
  62. X$pwd =~ s/\n//;
  63. X$x = `./perl -P Comp.cpp.tmp`;
  64. Xprint $x;
  65. Xunlink "Comp.cpp.tmp", "Comp.cpp.inc";
  66. !STUFFY!FUNK!
  67. echo Extracting t/comp/package.t
  68. sed >t/comp/package.t <<'!STUFFY!FUNK!' -e 's/X//'
  69. X#!./perl
  70. X
  71. Xprint "1..7\n";
  72. X
  73. X$blurfl = 123;
  74. X$foo = 3;
  75. X
  76. Xpackage XYZ;
  77. X
  78. X$bar = 4;
  79. X
  80. X{
  81. X    package ABC;
  82. X    $blurfl = 5;
  83. X    $main'a = $'b;
  84. X}
  85. X
  86. X$ABC'dyick = 6;
  87. X
  88. X$xyz = 2;
  89. X
  90. X$main = join(':', sort(keys _main));
  91. X$XYZ = join(':', sort(keys _XYZ));
  92. X$ABC = join(':', sort(keys _ABC));
  93. X
  94. Xprint $XYZ eq 'ABC:XYZ:bar:main:xyz' ? "ok 1\n" : "not ok 1 '$XYZ'\n";
  95. Xprint $ABC eq 'blurfl:dyick' ? "ok 2\n" : "not ok 2\n";
  96. Xprint $main'blurfl == 123 ? "ok 3\n" : "not ok 3\n";
  97. Xpackage ABC;
  98. Xprint $blurfl == 5 ? "ok 4\n" : "not ok 4\n";
  99. Xeval 'print $blurfl == 5 ? "ok 5\n" : "not ok 5\n";';
  100. Xeval 'package main; print $blurfl == 123 ? "ok 6\n" : "not ok 6\n";';
  101. Xprint $blurfl == 5 ? "ok 7\n" : "not ok 7\n";
  102. !STUFFY!FUNK!
  103. echo Extracting array.h
  104. sed >array.h <<'!STUFFY!FUNK!' -e 's/X//'
  105. X/* $Header: array.h,v 4.0 91/03/20 01:03:44 lwall Locked $
  106. X *
  107. X *    Copyright (c) 1989, Larry Wall
  108. X *
  109. X *    You may distribute under the terms of the GNU General Public License
  110. X *    as specified in the README file that comes with the perl 3.0 kit.
  111. X *
  112. X * $Log:    array.h,v $
  113. X * Revision 4.0  91/03/20  01:03:44  lwall
  114. X * 4.0 baseline.
  115. X * 
  116. X */
  117. X
  118. Xstruct atbl {
  119. X    STR    **ary_array;
  120. X    STR **ary_alloc;
  121. X    STR *ary_magic;
  122. X    int ary_max;
  123. X    int ary_fill;
  124. X    char ary_flags;
  125. X};
  126. X
  127. X#define ARF_REAL 1    /* free old entries */
  128. X
  129. XSTR *afetch();
  130. Xbool astore();
  131. XSTR *apop();
  132. XSTR *ashift();
  133. Xvoid afree();
  134. Xvoid aclear();
  135. Xbool apush();
  136. Xint alen();
  137. XARRAY *anew();
  138. XARRAY *afake();
  139. !STUFFY!FUNK!
  140. echo Extracting t/cmd/mod.t
  141. sed >t/cmd/mod.t <<'!STUFFY!FUNK!' -e 's/X//'
  142. X#!./perl
  143. X
  144. X# $Header: mod.t,v 4.0 91/03/20 01:49:33 lwall Locked $
  145. X
  146. Xprint "1..7\n";
  147. X
  148. Xprint "ok 1\n" if 1;
  149. Xprint "not ok 1\n" unless 1;
  150. X
  151. Xprint "ok 2\n" unless 0;
  152. Xprint "not ok 2\n" if 0;
  153. X
  154. X1 && (print "not ok 3\n") if 0;
  155. X1 && (print "ok 3\n") if 1;
  156. X0 || (print "not ok 4\n") if 0;
  157. X0 || (print "ok 4\n") if 1;
  158. X
  159. X$x = 0;
  160. Xdo {$x[$x] = $x;} while ($x++) < 10;
  161. Xif (join(' ',@x) eq '0 1 2 3 4 5 6 7 8 9 10') {
  162. X    print "ok 5\n";
  163. X} else {
  164. X    print "not ok 5\n";
  165. X}
  166. X
  167. X$x = 15;
  168. X$x = 10 while $x < 10;
  169. Xif ($x == 15) {print "ok 6\n";} else {print "not ok 6\n";}
  170. X
  171. Xopen(foo,'TEST') || open(foo,'t/TEST');
  172. X$x = 0;
  173. X$x++ while <foo>;
  174. Xprint $x > 50 && $x < 1000 ? "ok 7\n" : "not ok 7\n";
  175. !STUFFY!FUNK!
  176. echo Extracting t/op/exp.t
  177. sed >t/op/exp.t <<'!STUFFY!FUNK!' -e 's/X//'
  178. X#!./perl
  179. X
  180. X# $Header: exp.t,v 4.0 91/03/20 01:52:31 lwall Locked $
  181. X
  182. Xprint "1..6\n";
  183. X
  184. X# compile time evaluation
  185. X
  186. X$s = sqrt(2);
  187. Xif (substr($s,0,5) eq '1.414') {print "ok 1\n";} else {print "not ok 1\n";}
  188. X
  189. X$s = exp(1);
  190. Xif (substr($s,0,7) eq '2.71828') {print "ok 2\n";} else {print "not ok 2\n";}
  191. X
  192. Xif (exp(log(1)) == 1) {print "ok 3\n";} else {print "not ok 3\n";}
  193. X
  194. X# run time evaluation
  195. X
  196. X$x1 = 1;
  197. X$x2 = 2;
  198. X$s = sqrt($x2);
  199. Xif (substr($s,0,5) eq '1.414') {print "ok 4\n";} else {print "not ok 4\n";}
  200. X
  201. X$s = exp($x1);
  202. Xif (substr($s,0,7) eq '2.71828') {print "ok 5\n";} else {print "not ok 5\n";}
  203. X
  204. Xif (exp(log($x1)) == 1) {print "ok 6\n";} else {print "not ok 6\n";}
  205. !STUFFY!FUNK!
  206. echo Extracting t/op/exec.t
  207. sed >t/op/exec.t <<'!STUFFY!FUNK!' -e 's/X//'
  208. X#!./perl
  209. X
  210. X# $Header: exec.t,v 4.0 91/03/20 01:52:25 lwall Locked $
  211. X
  212. X$| = 1;                # flush stdout
  213. Xprint "1..8\n";
  214. X
  215. Xprint "not ok 1\n" if system "echo ok \\1";    # shell interpreted
  216. Xprint "not ok 2\n" if system "echo ok 2";    # split and directly called
  217. Xprint "not ok 3\n" if system "echo", "ok", "3"; # directly called
  218. X
  219. Xif (system "true") {print "not ok 4\n";} else {print "ok 4\n";}
  220. X
  221. Xif ((system "/bin/sh -c 'exit 1'") != 256) { print "not "; }
  222. Xprint "ok 5\n";
  223. X
  224. Xif ((system "lskdfj") == 255 << 8) {print "ok 6\n";} else {print "not ok 6\n";}
  225. X
  226. Xunless (exec "lskdjfalksdjfdjfkls") {print "ok 7\n";} else {print "not ok 7\n";}
  227. X
  228. Xexec "echo","ok","8";
  229. !STUFFY!FUNK!
  230. echo Extracting client
  231. sed >client <<'!STUFFY!FUNK!' -e 's/X//'
  232. X#!./perl
  233. X
  234. X$pat = 'S n C4 x8';
  235. X$inet = 2;
  236. X$echo = 7;
  237. X$smtp = 25;
  238. X$nntp = 119;
  239. X$test = 2345;
  240. X
  241. X$SIG{'INT'} = 'dokill';
  242. X
  243. X$this = pack($pat,$inet,0,   128,149,13,43);
  244. X$that = pack($pat,$inet,$test,127,0,0,1);
  245. X
  246. Xif (socket(S,2,1,6)) { print "socket ok\n"; } else { die $!; }
  247. Xif (bind(S,$this)) { print "bind ok\n"; } else { die $!; }
  248. Xif (connect(S,$that)) { print "connect ok\n"; } else { die $!; }
  249. X
  250. Xselect(S); $| = 1; select(stdout);
  251. X
  252. Xif ($child = fork) {
  253. X    while (<STDIN>) {
  254. X    print S;
  255. X    }
  256. X    sleep 3;
  257. X    do dokill();
  258. X}
  259. Xelse {
  260. X    while (<S>) {
  261. X    print;
  262. X    }
  263. X}
  264. X
  265. Xsub dokill { kill 9,$child if $child; }
  266. !STUFFY!FUNK!
  267. echo Extracting t/op/goto.t
  268. sed >t/op/goto.t <<'!STUFFY!FUNK!' -e 's/X//'
  269. X#!./perl
  270. X
  271. X# $Header: goto.t,v 4.0 91/03/20 01:52:52 lwall Locked $
  272. X
  273. Xprint "1..3\n";
  274. X
  275. Xwhile (0) {
  276. X    $foo = 1;
  277. X  label1:
  278. X    $foo = 2;
  279. X    goto label2;
  280. X} continue {
  281. X    $foo = 0;
  282. X    goto label4;
  283. X  label3:
  284. X    $foo = 4;
  285. X    goto label4;
  286. X}
  287. Xgoto label1;
  288. X
  289. X$foo = 3;
  290. X
  291. Xlabel2:
  292. Xprint "#1\t:$foo: == 2\n";
  293. Xif ($foo == 2) {print "ok 1\n";} else {print "not ok 1\n";}
  294. Xgoto label3;
  295. X
  296. Xlabel4:
  297. Xprint "#2\t:$foo: == 4\n";
  298. Xif ($foo == 4) {print "ok 2\n";} else {print "not ok 2\n";}
  299. X
  300. X$x = `./perl -e 'goto foo;' 2>&1`;
  301. Xprint "#3\t/label/ in :$x";
  302. Xif ($x =~ /label/) {print "ok 3\n";} else {print "not ok 3\n";}
  303. !STUFFY!FUNK!
  304. echo Extracting t/op/pack.t
  305. sed >t/op/pack.t <<'!STUFFY!FUNK!' -e 's/X//'
  306. X#!./perl
  307. X
  308. X# $Header: pack.t,v 4.0 91/03/20 01:53:57 lwall Locked $
  309. X
  310. Xprint "1..3\n";
  311. X
  312. X$format = "c2x5CCxsdila6";
  313. X# Need the expression in here to force ary[5] to be numeric.  This avoids
  314. X# test2 failing because ary2 goes str->numeric->str and ary doesn't.
  315. X@ary = (1,-100,127,128,32767,987.654321098 / 100.0,12345,123456,"abcdef");
  316. X$foo = pack($format,@ary);
  317. X@ary2 = unpack($format,$foo);
  318. X
  319. Xprint ($#ary == $#ary2 ? "ok 1\n" : "not ok 1\n");
  320. X
  321. X$out1=join(':',@ary);
  322. X$out2=join(':',@ary2);
  323. Xprint ($out1 eq $out2 ? "ok 2\n" : "not ok 2\n");
  324. X
  325. Xprint ($foo =~ /def/ ? "ok 3\n" : "not ok 3\n");
  326. !STUFFY!FUNK!
  327. echo Extracting eg/shmkill
  328. sed >eg/shmkill <<'!STUFFY!FUNK!' -e 's/X//'
  329. X#!/usr/bin/perl
  330. X
  331. X# $Header: shmkill,v 4.0 91/03/20 01:14:20 lwall Locked $
  332. X
  333. X# A script to call from crontab periodically when people are leaving shared
  334. X# memory sitting around unattached.
  335. X
  336. Xopen(ipcs,'ipcs -m -o|') || die "Can't run ipcs: $!";
  337. X
  338. Xwhile (<ipcs>) {
  339. X    $tmp = index($_,'NATTCH');
  340. X    $pos = $tmp if $tmp >= 0;
  341. X    if (/^m/) {
  342. X    ($m,$id,$key,$mode,$owner,$group,$attach) = split;
  343. X    if ($attach != substr($_,$pos,6)) {
  344. X        die "Different ipcs format--can't parse!\n";
  345. X    }
  346. X    if ($attach == 0) {
  347. X        push(@goners,'-m',$id);
  348. X    }
  349. X    }
  350. X}
  351. X
  352. Xexec 'ipcrm', @goners if $#goners >= 0;
  353. !STUFFY!FUNK!
  354. echo Extracting eg/muck.man
  355. sed >eg/muck.man <<'!STUFFY!FUNK!' -e 's/X//'
  356. X.\" $Header: muck.man,v 4.0 91/03/20 01:11:04 lwall Locked $
  357. X.TH MUCK 1 "10 Jan 1989"
  358. X.SH NAME
  359. Xmuck \- make usage checker
  360. X.SH SYNOPSIS
  361. X.B muck
  362. X[options]
  363. X.SH DESCRIPTION
  364. X.I muck
  365. Xlooks at your current makefile and complains if you've left out any dependencies
  366. Xbetween .o and .h files.
  367. XIt also complains about extraneous dependencies.
  368. X.PP
  369. XYou can use the -f FILENAME option to specify an alternate name for your
  370. Xmakefile.
  371. XThe -v option is a little more verbose about what muck is mucking around
  372. Xwith at the moment.
  373. X.SH SEE ALSO
  374. Xmake(1)
  375. X.SH BUGS
  376. XOnly knows about .h, .c and .o files.
  377. !STUFFY!FUNK!
  378. echo Extracting h2pl/cbreak.pl
  379. sed >h2pl/cbreak.pl <<'!STUFFY!FUNK!' -e 's/X//'
  380. X$sgttyb_t   = 'C4 S';
  381. X
  382. Xsub cbreak {
  383. X    &set_cbreak(1);
  384. X}
  385. X
  386. Xsub cooked {
  387. X    &set_cbreak(0);
  388. X}
  389. X
  390. Xsub set_cbreak {
  391. X    local($on) = @_;
  392. X
  393. X    require 'sizeof.ph';
  394. X    require 'sys/ioctl.ph';
  395. X
  396. X    ioctl(STDIN,&TIOCGETP,$sgttyb)
  397. X        || die "Can't ioctl TIOCGETP: $!";
  398. X
  399. X    @ary = unpack($sgttyb_t,$sgttyb);
  400. X    if ($on) {
  401. X        $ary[4] |= &CBREAK;
  402. X        $ary[4] &= ~&ECHO;
  403. X    } else {
  404. X        $ary[4] &= ~&CBREAK;
  405. X        $ary[4] |= &ECHO;
  406. X    }
  407. X    $sgttyb = pack($sgttyb_t,@ary);
  408. X    ioctl(STDIN,&TIOCSETP,$sgttyb)
  409. X            || die "Can't ioctl TIOCSETP: $!";
  410. X
  411. X}
  412. X
  413. X1;
  414. !STUFFY!FUNK!
  415. echo Extracting server
  416. sed >server <<'!STUFFY!FUNK!' -e 's/X//'
  417. X#!./perl
  418. X
  419. X$pat = 'S n C4 x8';
  420. X$inet = 2;
  421. X$echo = 7;
  422. X$smtp = 25;
  423. X$nntp = 119;
  424. X
  425. X$this = pack($pat,$inet,2345, 0,0,0,0);
  426. Xselect(NS); $| = 1; select(stdout);
  427. X
  428. Xif (socket(S,2,1,6)) { print "socket ok\n"; } else { die $!; }
  429. Xif (bind(S,$this)) { print "bind ok\n"; } else { die $!; }
  430. Xif (listen(S,5)) { print "listen ok\n"; } else { die $!; }
  431. Xfor (;;) {
  432. X    print "Listening again\n";
  433. X    if ($addr = accept(NS,S)) { print "accept ok\n"; } else { die $!; }
  434. X
  435. X    @ary = unpack($pat,$addr);
  436. X    $, = ' ';
  437. X    print @ary; print "\n";
  438. X
  439. X    while (<NS>) {
  440. X    print;
  441. X    print NS;
  442. X    }
  443. X}
  444. !STUFFY!FUNK!
  445. echo Extracting t/op/flip.t
  446. sed >t/op/flip.t <<'!STUFFY!FUNK!' -e 's/X//'
  447. X#!./perl
  448. X
  449. X# $Header: flip.t,v 4.0 91/03/20 01:52:36 lwall Locked $
  450. X
  451. Xprint "1..8\n";
  452. X
  453. X@a = (1,2,3,4,5,6,7,8,9,10,11,12);
  454. X
  455. Xwhile ($_ = shift(a)) {
  456. X    if ($x = /4/../8/) { $z = $x; print "ok ", $x + 0, "\n"; }
  457. X    $y .= /1/../2/;
  458. X}
  459. X
  460. Xif ($z eq '5E0') {print "ok 6\n";} else {print "not ok 6\n";}
  461. X
  462. Xif ($y eq '12E0123E0') {print "ok 7\n";} else {print "not ok 7\n";}
  463. X
  464. X@a = ('a','b','c','d','e','f','g');
  465. X
  466. Xopen(of,'../Makefile');
  467. Xwhile (<of>) {
  468. X    (3 .. 5) && $foo .= $_;
  469. X}
  470. X$x = ($foo =~ y/\n/\n/);
  471. X
  472. Xif ($x eq 3) {print "ok 8\n";} else {print "not ok 8 $x:$foo:\n";}
  473. !STUFFY!FUNK!
  474. echo Extracting eg/dus
  475. sed >eg/dus <<'!STUFFY!FUNK!' -e 's/X//'
  476. X#!/usr/bin/perl
  477. X
  478. X# $Header: dus,v 4.0 91/03/20 01:09:20 lwall Locked $
  479. X
  480. X# This script does a du -s on any directories in the current directory that
  481. X# are not mount points for another filesystem.
  482. X
  483. X($mydev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  484. X   $blksize,$blocks) = stat('.');
  485. X
  486. Xopen(ls,'ls -F1|');
  487. X
  488. Xwhile (<ls>) {
  489. X    chop;
  490. X    next unless s|/$||;
  491. X    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  492. X       $blksize,$blocks) = stat($_);
  493. X    next unless $dev == $mydev;
  494. X    push(@ary,$_);
  495. X}
  496. X
  497. Xexec 'du', '-s', @ary;
  498. !STUFFY!FUNK!
  499. echo Extracting lib/abbrev.pl
  500. sed >lib/abbrev.pl <<'!STUFFY!FUNK!' -e 's/X//'
  501. X;# Usage:
  502. X;#    %foo = ();
  503. X;#    &abbrev(*foo,LIST);
  504. X;#    ...
  505. X;#    $long = $foo{$short};
  506. X
  507. Xpackage abbrev;
  508. X
  509. Xsub main'abbrev {
  510. X    local(*domain) = @_;
  511. X    shift(@_);
  512. X    @cmp = @_;
  513. X    local($[) = 0;
  514. X    foreach $name (@_) {
  515. X    @extra = split(//,$name);
  516. X    $abbrev = shift(@extra);
  517. X    $len = 1;
  518. X    foreach $cmp (@cmp) {
  519. X        next if $cmp eq $name;
  520. X        while (substr($cmp,0,$len) eq $abbrev) {
  521. X        $abbrev .= shift(@extra);
  522. X        ++$len;
  523. X        }
  524. X    }
  525. X    $domain{$abbrev} = $name;
  526. X    while ($#extra >= 0) {
  527. X        $abbrev .= shift(@extra);
  528. X        $domain{$abbrev} = $name;
  529. X    }
  530. X    }
  531. X}
  532. X
  533. X1;
  534. !STUFFY!FUNK!
  535. echo Extracting t/op/chop.t
  536. sed >t/op/chop.t <<'!STUFFY!FUNK!' -e 's/X//'
  537. X#!./perl
  538. X
  539. X# $Header: chop.t,v 4.0 91/03/20 01:51:42 lwall Locked $
  540. X
  541. Xprint "1..4\n";
  542. X
  543. X# optimized
  544. X
  545. X$_ = 'abc';
  546. X$c = do foo();
  547. Xif ($c . $_ eq 'cab') {print "ok 1\n";} else {print "not ok 1 $c$_\n";}
  548. X
  549. X# unoptimized
  550. X
  551. X$_ = 'abc';
  552. X$c = chop($_);
  553. Xif ($c . $_ eq 'cab') {print "ok 2\n";} else {print "not ok 2\n";}
  554. X
  555. Xsub foo {
  556. X    chop;
  557. X}
  558. X
  559. X@foo = ("hi \n","there\n","!\n");
  560. X@bar = @foo;
  561. Xchop(@bar);
  562. Xprint join('',@bar) eq 'hi there!' ? "ok 3\n" : "not ok 3\n";
  563. X
  564. X$foo = "\n";
  565. Xchop($foo,@foo);
  566. Xprint join('',$foo,@foo) eq 'hi there!' ? "ok 4\n" : "not ok 4\n";
  567. !STUFFY!FUNK!
  568. echo Extracting h2pl/cbreak2.pl
  569. sed >h2pl/cbreak2.pl <<'!STUFFY!FUNK!' -e 's/X//'
  570. X$sgttyb_t   = 'C4 S';
  571. X
  572. Xsub cbreak {
  573. X    &set_cbreak(1);
  574. X}
  575. X
  576. Xsub cooked {
  577. X    &set_cbreak(0);
  578. X}
  579. X
  580. Xsub set_cbreak {
  581. X    local($on) = @_;
  582. X
  583. X    require 'sys/ioctl.pl';
  584. X
  585. X    ioctl(STDIN,$TIOCGETP,$sgttyb)
  586. X        || die "Can't ioctl TIOCGETP: $!";
  587. X
  588. X    @ary = unpack($sgttyb_t,$sgttyb);
  589. X    if ($on) {
  590. X        $ary[4] |= $CBREAK;
  591. X        $ary[4] &= ~$ECHO;
  592. X    } else {
  593. X        $ary[4] &= ~$CBREAK;
  594. X        $ary[4] |= $ECHO;
  595. X    }
  596. X    $sgttyb = pack($sgttyb_t,@ary);
  597. X    ioctl(STDIN,$TIOCSETP,$sgttyb)
  598. X            || die "Can't ioctl TIOCSETP: $!";
  599. X
  600. X}
  601. X
  602. X1;
  603. !STUFFY!FUNK!
  604. echo Extracting gettest
  605. sed >gettest <<'!STUFFY!FUNK!' -e 's/X//'
  606. X#!./perl
  607. X
  608. X    while (($name,$aliases,$addrtype,$length,@addrs) = gethostent) {
  609. X    print $name,' ',$aliases,
  610. X      sprintf(" %d.%d.%d.%d\n",unpack('CCCC',$addrs[0]));
  611. X    last if $i++ > 50;
  612. X    }
  613. X    <stdin>;
  614. X    while (($name,$aliases,$addrtype,$net) = getnetent) {
  615. X    print "$name $aliases $addrtype ",sprintf("%08lx",$net),"\n";
  616. X    }
  617. X    <stdin>;
  618. X    while (($name,$aliases,$proto) = getprotoent) {
  619. X    print "$name $aliases $proto\n";
  620. X    }
  621. X    <stdin>;
  622. X    while (($name,$aliases,$port,$proto) = getservent) {
  623. X    print "$name $aliases $port $proto\n";
  624. X    }
  625. X
  626. !STUFFY!FUNK!
  627. echo Extracting t/io/dup.t
  628. sed >t/io/dup.t <<'!STUFFY!FUNK!' -e 's/X//'
  629. X#!./perl
  630. X
  631. X# $Header: dup.t,v 4.0 91/03/20 01:50:49 lwall Locked $
  632. X
  633. Xprint "1..6\n";
  634. X
  635. Xprint "ok 1\n";
  636. X
  637. Xopen(dupout,">&STDOUT");
  638. Xopen(duperr,">&STDERR");
  639. X
  640. Xopen(STDOUT,">Io.dup") || die "Can't open stdout";
  641. Xopen(STDERR,">&STDOUT") || die "Can't open stderr";
  642. X
  643. Xselect(STDERR); $| = 1;
  644. Xselect(STDOUT); $| = 1;
  645. X
  646. Xprint STDOUT "ok 2\n";
  647. Xprint STDERR "ok 3\n";
  648. Xsystem 'echo ok 4';
  649. Xsystem 'echo ok 5 1>&2';
  650. X
  651. Xclose(STDOUT);
  652. Xclose(STDERR);
  653. X
  654. Xopen(STDOUT,">&dupout");
  655. Xopen(STDERR,">&duperr");
  656. X
  657. Xsystem 'cat Io.dup';
  658. Xunlink 'Io.dup';
  659. X
  660. Xprint STDOUT "ok 6\n";
  661. !STUFFY!FUNK!
  662. echo Extracting os2/perl.cs
  663. sed >os2/perl.cs <<'!STUFFY!FUNK!' -e 's/X//'
  664. X(-W1 -Od -Olt -DDEBUGGING -Gt2048
  665. Xarray.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c form.c
  666. Xhash.c perl.c perly.c regcomp.c regexec.c stab.c str.c util.c
  667. X)
  668. X(-W1 -Od -Olt -B2C2L -B3C3L -DDEBUGGING eval.c{evalargs.xc} toke.c)
  669. X(-W1 -Od -Olt -I. -Ios2
  670. Xos2\os2.c os2\popen.c os2\mktemp.c os2\director.c os2\suffix.c os2\alarm.c
  671. X)
  672. X
  673. X; link with this library if you have GNU gdbm for OS/2
  674. X; remember to enable the NDBM symbol in config.h before compiling
  675. Xlgdbm.lib
  676. Xsetargv.obj
  677. Xos2\perl.def
  678. Xos2\perl.bad
  679. Xperl.exe
  680. X
  681. X-AL -LB -S0x8000
  682. !STUFFY!FUNK!
  683. echo Extracting t/cmd/elsif.t
  684. sed >t/cmd/elsif.t <<'!STUFFY!FUNK!' -e 's/X//'
  685. X#!./perl
  686. X
  687. X# $Header: elsif.t,v 4.0 91/03/20 01:49:21 lwall Locked $
  688. X
  689. Xsub foo {
  690. X    if ($_[0] == 1) {
  691. X    1;
  692. X    }
  693. X    elsif ($_[0] == 2) {
  694. X    2;
  695. X    }
  696. X    elsif ($_[0] == 3) {
  697. X    3;
  698. X    }
  699. X    else {
  700. X    4;
  701. X    }
  702. X}
  703. X
  704. Xprint "1..4\n";
  705. X
  706. Xif (($x = do foo(1)) == 1) {print "ok 1\n";} else {print "not ok 1 '$x'\n";}
  707. Xif (($x = do foo(2)) == 2) {print "ok 2\n";} else {print "not ok 2 '$x'\n";}
  708. Xif (($x = do foo(3)) == 3) {print "ok 3\n";} else {print "not ok 3 '$x'\n";}
  709. Xif (($x = do foo(4)) == 4) {print "ok 4\n";} else {print "not ok 4 '$x'\n";}
  710. !STUFFY!FUNK!
  711. echo Extracting t/comp/script.t
  712. sed >t/comp/script.t <<'!STUFFY!FUNK!' -e 's/X//'
  713. X#!./perl
  714. X
  715. X# $Header: script.t,v 4.0 91/03/20 01:50:26 lwall Locked $
  716. X
  717. Xprint "1..3\n";
  718. X
  719. X$x = `./perl -e 'print "ok\n";'`;
  720. X
  721. Xif ($x eq "ok\n") {print "ok 1\n";} else {print "not ok 1\n";}
  722. X
  723. Xopen(try,">Comp.script") || (die "Can't open temp file.");
  724. Xprint try 'print "ok\n";'; print try "\n";
  725. Xclose try;
  726. X
  727. X$x = `./perl Comp.script`;
  728. X
  729. Xif ($x eq "ok\n") {print "ok 2\n";} else {print "not ok 2\n";}
  730. X
  731. X$x = `./perl <Comp.script`;
  732. X
  733. Xif ($x eq "ok\n") {print "ok 3\n";} else {print "not ok 3\n";}
  734. X
  735. X`/bin/rm -f Comp.script`;
  736. !STUFFY!FUNK!
  737. echo Extracting t/comp/decl.t
  738. sed >t/comp/decl.t <<'!STUFFY!FUNK!' -e 's/X//'
  739. X#!./perl
  740. X
  741. X# $Header: decl.t,v 4.0 91/03/20 01:50:09 lwall Locked $
  742. X
  743. X# check to see if subroutine declarations work everwhere
  744. X
  745. Xsub one {
  746. X    print "ok 1\n";
  747. X}
  748. Xformat one =
  749. Xok 5
  750. X.
  751. X
  752. Xprint "1..7\n";
  753. X
  754. Xdo one();
  755. Xdo two();
  756. X
  757. Xsub two {
  758. X    print "ok 2\n";
  759. X}
  760. Xformat two =
  761. X@<<<
  762. X$foo
  763. X.
  764. X
  765. Xif ($x eq $x) {
  766. X    sub three {
  767. X    print "ok 3\n";
  768. X    }
  769. X    do three();
  770. X}
  771. X
  772. Xdo four();
  773. X$~ = 'one';
  774. Xwrite;
  775. X$~ = 'two';
  776. X$foo = "ok 6";
  777. Xwrite;
  778. X$~ = 'three';
  779. Xwrite;
  780. X
  781. Xformat three =
  782. Xok 7
  783. X.
  784. X
  785. Xsub four {
  786. X    print "ok 4\n";
  787. X}
  788. !STUFFY!FUNK!
  789. echo Extracting t/op/append.t
  790. sed >t/op/append.t <<'!STUFFY!FUNK!' -e 's/X//'
  791. X#!./perl
  792. X
  793. X# $Header: append.t,v 4.0 91/03/20 01:51:23 lwall Locked $
  794. X
  795. Xprint "1..3\n";
  796. X
  797. X$a = 'ab' . 'c';    # compile time
  798. X$b = 'def';
  799. X
  800. X$c = $a . $b;
  801. Xprint "#1\t:$c: eq :abcdef:\n";
  802. Xif ($c eq 'abcdef') {print "ok 1\n";} else {print "not ok 1\n";}
  803. X
  804. X$c .= 'xyz';
  805. Xprint "#2\t:$c: eq :abcdefxyz:\n";
  806. Xif ($c eq 'abcdefxyz') {print "ok 2\n";} else {print "not ok 2\n";}
  807. X
  808. X$_ = $a;
  809. X$_ .= $b;
  810. Xprint "#3\t:$_: eq :abcdef:\n";
  811. Xif ($_ eq 'abcdef') {print "ok 3\n";} else {print "not ok 3\n";}
  812. !STUFFY!FUNK!
  813. echo Extracting eg/down
  814. sed >eg/down <<'!STUFFY!FUNK!' -e 's/X//'
  815. X#!/usr/bin/perl
  816. X
  817. X$| = 1;
  818. Xif ($#ARGV >= 0) {
  819. X    $cmd = join(' ',@ARGV);
  820. X}
  821. Xelse {
  822. X    print "Command: ";
  823. X    $cmd = <stdin>;
  824. X    chop($cmd);
  825. X    while ($cmd =~ s/\\$//) {
  826. X    print "+ ";
  827. X    $cmd .= <stdin>;
  828. X    chop($cmd);
  829. X    }
  830. X}
  831. X$cwd = `pwd`; chop($cwd);
  832. X
  833. Xopen(FIND,'find . -type d -print|') || die "Can't run find";
  834. X
  835. Xwhile (<FIND>) {
  836. X    chop;
  837. X    unless (chdir $_) {
  838. X    print stderr "Can't cd to $_\n";
  839. X    next;
  840. X    }
  841. X    print "\t--> ",$_,"\n";
  842. X    system $cmd;
  843. X    chdir $cwd;
  844. X}
  845. !STUFFY!FUNK!
  846. echo Extracting t/op/glob.t
  847. sed >t/op/glob.t <<'!STUFFY!FUNK!' -e 's/X//'
  848. X#!./perl
  849. X
  850. X# $Header: glob.t,v 4.0 91/03/20 01:52:49 lwall Locked $
  851. X
  852. Xprint "1..4\n";
  853. X
  854. X@ops = <op/*>;
  855. X$list = join(' ',@ops);
  856. X
  857. Xchop($otherway = `echo op/*`);
  858. X
  859. Xprint $list eq $otherway ? "ok 1\n" : "not ok 1\n$list\n$otherway\n";
  860. X
  861. Xprint $/ eq "\n" ? "ok 2\n" : "not ok 2\n";
  862. X
  863. Xwhile (<jskdfjskdfj* op/* jskdjfjkosvk*>) {
  864. X    $not = "not " unless $_ eq shift @ops;
  865. X    $not = "not at all " if $/ eq "\0";
  866. X}
  867. Xprint "${not}ok 3\n";
  868. X
  869. Xprint $/ eq "\n" ? "ok 4\n" : "not ok 4\n";
  870. !STUFFY!FUNK!
  871. echo Extracting t/op/mkdir.t
  872. sed >t/op/mkdir.t <<'!STUFFY!FUNK!' -e 's/X//'
  873. X#!./perl
  874. X
  875. X# $Header: mkdir.t,v 4.0 91/03/20 01:53:39 lwall Locked $
  876. X
  877. Xprint "1..7\n";
  878. X
  879. X`rm -rf blurfl`;
  880. X
  881. Xprint (mkdir('blurfl',0777) ? "ok 1\n" : "not ok 1\n");
  882. Xprint (mkdir('blurfl',0777) ? "not ok 2\n" : "ok 2\n");
  883. Xprint ($! =~ /exist/ ? "ok 3\n" : "not ok 3\n");
  884. Xprint (-d 'blurfl' ? "ok 4\n" : "not ok 4\n");
  885. Xprint (rmdir('blurfl') ? "ok 5\n" : "not ok 5\n");
  886. Xprint (rmdir('blurfl') ? "not ok 6\n" : "ok 6\n");
  887. Xprint ($! =~ /such|exist/ ? "ok 7\n" : "not ok 7\n");
  888. !STUFFY!FUNK!
  889. echo Extracting t/io/inplace.t
  890. sed >t/io/inplace.t <<'!STUFFY!FUNK!' -e 's/X//'
  891. X#!./perl
  892. X
  893. X$^I = '.bak';
  894. X
  895. X# $Header: inplace.t,v 4.0 91/03/20 01:50:59 lwall Locked $
  896. X
  897. Xprint "1..2\n";
  898. X
  899. X@ARGV = ('.a','.b','.c');
  900. X`echo foo | tee .a .b .c`;
  901. Xwhile (<>) {
  902. X    s/foo/bar/;
  903. X}
  904. Xcontinue {
  905. X    print;
  906. X}
  907. X
  908. Xif (`cat .a .b .c` eq "bar\nbar\nbar\n") {print "ok 1\n";} else {print "not ok 1\n";}
  909. Xif (`cat .a.bak .b.bak .c.bak` eq "foo\nfoo\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";}
  910. X
  911. Xunlink '.a', '.b', '.c', '.a.bak', '.b.bak', '.c.bak';
  912. !STUFFY!FUNK!
  913. echo Extracting t/io/print.t
  914. sed >t/io/print.t <<'!STUFFY!FUNK!' -e 's/X//'
  915. X#!./perl
  916. X
  917. X# $Header: print.t,v 4.0 91/03/20 01:51:08 lwall Locked $
  918. X
  919. Xprint "1..16\n";
  920. X
  921. X$foo = 'STDOUT';
  922. Xprint $foo "ok 1\n";
  923. X
  924. Xprint "ok 2\n","ok 3\n","ok 4\n";
  925. Xprint STDOUT "ok 5\n";
  926. X
  927. Xopen(foo,">-");
  928. Xprint foo "ok 6\n";
  929. X
  930. Xprintf "ok %d\n",7;
  931. Xprintf("ok %d\n",8);
  932. X
  933. X@a = ("ok %d%c",9,ord("\n"));
  934. Xprintf @a;
  935. X
  936. X$a[1] = 10;
  937. Xprintf STDOUT @a;
  938. X
  939. X$, = ' ';
  940. X$\ = "\n";
  941. X
  942. Xprint "ok","11";
  943. X
  944. X@x = ("ok","12\nok","13\nok");
  945. X@y = ("15\nok","16");
  946. Xprint @x,"14\nok",@y;
  947. !STUFFY!FUNK!
  948. echo Extracting eg/van/vanexp
  949. sed >eg/van/vanexp <<'!STUFFY!FUNK!' -e 's/X//'
  950. X#!/usr/bin/perl
  951. X
  952. X# $Header: vanexp,v 4.0 91/03/20 01:15:54 lwall Locked $
  953. X
  954. X# This is for running from a find at night to expire old .deleteds
  955. X
  956. X$can = $ARGV[0];
  957. X
  958. Xexit 1 unless $can =~ /.deleted$/;
  959. X
  960. X($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  961. X   $blksize,$blocks) = stat($can);
  962. X
  963. Xexit 0 unless $size;
  964. X
  965. Xif (time - $mtime > 2 * 24 * 60 * 60) {
  966. X    `/bin/rm -rf $can`;
  967. X}
  968. Xelse {
  969. X    `find $can -ctime +2 -exec rm -f {} \;`;
  970. X}
  971. !STUFFY!FUNK!
  972. echo Extracting eg/who
  973. sed >eg/who <<'!STUFFY!FUNK!' -e 's/X//'
  974. X#!/usr/bin/perl
  975. X# This assumes your /etc/utmp file looks like ours
  976. Xopen(UTMP,'/etc/utmp');
  977. X@mo = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec);
  978. Xwhile (read(UTMP,$utmp,36)) {
  979. X    ($line,$name,$host,$time) = unpack('A8A8A16l',$utmp);
  980. X    if ($name) {
  981. X    $host = "($host)" if $host;
  982. X    ($sec,$min,$hour,$mday,$mon) = localtime($time);
  983. X    printf "%-9s%-8s%s %2d %02d:%02d   %s\n",
  984. X      $name,$line,$mo[$mon],$mday,$hour,$min,$host;
  985. X    }
  986. X}   
  987. !STUFFY!FUNK!
  988. echo Extracting eg/g/ged
  989. sed >eg/g/ged <<'!STUFFY!FUNK!' -e 's/X//'
  990. X#!/usr/bin/perl
  991. X
  992. X# $Header: ged,v 4.0 91/03/20 01:10:22 lwall Locked $
  993. X
  994. X# Does inplace edits on a set of files on a set of machines.
  995. X#
  996. X# Typical invokation:
  997. X#
  998. X#    ged vax+sun /etc/passwd
  999. X#    s/Freddy/Freddie/;
  1000. X#    ^D
  1001. X#
  1002. X
  1003. X$class = shift;
  1004. X$files = join(' ',@ARGV);
  1005. X
  1006. Xdie "Usage: ged class files <perlcmds\n" unless $files;
  1007. X
  1008. Xexec "gsh", $class, "-d", "perl -pi.bak - $files";
  1009. X
  1010. Xdie "Couldn't execute gsh for some reason, stopped";
  1011. !STUFFY!FUNK!
  1012. echo Extracting x2p/EXTERN.h
  1013. sed >x2p/EXTERN.h <<'!STUFFY!FUNK!' -e 's/X//'
  1014. X/* $Header: EXTERN.h,v 4.0 91/03/20 01:56:53 lwall Locked $
  1015. X *
  1016. X *    Copyright (c) 1989, Larry Wall
  1017. X *
  1018. X *    You may distribute under the terms of the GNU General Public License
  1019. X *    as specified in the README file that comes with the perl 3.0 kit.
  1020. X *
  1021. X * $Log:    EXTERN.h,v $
  1022. X * Revision 4.0  91/03/20  01:56:53  lwall
  1023. X * 4.0 baseline.
  1024. X * 
  1025. X */
  1026. X
  1027. X#undef EXT
  1028. X#define EXT extern
  1029. X
  1030. X#undef INIT
  1031. X#define INIT(x)
  1032. X
  1033. X#undef DOINIT
  1034. !STUFFY!FUNK!
  1035. echo Extracting EXTERN.h
  1036. sed >EXTERN.h <<'!STUFFY!FUNK!' -e 's/X//'
  1037. X/* $Header: EXTERN.h,v 4.0 91/03/20 00:58:26 lwall Locked $
  1038. X *
  1039. X *    Copyright (c) 1989, Larry Wall
  1040. X *
  1041. X *    You may distribute under the terms of the GNU General Public License
  1042. X *    as specified in the README file that comes with the perl 3.0 kit.
  1043. X *
  1044. X * $Log:    EXTERN.h,v $
  1045. X * Revision 4.0  91/03/20  00:58:26  lwall
  1046. X * 4.0 baseline.
  1047. X * 
  1048. X */
  1049. X
  1050. X#undef EXT
  1051. X#define EXT extern
  1052. X
  1053. X#undef INIT
  1054. X#define INIT(x)
  1055. X
  1056. X#undef DOINIT
  1057. !STUFFY!FUNK!
  1058. echo Extracting os2/perlsh.cmd
  1059. sed >os2/perlsh.cmd <<'!STUFFY!FUNK!' -e 's/X//'
  1060. Xextproc perl -x
  1061. X#!perl
  1062. X
  1063. X# Poor man's perl shell.
  1064. X
  1065. X# Simply type two carriage returns every time you want to evaluate.
  1066. X# Note that it must be a complete perl statement--don't type double
  1067. X#  carriage return in the middle of a loop.
  1068. X
  1069. Xprint "Perl shell\n> ";
  1070. X
  1071. X$/ = '';    # set paragraph mode
  1072. X$SHlinesep = "\n";
  1073. X
  1074. Xwhile ($SHcmd = <>) {
  1075. X    $/ = $SHlinesep;
  1076. X    eval $SHcmd; print $@ || "\n> ";
  1077. X    $SHlinesep = $/; $/ = '';
  1078. X}
  1079. !STUFFY!FUNK!
  1080. echo Extracting x2p/INTERN.h
  1081. sed >x2p/INTERN.h <<'!STUFFY!FUNK!' -e 's/X//'
  1082. X/* $Header: INTERN.h,v 4.0 91/03/20 01:56:58 lwall Locked $
  1083. X *
  1084. X *    Copyright (c) 1989, Larry Wall
  1085. X *
  1086. X *    You may distribute under the terms of the GNU General Public License
  1087. X *    as specified in the README file that comes with the perl 3.0 kit.
  1088. X *
  1089. X * $Log:    INTERN.h,v $
  1090. X * Revision 4.0  91/03/20  01:56:58  lwall
  1091. X * 4.0 baseline.
  1092. X * 
  1093. X */
  1094. X
  1095. X#undef EXT
  1096. X#define EXT
  1097. X
  1098. X#undef INIT
  1099. X#define INIT(x) = x
  1100. X
  1101. X#define DOINIT
  1102. !STUFFY!FUNK!
  1103. echo Extracting INTERN.h
  1104. sed >INTERN.h <<'!STUFFY!FUNK!' -e 's/X//'
  1105. X/* $Header: INTERN.h,v 4.0 91/03/20 00:58:35 lwall Locked $
  1106. X *
  1107. X *    Copyright (c) 1989, Larry Wall
  1108. X *
  1109. X *    You may distribute under the terms of the GNU General Public License
  1110. X *    as specified in the README file that comes with the perl 3.0 kit.
  1111. X *
  1112. X * $Log:    INTERN.h,v $
  1113. X * Revision 4.0  91/03/20  00:58:35  lwall
  1114. X * 4.0 baseline.
  1115. X * 
  1116. X */
  1117. X
  1118. X#undef EXT
  1119. X#define EXT
  1120. X
  1121. X#undef INIT
  1122. X#define INIT(x) = x
  1123. X
  1124. X#define DOINIT
  1125. !STUFFY!FUNK!
  1126. echo Extracting os2/mktemp.c
  1127. sed >os2/mktemp.c <<'!STUFFY!FUNK!' -e 's/X//'
  1128. X/* MKTEMP.C using TMP environment variable */
  1129. X
  1130. X#include <stdio.h>
  1131. X#include <stdlib.h>
  1132. X#include <string.h>
  1133. X#include <io.h>
  1134. X
  1135. Xvoid Mktemp(char *file)
  1136. X{
  1137. X  char fname[32], *tmp;
  1138. X
  1139. X  tmp = getenv("TMP");
  1140. X
  1141. X  if ( tmp != NULL )
  1142. X  {
  1143. X    strcpy(fname, file);
  1144. X    strcpy(file, tmp);
  1145. X
  1146. X    if ( file[strlen(file) - 1] != '\\' )
  1147. X      strcat(file, "\\");
  1148. X
  1149. X    strcat(file, fname);
  1150. X  }
  1151. X
  1152. X  mktemp(file);
  1153. X}
  1154. X
  1155. X/* End of MKTEMP.C */
  1156. !STUFFY!FUNK!
  1157. echo Extracting t/op/int.t
  1158. sed >t/op/int.t <<'!STUFFY!FUNK!' -e 's/X//'
  1159. X#!./perl
  1160. X
  1161. X# $Header: int.t,v 4.0 91/03/20 01:53:08 lwall Locked $
  1162. X
  1163. Xprint "1..4\n";
  1164. X
  1165. X# compile time evaluation
  1166. X
  1167. Xif (int(1.234) == 1) {print "ok 1\n";} else {print "not ok 1\n";}
  1168. X
  1169. Xif (int(-1.234) == -1) {print "ok 2\n";} else {print "not ok 2\n";}
  1170. X
  1171. X# run time evaluation
  1172. X
  1173. X$x = 1.234;
  1174. Xif (int($x) == 1) {print "ok 3\n";} else {print "not ok 3\n";}
  1175. Xif (int(-$x) == -1) {print "ok 4\n";} else {print "not ok 4\n";}
  1176. !STUFFY!FUNK!
  1177. echo Extracting h2pl/eg/sizeof.ph
  1178. sed >h2pl/eg/sizeof.ph <<'!STUFFY!FUNK!' -e 's/X//'
  1179. X$sizeof{'char'} = 1;
  1180. X$sizeof{'int'} = 4;
  1181. X$sizeof{'long'} = 4;
  1182. X$sizeof{'struct arpreq'} = 36;
  1183. X$sizeof{'struct ifconf'} = 8;
  1184. X$sizeof{'struct ifreq'} = 32;
  1185. X$sizeof{'struct ltchars'} = 6;
  1186. X$sizeof{'struct pcntl'} = 116;
  1187. X$sizeof{'struct rtentry'} = 52;
  1188. X$sizeof{'struct sgttyb'} = 6;
  1189. X$sizeof{'struct tchars'} = 6;
  1190. X$sizeof{'struct ttychars'} = 14;
  1191. X$sizeof{'struct winsize'} = 8;
  1192. X$sizeof{'struct termios'} = 132;
  1193. !STUFFY!FUNK!
  1194. echo Extracting t/base/cond.t
  1195. sed >t/base/cond.t <<'!STUFFY!FUNK!' -e 's/X//'
  1196. X#!./perl
  1197. X
  1198. X# $Header: cond.t,v 4.0 91/03/20 01:48:54 lwall Locked $
  1199. X
  1200. X# make sure conditional operators work
  1201. X
  1202. Xprint "1..4\n";
  1203. X
  1204. X$x = '0';
  1205. X
  1206. X$x eq $x && (print "ok 1\n");
  1207. X$x ne $x && (print "not ok 1\n");
  1208. X$x eq $x || (print "not ok 2\n");
  1209. X$x ne $x || (print "ok 2\n");
  1210. X
  1211. X$x == $x && (print "ok 3\n");
  1212. X$x != $x && (print "not ok 3\n");
  1213. X$x == $x || (print "not ok 4\n");
  1214. X$x != $x || (print "ok 4\n");
  1215. !STUFFY!FUNK!
  1216. echo Extracting usub/Makefile
  1217. sed >usub/Makefile <<'!STUFFY!FUNK!' -e 's/X//'
  1218. XSRC = /usr/local/src/perl
  1219. XGLOBINCS = 
  1220. XLOCINCS = 
  1221. XLIBS = -lcurses -ltermlib
  1222. X
  1223. Xcurseperl: $(SRC)/uperl.o usersub.o curses.o
  1224. X    cc $(SRC)/uperl.o usersub.o curses.o $(LIBS) -lm -o curseperl
  1225. X
  1226. Xusersub.o: usersub.c
  1227. X    cc -c -I$(SRC) $(GLOBINCS) -DDEBUGGING -g usersub.c
  1228. X
  1229. Xcurses.o: curses.c
  1230. X    cc -c -I$(SRC) $(GLOBINCS) -DDEBUGGING -g curses.c
  1231. X
  1232. Xcurses.c: curses.mus
  1233. X    mus curses.mus >curses.c
  1234. !STUFFY!FUNK!
  1235. echo Extracting lib/flush.pl
  1236. sed >lib/flush.pl <<'!STUFFY!FUNK!' -e 's/X//'
  1237. X;# Usage: &flush(FILEHANDLE)
  1238. X;# flushes the named filehandle
  1239. X
  1240. X;# Usage: &printflush(FILEHANDLE, "prompt: ")
  1241. X;# prints arguments and flushes filehandle
  1242. X
  1243. Xsub flush {
  1244. X    local($old) = select(shift);
  1245. X    $| = 1;
  1246. X    print "";
  1247. X    $| = 0;
  1248. X    select($old);
  1249. X}
  1250. X
  1251. Xsub printflush {
  1252. X    local($old) = select(shift);
  1253. X    $| = 1;
  1254. X    print @_;
  1255. X    $| = 0;
  1256. X    select($old);
  1257. X}
  1258. X
  1259. X1;
  1260. !STUFFY!FUNK!
  1261. echo Extracting t/op/groups.t
  1262. sed >t/op/groups.t <<'!STUFFY!FUNK!' -e 's/X//'
  1263. X#!./perl
  1264. X
  1265. Xif (! -x '/usr/ucb/groups') {
  1266. X    print "1..0\n";
  1267. X    exit 0;
  1268. X}
  1269. X
  1270. Xprint "1..1\n";
  1271. X
  1272. Xfor (split(' ', $()) {
  1273. X    next if $seen{$_}++;
  1274. X    push(@gr, (getgrgid($_))[0]); 
  1275. X} 
  1276. X$gr1 = join(' ',sort @gr);
  1277. X$gr2 = join(' ', sort split(' ',`groups`));
  1278. X#print "gr1 is <$gr1>\n";
  1279. X#print "gr2 is <$gr2>\n";
  1280. Xprint +($gr1 eq $gr2) ? "ok 1\n" : "not ok 1\n";
  1281. !STUFFY!FUNK!
  1282. echo Extracting lib/importenv.pl
  1283. sed >lib/importenv.pl <<'!STUFFY!FUNK!' -e 's/X//'
  1284. X;# $Header: importenv.pl,v 4.0 91/03/20 01:25:28 lwall Locked $
  1285. X
  1286. X;# This file, when interpreted, pulls the environment into normal variables.
  1287. X;# Usage:
  1288. X;#    require 'importenv.pl';
  1289. X;# or
  1290. X;#    #include <importenv.pl>
  1291. X
  1292. Xlocal($tmp,$key) = '';
  1293. X
  1294. Xforeach $key (keys(ENV)) {
  1295. X    $tmp .= "\$$key = \$ENV{'$key'};" if $key =~ /^[A-Za-z]\w*$/;
  1296. X}
  1297. Xeval $tmp;
  1298. X
  1299. X1;
  1300. !STUFFY!FUNK!
  1301. echo Extracting t/op/join.t
  1302. sed >t/op/join.t <<'!STUFFY!FUNK!' -e 's/X//'
  1303. X#!./perl
  1304. X
  1305. X# $Header: join.t,v 4.0 91/03/20 01:53:17 lwall Locked $
  1306. X
  1307. Xprint "1..3\n";
  1308. X
  1309. X@x = (1, 2, 3);
  1310. Xif (join(':',@x) eq '1:2:3') {print "ok 1\n";} else {print "not ok 1\n";}
  1311. X
  1312. Xif (join('',1,2,3) eq '123') {print "ok 2\n";} else {print "not ok 2\n";}
  1313. X
  1314. Xif (join(':',split(/ /,"1 2 3")) eq '1:2:3') {print "ok 3\n";} else {print "not ok 3\n";}
  1315. !STUFFY!FUNK!
  1316. echo Extracting usub/usersub.c
  1317. sed >usub/usersub.c <<'!STUFFY!FUNK!' -e 's/X//'
  1318. X/* $Header: usersub.c,v 4.0 91/03/20 01:56:34 lwall Locked $
  1319. X *
  1320. X * $Log:    usersub.c,v $
  1321. X * Revision 4.0  91/03/20  01:56:34  lwall
  1322. X * 4.0 baseline.
  1323. X * 
  1324. X * Revision 3.0.1.1  90/08/09  04:06:10  lwall
  1325. X * patch19: Initial revision
  1326. X * 
  1327. X */
  1328. X
  1329. X#include "EXTERN.h"
  1330. X#include "perl.h"
  1331. X
  1332. Xint
  1333. Xuserinit()
  1334. X{
  1335. X    init_curses();
  1336. X}
  1337. X
  1338. !STUFFY!FUNK!
  1339. echo Extracting h2pl/eg/sysexits.pl
  1340. sed >h2pl/eg/sysexits.pl <<'!STUFFY!FUNK!' -e 's/X//'
  1341. X$EX_OK = 0x0;
  1342. X$EX__BASE = 0x40;
  1343. X$EX_USAGE = 0x40;
  1344. X$EX_DATAERR = 0x41;
  1345. X$EX_NOINPUT = 0x42;
  1346. X$EX_NOUSER = 0x43;
  1347. X$EX_NOHOST = 0x44;
  1348. X$EX_UNAVAILABLE = 0x45;
  1349. X$EX_SOFTWARE = 0x46;
  1350. X$EX_OSERR = 0x47;
  1351. X$EX_OSFILE = 0x48;
  1352. X$EX_CANTCREAT = 0x49;
  1353. X$EX_IOERR = 0x4A;
  1354. X$EX_TEMPFAIL = 0x4B;
  1355. X$EX_PROTOCOL = 0x4C;
  1356. X$EX_NOPERM = 0x4D;
  1357. !STUFFY!FUNK!
  1358. echo Extracting t/op/unshift.t
  1359. sed >t/op/unshift.t <<'!STUFFY!FUNK!' -e 's/X//'
  1360. X#!./perl
  1361. X
  1362. X# $Header: unshift.t,v 4.0 91/03/20 01:55:21 lwall Locked $
  1363. X
  1364. Xprint "1..2\n";
  1365. X
  1366. X@a = (1,2,3);
  1367. X$cnt1 = unshift(a,0);
  1368. X
  1369. Xif (join(' ',@a) eq '0 1 2 3') {print "ok 1\n";} else {print "not ok 1\n";}
  1370. X$cnt2 = unshift(a,3,2,1);
  1371. Xif (join(' ',@a) eq '3 2 1 0 1 2 3') {print "ok 2\n";} else {print "not ok 2\n";}
  1372. X
  1373. X
  1374. !STUFFY!FUNK!
  1375. echo Extracting t/op/oct.t
  1376. sed >t/op/oct.t <<'!STUFFY!FUNK!' -e 's/X//'
  1377. X#!./perl
  1378. X
  1379. X# $Header: oct.t,v 4.0 91/03/20 01:53:43 lwall Locked $
  1380. X
  1381. Xprint "1..3\n";
  1382. X
  1383. Xif (oct('01234') == 01234) {print "ok 1\n";} else {print "not ok 1\n";}
  1384. Xif (oct('0x1234') == 0x1234) {print "ok 2\n";} else {print "not ok 2\n";}
  1385. Xif (hex('01234') == 0x1234) {print "ok 3\n";} else {print "not ok 3\n";}
  1386. !STUFFY!FUNK!
  1387. echo Extracting os2/eg/syscalls.pl
  1388. sed >os2/eg/syscalls.pl <<'!STUFFY!FUNK!' -e 's/X//'
  1389. X# OS/2 syscall values
  1390. X
  1391. X$OS2_GetVersion = 0;
  1392. X$OS2_Shutdown = 1;
  1393. X$OS2_Beep = 2;
  1394. X$OS2_PhysicalDisk = 3;
  1395. X$OS2_Config = 4;
  1396. X$OS2_IOCtl = 5;
  1397. X$OS2_QCurDisk = 6;
  1398. X$OS2_SelectDisk = 7;
  1399. X$OS2_SetMaxFH = 8;
  1400. X$OS2_Sleep = 9;
  1401. X$OS2_StartSession = 10;
  1402. X$OS2_StopSession = 11;
  1403. X$OS2_SelectSession = 12;
  1404. X1;
  1405. !STUFFY!FUNK!
  1406. echo Extracting t/op/ord.t
  1407. sed >t/op/ord.t <<'!STUFFY!FUNK!' -e 's/X//'
  1408. X#!./perl
  1409. X
  1410. X# $Header: ord.t,v 4.0 91/03/20 01:53:50 lwall Locked $
  1411. X
  1412. Xprint "1..2\n";
  1413. X
  1414. X# compile time evaluation
  1415. X
  1416. Xif (ord('A') == 65) {print "ok 1\n";} else {print "not ok 1\n";}
  1417. X
  1418. X# run time evaluation
  1419. X
  1420. X$x = 'ABC';
  1421. Xif (ord($x) == 65) {print "ok 2\n";} else {print "not ok 2\n";}
  1422. !STUFFY!FUNK!
  1423. echo Extracting msdos/glob.c
  1424. sed >msdos/glob.c <<'!STUFFY!FUNK!' -e 's/X//'
  1425. X/*
  1426. X * Globbing for MS-DOS.  Relies on the expansion done by the library
  1427. X * startup code. (dds)
  1428. X */
  1429. X
  1430. X#include <stdio.h>
  1431. X#include <string.h>
  1432. X
  1433. Xmain(int argc, char *argv[])
  1434. X{
  1435. X    register i;
  1436. X
  1437. X    for (i = 1; i < argc; i++) {
  1438. X        fputs(strlwr(argv[i]), stdout);
  1439. X        putchar(0);
  1440. X    }
  1441. X}
  1442. !STUFFY!FUNK!
  1443. echo Extracting t/base/if.t
  1444. sed >t/base/if.t <<'!STUFFY!FUNK!' -e 's/X//'
  1445. X#!./perl
  1446. X
  1447. X# $Header: if.t,v 4.0 91/03/20 01:49:03 lwall Locked $
  1448. X
  1449. Xprint "1..2\n";
  1450. X
  1451. X# first test to see if we can run the tests.
  1452. X
  1453. X$x = 'test';
  1454. Xif ($x eq $x) { print "ok 1\n"; } else { print "not ok 1\n";}
  1455. Xif ($x ne $x) { print "not ok 2\n"; } else { print "ok 2\n";}
  1456. !STUFFY!FUNK!
  1457. echo Extracting t/base/pat.t
  1458. sed >t/base/pat.t <<'!STUFFY!FUNK!' -e 's/X//'
  1459. X#!./perl
  1460. X
  1461. X# $Header: pat.t,v 4.0 91/03/20 01:49:12 lwall Locked $
  1462. X
  1463. Xprint "1..2\n";
  1464. X
  1465. X# first test to see if we can run the tests.
  1466. X
  1467. X$_ = 'test';
  1468. Xif (/^test/) { print "ok 1\n"; } else { print "not ok 1\n";}
  1469. Xif (/^foo/) { print "not ok 2\n"; } else { print "ok 2\n";}
  1470. !STUFFY!FUNK!
  1471. echo Extracting t/op/cond.t
  1472. sed >t/op/cond.t <<'!STUFFY!FUNK!' -e 's/X//'
  1473. X#!./perl
  1474. X
  1475. X# $Header: cond.t,v 4.0 91/03/20 01:51:47 lwall Locked $
  1476. X
  1477. Xprint "1..4\n";
  1478. X
  1479. Xprint 1 ? "ok 1\n" : "not ok 1\n";    # compile time
  1480. Xprint 0 ? "not ok 2\n" : "ok 2\n";
  1481. X
  1482. X$x = 1;
  1483. Xprint $x ? "ok 3\n" : "not ok 3\n";    # run time
  1484. Xprint !$x ? "not ok 4\n" : "ok 4\n";
  1485. !STUFFY!FUNK!
  1486. echo Extracting h2pl/getioctlsizes
  1487. sed >h2pl/getioctlsizes <<'!STUFFY!FUNK!' -e 's/X//'
  1488. X#!/usr/bin/perl
  1489. X
  1490. Xopen (IOCTLS,'/usr/include/sys/ioctl.h') || die "ioctl open failed";
  1491. X
  1492. Xwhile (<IOCTLS>) {
  1493. X    if (/^\s*#\s*define\s+\w+\s+_IO(R|W|WR)\(\w+,\s*\w+,\s*([^)]+)/) {
  1494. X    $need{$2}++;
  1495. X    } 
  1496. X}
  1497. X
  1498. Xforeach $key ( sort keys %need ) {
  1499. X    print $key,"\n";
  1500. X} 
  1501. !STUFFY!FUNK!
  1502. echo Extracting os2/eg/alarm.pl
  1503. sed >os2/eg/alarm.pl <<'!STUFFY!FUNK!' -e 's/X//'
  1504. Xsub handler {
  1505. X  local($sig) = @_;
  1506. X  print "Caught a SIG$sig -- shutting down\n";
  1507. X  exit(0);
  1508. X}
  1509. X
  1510. X$SIG{'INT'} = 'handler';
  1511. X$SIG{'QUIT'} = 'handler';
  1512. X$SIG{'ALRM'} = 'handler';
  1513. X
  1514. Xprint "Starting execution ...\n";
  1515. Xalarm(10);
  1516. X
  1517. Xwhile ( <> ) {
  1518. X}
  1519. Xprint "Normal exit.\n";
  1520. !STUFFY!FUNK!
  1521. echo Extracting t/op/sprintf.t
  1522. sed >t/op/sprintf.t <<'!STUFFY!FUNK!' -e 's/X//'
  1523. X#!./perl
  1524. X
  1525. X# $Header: sprintf.t,v 4.0 91/03/20 01:54:46 lwall Locked $
  1526. X
  1527. Xprint "1..1\n";
  1528. X
  1529. X$x = sprintf("%3s %-4s%%foo %5d%c%3.1f","hi",123,456,65,3.0999);
  1530. Xif ($x eq ' hi 123 %foo   456A3.1') {print "ok 1\n";} else {print "not ok 1 '$x'\n";}
  1531. !STUFFY!FUNK!
  1532. echo Extracting eg/ADB
  1533. sed >eg/ADB <<'!STUFFY!FUNK!' -e 's/X//'
  1534. X#!/usr/bin/perl
  1535. X
  1536. X# $Header: ADB,v 4.0 91/03/20 01:08:34 lwall Locked $
  1537. X
  1538. X# This script is only useful when used in your crash directory.
  1539. X
  1540. X$num = shift;
  1541. Xexec 'adb', '-k', "vmunix.$num", "vmcore.$num";
  1542. !STUFFY!FUNK!
  1543. echo Extracting hints/sunos_4_0_1.sh
  1544. sed >hints/sunos_4_0_1.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1545. Xecho ': work around botch in SunOS 4.0.1 and 4.0.2'    >>../perl.h
  1546. Xecho '#ifndef fputs'                    >>../perl.h
  1547. Xecho '#define fputs(str,fp) fprintf(fp,"%s",str)'    >>../perl.h
  1548. Xecho '#endif'                        >>../perl.h
  1549. !STUFFY!FUNK!
  1550. echo Extracting hints/sunos_4_0_2.sh
  1551. sed >hints/sunos_4_0_2.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1552. Xecho ': work around botch in SunOS 4.0.1 and 4.0.2'    >>../perl.h
  1553. Xecho '#ifndef fputs'                    >>../perl.h
  1554. Xecho '#define fputs(str,fp) fprintf(fp,"%s",str)'    >>../perl.h
  1555. Xecho '#endif'                        >>../perl.h
  1556. !STUFFY!FUNK!
  1557. echo Extracting h2pl/tcbreak
  1558. sed >h2pl/tcbreak <<'!STUFFY!FUNK!' -e 's/X//'
  1559. X#!/usr/bin/perl
  1560. X
  1561. Xrequire 'cbreak.pl';
  1562. X
  1563. X&cbreak;
  1564. X
  1565. X$| = 1;
  1566. X
  1567. Xprint "gimme a char: ";
  1568. X
  1569. X$c = getc;
  1570. X
  1571. Xprint "$c\n";
  1572. X
  1573. Xprintf "you gave me `%s', which is 0x%02x\n", $c, ord($c);
  1574. X
  1575. X&cooked;
  1576. !STUFFY!FUNK!
  1577. echo Extracting t/op/sleep.t
  1578. sed >t/op/sleep.t <<'!STUFFY!FUNK!' -e 's/X//'
  1579. X#!./perl
  1580. X
  1581. X# $Header: sleep.t,v 4.0 91/03/20 01:54:34 lwall Locked $
  1582. X
  1583. Xprint "1..1\n";
  1584. X
  1585. X$x = sleep 2;
  1586. Xif ($x >= 2 && $x <= 10) {print "ok 1\n";} else {print "not ok 1 $x\n";}
  1587. !STUFFY!FUNK!
  1588. echo Extracting eg/rmfrom
  1589. sed >eg/rmfrom <<'!STUFFY!FUNK!' -e 's/X//'
  1590. X#!/usr/bin/perl -n
  1591. X
  1592. X# $Header: rmfrom,v 4.0 91/03/20 01:12:02 lwall Locked $
  1593. X
  1594. X# A handy (but dangerous) script to put after a find ... -print.
  1595. X
  1596. Xchop; unlink;
  1597. !STUFFY!FUNK!
  1598. echo Extracting hints/hpux.sh
  1599. sed >hints/hpux.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1600. Xd_syscall=$undef
  1601. Xecho " "
  1602. Xecho "NOTE: regression test op.read may fail due to an NFS bug in HP/UX."
  1603. Xecho "If so, don't worry about it."
  1604. !STUFFY!FUNK!
  1605. echo Extracting hints/sgi.sh
  1606. sed >hints/sgi.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1607. Xoptimize='-O0'
  1608. Xusemymalloc='y'
  1609. Xmallocsrc='malloc.c'
  1610. Xmallocobj='malloc.o'
  1611. Xccflags="$ccflags -Uf_next"
  1612. Xd_voidsig=define
  1613. Xd_vfork=undef
  1614. !STUFFY!FUNK!
  1615. echo Extracting os2/a2p.cs
  1616. sed >os2/a2p.cs <<'!STUFFY!FUNK!' -e 's/X//'
  1617. X(-W1 -Od -Ocgelt a2p.y{a2py.c})
  1618. X(-W1 -Od -Ocgelt hash.c str.c util.c walk.c)
  1619. X
  1620. Xsetargv.obj
  1621. X..\os2\a2p.def
  1622. Xa2p.exe
  1623. X
  1624. X-AL -LB -S0x9000
  1625. !STUFFY!FUNK!
  1626. echo Extracting os2/selfrun.cmd
  1627. sed >os2/selfrun.cmd <<'!STUFFY!FUNK!' -e 's/X//'
  1628. Xextproc perl -x
  1629. X#!perl
  1630. X
  1631. Xprintf "
  1632. XThis is a self-running perl script using the
  1633. Xextproc feature of the OS/2 command processor.
  1634. X"
  1635. !STUFFY!FUNK!
  1636. echo Extracting os2/perlglob.cs
  1637. sed >os2/perlglob.cs <<'!STUFFY!FUNK!' -e 's/X//'
  1638. Xos2\glob.c
  1639. X(-DPERLGLOB os2\director.c)
  1640. X
  1641. Xsetargv.obj
  1642. Xos2\perlglob.def
  1643. Xos2\perlglob.bad
  1644. Xperlglob.exe
  1645. X
  1646. X-AS -LB -S0x1000
  1647. !STUFFY!FUNK!
  1648. echo Extracting os2/selfrun.bat
  1649. sed >os2/selfrun.bat <<'!STUFFY!FUNK!' -e 's/X//'
  1650. X@echo off
  1651. Xperl -x %0.bat
  1652. Xgoto exit
  1653. X#!perl
  1654. X
  1655. Xprintf "
  1656. XThis is a self-running perl script for DOS.
  1657. X
  1658. X"
  1659. X
  1660. X__END__
  1661. X:exit
  1662. !STUFFY!FUNK!
  1663. echo Extracting hints/mips.sh
  1664. sed >hints/mips.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1665. Xoptimize='-g'
  1666. Xd_volatile=undef
  1667. Xd_castneg=undef
  1668. Xcc=cc
  1669. Xlibpth="/usr/lib/cmplrs/cc $libpth"
  1670. Xgroupstype=int
  1671. !STUFFY!FUNK!
  1672. echo Extracting os2/perl.bad
  1673. sed >os2/perl.bad <<'!STUFFY!FUNK!' -e 's/X//'
  1674. XDOSMAKEPIPE
  1675. XDOSCWAIT
  1676. XDOSKILLPROCESS
  1677. XDOSFLAGPROCESS
  1678. XDOSSETPRTY
  1679. XDOSGETPRTY
  1680. XDOSQFSATTACH
  1681. XDOSCREATETHREAD
  1682. !STUFFY!FUNK!
  1683. echo Extracting hints/next.sh
  1684. sed >hints/next.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1685. X: Just disable defaulting to -fpcc-struct-return, since gcc is native compiler.
  1686. Xccflags="$ccflags "
  1687. !STUFFY!FUNK!
  1688. echo Extracting os2/perlglob.def
  1689. sed >os2/perlglob.def <<'!STUFFY!FUNK!' -e 's/X//'
  1690. XNAME PERLGLOB WINDOWCOMPAT NEWFILES
  1691. XDESCRIPTION 'Filename globbing for PERL - for MS-DOS and OS/2'
  1692. !STUFFY!FUNK!
  1693. echo Extracting os2/a2p.def
  1694. sed >os2/a2p.def <<'!STUFFY!FUNK!' -e 's/X//'
  1695. XNAME AWK2PERL WINDOWCOMPAT NEWFILES
  1696. XDESCRIPTION 'AWK to PERL translator - for MS-DOS and OS/2'
  1697. !STUFFY!FUNK!
  1698. echo Extracting hints/sco_3.sh
  1699. sed >hints/sco_3.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1700. Xyacc='/usr/bin/yacc -Sm11000'
  1701. Xlibswanted=`echo $libswanted | sed 's/ x / /'`
  1702. Xi_varargs=undef
  1703. !STUFFY!FUNK!
  1704. echo Extracting os2/perl.def
  1705. sed >os2/perl.def <<'!STUFFY!FUNK!' -e 's/X//'
  1706. XNAME PERL WINDOWCOMPAT NEWFILES
  1707. XDESCRIPTION 'PERL 3.0 - for MS-DOS and OS/2'
  1708. !STUFFY!FUNK!
  1709. echo Extracting hints/sco_2_3_2.sh
  1710. sed >hints/sco_2_3_2.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1711. Xyacc='/usr/bin/yacc -m25000'
  1712. Xlibswanted=`echo $libswanted | sed 's/ x / /'`
  1713. !STUFFY!FUNK!
  1714. echo Extracting hints/sco_2_3_3.sh
  1715. sed >hints/sco_2_3_3.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1716. Xyacc='/usr/bin/yacc -m25000'
  1717. Xlibswanted=`echo $libswanted | sed 's/ x / /'`
  1718. !STUFFY!FUNK!
  1719. echo Extracting Wishlist
  1720. sed >Wishlist <<'!STUFFY!FUNK!' -e 's/X//'
  1721. Xbuilt-in cpp
  1722. Xperl to C translator
  1723. Xmulti-threading
  1724. !STUFFY!FUNK!
  1725. echo Extracting os2/alarm.h
  1726. sed >os2/alarm.h <<'!STUFFY!FUNK!' -e 's/X//'
  1727. X#define SIGALRM SIGUSR1
  1728. Xunsigned alarm(unsigned);
  1729. !STUFFY!FUNK!
  1730. echo Extracting hints/aux.sh
  1731. sed >hints/aux.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1732. Xoptimize='-O'
  1733. Xccflags="$ccflags -B/usr/lib/bin/'
  1734. !STUFFY!FUNK!
  1735. echo Extracting hints/ultrix_3.sh
  1736. sed >hints/ultrix_3.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1737. Xccflags="$ccflags -DLANGUAGE_C"
  1738. Xd_waitpid=$undef
  1739. !STUFFY!FUNK!
  1740. echo Extracting hints/ncr_tower.sh
  1741. sed >hints/ncr_tower.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1742. Xccflags="$ccflags -W2,-Sl,2000"
  1743. Xd_mkdir=$undef
  1744. !STUFFY!FUNK!
  1745. echo Extracting hints/hp9000_400.sh
  1746. sed >hints/hp9000_400.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1747. Xoptimize='+O1'
  1748. Xccflags="$ccflags -Wc,-Nw500"
  1749. !STUFFY!FUNK!
  1750. echo Extracting hints/ultrix_4.sh
  1751. sed >hints/ultrix_4.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1752. Xccflags="$ccflags -DLANGUAGE_C -Olimit 2900"
  1753. !STUFFY!FUNK!
  1754. echo Extracting hints/hp9000_300.sh
  1755. sed >hints/hp9000_300.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1756. Xoptimize='+O1'
  1757. Xccflags="$ccflags -Wc,-Nw500"
  1758. !STUFFY!FUNK!
  1759. echo Extracting hints/sco_2_3_1.sh
  1760. sed >hints/sco_2_3_1.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1761. Xyacc='/usr/bin/yacc -m25000'
  1762. Xi_dirent=undef
  1763. !STUFFY!FUNK!
  1764. echo Extracting hints/sco_2_3_0.sh
  1765. sed >hints/sco_2_3_0.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1766. Xyacc='/usr/bin/yacc -m25000'
  1767. Xi_dirent=undef
  1768. !STUFFY!FUNK!
  1769. echo Extracting hints/sunos_3_4.sh
  1770. sed >hints/sunos_3_4.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1771. Xusemymalloc=n
  1772. Xmallocsrc=''
  1773. Xmallocobj=''
  1774. !STUFFY!FUNK!
  1775. echo Extracting hints/sunos_3_5.sh
  1776. sed >hints/sunos_3_5.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1777. Xusemymalloc=n
  1778. Xmallocsrc=''
  1779. Xmallocobj=''
  1780. !STUFFY!FUNK!
  1781. echo Extracting hints/aix_rt.sh
  1782. sed >hints/aix_rt.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1783. Xccflags="$ccflags -a -DCRIPPLED_CC"
  1784. !STUFFY!FUNK!
  1785. echo Extracting hints/fps.sh
  1786. sed >hints/fps.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1787. Xccflags="$ccflags -J -DBADSWITCH"
  1788. !STUFFY!FUNK!
  1789. echo Extracting hints/osf_1.sh
  1790. sed >hints/osf_1.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1791. Xccflags="$ccflags -D_BSD"
  1792. !STUFFY!FUNK!
  1793. echo Extracting hints/i386.sh
  1794. sed >hints/i386.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1795. Xldflags='-L/usr/ucblib'
  1796. !STUFFY!FUNK!
  1797. echo Extracting hints/apollo_C6_7.sh
  1798. sed >hints/apollo_C6_7.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1799. Xoptimize='-opt 2'
  1800. !STUFFY!FUNK!
  1801. echo Extracting hints/genix.sh
  1802. sed >hints/genix.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1803. Xi_varargs=undef
  1804. !STUFFY!FUNK!
  1805. echo Extracting hints/dynix.sh
  1806. sed >hints/dynix.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1807. Xd_castneg=undef
  1808. !STUFFY!FUNK!
  1809. echo Extracting hints/3b2.sh
  1810. sed >hints/3b2.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1811. Xoptimize='-g'
  1812. !STUFFY!FUNK!
  1813. echo Extracting hints/dnix.sh
  1814. sed >hints/dnix.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1815. Xoptimize='-g'
  1816. !STUFFY!FUNK!
  1817. echo Extracting hints/aix_rs.sh
  1818. sed >hints/aix_rs.sh <<'!STUFFY!FUNK!' -e 's/X//'
  1819. Xoptimize='-g'
  1820. !STUFFY!FUNK!
  1821. echo Extracting os2/perlglob.bad
  1822. sed >os2/perlglob.bad <<'!STUFFY!FUNK!' -e 's/X//'
  1823. XDOSQFSATTACH
  1824. !STUFFY!FUNK!
  1825. echo " "
  1826. echo "End of kit 36 (of 36)"
  1827. cat /dev/null >kit36isdone
  1828. run=''
  1829. config=''
  1830. for iskit in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36; do
  1831.     if test -f kit${iskit}isdone; then
  1832.     run="$run $iskit"
  1833.     else
  1834.     todo="$todo $iskit"
  1835.     fi
  1836. done
  1837. case $todo in
  1838.     '')
  1839.     echo "You have run all your kits.  Please read README and then type Configure."
  1840.     for combo in *:AA; do
  1841.         if test -f "$combo"; then
  1842.         realfile=`basename $combo :AA`
  1843.         cat $realfile:[A-Z][A-Z] >$realfile
  1844.         rm -rf $realfile:[A-Z][A-Z]
  1845.         fi
  1846.     done
  1847.     rm -rf kit*isdone
  1848.     chmod 755 Configure
  1849.     ;;
  1850.     *)  echo "You have run$run."
  1851.     echo "You still need to run$todo."
  1852.     ;;
  1853. esac
  1854. : Someone might mail this, so...
  1855. exit
  1856.  
  1857. exit 0 # Just in case...
  1858. -- 
  1859. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1860. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1861. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1862. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1863.