Hi Mark,

the "chomp" function will take care of that problem for you.  "chomp" removes carriage 
returns, if
any, from the input.  

you might have also heard of "chop" which removes the last character of a string, 
which may or may
not be a return.  So, use "chomp" instead.

#!/usr/local/bin/perl -w

@array = <STDIN>; # or $scalar = <STDIN>;
chomp @array;

Hope that helps,

Simon

--- Mark Thumper Weisman <[EMAIL PROTECTED]> wrote:
> Hello List,
>    I've got an easy one probably, however, I can't figure it out. I'm 
> writing a command line script which asks the user to complete some 
> simple information. I use the <STDIN> pushing the value into a variable, 
> however when I got to post the variable to another variable or array, it 
> has a carraige return in it so instead of posting the way it should it 
> adds lines vertically. Can anyone help me get the Carriage returns out 
> of the <STDIN>?
> 
> Thanks,
> Mark
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


=====
#########################################

Warmest Regards,
Simon K. Chan - [EMAIL PROTECTED]

"Great spirits have always encountered violent opposition from mediocre minds."  - 
Albert Einstein

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

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

Reply via email to