#!/usr/bin/perl -w -i.bak use strict our $count=@ARGV; while (<>) { if ($count > @ARGV) { s[^#!/usr/local/bin/perl][#!/usr/bin/perl]; $count--; } print; }