Path: utzoo!attcan!uunet!samsung!brutus.cs.uiuc.edu!jarthur!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Command substitution or Common novice bug Message-ID: <7566@jpl-devvax.JPL.NASA.GOV> Date: 27 Mar 90 19:13:33 GMT References: <1460@kuling.UUCP> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 29 In article <1460@kuling.UUCP> jand@kuling.UUCP (Jan Dj{rv) writes: : Should command substitution work inside double quotes? : It sure doesn't for me: : : % perl -e 'print "`date` ", `date`, "\n";' : `date` Tue Mar 27 10:50:02 METDST 1990 : : Is there any reason for this behaviour? As an seasoned shell programmer : I often make this mistake. This is my most common novice bug (I never seem : to learn...) and I'm sure others who program in shell make the same mistake. : : Can't perl change in this respect (please). Sorry. Not only would it break already existing scripts, but I don't like multiple-substitution-pass semantics. It's part of what makes shells so messy. You'll note that it's already documented under TRAPS that The backtick operator does variable interpretation without regard to the presence of single quotes in the command. This is another manifestation of the same thing. Just because you get into double quotes or backticks doesn't mean you're in a shell. It only means that you can interpolate variables and backslash sequences in the string so delimited. The fact that I've selected the features of Perl from many languages you like implies that I've rejected some features from some of the languages you like. Larry