GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Cwd::Guard(3) User Contributed Perl Documentation Cwd::Guard(3)

Cwd::Guard - Temporary changing working directory (chdir)

  use Cwd::Guard qw/cwd_guard/;
  use Cwd;

  my $dir = getcwd;
  MYBLOCK: {
      my $guard = cwd_guard('/tmp/xxxxx') or die "failed chdir: $Cwd::Guard::Error";
      # chdir to /tmp/xxxxx
  }
  # back to $dir

CORE::chdir Cwd:: Guard can change the current directory (chdir) using a limited scope.

cwd_guard($dir);
chdir to $dir and returns Cwd::Guard object. return to current working directory, if this object destroyed. if failed to chdir, cwd_guard return undefined value. You can get error messages with $Gwd::Guard::Error.

Masahiro Nagano <kazeburo {at} gmail.com>

File::chdir, File::pushd

Copyright (C) Masahiro Nagano

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2022-04-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.