Octavian Rasnita wrote:
>
> From: "Rob Dixon" <[EMAIL PROTECTED]>
>>
>> The documentation that John referred you to recommends
>>
>>  =begin comment
>>    :
>>  =end
>>
>> Which may be a trifle awkward, but I'm sure there are worse things that 
>> happen
>> to you in your day. It takes less than a second to type, and if you do it 
>> a lot
>> you could set up a macro in your editor.
> 
> Unfortunately it doesn't work that way.
> Even the POD documentation says that in the same perldoc -q ...:
> 
> """
>     The pod directives cannot go just anywhere. You must put a pod directive
>     where the parser is expecting a new statement, not just in the middle of
>     an expression or some other arbitrary grammar production.
> """
> 
> Here is an example that doesn't work:
> 
> if (1) {
> 
> =begin comment
> 
> print "ok";
> 
> =end comment
> 
> }
> 
> It gives the following error:
> Missing right curly or square bracket at E:\zzz.pl line 11, at end of line
> 
> If the user uses the not recommended
> 
> =start
> ...
> ...
> =cut
> 
> then it simply works, at least until a newer version of perl will decide 
> that this should give an error.

Yes, I'm afraid I misquoted the entry from perlfaq7, which actually recommends

=begin comment
  :
=end comment

=cut

which is clumsy, to say the least. However I use

=begin comment
  :
=cut

which works fine, and I don't think contravenes POD syntax except that =cut
should strictly be preceded and followed by blank lines, but Perl doesn't seem
to care. The comment block is closed implicitly by =cut.

Rob


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


Reply via email to