Path: utzoo!attcan!uunet!mcsun!inesc!eagle!jmc From: jmc@eagle.inesc.pt (Miguel Casteleiro) Newsgroups: comp.lang.perl Subject: Help with split, replace and number formats. Summary: split tr// s// print Message-ID: <1991Jan29.030541.46@eagle.inesc.pt> Date: 29 Jan 91 03:08:31 GMT Sender: news@inesc.UUCP Organization: INESC/P1714, Lisboa, Portugal Lines: 43 Nntp-Posting-Host: eagle Hi there! I have some problems that I need to solve so I can finish some perl scripts. 1) I need to split the following line: "This is a line ( test,with ugly typing." into the array: ('"This','is','a','line','(','test,','with','ugly','typing."') Please note the punctuation characters. Is there a split pattern to do this? 2) I need to replace the word: 'teste' by the word: 'aebtecd' In this replace operation the character 't' gets replaced by 'a' and 'c' is appended to the word, and the character 's' is replaced by 'b' and 'd' is appended to the word. I need this strange replace to use a 7-bit sort to sort 8-bit (ISO-8859-1) text. What I need is to translate some characters by some others, and for each character translated I need to append a character to the string (something like: tr/ts/ab/cd/ :-). Is there an easy way to do this? 3) Finally, is there an easy way to print numbers in the form: 12345678.12 -> 12,345,678$12 Thanks for any help! -- __ Miguel Casteleiro at __ /// INESC, Lisboa, Portugal. "News: so many articles, \\\/// Only Email: jmc@eagle.inesc.pt so little time..." \XX/ Amiga