Opened 11 years ago

Closed 8 years ago

#552 closed defect (fixed)

outline view nests stigmata and packages wrongly

Reported by: rhebus Owned by:
Priority: minor Milestone:
Component: Outline Version: trunk
Keywords: Cc:


Example code:

use strict;
package Foo;

my $x = 3;
print $x;

package Bar;

$y = 2;
print $y;

This code should not compile, because 'use strict' is still in effect within package Bar. The outline view, however, lists "use strict" *within* package Foo, so Bar doesn't seem to be under the use strict; pragma.

I'm not sure of the best way to do this. Pragmata can operate on a per-file basis and ignore package hierarchy. Even if 'use strict' is declared within package Foo; it still affects Bar unless Bar explicitly states 'no strict'. However pragmata can also operate on a per-package basis ('use base' is an obvious example). Getting the nesting right given these circumstances would be difficult, if not impossible -- what should you do if a pragma is declared halfway through a package?

In any case, this won't affect the vast majority of one-package-per-file programs, in which it doesn't really matter if the pragmata are nested inside or outside the package.

Change History (2)

comment:1 Changed 9 years ago by szabgab

  • Component changed from editor to Outline

comment:2 Changed 8 years ago by bowtie

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.