in reply to Line input clipped from my array?

I think you need to show more of the code. Here is what I get with your three examples:

$ echo "foo > bar > baz > " | perl -e 'my @a = <STDIN>; print @a' foo bar baz $ echo "foo > bar > baz > " | perl -e 'my @a = <STDIN>; print "\n @a"' foo bar baz $ echo "foo > bar > baz > " | perl -e 'my @a = <STDIN>; chomp(@a); print @a' foobarbaz$
Do you do other manipulations of STDIN?

Update: Hmmmm, that is strange. I think chromatic's suggestion of something funny in the input file is likely. Also, do you (maybe in some init file) set $[=1; to get one-based indexing? That doesn't seem likely, but this is a puzzler.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Line input clipped from my array?
by jerrygarciuh (Curate) on Sep 24, 2001 at 18:41 UTC
    That is exactly what is bugging me about this Zaxo, that IS all the code:
    #!/usr/local/bin/perl -w use strict; my @a=<STDIN>; print @a;
    I am so baffled! I'm doing this as one of the exercises in Llama Ch. 4. I had assumed y'all would respond with a "Well of course it's doing that, you did ......."
    jg
      Additionally,
      #!/usr/local/bin/perl -w use strict; my @a=<STDIN>; print $a[0]; print $a[1]; print $a[2];

      returns the contents of  $a[1] and  $a[2] but nothing (not even a newline) for  $a[0] .
      Arghhhh!
      jg