>
> 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;
$line =~ s/\<|\>|\,|\"//g;
or
$line =~ s/[<>",]//g; # but you may have to backslash the chars here, not sure
exactly, try it and see.
Or you could use HTML::Parser, we had quite a discussion about it a few days ago.
It is really handy and it look like that is what you are doing , at leats in part.
>
> # 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]
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]