in reply to open file does not work for externally defined filename

Can you post more code ... like how $file is set? Also, try checking the return value of the open call:

open( FH, ">>", $file ) or die "Cannot open $file: $!\n";

... but if I call the program with any number of slash ...

As MJD says you can't just make shit up and expect the computer to know what you mean (Good 'ole #11901)

-derby