That worked!  thanks!

-----Original Message-----
From: Tanton Gibbs [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 2:20 PM
To: File Send; [EMAIL PROTECTED]
Subject: Re: Perl types?


I'm not sure how you read in the fields, but the last one probably has a
newline appended to it.
You should
chomp( $settings[3] );
before you use it.
----- Original Message -----
From: "File Send" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 02, 2002 2:16 PM
Subject: Perl types?


> Hello,
> I am hoping to get some help solving a problem I am having with what I am
> assuming is only a problem for me due to my ignorance when it comes to
perl
> data types.  I have a script that reads some information from a comma
> separated file.  The file contains 4 fields.  The last field is the one I
am
> having problems with.  I read the fields into an array called @settings
and
> I retrieve the 4th fields with $settings[3] and assign it to $signon
> ($signon = $settings[3]).  I then append the field to another string and
> calculate a CRC-16 from the full string.  I don't get the result that I
> expect.  Now on the other hand, if I set a variable up as $signon =
"VALUE"
> where VALUE is identical to what I would have read from the fourth field
of
> the file, I get the correct result.  So to get it to work I would have to
> code in the signon which is not an option for me.  I have verified that
what
> I am reading from the file is the correct value by printing $settings[3]
to
> the screen.
> So my question is how do I make perl treat
> $signon = $settings[3];
> and
> $signon = "VALUE";
> exactly the same string wise?
>
> Things I have tried:
> $signon = "$settings[3]";
>
> $signon = '$settings[3]';
>
> $signon = ${settings}[3];
>
> Skipped the assignment of $signon and appended $settings[3] directly to
the
> string.
>
> Re-typed my file (very carefully)
>
>
> Now I am stumped.  Help would be great.
>
> thanks
> Ollie
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to