in reply to coding style suggestion: (...)[1] vs. [...]->[1]
You probably want /\s+/ to allow for multple spaces.$number = (split /\s/, $string)[1];
$number = [ split /\s/, $string ]->[1];
Only a performance reason, because in this case you are also creating an array, but then also creating a reference to it. So you're doing extra work in this case.
But if you're happy with that way, go for it. Just do it that way all the time. Be consistent. Avoid premature optimization!
Liz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: coding style suggestion
by demerphq (Chancellor) on Sep 19, 2003 at 10:43 UTC |