Not sure what you mean by "use firefox as the proxy". Can you elaborate?
Do you mean that you set up firefox to use the computer running wsp.pl as the proxy?
The "bad filename" problem is probably a file permission issue or something similar. Are you in a directory where you can create files? Try "ls > filetosaveto" to verify that.