Date: Fri, 02 Mar 2001 12:32:11 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: sokal AT holyrood DOT ed DOT ac DOT uk Message-Id: <8011-Fri02Mar2001123210+0200-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6 CC: djgpp AT delorie DOT com In-reply-to: (message from Daniel Barker on Thu, 1 Mar 2001 20:29:35 +0000 (GMT)) Subject: Re: Penalty for immature language (PERL/BASH) References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Newsgroups: comp.os.msdos.djgpp > Date: Thu, 1 Mar 2001 20:29:35 +0000 (GMT) > From: Daniel Barker > > On Thu, 1 Mar 2001, Eli Zaretskii wrote: > > > > At the BASH prompt, I launch the following PERL script, prog.pl: > > > > > > while(<>) > > > { > > > `$_` > > > } > > > > > > If I give this a single line consisting of the word "poo", BASH performs > > > an illegal instruction. > > > > Could you please describe, for the Perl-illiterate such as myself, > > what does this loop do, in the terms of its interaction with the OS? > > In pseudocode, something like this: > > WHILE (there is an unprocessed line of standard input) > { > execute that line as if typed at the shell prompt, but > without printing its output; > } > > `` in PERL is very similar to `` in BASH. Does a plain `$_` (i.e. without the loop) work, or does it crash as well? What happens if you run your Perl script from COMMAND.COM, not from Bash?