On Thu, Dec 16, 2004 at 10:42:35AM +0100, Michele Dondi wrote:
: On Wed, 15 Dec 2004, Abhijit Mahabal wrote:
:
: >#!/usr/bin/perl -e
: >$x = 1;
:
: Is this supposed to work? I would tend to consider it counter intuitive...
It occurred to me as I was dropping off to sleep last night that it
can't work on any OS that processes #! for you, since there's no way
to pass an argument to the script that wouldn't be misinterpreted as
the argument to -e. So forget that subidea. -e still sets "lax" mode,
of course.
: >#!/usr/bin/perl
: >v6; $x = 1;
:
: Incidentally, and on a totally OT basis, I've noticed that Perl6 is
: supposed to have v-strings. But (current) 'perldoc perldata' warns that
: they won't be there after 5.8: taking all this into account I wonder
: wether this would be a wyse choice. I mean: maybe it hasn't been such a
: good thing to introduce them in the first place, but now that they're
: there, it may be even worse to remove them...
The problem wasn't the syntax so much as the semantics. In Perl 6,
C<v6> creates a string, not an object, so there's no way to overload
its operators to avoid conflicts with other kinds of strings.
In Perl 6 C<v6> makes a version object, not a utf-8 string, and
they compare using numeric operators instead of string operators.
(Perl 5's v-strings had a numeric component that was an old-style
floating point number version (5.00401, for instance), and you could
compare those numerically. Perl 6 will be able to handle those via
MMD without compromising the normal comparison semantics when you
compare two version objects with numeric comparisions.)
The other places v-strings cause ambiguity problems in Perl 5 have
also been addressed, at least insofar as
v6 => "mumble"
always autoquotes its left side even if it's a keyword, and
%blech{v6}
never autoquotes anymore, so there's never any keyword ambiguity in either
of those places.
Larry