satchboost has asked for the wisdom of the Perl Monks concerning the following question:
This prints out "#200 456" when it should be printing "200 456". Now, I noticed that if I split the trinary up into a if-else, it worked just as expected. Why would that be?my ($foo, $bar) = (123, 456); my $base_string = "#200"; $base_string =~ /^#/ ? $foo = $' : $bar = $base_string; print "$foo $bar\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why won't $' work in a trinary operation?
by japhy (Canon) on Feb 05, 2001 at 20:53 UTC | |
|
Re: Why won't $' work in a trinary operation?
by chipmunk (Parson) on Feb 05, 2001 at 21:03 UTC | |
|
Re: Why won't $' work in a trinary operation?
by Fastolfe (Vicar) on Feb 06, 2001 at 00:39 UTC | |
|
(tye)Re: Why won't $' work in a trinary operation?
by tye (Sage) on Feb 06, 2001 at 03:31 UTC | |
|
Re (tilly) 1: Why won't $' work in a trinary operation?
by tilly (Archbishop) on Feb 06, 2001 at 03:58 UTC |