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 8215645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:51:18+00:00 2026-06-07T11:51:18+00:00

In my Perl program, I am fetching an encrypted email, decoding it and processing

  • 0

In my Perl program, I am fetching an encrypted email, decoding it and processing it further. I am facing a problem since the data contains: %localappdata%
I could not use the qw() function directly since the data is being fetched from the mailbox. Is there a way to apply this function?
How do I use it so that special characters are not recognized as special characters but normal characters? Or is there a regex to do so?

Update: The processing that I am doing is converting the data to HTML and sending it to REST API using Curl.

Update 2: Here is the code: https://gist.github.com/8cd801fedeb90a5ca7fc
$description contains %localappdata%

  • 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-07T11:51:20+00:00Added an answer on June 7, 2026 at 11:51 am

    OK thank you for showing your complete code. The problem is that you are passing the contents of $body as a URL parameter, and so the HTTP protocl needs various characters escaping to pass them through properly.

    You can achieve this with the URI::Escape module, and you will no longer have to do the sanitizing that you do on line 125 and the lines following # clean the body.

    This program uses a string containing all the problem characters you have identified, and translates it using the module. If you use uri_escape on the contents of $body before appending it to the URL for Curl then everything should work.

    use strict;
    use warnings;
    
    use URI::Escape 'uri_escape';
    
    my $body = '%localappdata% â & ';
    
    print uri_escape $body;
    

    output

    %25localappdata%25%20%E2%20%26%20
    

    Update

    For manipulating URLs in general it is best to use the URI module which will do all necessary escaping for you in both the path and the query part of the URL.

    The program below shows how to generate the URL you need to pass to $curl->setopt using this method

    use strict;
    use warnings;
    
    use URI;
    
    my $url = URI->new('https://this/is/the/url');
    my $body = '%localappdata% â & ';
    
    $url->query_form(body => $body);
    print $url, "\n";
    

    output

    https://this/is/the/url?body=%25localappdata%25+%E2+%26+
    

    (Note that this method uses + instead of %20 for space characters. Either is acceptable in the query portion of a URL.)

    This URL can be set as a Curl option directly by writing

    $curl->setopt(CURLOPT_URL, $url);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a problem in making a PERL program for matching the words in two
I've got a problem in my Perl program when I try to combine a
I want to capture output of a Perl program and display output data (string
I am just trying to run a simple perl program to import data from
I have a Perl program that reads in a bunch of data, munges it,
I got this problem with a SQLite DB I access through a Perl program.
I wrote a Perl program to capture a live data stream from a tail
How to do a Perl program that contains an array and that array points
My Perl program is processing an XML file. Some entries may contain & symbols.
My Perl program is reading data from a serial device attached through USB. Headlines

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.