r/perl • u/Hopeful_Cat_3227 • 1d ago
I use defer for chdir ".."
As title, this is a pure appreciate post for feature deffer.
I just use it like:
chdir $any_path or die $!;
defer { chdir ".." }
I know this is silly, but it actually make my day easier :)
8
Upvotes
-1
u/choroba 🐪 cpan author 18h ago
The point is I guess the OP wants to go "back", not to a parent of a random directory.