Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How do I stop this from removing spaces?

by ikegami (Patriarch)
on Jun 25, 2010 at 03:18 UTC ( [id://846452]=note: print w/replies, xml ) Need Help??


in reply to How do I stop this from removing spaces?

For good measure, this adds \Q so it works if you happen to include ^, ] or -.
my @filename_filter = ('*','|','<','>','?','/'); my $filename_filter = join '', @file_filter; $id =~ s/[\Q$filename_filter\E]//g;

That said, it's much much safer to specify which characters are safe to include rather than then specifying which characters are not safe to include.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://846452]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 21:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found