File: changeperl

package info (click to toggle)
pgplot5 5.2-8
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 6,268 kB
  • ctags: 5,900
  • sloc: fortran: 37,938; ansic: 18,809; sh: 1,136; objc: 532; perl: 443; makefile: 271; pascal: 233; tcl: 178; awk: 51; csh: 25
file content (24 lines) | stat: -rw-r--r-- 591 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl
# Just change /usr/local/bin/perl to /usr/bin/perl
# pretty big script.

@files = qw( makehtml maketex );

foreach $infile (@files) {
    open IH,"<$infile" or die "Can't open $infile";
    $outfile = $infile . ".new";
    open OH,">$outfile" or die "Can't open $outfile";
    while ($line = <IH> ) {
	if ($line =~ m|^#!/usr/local/bin/perl|) {
	    print OH "#!/usr/bin/perl\n";
	}
	else {
	    print OH $line;
	}
    }
    close IH; close OH;
    system "cp $infile $infile.orig" unless -e "$infile.orig";
    system "mv $outfile $infile";
    system "chmod +x $infile";
}