On Monday, April 8, 2002, at 12:01  PM, Ho, Tony wrote:

> Hi guys
> I was wondering if you could help me.
> In my perl code, I am reading a file with the following line:
>
>    123000
>
> There are 3 spaces before 123000.
> I unpack the values into 2 variables, A and B
> A is assigned the 3 spaces and B is assigned the value 123000.
> I have another variable C which is assigned the value 600.
>

reading from a file? maybe show some code?

> If I write the values A, B and C to a new file using the following code:
>
> print NEW_FILE $C$A$B
>

i don't think that's right. no concatenation operator and no semi-colon.
should be:
print NEW_FILE $C,$A,$B;
or:
print NEW_FILE $C.$A.$B;


> I get the following result:
>
> 600123000
>
> I was hoping to get to obtain the following result:
>
> 600   123000
>
> Any ideas why the spaces in variable A is not taken into account ?
>
> I would be most grateful if you could let me know.
> Thanks in advance
> Tony

if you interpret the string '   123' somewhere as a number it won't have 
spaces.
then when you print it out - no spaces.


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

Reply via email to