in reply to Syntax Problem
You've (accidentally) stumbled upon a new (5.6) feature. Quoting perldoc perldata: ... a literal of the form v1.20.300.4000 is parsed as a string composed of characters with the specified ordinals.
print ".102.111.111 - ", .102.111.111; #prints ".102.111.111 - foo?
This actually parses as:
print ".102.111.111 - ", v0.102.111.111;
Since it's a numeric literal with multiple `.'s, it's interpreted as a v-string (there's actually a hidden \0 there as the first character). In your second example, you don't have a literal with more than two dots, so it parses as print ".$num.111.111 - ",. $num . 111.111.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Syntax Problem
by Anonymous Monk on Nov 19, 2001 at 19:40 UTC | |
by Fletch (Bishop) on Nov 19, 2001 at 20:22 UTC |