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

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



On Thu, Aug 05, 1999 at 07:20:34PM -0700, Craig McLane wrote:
> Ronald J Kimball wrote:
> 
> > On Thu, Aug 05, 1999 at 06:30:35PM -0700, Craig McLane wrote:
> > > You omitted $_ which is the default input.
> > >
> >
> > If you weren't allowed to omit it, it wouldn't be the default, would it??
> >
> > Look again.
> 
> Maybe I'm missing something, but I don't think so.
> I assumed the intent was to print the elements in @INC
> and from the Camel book, $_ is defined as 'The default input and
> pattern-searching space.' as well as 'The default iterator variable in a
> foreach loop if no other variable is supplied'
> 
> What do you mean by if you were allowed to omit it, it wouldn't be the
> default?

What I said was, "if you _weren't_ allowed to omit it...".  $_ is the
default precisely because you can omit it.

The problem with the code shown is not the omission of $_, as you
suggested, but the omission of a semicolon.


> It makes sense that print print "\n"; will print the success of print "\n";
> is this what you meant?

Yes, it will do that.  But adding $_:

print $_ print "\n";

won't fix it.  :)


Ronald

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