in reply to Retriving Filename from Filehandle

I'm pretty sure I've done this before but don't remember. If you're doing the calling one thing to consider is using the filename as the filehandle in the form of a scalar.
$filename = '/etc/hosts'; open($filename, $filename);

It is left as an excercies for the reader to worry about potential security pitfalls (Hint: not specifying the mode).

--
perl -p -e "s/(?:\w);([st])/'\$1/mg"