develooper Front page | perl.perl5.porters | Postings from April 2008

Re: [perl #46369] "perl -x" reports incorrect line number for errors or warnings

From:
Anon Sricharoenchai
Date:
April 29, 2008 04:05
Subject:
Re: [perl #46369] "perl -x" reports incorrect line number for errors or warnings
Message ID:
5914604b0804282122x37cef775t9fc0c36fdb07c092@mail.gmail.com
On 4/27/08, Bram via RT <perlbug-followup@perl.org> wrote:
>
>  I'm not sure if that is intended behaviour for -x or not... (I tend to
>  believe it is but there is nothing in the documentation about it)
>
>  Either way, if you want to avoid confusion then you can use the # line
>  directive
>
>
>
>  $ perl -x << END
>  #1
>  #2
>  #3
>  #!perl -w
>
> #line 100
>  bla bla bla;
>  END
>
>  Then the output is:
>
>  Unquoted string "bla" may clash with future reserved word at - line 100.
>
> Can't locate object method "bla" via package "bla" (perhaps you forgot to
>
> load "bla"?) at - line 100
>

Thank you, this helps.
Though, I have to manually update the #line number, whenever the
number of lines in the non-perl chunk has been changed.



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