Mailing List Archive

Re: Problems with formats and Curses in Perl5.001m
[.courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc,
mhm@austin.ibm.com () writes:
:Anyone else having problems with the use of formats while using
:perlmenuv3.2 and Curses under perl5.001m?
:
:I have a situation where the format is choosing to display the wrong
:variables for the format, which disappears if I stop using
:perlmenu&curses.
:
:Any solutions, pointers?

Are you using lexical variables. Here's a testcase on a bug related to
compile time resolution of lexicals and binding of formats(), foreach()
aliasing, and variables suicide.

#!/usr/bin/perl -w

use strict;

my (
%count, # how many of each shell we have
$input, # name of input file; maybe pipe
%ok, # whether the shells are ok
$shell, # which shell
@notes, # complaints
);

format Shell_Header =
Shell Report for @<<<<<<<<<<<<<<<<<<<<<<<<<<< Page @>>
scalar localtime, $%

@<<<<<<<<<<<<<<< @>>>>>> @*
'Shell Name', 'Usage', 'Notes'
-----------------------------------------------------------