#171 perl parser stops when here-doc uses __END__ delimiter

open
Dmitri
None
5
2007-06-21
2007-06-21
Randy
No

In the code below, ctags will not detect the ghi subroutine because of __END__ being used in the here-doc.

package a;

sub abc {
print "abc";
}

sub def {
print <<__END__;
def
__END__
}

sub ghi {
print "ghi";
}

1;

Discussion

  • Elliott Hughes

    Elliott Hughes - 2007-06-21
    • assigned_to: nobody --> perlguy0
     
  • Elliott Hughes

    Elliott Hughes - 2007-06-21

    Logged In: YES
    user_id=1127237
    Originator: NO

    (assigning to Perl maintainer.)

     
  • Dmitri

    Dmitri - 2007-07-12

    Logged In: YES
    user_id=121699
    Originator: NO

    Show me a Perl programmer who does that and I'll do something evil to him ;-)

    I wonder if there are any instances of this. Running the following grep command produces no matches on my box:
    egrep -r '<< *['\''"]?__END__' /usr/lib/perl5

     
  • Dmitri

    Dmitri - 2007-07-12

    Logged In: YES
    user_id=121699
    Originator: NO

    I take that back. Apparently, there are plenty of instances of such use:
    http://www.google.com/codesearch?as_q=%3C%3C+\*%5B%27%22%5D%3F__END__&btnG=Search+Code&hl=en&as_lang=perl&as_license_restrict=i&as_license=&as_package=&as_filename=&as_case=

     

Log in to post a comment.