List Info

Thread: RE: OK, but what about me?




RE: OK, but what about me?
user name
2007-04-23 13:21:50
On Mon, 23 Apr 2007, Johan Vromans wrote:
> "Dr.Ruud" <rvtol+newsisolution.nl> writes:
> 
> > Brain fart:
> >
> >     my $foo = <<'FOO' :koi8-r;
> > raw koi8-r data here
> > FOO
> 
> Brilliant, except for the complication that the
end-of-heredoc string
> must be encoded in the foreign encoding (which I think
is a solvable
> problem).

There is also a problem that this syntactic space is not
completely
empty.  The following program is valid Perl code; how should
it be
parsed with the new syntax in place?

    use strict;
    use warnings;

    sub  encoding { "some other data" }

    my $foo = shift() ? <<'FOO' :encoding;
    raw data here
    FOO

    print $foo;

  $ perl test.pl 0
  some other data
  $ perl test.pl 1
  raw data here

Cheers,
-Jan


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )