use strict; use warnings; opendir my $scan, '.'; @ARGV = grep {/\.c$/} readdir $scan; closedir $scan; $^I = 'org/*'; while (<>) { print "//$_"; }