On Nov 24, 11:14 am, mark_galeck_spam_mag...@yahoo.com (Mark_Galeck)
wrote:
> If I can do this:
>
> $ref = \...@foobar;
> print @$ref;
>
> then why can't I do this:
>
> print @\...@foobar;

Because you're asking the parser to do too much. It needs
to quickly identify the reference without ambiguity. What if
someone expected the parser to decipher this for example..

      print @\...@\$foo{\$$bar[0]}

At some point, there has to be an way  to identify easily
what's happening... without confusing perl or the coder.
(But someone familiar with parsing may be able to explain this
more fully or provide a better example of the difficulties.)

See 'perldoc perlref' ...specifically 'Using References' section
Bottom line: perl requires  a block to identify the reference,
unless it's a simple scalar, eg.

     print @{...@foobar}
     print @$ref

--
Charles DeRykus


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to