I find that when most people try to execute outside programs from Perl, a pure-Perl version is often as short or shorter. This is not to say there is no good use of executing outside programs, just that it's usually not.
In this case, as another poster mentioned, you can use glob and unlink:
unlink glob('C:\temp\*.audit');So it shaved off a line of code and doesn't have the overhead or potential security risk of executing an outside program. I don't see a downside here, except maybe the time it took to RTM.
Update: Everyone needs to RTM. And that includes me. Problem with character escaping fixed, as per suggestions below.
----
Reinvent a rounder wheel.
Note: All code is untested, unless otherwise stated
In reply to Re: Problem with system ()
by hardburn
in thread Problem with system ()
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |