Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: concatenate a non-printable character onto an ascii string and inspect the content

by choroba (Cardinal)
on Sep 20, 2017 at 16:21 UTC ( [id://1199764]=note: print w/replies, xml ) Need Help??


in reply to concatenate a non-printable character onto an ascii string and inspect the content

What do you think pack 'a*', '123456' does? Are you interested in ord?
#!/usr/bin/perl use warnings; use strict; my $string = '123456'; $string .= "\x1c"; # or chr 0x1c printf '%02x ', ord $_, ' ' for split //, $string; print "\n";
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
  • Comment on Re: concatenate a non-printable character onto an ascii string and inspect the content
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: concatenate a non-printable character onto an ascii string and inspect the content
by holandes777 (Scribe) on Sep 20, 2017 at 17:00 UTC

    Your first download worked very nicely. Thank you.

    So packing the ASCII string is wrong, It is stored as 0=0x30 etc. (see my own reply to my question). The trick was concatenating "\x1c"

    .

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1199764]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-23 10:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found