in reply to Re^4: Perl : Split/Regex
in thread Perl : Split/Regex
Interesting! I'd checked using a numeric constant for the conditional and that works as I expected:
use strict; use warnings; my @streams; my @spaces; push ((0 ? @streams : @spaces), 0); push ((1 ? @streams : @spaces), 1); print "$]\n"; print "Streams: '@streams'\n"; print "Spaces: '@spaces'\n";
Prints:
5.016003 Streams: '1' Spaces: '0'
but anything other than a numeric constant fails as you describe. That'll teach me to test one thing then post another!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Perl : Split/Regex
by AnomalousMonk (Archbishop) on Sep 04, 2014 at 02:22 UTC |