On Wed, Dec 31, 2008 at 9:42 AM, Christoph Leser <[email protected]> wrote:
> Just my 1 cent on the perl script
>
> #!/usr/bin/perl
> `cd /path-to-dir`:
> `rm *`;
>
> will purge your working directory, not /path-to-dir, as each of the `command`
> constructs is executed  in a process of its own and thus has no influence on
> the next command

You shouldn't be using backticks in a perl script.  Backtick simply
starts a new process/subshell and runs whatever you have in the
backticks.  If you're writing perl, use perl's syntax, and you won't
have these issues.


-- 
http://www.glumbert.com/media/shift
http://www.youtube.com/watch?v=tGvHNNOLnCk
"This officer's men seem to follow him merely out of idle curiosity."
-- Sandhurst officer cadet evaluation.
"Securing an environment of Windows platforms from abuse - external or
internal - is akin to trying to install sprinklers in a fireworks
factory where smoking on the job is permitted."  -- Gene Spafford
learn french:  http://www.youtube.com/watch?v=j1G-3laJJP0&feature=related

Reply via email to