--

On Fri, 12 Apr 2002 18:27:11  
 abigail wrote:
>On Fri, Apr 12, 2002 at 04:42:07PM +0100, Piers Cawley wrote:
>> [EMAIL PROTECTED] writes:
>> >
>> > Why isn't
>> >
>> >     if %foo {"key"} {print "Hello 1"}
>> >
>> > equivalent with the perl5 syntax:
>> >
>> >     if (%foo) {"key"} {print "Hello 1"}
>> >
>> > Which keyword is it expecting?
>> 
>> Keyword /els(e|if)/, or end of line, or semicolon. Sorry badly phrased
>> on my part. The closing brace of {"key"} only ends the statement if it


As i understand it (Tell me if I'm wrong) This

%hash {key};

will not work, because space between the hashname and the brace was no longer allowed. 
This allows for

if %hash{key} { ... }

and also

if $scalar { ... }.

The only other white space rule is that white space after the closing brace of a 
closure, when that closure is the last argument of a user defined sub get's treated as 
a semicolon if there is nothing else on that line. This allows custom iterators to 
parse (or appear to parse) like builtins.

myforeach @arry, %hash, $scalar {
   ...
} 
#No semicolon required!

What problems does this seem to cause - I don't see anything wrong. I don't see how 
(except in the case of closure as last argument) how it matters one way or another 
what kind white space appears between tokens. 

What am I missing?

-Erik


Is your boss reading your email? ....Probably
Keep your messages private by using Lycos Mail.
Sign up today at http://mail.lycos.com

Reply via email to