in reply to Too late to substitute param()

And the answer is ... your script is fine.

Try this invoking it like this

foobar.pl file='c:\foo\bat.txt'
The single quotes in the call fix it, simple when you know how :-)

Nuance

Baldrick, you wouldn't see a subtle plan if it painted itself purple and danced naked on top of a harpsichord, singing "Subtle plans are here again!"