Re: using variables in a translation

2010-11-30 Thread John
Try: eval "\$test =~ y/$x/$y/;"; Perfect. Thanks, John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: using variables in a translation

2010-11-30 Thread Shawn H Corey
On 10-11-29 11:51 PM, John wrote: I tried using that, but $test wasn't changed here: $test = "This is a test."; $x = "is"; $y = "si"; eval $test =~ y/$x/$y/; print "$test\n"; Try: eval "\$test =~ y/$x/$y/;"; -- Just my 0.0002 million dollars worth, Shawn P

Re: using variables in a translation

2010-11-29 Thread John
Is there a way to use variables in a translation? I'm looking for a way to use, for example, $x = "abc" and $y = "ABC" so something like y/$x/$y/; behave like y/[abc]/[ABC]/; The tr/// operator doesn't interpolate so you have to do something like: eval y/$x/

Re: using variables in a translation

2010-11-29 Thread Uri Guttman
>>>>> "JWK" == John W Krahn writes: JWK> John W. Krahn wrote: >> John wrote: >>> Is there a way to use variables in a translation? I'm looking for a way >>> to use, for example, $x = "abc" and $y = "ABC" so so

Re: using variables in a translation

2010-11-29 Thread John W. Krahn
John W. Krahn wrote: John wrote: Is there a way to use variables in a translation? I'm looking for a way to use, for example, $x = "abc" and $y = "ABC" so something like y/$x/$y/; behave like y/[abc]/[ABC]/; The tr/// operator doesn't interpolate so you have

Re: using variables in a translation

2010-11-29 Thread John W. Krahn
John wrote: Is there a way to use variables in a translation? I'm looking for a way to use, for example, $x = "abc" and $y = "ABC" so something like y/$x/$y/; behave like y/[abc]/[ABC]/; The tr/// operator doesn't interpolate so you have to do something lik

using variables in a translation

2010-11-29 Thread John
Is there a way to use variables in a translation? I'm looking for a way to use, for example, $x = "abc" and $y = "ABC" so something like y/$x/$y/; behave like y/[abc]/[ABC]/; Thanks, John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional co

Re: Advice on how to approach character translation

2008-04-26 Thread Dr.Ruud
J. Peng schreef: > Dr.Ruud: >> J. Peng: >>> Dr.Ruud: Jenda Krynicky: >@signs = map quotemeta($_) @signs; @signs = map quotemeta($_), @signs; (there was a comma missing) which you could even write as @signs = map quotemeta, @signs; >>> >>> or: >>>

Re: Advice on how to approach character translation

2008-04-26 Thread J. Peng
On Sat, Apr 26, 2008 at 7:54 PM, Dr.Ruud <[EMAIL PROTECTED]> wrote: > J. Peng schreef: > > Dr.Ruud: > >> Jenda Krynicky: > > > >>>@signs = map quotemeta($_) @signs; > >> > >> @signs = map quotemeta($_), @signs; > >> (there was a comma missing) > >> which you could even write as > >

Re: Advice on how to approach character translation

2008-04-26 Thread Dr.Ruud
J. Peng schreef: > Dr.Ruud: >> Jenda Krynicky: >>>@signs = map quotemeta($_) @signs; >> >> @signs = map quotemeta($_), @signs; >> (there was a comma missing) >> which you could even write as >> @signs = map quotemeta, @signs; > > or: > @signs = map { quotemeta } @signs; That i

Re: Advice on how to approach character translation

2008-04-26 Thread J. Peng
On Sat, Apr 26, 2008 at 5:41 PM, Dr.Ruud <[EMAIL PROTECTED]> wrote: > "Jenda Krynicky" schreef: > > > > @signs = map quotemeta($_) @signs; > > @signs = map quotemeta($_), @signs; > > (there was a comma missing) > > which you could even write as > > @signs = map quotemeta, @signs; >

Re: Advice on how to approach character translation

2008-04-26 Thread Dr.Ruud
"Jenda Krynicky" schreef: > @signs = map quotemeta($_) @signs; @signs = map quotemeta($_), @signs; (there was a comma missing) which you could even write as @signs = map quotemeta, @signs; -- Affijn, Ruud "Gewoon is een tijger." sub uniq { my $prev; map

Re: Advice on how to approach character translation

2008-04-25 Thread R (Chandra) Chandrasekhar
Jenda Krynicky wrote: ... and build a regexp to match the 1-3 characters to replace: @signs = sort {length($b) <=> length($a)} keys %trans; Thanks for this priceless construct. It was very helpful indeed. @signs = map quotemeta($_) @signs; @signs = map quotemeta($_), @signs; # needed a c

Re: Advice on how to approach character translation

2008-04-24 Thread Chas. Owens
On Thu, Apr 24, 2008 at 11:40 AM, R (Chandra) Chandrasekhar <[EMAIL PROTECTED]> wrote: > Chas. Owens wrote: > > > > The easiest way I can think of is to build a (UTF-8) file named > > itrans2unicode.table that looks like this > > > > a => a > > aa => ā > > ~N => ṅ > > > > > > I have successfully

Re: Advice on how to approach character translation

2008-04-24 Thread R (Chandra) Chandrasekhar
Chas. Owens wrote: The easiest way I can think of is to build a (UTF-8) file named itrans2unicode.table that looks like this a => a aa => ā ~N => ṅ I have successfully created the file lookup.table containing lines as suggested above with ASCII and Unicode characters separated by ' => '.

Re: Advice on how to approach character translation

2008-04-23 Thread Jenda Krynicky
From: "R (Chandra) Chandrasekhar" <[EMAIL PROTECTED]> > 3. Some transliteration examples are shown below: > > a a U+0061 LATIN SMALL LETTER A > aa a U+0101 LATIN SMALL LETTER A WITH MACRON > A a U+0101 LATIN SMALL LETTER A WITH MACRON > .a ' U+0027 APOSTROPHE >

Re: Advice on how to approach character translation

2008-04-23 Thread Chas. Owens
or a Romanized script called IAST. Since characters in these > scripts have Unicode code points, it should be possible to automate the > translation between words in the ASCII source text and the desired Unicoded > output text. > > I am trying to write a Perl script to do this and woul

Advice on how to approach character translation

2008-04-23 Thread R (Chandra) Chandrasekhar
to automate the translation between words in the ASCII source text and the desired Unicoded output text. I am trying to write a Perl script to do this and would appreciate advice on how best to proceed before I start. To give a better picture of what I am trying to do, I have given some

Re: address translation

2008-02-21 Thread J. Peng
On Thu, Feb 21, 2008 at 4:11 PM, J. Peng <[EMAIL PROTECTED]> wrote: > On Thu, Feb 21, 2008 at 4:03 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: > > > > So 0x would indicate a network with no hosts on it and thus it > > is not a valid netmask. > > > > yup, but sometime we need a 255.2

Re: address translation

2008-02-21 Thread J. Peng
On Thu, Feb 21, 2008 at 4:03 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: > > So 0x would indicate a network with no hosts on it and thus it > is not a valid netmask. > yup, but sometime we need a 255.255.255.255 netmask to forbit the host don't reply to any ARP requests. for example, yo

Re: address translation

2008-02-21 Thread John W. Krahn
J. Peng wrote: On Thu, Feb 21, 2008 at 3:29 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: J. Peng wrote: > how to translate this mask to clear text form with perl? > netmask 0x If you mean an IP address netmask then 0x is an invalid netmask because all the bits are 1. John

Re: address translation

2008-02-20 Thread J. Peng
On Thu, Feb 21, 2008 at 3:29 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: > J. Peng wrote: > > how to translate this mask to clear text form with perl? > > netmask 0x > > If you mean an IP address netmask then 0x is an invalid netmask > because all the bits are 1. > John, all

Re: address translation

2008-02-20 Thread John W. Krahn
J. Peng wrote: how to translate this mask to clear text form with perl? netmask 0x If you mean an IP address netmask then 0x is an invalid netmask because all the bits are 1. John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of

address translation

2008-02-20 Thread J. Peng
how to translate this mask to clear text form with perl? netmask 0x thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Use parentheses in translation strings

2008-01-02 Thread Nihilism Machine
aving problem with using parentheses in translation strings. For example, I want to replace the 4 digit year code '' with '(\d\d\d\d)', so it can be used for grouping in string matching later. I expected the code would be like: $org_str =~ tr//\(\d\d\d\d\)/; Then the r

Re: Use parentheses in translation strings

2008-01-02 Thread Nihilism Machine
how do i unsubscribe from this list? On Jan 2, 2008, at 12:14 PM, Tom Phoenix wrote: On Jan 1, 2008 1:20 PM, <[EMAIL PROTECTED]> wrote: I'm quite new to perl, and now having problem with using parentheses in translation strings. For example, I want to replace the 4 digit year

Re: Use parentheses in translation strings

2008-01-02 Thread Chas. Owens
On Jan 2, 2008 10:48 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Jan 1, 2008 4:20 PM, <[EMAIL PROTECTED]> wrote: > > Hi there, > > > > I'm quite new to perl, and now having problem with using parentheses > > in translation strings. For example,

Re: Use parentheses in translation strings

2008-01-02 Thread Paul Lalli
On Jan 1, 4:20 pm, [EMAIL PROTECTED] wrote: > Hi there, > > I'm quite new to perl, and now having problem with using  parentheses > in translation strings. For example, I want to replace the 4 digit > year code '' with '(\d\d\d\d)', so it can be used fo

Re: Use parentheses in translation strings

2008-01-02 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hi there, Hello, I'm quite new to perl, and now having problem with using parentheses in translation strings. For example, I want to replace the 4 digit year code '' with '(\d\d\d\d)', so it can be used for grouping in string matching l

Re: Use parentheses in translation strings

2008-01-02 Thread Tom Phoenix
On Jan 1, 2008 1:20 PM, <[EMAIL PROTECTED]> wrote: > I'm quite new to perl, and now having problem with using parentheses > in translation strings. For example, I want to replace the 4 digit > year code '' with '(\d\d\d\d)', so it can be used for gr

Re: Use parentheses in translation strings

2008-01-02 Thread Martin Barth
t;. HTH! Martin On 22:20:53 01/01/2008 [EMAIL PROTECTED] wrote: > Hi there, > > I'm quite new to perl, and now having problem with using parentheses > in translation strings. For example, I want to replace the 4 digit > year code '' with '(\d\d\d\d)'

Re: Use parentheses in translation strings

2008-01-02 Thread Chas. Owens
On Jan 1, 2008 4:20 PM, <[EMAIL PROTECTED]> wrote: > Hi there, > > I'm quite new to perl, and now having problem with using parentheses > in translation strings. For example, I want to replace the 4 digit > year code '' with '(\d\d\d\d)', so it

Use parentheses in translation strings

2008-01-02 Thread yellowbluetest
Hi there, I'm quite new to perl, and now having problem with using parentheses in translation strings. For example, I want to replace the 4 digit year code '' with '(\d\d\d\d)', so it can be used for grouping in string matching later. I expected the code would be l

php to perl translation

2007-06-18 Thread Andreas Moroder
Hello, after a long search I found a script that creates oracle password hashes. I need the result of this script to store the password in out LDAP database in the oracle hashed format. The problem is that it is a php script and I need it in perl. I am a perl beginner and I am not able to co

GPS, standard output, translation

2007-05-08 Thread Pierre TESTORI
Hi All, After more than 30 years shooting fotos with film, i use now a second-hand digital cam wich produce *.NEF files. PC env : Ubuntu 7.04 'gpscorrelate' synchronise GPS-time and cam-time to give the position of the 'shooter'. As example : 'gpscorrelate -o DSC_0934.NEF.dcraw-a.gimp.jpg'

Re: MS Word translation

2007-04-03 Thread Ken Foskey
On Tue, 2007-04-03 at 11:56 +0800, Jen mlists wrote: > Hello, > > Would you please tell me what's the correct module for translating a > word document to the plain text?Thanks. There is a Perl Interface in OpenOffice.org that might be useful for you. -- Ken Foskey FOSS developer -- To unsubs

Re: MS Word translation

2007-04-03 Thread Edi STOJICEVIC
* Jen mlists <[EMAIL PROTECTED]> [2007-04-03 11:56:07 +0800] wrote : > Hello, > > Would you please tell me what's the correct module for translating a > word document to the plain text?Thanks. > Hi, If you're using Linux you can try the little app' catdoc : $ catdoc test.doc > test.txt And

Re: MS Word translation

2007-04-03 Thread rcook
> Hello, > > Would you please tell me what's the correct module for translating a > word document to the plain text?Thanks. Try putting perl read word document into google It will probably help you Owen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

MS Word translation

2007-04-02 Thread Jen mlists
Hello, Would you please tell me what's the correct module for translating a word document to the plain text?Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Looking for a simple string translation module

2006-08-21 Thread Dr.Ruud
"Jeff Peng" schreef: > Turn the character string like 'abcdsfjijifjdfdf' to the integer as > '23332399343'. Use a hash? -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Looking for a simple string translation module

2006-08-20 Thread Jeff Peng
Hello,Lists, I have a Perl socket server which is in heavy load.Now I want to do a thing in each of its childs: Turn the character string like 'abcdsfjijifjdfdf' to the integer as '23332399343'. I know some module like md5sum could do it.But running md5sum for this

Re: about utf8 translation

2005-11-29 Thread Jeff Pang
I have resolve this problem,as: $subject = encode("euc-cn", decode("utf8", $subject)); Sorry for bothering. 在 05-11-30,Jeff Pang<[EMAIL PROTECTED]> 写道: > Hi,lists, > > I have a file looking as below: > > <[EMAIL PROTECTED]> 145K179B 璧搴? > <[EMAIL PROTECTED]>

about utf8 translation

2005-11-29 Thread Jeff Pang
Hi,lists, I have a file looking as below: <[EMAIL PROTECTED]> 145K179B 璧搴? <[EMAIL PROTECTED]>171K122B ���璇� <[EMAIL PROTECTED]> 28K904B ���K60830 <[EMAIL PROTECTED]> 243K600B ��规�寮�? <[EMAIL PROT

Re: E and pod2html translation problem

2005-06-08 Thread Offer Kaye
On 6/7/05, Offer Kaye wrote: > Hi all, > I have a POD file with the following link: > L > podchecker complained about this ("node '$/' contains non-escaped | or > /"), so I looked at "perlpod" and read that I should use "E" > instead of a literal "/" inside an "L<...>" link. > But now, after runnin

E and pod2html translation problem

2005-06-07 Thread Offer Kaye
Hi all, I have a POD file with the following link: L podchecker complained about this ("node '$/' contains non-escaped | or /"), so I looked at "perlpod" and read that I should use "E" instead of a literal "/" inside an "L<...>" link. But now, after running Pod::Html, I get HTML that has the string

Re: translation

2003-01-22 Thread GoodTimeTribe
all string and then translating the characters. If you process through the translation, you get a rude and uninspired message. I suspect that your boss is ribbing you, since a genuine obfuscator would cook up a more insulting or clever message. :) Bob Showalter wrote: Mat Harris wrote: my boss

Re: translation and its attachment

2003-01-21 Thread R. Joseph Newton
It's a pgp [Pretty Good Privacy] signature file--used to assure that this post is indeed from: Mat Harris OpenGPG Public Key ID: C37D57D9. Netscape Messenger 4.x doesn't seem to know what to do with it when I try to open it.. The plug-in finder found no appropriate plug-ins,

Re: translation

2003-01-20 Thread Ben Siders
I suspect we're being baited, but I'll bite. Write this as a normal Perl program: #!/usr/bin/perl $_="7P0>374;"; tr[0->][ LEOR!AUBGNSTY]; print; It's setting the default variable to that goofball string and then translating the characters. If you process thro

Re: translation

2003-01-20 Thread Rob Dixon
I smell a troll. Sniff. /R -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: translation

2003-01-20 Thread George Schlossnagle
eration operator to $_. Translation map is: take everything from 0 to > (ascii character range), and translate it to LEOR!AUBGNSTY. i.e. 0 becomes ' ' (a single space) 1 become L 2 becomes E 3 becomes 0 4 -> R 5 -> ! 6-> A 7-> U 8 -> B 9 -> G : -> N ; -> S <

Re: translation

2003-01-20 Thread Rob Dixon
Mat Harris wrote: My email doesn't allow any attachments. Can't you post in the message body? Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: translation

2003-01-20 Thread Jeff 'japhy' Pinyan
On Jan 20, Mat Harris said: >my boss emailed me this little snippet this morning and I have to confess it >has me stumped. > >Please can someone break down this translation for me? I hope you (or your boss) have a sense of humor. >perl -le '$_="7P0>374;";tr[0-

RE: translation

2003-01-20 Thread Bob Showalter
Mat Harris wrote: > my boss emailed me this little snippet this morning and I have to > confess it has me stumped. > > Please can someone break down this translation for me? > > perl -le '$_="7P0>374;";tr[0->][ LEOR!AUBGNSTY];print' > > t

Re: translation and its attachment

2003-01-20 Thread Rob Richardson
Mat, Why did your message have an attachment named "file.bin"? Yahoo's virus scan said it was clean, but it still makes me nervous. RobR __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To un

translation

2003-01-20 Thread Mat Harris
my boss emailed me this little snippet this morning and I have to confess it has me stumped. Please can someone break down this translation for me? perl -le '$_="7P0>374;";tr[0->][ LEOR!AUBGNSTY];print' thanks -- Mat Harris OpenGPG Publ

Re: translation of logical operators

2002-02-02 Thread Jonathan E. Paton
--- Filson <[EMAIL PROTECTED]> wrote: > Dear perl mongers. I need to know if I can translate > symbols in a text file into logical operators like > AND|OR|NOT and so forth. The thing is that I'm trying to > build a simulator for digital cuircuts, with input files > in 3DML style (ascii graphix st

translation of logical operators

2002-02-01 Thread Filson
Dear perl mongers. I need to know if I can translate symbols in a text file into logical operators like AND|OR|NOT and so forth. The thing is that I'm trying to build a simulator for digital cuircuts, with input files in 3DML style (ascii graphix style) like this: =A-N> =O> >A- Hrm, a little