#671 Hash with key named 'package' interpreted as package in outline

v0.7.x
open
nobody
None
5
2016-05-12
2014-05-23
richieman
No

Look at the outline of this script, it's kind of messed up.

!/usr/bin/perl

use strict;
use warnings;

sub test { }

my $hash = {
package => 'name',
};

sub test2 { }

my $array_of_hash =
{ package => 'pkg1', name => 'xx' },
{ package => 'pkg2', something => 'else' },
{ package => "pkg3" },
{ package => 'pkg4' },
;

sub test3 {}

Discussion

  • richieman

    richieman - 2014-05-23

    Oeps, the editor messed up the example a bit. Just add the # at the beginning and [ and ] around the array.

     
  • RonW

    RonW - 2015-03-04

    This is also happening in EPIC version 0.7.0

     
  • Oliver Trosien

    Oliver Trosien - 2016-05-12

    Yeah, sorry. That's a limitation of the parser at the moment (which is trying to be as context-less as possible for performance reasons.) As a work-around please use quotes for your hash keys.

     
  • Oliver Trosien

    Oliver Trosien - 2016-05-12
    • Group: v0.5.x --> v0.7.x
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks