Gossamer Forum
Quote Reply
Docs Bug
Spot the mistake? :)

Code:
$editor->add_col ($col_name,
{
size => 20,
type => 'int'
view_size => 20,
nice_name => "my col",
regex => 'myregex'
}
);

This is in the GT::Editor add_col doc.

Last edited by:

RedRum: Feb 27, 2002, 12:27 PM
Quote Reply
Re: [RedRum] Docs Bug In reply to
Code:
$editor->add_col ($col_name,
{
size => 20,
type => 'int',
view_size => 20,
nice_name => "my col",
regex => 'myregex'
}
);

- wil

Last edited by:

Wil: Feb 27, 2002, 12:46 PM
Quote Reply
Re: [Wil] Docs Bug In reply to
You think perl would let you get away with:

{ size => 20, type => 'int'view_size => 20, nice_name => "my col", regex => 'myregex' }

Tongue

Last edited by:

RedRum: Feb 27, 2002, 12:47 PM
Quote Reply
Re: [RedRum] Docs Bug In reply to
Yes, but with that sort of layout, you seem to think that maybe you could be able to (in future versions?) just leave it out. We don't need a semi-colon at the end of the line now, do we? Or even an amperstand before a sub?

- wil
Quote Reply
Re: [Wil] Docs Bug In reply to
>>
We don't need a semi-colon at the end of the line now, do we?
<<

Maybe not in your code :)

Try executing:

print "hello"
print "hmm you won't get here"

>>
Or even an amperstand before a sub?
<<

That depends, it isn't just a matter of leaving it out when you feel like it.

NAME(LIST); # & is optional with parentheses.
NAME LIST; # Parentheses optional if predeclared/imported.
&NAME(LIST); # Circumvent prototypes.
&NAME; # Makes current @_ visible to called subroutine

Last edited by:

RedRum: Feb 27, 2002, 12:56 PM
Quote Reply
Re: [RedRum] Docs Bug In reply to
Yes, OK. But you get my point, right? Visually looking at the neatly formatted code intices you into believing that you can leave off the commas, or at least it would for me - although I know better ;-)

- wil
Quote Reply
Re: [Wil] Docs Bug In reply to
Yes I suppose if you can split keys/values by commas it shouldn't be too hard to split by spaces or newlines in theory.
Quote Reply
Re: [RedRum] Docs Bug In reply to
Oops, fixed!

Cheers,

Alex
--
Gossamer Threads Inc.