🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #1329

Reemplazar caracteres por hexadecimal en Perl

#1329
From: Chano
Date: Tue, 26 Sep 2006 19:38
20 lines
1531 bytes
  Necesito reemplazar en un string cada uno de los caracteres por un código hexadecimal.
Pensaba poner el listado de equivalencias en un hash y luego usar una expresion regular de 
reemplazo para hacerlo... pero me quedé en el hash y se me fue en collera la exp regular.

%hash=( 'a' => '+61',
	'b' => '+62',
	...
	'z' => '+7A'
	);

s/$string/??????/

  Alguna idea?

-- 
Chano
jgarrido[@]dcc.uchile.cl
Technical Details
Message-ID: <efbvjj$3g4$1@localhost.localdomain>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!nntp-server.pubsub.com!news.nivel5.cl!news.cec.uchile.cl!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,5bb18c6b72accfca,start
X-Google-Attributes: gid1593cb,public
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!nntp-server.pubsub.com!news.nivel5.cl!news.cec.uchile.cl!not-for-mail
From: Chano <chano@lj.NOSPAM.cl>
Newsgroups: chile.comp.programacion
Subject: Reemplazar caracteres por hexadecimal en Perl
Date: Tue, 26 Sep 2006 19:38:27 +0000 (UTC)
Organization: Chano Records Inc.
Lines: 20
Sender: Jose Miguel Garrido Urzua <jgarrido@cipres.cec.uchile.cl>
Distribution: world
Message-ID: <efbvjj$3g4$1@localhost.localdomain>
Reply-To: Chano <chanorecords@gmail.com>
NNTP-Posting-Host: cipres.cec.uchile.cl
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: localhost.localdomain 1159299507 3588 200.9.100.5 (26 Sep 2006 19:38:27 GMT)
X-Complaints-To: news@localhost.localdomain
NNTP-Posting-Date: Tue, 26 Sep 2006 19:38:27 +0000 (UTC)
X-Nick: Chano
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))