tie $cwd => 'main'; # the example ties in package main { local $cwd = '/some/other/directory'; # execute in /some/other/directory } # resume in original working directory
This technique will obviously work for other ties too; it is probably more appropriate when initialisation and finalisations are such paired opposites.
In reply to Re: 'finally' block in Perl?
by ariels
in thread 'finally' block in Perl?
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |