in reply to chdir in perl

$mpath = `/vobs/package134/inttools/modules/unixtools/srce/whichPat +h $m`; ... if(! chdir($mpath)){
I'm betting there's a newline on the end of $mpath. Since newline is a valid character within (and therefore at the end of) a path, the chdir() function cannot ignore it, and will look for a path that ends in newline, which you probably don't have.

Consider a chomp on $mpath.

-- Randal L. Schwartz, Perl hacker

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Replies are listed 'Best First'.
Re^2: chdir in perl
by Anonymous Monk on May 05, 2011 at 00:15 UTC
    I'm betting there's a newline on the end of $mpath. Since newline is a valid character within (and therefore at the end of) a path, the chdir() function cannot ignore it, and will look for a path that ends in newline, which you probably don't have. Consider a chomp on $mpath.
    Great catch! You just solved an hour-long headscratching for me!