develooper Front page | perl.perl5.porters | Postings from October 2015

Warn about unexpected POD?

Thread Next
From:
Paul "LeoNerd" Evans
Date:
October 28, 2015 16:20
Subject:
Warn about unexpected POD?
Message ID:
20151028161932.7bd7dda0@shy.leonerd.org.uk
I encountered the following:

  $ perl
  use strict;
  use warnings;
  push our @EXPORT, qw( foo )

  =head2 foo

    $result = foo()->get;

  =cut

  __END__
  Global symbol "$result" requires explicit package name at - line 7.

I know that perlpod(1) mentions that POD can't appear within statements
and only between them, but I wonder to what extent this could be turned
into a warning of some kind? It might be nice to get a clue that looked
something like

  Possible attempt to embed POD within an expression at - line 5.

before it reported on the syntax error on a later line. Otherwise, that
missing semicolon might not be so obvious as the reason.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk
http://www.leonerd.org.uk/  |  https://metacpan.org/author/PEVANS

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About