use5.010;usestrict;usewarnings;useutf8;useCwd;useFile::Basename;my$currentDir=getcwd;my$file=$ARGV[0];my$fullpath="$currentDir/$file";my@suffix_list=qw(.cpp .c);my($name,$dir,$ext)=fileparse($file,@suffix_list);given($ext){when(".c"){my$compile_c="gcc -o $name $file";system($compile_c);}when(".cpp"){my$compile_cpp="g++ -o $name $file";system($compile_cpp);}default{say"$file is of an type not compilable!";}}__END__=pod=head1 NAMEcpl=head1 SYNOPSIS $ cpl filenamecpl --use gcc/g++ to compile a file with c/cpp extension. Usually we will do things like "gcc -o hello hello.c", but with this scipt, we can just issue command like this, "gcp hello.c";Thanks,Steven