Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Why will v-strings be deprecated

by Abigail-II (Bishop)
on Oct 01, 2003 at 14:35 UTC ( #295641=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://295641]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2021-03-03 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (78 votes). Check out past polls.

    Notices?