|
|
| more useful options | |
| PerlMonks |
Re: Using Variables in Path Namesby andye (Curate) |
| on Nov 28, 2001 at 10:44 UTC ( [id://128035]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Hi lfindle, just a quick note in addition to all the useful advice above.
One alternative (to constructing the pathname by untainting user-supplied parameters) would be to match the incoming parameters against a hash of allowable values. Obviously this only works if there are a fixed set of allowable values. So, say that the incoming param is called 'dir', and you don't want to allow anything except 'a','b' or 'c', you could do: Then you can interpolate $dir into your path in the certain knowledge that Everything Is All Right.
hth,
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||