sub ch_dir { my $cmd = shift; $cmd =~ s/cd //; chdir($cmd) || die "Can't chdir to: $cmd $!\n"; }