in reply to speech marks in variable

That would be the quotemeta() function you'll be wanting
$filename = '/some "really" long file name.txt' $cmd = 'rm '.quotemeta $filename; system($cmd);
I assume you've got a *very* good reason for not using unlink() as it sort's out this sort of thing without a problem.
HTH

broquaint