On Sun, Apr 13, 2008 at 11:58 AM, brian d foy <[EMAIL PROTECTED]> wrote:
snip
>  > First off, don't call functions with &*.
>
>  The is _Learning Perl_, and he hasn't got to the point where we tell
>  the reader they don't need the & in front of subroutine calls. Most of
>  the progression goes from the general rule to the usual case.
snip

I remember in Learning Perl 2nd edition it never calling functions
with & (it had a footnote stating something to the effect that func's
name was really &func, but that you normally didn't need to spell it
that way).  Is this some error that has crept into later editions?  Do
you have a rationale for confusing the reader by first telling him/her
to call function with & and then later telling him/her not to because
it breaks prototypes and passes the calling functions @_ if no
arguments are supplied?  Adding the & adds magic, I wouldn't call that
the "general case".  It seems like handing a someone a loaded gun and
teaching him/her about proper gun safety an hour later.

snip
>  > The problem here is that you
>  > are evaluating <STDIN> in list context.
>
>  It's supposed to be in list context. That's how you get multiple lines
>  containing one number per line, as noted in the prompt string. :)
snip

Reread the rest of that paragraph; the problem the user is seeing is
that the input phase never ends.  This is because he/she is evaluating
<STDIN> in list context and STDIN does not have an end (if it where
normal file handle it wouldn't be a problem because the file has an
end).  So he/she must give the program an end by typing control-d on
UNIX or control-z on Win32.

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to