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

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



> #!/usr/bin/perl
> 
> foreach (@INC) {
>    print
>    print "\n"
> }
> 
>
> The results are not what I expected...

The empty print simply prints the 'success' value it's own operation.

You have to explicitly call $_ to get it -

#!/usr/bin/perl

foreach (@INC) {
   print $_, "\n";
}


Also, try this one:

#!/usr/bin/perl

foreach (@INC) {
   print $_
   print "\n"
}


Under MacPerl I get -
Filehandle main::MacOS:Applications:Perl:MacPerl Ÿ:lib:MacPPC: never opened.

instead of the more normal -
MacOS:Applications:Perl:MacPerl Ÿ:lib:MacPPC:

HTH,
-Sneex-  :]

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