--- Rob Dixon <[EMAIL PROTECTED]> wrote: > Hi Stuart. <snip> Mornin' Rob.
> My guess is that you're looking at the output from > > print @list; Yes, that's what I was doing at first. Then I consulted "Beginning Perl," and it told me that I had to "stringify" the list to get spaces in between the numbers. > > which 'squishes' the values. Look: > > my @list = 'A' .. 'F'; > print @list, "\n"; > print "@list", "\n"; > > **OUTPUT > > ABCDEF > A B C D E F > Yup, I've got that. <snip> > Your code is exactly right: well done. You don't > even need > to chomp the input: > Thanks. > my $input = " 22 \n"; > my @list = (2 .. $input); > print "list first: @list\n"; > > **OUTPUT > > list first: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 > 17 18 19 20 21 22 > Does putting a space before and after the last number do something special? I can't check this now, as I'm at work, but doesn't that just put all those numbers, spaces included, into $list[0]? That's what I thought John was telling me the "Use of unitialized value in concatenation" etc error was alerting me about. I can get the range, and I can get the spaces in between the numbers, I just can't seem to get the numbers into an array, one number per element. > I hope this helps. I smell a misconception here, > which may > end up with us talking at cross-purposes; but please > come > back to the list if you're puzzled about anything. > Yes, I certainly am missing a concept: that of storing a list into an array one element at a time. I'm not sure what you mean by "cross-purposes." Thanks for the help. -stu __________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>