Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!rpi!bu.edu!nntp-read!composer From: composer@bucsf.bu.edu (Jeff Kellem) Newsgroups: comp.lang.perl Subject: Re: perl -x take argument as a filename (bug or feature?) Message-ID: Date: 14 Aug 90 04:12:32 GMT References: Sender: news@bu.edu.bu.edu Reply-To: composer@cs.bu.edu Distribution: comp.lang.perl Organization: Boston University Computer Science Department Lines: 36 In-reply-to: stef@zweig.sun's message of 14 Aug 90 00:28:14 GMT In article stef@zweig.sun (Stephane Payrard) writes: > Assumiong there is no file named argument in the current directory, > pipe this article in 'perl -x argument'. The output is: > Can't open perl script "argument": No such file or directory > > I would have been expected the string 'argument' to be printed. Actually, perl allows an optional directory name as an argument to the `-x' option. If the directory name is specified, perl will chdir to the directory before executing the script. It currently is either half-broken or just not documented specifically enough right now. Judging from the man page, it looks like a space should be allowed (so, [on another note] there should be no space between the `-i' option and the arg in the man page then, right??). But, the code in `perly.c' only deals with `-xdirectory'. Is a space supposed to be allowed between `-x' and `directory'?? It seems like it should be okay. But, a fix depends on which is supposed to be correct. So, Larry, are both perl -xdirectory and perl -x directory supposed to be legal? To allow the latter should be a simple fix. Cheers... -jeff Jeff Kellem INTERNET: composer@cs.bu.edu (or composer@bu.edu) UUCP: ...!harvard!bu-cs!composer