`cp file file.bak`;
And now they think ``Hey, I'll just always use backticks to run programs.''
Bad idea: backticks are for capturing a program's output; the
system
function is for running programs.
Consider this line:
`cat /etc/termcap`;
You haven't assigned the output anywhere, so it just wastes memory (for a
little while). Plus you forgot to check $?
to see whether the program even ran correctly. Even if you wrote
print `cat /etc/termcap`;
In most cases, this could and probably should be written as
system("cat /etc/termcap") == 0 or die "cat program failed!";
Which will get the output quickly (as its generated, instead of only at the end ) and also check the return value.
System also provides direct control over whether shell wildcard processing may take place, whereas backticks do not.