Gossamer Forum
Home : General : Perl Programming :

Not stripping something?

Quote Reply
Not stripping something?
For some reason, there is a newline feed not being cleaned out from a variable I have. The code i am using is;

my $new_cat = $_;
chomp $new_cat;
$new_cat =~ s/_/ /g;
$new_cat =~ s,\n,,g;

...if I put an extra bit of Regex in that cleans out \W, then it doesn't show the newline. The problem with that, is it cleans out stuff I don't want removing, such as / and \.

Anyone got any ideas why it would do this? Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Not stripping something? Andy 4512 Jun 26, 2003, 4:26 AM
Thread Re: [Andy] Not stripping something?
Paul 4388 Jun 26, 2003, 4:50 AM
Thread Re: [Paul] Not stripping something?
Andy 4394 Jun 26, 2003, 5:01 AM
Post Re: [Andy] Not stripping something?
Paul 4359 Jun 26, 2003, 6:38 AM