Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Strange file-opening problem with perl 3.0@44 Message-ID: <11217@jpl-devvax.JPL.NASA.GOV> Date: 29 Jan 91 17:30:30 GMT References: <142743@pyramid.pyramid.com> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 25 In article <142743@pyramid.pyramid.com> mfrost@sword.pyramid.com (Mark Frost) writes: : # Set host-specific configfile name : # Config file name is $thishost + ".config" : $hostconfigfile = "configs/". $thishost . ".config"; : : open(HOSTFILE, "$hostconfigfile" || die "Can't open $hostconfigfile\n"); But $hostconfigfile is always true, so the die will never happen. You want: open(HOSTFILE, "$hostconfigfile") || die "Can't open $hostconfigfile: $!\n"; Put the closing paren in the right place and use $! to tell you why it thought it couldn't open the file in question (probably because $thishost got mangled somehow). Without seeing &gethostname I couldn't tell you why pl44 might mangle $thishost. My first guess would be, however, that you said the equivalent of $thishost = `hostname`; and forgot to chop the newline. Larry