Re: perl flawed or my fault
paul wrote:
Hello all,
please help me the check the following code
use strict;
my $something = 'phal';
my $otherthing = 'paul';
my $note_whom = 'szmuzu\'mi';
defined($something) ? $note_whom = $something : $otherthing =
'singapore';
print "$note_whom \n $otherthing \n";
The result is: singapore
singapore
I don't know why the scalar $note_whom get the value that is assigned
to $otherthing.
Please give me the explaination, and thank you.
note precendence...
C:\tmp>perl -MO=Deparse,-p tmp.pl
use warnings;
use strict 'refs';
(my $something = 'phal');
(my $otherthing = 'paul');
(my $note_whom = q[szmuzu'mi]);
((defined($something) ? ($note_whom = $something) : $otherthing) =
'singapore');
print("$note_whom \n $otherthing \n");
HTH,
-jp
.
Relevant Pages
- Re: perl flawed or my fault
... use strict; ... my $otherthing = 'paul'; ... The result is: singapore ... sort them into the correct order. ... (comp.lang.perl.misc) - Re: perl flawed or my fault
... paul wrote: ... use strict; ... The result is: singapore ... to $otherthing. ... (comp.lang.perl.misc) - Re: perl flawed or my fault
... John W. Krahn wrote: ... use strict; ... The result is: singapore ... to $otherthing. ... (comp.lang.perl.misc) - Re: Is Singapore to boring ?
... s'pore isn't really boring as such to many foreigners. ... >>>and newspapers not allowed to be sold in Singapore. ... >>>But he constantly feel Singapore is a little too strict and restrictive, ... (soc.culture.singapore) - Re: Is Singapore to boring ?
... million tourist spent less than 2 days here! ... In addition, due to the relax control on media industry by their authorities, cable and satellite TV programme are cheap and plentiful 24 hours a day, and there are also many different kinds of newspapers and magazines available to him to read, including many foreign publications and newspapers not allowed to be sold in Singapore. ... He also said whatever Singapore entertainment industry provided to locals and foreigners here, in his own country, it is much more exciting and vibrant than what Singapore have at the moment. ... But he constantly feel Singapore is a little too strict and restrictive, too many fines, too many rules and regulations, and constant heavy punishment for small crimes shown in the press that his country justice system would never take action to that extend, such as jail or caning by Singapore government. ... (soc.culture.singapore) |
|