Thursday, February 10, 2011

PERL : Operator $call_sign

my $call_sign = 1;
print "\ncall_sign : ".$call_sign;
my $next_sign = $call_sign++;
print "\nnext_sign is call_sign plus 1: ".$next_sign."\n";
my $prev_sign = $call_sign--;
print "\nprev_sign is call_sign minus 1: ".$prev_sign."\n";


$call_sign = "string";
print "\ncall_sign : ".$call_sign;
my $next_sign = $call_sign++;
print "\nnext_sign is call_sign plus 1: ".$next_sign."\n";
my $prev_sign = $call_sign--;
print "\nprev_sign is call_sign minus 1: ".$prev_sign."\n";

RESULT:
call_sign : 1
next_sign is call_sign plus 1: 1
prev_sign is call_sign minus 1: 2
call_sign : string
next_sign is call_sign plus 1: string
prev_sign is call_sign minus 1: strinh

No comments:

Post a Comment