Ing. Branislav Gerzo wrote:
Elvis Cehajic [EC], on Saturday, June 18, 2005 at 19:11 (+0200) wrote:

EC> Like that?:

EC> use strict;
EC> use warnings;

EC> my $first = 'B';
EC> my $second = 'a';

EC> ($first, $second) = (uc($second) , lc($first));

EC> print $first, "\n";
EC> print $second, "\n";

sorry, I was not clear. I don;t know the case, so it have to work for:

ab
Ab
aB
AB

change characters order and keep case without $temp, it is possible ?

$ perl -le'
my $first  = 'B';
my $second = 'a';

( $first, $second ) = map lc eq $_ ? uc : lc, ( $second , $first );

print for $first, $second;
'
A
b



John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to