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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:22:34+00:00 2026-06-15T01:22:34+00:00

I want to be able to output 0x41 , and have it show up

  • 0

I want to be able to output 0x41, and have it show up as A.

This is what I have tried so far:

my $out;
open $out, ">file.txt" or die $!;
binmode $out;
print $out 0x41;
close $out;

It outputs 65 instead of A in the resulting file. This is not what I want.

I also have read this similar question, but I wouldn’t transfer the answer over. pack a short results to 2 bytes instead of 1 byte.

  • 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-15T01:22:35+00:00Added an answer on June 15, 2026 at 1:22 am

    You can use chr(0x41).

    For larger structures, you can use pack:

    pack('c3', 0x41, 0x42, 0x43) # gives "ABC"
    

    Regarding your suspicion of pack, do go read its page – it is extremely versatile. 'c' packs a single byte, 's' (as seen in that question) will pack a two-byte word.

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

Sidebar

Related Questions

I have two different enums and i want to be able to output whether
I want to be able to output the number of times the second-position numbers
I want to be able to run netstat -n and grab the output somehow
to export some data i want to be able to generate an html output.
I want to be able to take an image that i have already captured
I want to be able to stream the output of a child process in
I want to be able to output data from PowerShell without any column headings.
I want to be able to output something like the following: Name Car Type
I want to be able to output a simple string as text rather than
I feel incredibly stupid for not being able to figure this out, but I

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.