[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Is this fun? What's going on?



At 17:17 05-08-99 -0700, Vicki Brown wrote:
>#!/usr/bin/perl
>
>foreach (@INC) {
>   print
>   print "\n"
>}
>
>
>The results are not what I expected...

OK, what did you expect? I would expect the string "1\n" to be printed x
times, where x equals the number of elements in @INC. It does that when I
test it :-)

If you just wanted to print the elements of @INC, each followed by a
newline you could write

{
  local $, = "\n";
  print @INC;
}

But that's just guessing what you are expecting.

/Henning

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe