On Thu, 14 Sep 2000 12:41:04 -0700, Glenn Linderman <[EMAIL PROTECTED]> wrote:
> 1) do perl6 formats need to have exactly the same scoping rules as perl5
> formats in this regard?

perl5 formats do NOT support lexicals, so this is not a very interesting
question. (Re-)implementation of formats in perl6 should only consider perl5
syntax in perl526 as conversion issues.

> 2) is it a problem in practice?
> 
> None of the format code I've written would work differently do to such a
> semantic change in the time of compilation, but I'm just one novice.  I
> tend to think that code that uses formats is really pretty simple code...

Bad thinking ;-) As an example, I've converted a 4GL/RPT script of over 1500
lines to a format using perl script of less than 150 lines being able of lots
and lots more. OK, it has since than grown to about 400 lines being able of
using headers, margings, footers and dynamic (nested) formats, but even than
is wasn't the most simplistic code.

> if it were more complex, it would probably use sprintf rather than
> format... as simple code, it tends not to have many scopes and reused
> variable names.

Using sprintf I could have reached the same results, but it would have been a
lot harder to document and maintain.

> If it is, p52p6 could handle this situation by renaming the inner scope's
> $foo to avoid the conflict.

Just look at Damian's proposal. Even the most heavily format using perl5
programmers (like me) will switch sooner or later. I'm looking at the
consequences of changing *ALL* my format scripts to using the format part of
Text::Autoformat right now.

-- 
H.Merijn Brand           Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
using perl-5.005.03, 5.6.0, 5.7.1 & 516 on HP-UX 10.20 & 11.00, AIX 4.2 & 4.3,
     DEC OSF/1 4.0 and WinNT 4.0 SP-6a,  often with Tk800.022 and/or DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/

Reply via email to