http://www.perlmonks.org?node_id=295641


in reply to Why will v-strings be deprecated

But 'v10' also looks like a bareword. Consider this:
sub u11 {"u11"} sub v11 {"v11"} sub w11 {"w11"} print u11, v11, w11, v10; __END__ u11v11w11

And that includes the new line.

There are more things that cause more confusion than they solve peoples problems:

print 65.66; # prints '65.66' print 65.66.67; # prints 'ABC'
And while you can use print v10 to print a newline, you can't use it to print two newlines (as opposed to one string with two newlines):
print v10; # prints newline. print v10, v10; # "No comma allowed after filehandle"

Abigail

Replies are listed 'Best First'.
Re: Re: Why will v-strings be deprecated
by ambrus (Abbot) on Oct 06, 2003 at 14:46 UTC
    You're right. I think 10v would've been a better syntax instead of v10. Letters after numbers could be used for some interesting purposes: for example 3a could be short for $_[3].
Re^2: Why will v-strings be deprecated
by Dietz (Curate) on Jan 05, 2006 at 17:16 UTC

    And while you can use print v10 to print a newline, you can't use it to print two newlines (as opposed to one string with two newlines):
    print v10; # prints newline. print v10, v10; # "No comma allowed after filehandle"

    For this purpose the following works:

    print v10 x 2; # prints 2 newlines
    Or even:
    print v10 x 1, v10; # also prints 2 newlines