#
!/usr/bin/perl -w
use
File
::
Find;
@ARGV
>
0
||
die
"
usage:\nperl $ [directory]
"
;
$dir
=
$ARGV
[
0
];
find(
\&
traverse
,
$dir
);
sub
traverse
{
print
$_
,
"
\n
"
;
if
(
-
f
$_
&&
$_
=~
/
(
.*
)
.
c$
/
)
{
print
"
rename $_ to $1.cpp
"
,
"
\n
"
;
rename
$_
,
"
$1.cpp
"
;
}
}