"Paul Kraus" <[EMAIL PROTECTED]> wrote in message 005b01c2cb99$02315ee0$8afea8c0@pkraus">news:005b01c2cb99$02315ee0$8afea8c0@pkraus... > I have an array that I want to remove every instance of '$' and all > leading and trailing white space. > My code only seems to remove '$'. I know I can split this into separate > commands but is there a way to do this all at once? > > $_=~s/($\s+)||(\s+^)||(\$)//g foreach (@fields); > I have also tried > $_=~s/[($\s+)(\s+^)(\$)]//g foreach (@fields);
Hi Paul. I assume you mean whitespace preceding and following the dollar? s/\s*\$\s*//g foreach @fields; I'm sure you knew the answer really! Cheers, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]