#!/usr/bin/perl

while (@ARGV) {
	$file=shift(@ARGV);
	open (FH, "$file");
	@lines=(<FH>);
	close (FH);

	print "$file\n";

	if (@lines[0] =~ m/\/usr\/local\/bin\/perl/){
	print "path already contains local.\n";}
	
	else{
	print "local has been added to the path.\n";
	foreach (@lines){
		s/\/usr\/bin\/perl/\/usr\/local\/bin\/perl/;
		last;
		}
	}

	open (OUT,">$file");
	foreach(@lines){
		print OUT "$_";
		}
	close (OUT);
}
