in reply to How do you clean up user specified filenames?
One of the surest ways you can avoid shell metacharacter problems is simply not to use a function that passes them via a shell. Use sysopen instead of open, for example. Also see Avoiding surprises using 'open' for working around unexpected bits of input using Perl's normal open function.
Another common solution is simply to restrict what people can specify in filenames:
tr/A-Za-z_.-//dc;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How do you clean up user specified filenames?
by tomhukins (Curate) on Feb 21, 2001 at 21:13 UTC |