in reply to Useful syntax highlighting to illustrate variable interpolation?

The $sanity is a different colour, indicating it will be interpolated. But the ->{sane} is the same colour as the rest of the string, implying it will not be interpolated.

Its hilighted the same as

$sanity->{sane} = 4;

Shouldn't the whole of $sanity->{sane} be the same colour as an interpolated variable? That way one could know whether or not the syntax was actually correct for interpolation.

syntax hilighters aren't perl interpreters , they don't actually check syntax

But even Padre failed to highlight properly and I thought that was supposed to know the most about Perl internals.

Who decides what is proper?

  • Comment on Re: Useful syntax highlighting to illustrate variable interpolation?
  • Download Code

Replies are listed 'Best First'.
Re^2: Useful syntax highlighting to illustrate variable interpolation?
by will_ (Scribe) on Feb 07, 2011 at 11:56 UTC

    syntax hilighters aren't perl interpreters , they don't actually check syntax

    Well, they should do.

    Who decides what is proper?

    I knew someone was going to ask that. We decide!

    Proper is something that helps efficient coding. That tells me whether or not what I'm writing is what I intended to write.

    Proper syntax highlighting will tell me what the code is going to do before I run it.

    So, does anyone know how to 'fix' this problem?

      to fix this problem get the latest vim (or at least vim 7.2) and the latest syntax file for perl (at least last changed 2009-09-2).