Swami wrote:
> I am reading a line from a file and splitting it into
> a 2 dimensional array, this is no probs..
> BUT i want to get rid of " < > and , out of each line
> - how do i do this ???????

You can use the transliteration operator for this.  You will have to use the d 
modifier to tell it to delete the characters you specify.  Just put this into your 
code:

while ($line=<INFILE>)  # This is where you're reading in the file
{
     chop $line;

     # this is the transliteration.  Look for any " < > or , characters
     # and delete them. 
     $line=~tr/"<>,//d;

     # now, you can do your splitting, etc...   
} 
 
If you prefer, you could of course use the tr on the array elements, after it was 
split.

Regards,

Jared

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

Reply via email to