Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9153153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:13:12+00:00 2026-06-17T12:13:12+00:00

I am reading this document to learn Perl’s taint mode => http://www.webreference.com/programming/perl/taint/index.html It is

  • 0

I am reading this document to learn Perl’s taint mode => http://www.webreference.com/programming/perl/taint/index.html

It is mentioned one way of clean tainted value,

Another more obscure way to clean tainted values is to use them as a
hash key; since hash keys themselves are never considered tainted

I do not quite understand what means “use them as a hash key”, and why hash key as never treated as tainted. Appreciate if anyone could help?

thanks in advance,
Lin

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:13:13+00:00Added an answer on June 17, 2026 at 12:13 pm

    You should really pay no attention to that statement. What it means is that, if you run this in taint mode

    my $fname = <>;
    chomp $fname;
    open my $fh, '>', $fname;
    

    then the program will die because you are using a tainted value for the file name. But if you store that value as a hash key, like this

    my $fname = <>;
    chomp $fname;
    my %data;
    $data{$fname} = 1;
    open my $fh, '>', $_ for keys %data;
    

    then the code will run fine.

    The reason for this is nothing to do with wisdom about tainted values, but rather that the keys of a hash aren’t scalar values, but just simple strings that are stored within the internal Perl hash structure. Perl scalar values – like scalar variables or hash or array values – are much more complicated data structures that contain information about the status and nature of the value as well as its actual contents, and only these can be flagged as being tainted. In contrast a hash key is just a string of characters, and it cannot carry any status information.

    So, as I said, apart from being aware of this shortcoming of Perl, you should ignore this statement in the documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading this document: http://www.fadden.com/techmisc/hdc/lesson11.htm In it he stated: Problem is, we don't
I saved my project.apk file, and I was reading this document: http://developer.android.com/guide/publishing/app-signing.html#setup and they
I was reading through this document http://llvm.org/docs/WritingAnLLVMPass.html , where in I came across CallGraphSCCPass
Reading this article http://support.microsoft.com/kb/813878 I have a question: Where can I get ipseccmd.exe for
After reading this article I don't have a clear answer: http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/ Will browsers interpret
After reading this: http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-to-use-it I came to the conclusion that it is not valid
I'm reading Tutorial on Network Programming with Python , and in this document the
I am reading this article about Optimize Social Plugin Performance http://developers.facebook.com/blog/post/530/ The article describes
I was reading this http://dev.w3.org/html5/markup/input.file.html , but I only found the accept attribute. I
I was reading this code ( http://jqueryui.com/droppable/#photo-manager ), but couldn't understand one specific line

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.