Perl - Boolean string expressions

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

Perl - Boolean string expressions

Postby Ram » Wed Oct 11, 2006 2:03 pm

Hi,

I'm in the middle of frying my brian and need some assistance.

Can someone explain to me why:

$A = "xyz";
$B = "stu";

print $A gt $B;

is true?

I can't find any rhyme or reason to what the value's are or how it make's the comparison.
User avatar
Ram
LXF regular
 
Posts: 1676
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Re: Perl - Boolean string expressions

Postby M-Saunders » Wed Oct 11, 2006 3:42 pm

Ram wrote:I'm in the middle of frying my brian


Maybe Brian could help if you were nicer to him! :-)

M
User avatar
M-Saunders
LXF regular
 
Posts: 2893
Joined: Mon Apr 11, 2005 12:14 pm

Postby Ram » Wed Oct 11, 2006 4:48 pm

C, I'd told U it was fried :o
User avatar
Ram
LXF regular
 
Posts: 1676
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby MartyBartfast » Wed Oct 11, 2006 8:33 pm

Back on topic it sounds right to me, xyz is 'greater than' stu, in as much as it would come second if they're sorted alphabetically.
I have been touched by his noodly appendage.
User avatar
MartyBartfast
LXF regular
 
Posts: 815
Joined: Mon Aug 22, 2005 7:25 am
Location: Hants, UK

Postby Ram » Wed Oct 25, 2006 12:50 pm

Brian still fired, thought I'd replied to this.

Yes Martin that's what I thought but the damned CBT course had it wrong. :D

Cheers

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1676
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby Steogede » Wed Oct 25, 2006 4:15 pm

Ram wrote:Brian still fired, thought I'd replied to this.

Yes Martin that's what I thought but the damned CBT course had it wrong. :D

Cheers


You need to be able to perform boolean operations on strings using perl, in order to learn to ride a motorcycle now? What will the DSA think of next.
Steogede
LXF regular
 
Posts: 146
Joined: Thu May 04, 2006 5:39 pm

Postby Ram » Tue Oct 31, 2006 3:26 pm

Steogede wrote:
Ram wrote:Brian still fired, thought I'd replied to this.

Yes Martin that's what I thought but the damned CBT course had it wrong. :D

Cheers


You need to be able to perform boolean operations on strings using perl, in order to learn to ride a motorcycle now? What will the DSA think of next.



It was a highspeed crash course......
User avatar
Ram
LXF regular
 
Posts: 1676
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough


Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests