| … | |
… | |
| 404 | open FILE, $file || die "Couldn't open $file for reading."; |
404 | open FILE, $file || die "Couldn't open $file for reading."; |
| 405 | my @lines = <FILE>; |
405 | my @lines = <FILE>; |
| 406 | close FILE || die "Couldn't close $file after reading."; |
406 | close FILE || die "Couldn't close $file after reading."; |
| 407 | |
407 | |
| 408 | # fix perl path |
408 | # fix perl path |
| 409 | $lines[0] =~ m/^#!(\S*)/; |
409 | $lines[0] =~ m/^#!(.*)$/; |
| 410 | if($1 ne $perlPath) { |
410 | if($1 ne $perlPath) { |
| 411 | $lines[0] =~ s/^#!\S*/#!$perlPath/; |
411 | $lines[0] =~ s/^#!.*$/#!$perlPath/; |
| 412 | open FILE, ">$file" || die "Couldn't open $file for writing."; |
412 | open FILE, ">$file" || die "Couldn't open $file for writing."; |
| 413 | print FILE @lines; |
413 | print FILE @lines; |
| 414 | close FILE || die "Couldn't close $file for writing."; |
414 | close FILE || die "Couldn't close $file for writing."; |
| 415 | } |
415 | } |
| 416 | } |
416 | } |