| 1 | # Tim Maher | ||||||||||
| 2 | |||||||||||
| 3 | # This script, script.pl.PL, is called by the Make system, with the name of the | ||||||||||
| 4 | # script to be created, script.pl as its arg | ||||||||||
| 5 | |||||||||||
| 6 | # the contents of script.pl, except for its shebang line, is in script.0, | ||||||||||
| 7 | # which is inserted into script.pl by this script, script.pl.PL | ||||||||||
| 8 | |||||||||||
| 9 | # NOTE: In this version, the *.0 an *.PL files are in the top-level | ||||||||||
| 10 | # distribution directory, but the generated scripts appear under ./Scripts. | ||||||||||
| 11 | # Sun May 4 17:01:10 PDT 2003 | ||||||||||
| 12 | |||||||||||
| 13 | 10 | ▶ | use Config; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 10 | $pl_file = shift; | |||||||||
| 16 | |||||||||||
| 17 | 10 | ▶ | ( $basename = $pl_file ) =~ s/\.plx$// or | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | die "$0: Bad scriptname argument; no .plx ending!\n"; | ||||||||||
| 19 | 10 | $file0="$basename.0"; | |||||||||
| 20 | |||||||||||
| 21 | 10 | ▶ | open IN, "< $file0" or die "Can't open $file0: $!"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 10 | ▶ | open OUT, "> Scripts/$pl_file" or die "Can't create $pl_file: $!"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 10 | chmod (0755, "Scripts/$pl_file"); | |||||||||
| 24 | |||||||||||
| 25 | 10 | print OUT $Config{startperl}, " -w\n", <IN>; | |||||||||