chomp $character;
You need to get rid of the newline character at the end of every string
from <STDIN>
On Wed, 14 Nov 2001, samuel wrote:
> Hi there!
> i'm seeking for help on something which should b easy, but has
> turned into my personal hell.
> i'm trying to compare character (but i guess it applies the same to
> strings) for my database entry markers, but i simpled the problem
> out to this:
>
> #Here starts my nightmare
>
> print"\nCharacter?:";
> $character= <STDIN>;
>
> if($character eq ':') #Here is the root of my
> nightmare
> { print "\n\nEureka! $character equals ':'\n";
> }
>
> else{ print "\nThis script sucks ass!!";}
>
> +-+-+-+-End of code+-+-+-+-+
>
>
> i'm pretty certain this has something to do with
> string terminators (like '\0' in C).
> well, i hope u can help me.
> Eternally grateful,
>
> Samuel 'Ironsam' Molina
>
>
--
Chris D. Garringer
LAN/WAN Supervisor
Toshiba International
713-466-0277 x3756
fax 713-896-5266
Red Hat Certified Engineer
Novell MCNE
Microsoft Certified System Engineer
Certified Solaris Administrator
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]