Mail Archives: djgpp/2001/03/02/05:32:35
> Newsgroups: comp.os.msdos.djgpp
> Date: Thu, 1 Mar 2001 20:29:35 +0000 (GMT)
> From: Daniel Barker <sokal AT holyrood DOT ed DOT ac DOT uk>
>
> 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;
> }
>
> `<command_string>` in PERL is very similar to `<command_string>` 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?
- Raw text -