Use File::Spec in the example to manually create tempfiles

Hardcoding both /tmp and environment variables is both prone to
error and not portable -- the example didn't work on Android,
for example.
Merge pull request #48 from Hugmeir/master

Use File::Spec in the example to manually create tempfiles