On 4/16/02 7:43 AM, "Griffith, Shaun" <[EMAIL PROTECTED]> claimed:
> So I take it readability is deprecated?
>
> For instance:
>
> $some_nested_hash{very_long_descriptive_key}{another_key}...{last_key}
>
> can no longer be broken into multiple lines, like this?
>
> $some_nested_hash{very_long_descriptive_key}
> {another_key}
> ...
> {last_key}
>
> Or does it depend on whether {some_key} "looks like" a statement block or
> not?
IIUC, the no whitespace rule only applies before control structure blocks,
such as if {} and while {}, because you need the space before the opening
brace. In other spaces, it's not necessary. So while you'll need to do this:
%some_nested_hash{very_long_descriptive_key}
{another_key}
...
{last_key} = 'foo';
You'll have to do this for control blocks:
if %some_nested_hash{very_long_descriptive_key}{another_key}...{last_key} {
# do stuff
}
But if you really want to improve legibility, and you find you have a lot of
this sort of thing in your code, I suggest you make a shortcut:
my %scut = %some_nested_hash{very_long_descriptive_key}{another_key}{one};
if %scut.{last_key} { # Perl 6 hashref syntax.
# do stuff
}
Regards,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: [EMAIL PROTECTED]