in reply to what difference does a command run in shell and in perl

BrowserUK already pointed out your particular problem with backticks. One thing I would suggest is you can use characters other than '/' for matching and substitution, etc. I'm a big fan of doing this when it makes things easier to follow. Anytime '/' or '\' is involved is a good time for {} or other characters.

########################################################## # change back slashes to forward sub slashfwd { my $retval = $_[0]; $retval =~ s{\\} {/}g; return $retval; }