in reply to Precedence design question...'x' & arith
I have a dim memory of someone saying that x has the precedence it has, so that you can write:
print 'this' . ' ' x $spaces . 'that';
Without the need for parens.
If $spaces is variable, precalculate it:
$spaces = $n * rand() + theNumberYouFirstThoughtOf(); print 'this' . ' ' x $spaces . 'that';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Precedence design question...'x' & arith
by perl-diddler (Chaplain) on Jul 05, 2013 at 20:04 UTC | |
by BrowserUk (Patriarch) on Jul 05, 2013 at 20:55 UTC | |
by perl-diddler (Chaplain) on Jul 06, 2013 at 00:04 UTC | |
by BrowserUk (Patriarch) on Jul 06, 2013 at 01:23 UTC | |
|