I think you can:

$line=~s/\s*$//;
It deletes every space at the end of the line ( I think) ;)



-- 
Duarte Manuel Cordeiro 
Manager - IT - Security & Communications 
mailto:[EMAIL PROTECTED] |  msn: [EMAIL PROTECTED] |  
http://www.neoris.com/ 
-- 
Neoris Portugal 
Edificio Inovação IV - Sala 819 - Taguspark * 2780-920 Oeiras * Portugal 
Tel: +351 21 423-8350  |  Fax: +351 21 421-7626  | Mob: +35191 613-5706 
-- 
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message and kindly notify the sender by reply email. Please advise 
immediately if you or your employer does not consent to Internet email for messages of 
this kind. Opinions, conclusions and other information in this message that do not 
relate to the official business of my firm shall be understood as neither given nor 
endorsed by it.



> -----Original Message-----
> From: Joseph Paish [mailto:[EMAIL PROTECTED]] 
> Sent: sexta-feira, 29 de Novembro de 2002 18:04
> To: perl_beginner
> Subject: how to delete space at end of line
> 
> 
> i have a data file that i am reading into an array.  some of 
> the data file 
> entries have a space at the end of the line and some do not.  
> is there some 
> way that i can delete the space if it exists as i read each 
> line (something 
> like chomp deletes newlines if they exist)?  preferably 
> something legible to 
> a perl newbie (i am going to have to maintain this in the 
> future, and the 
> less obscure the code, the better).
> 
> thanks
> 
> joe
> 
> ps.  examples of data file entries :
> 
> first line of file
> second line of file 
> third line of file
> 
> the space at the end of the second line is invisible just to 
> look at it, but 
> i need to strip it off as i read it.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ______________________________________________________________
> ______________
> For your protection, this e-mail message has been scanned for 
> viruses. Visit us at http://www.neoris.com/
> 

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

Reply via email to