Sorting hash values

2006-04-04 Thread Baskaran Sankaran
t$freq2\t$prob1\t$prob2\n"; } sub compute_probability() { my $key = shift; my $prob = $rules_new{$key}->[0] / ($rules_new{$key}->[0] + $rules_new{$key}->[1]); return $prob; } And it doesn't work. Any help is appreciated. Thanks, Baskaran -- To unsubscri

RE: store Array in hash ?

2006-03-30 Thread Baskaran Sankaran
You can try this. $test->{$setup}->{'data'} = [$data[0], $data[1]]; As you said reference is not going to work, if your array value changes at run time. You can also access specific elements of the array individually, whenever required. Baskaran __

RE: Tree:Nary and Unicode

2006-03-20 Thread Baskaran Sankaran
>> -Original Message- From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED] Sent: 20 March 2006 16:25 To: beginners@perl.org Subject: Re: Tree:Nary and Unicode Baskaran Sankaran wrote: > use Tree::Nary; > > use warnings; > > > > open(O, ">chil

Tree:Nary and Unicode

2006-03-20 Thread Baskaran Sankaran
Hi group, My Unicode blues continues… One more question on handling Unicode. Does Tree::Nary module works with Unicode data? I am trying to store some Unicode strings (UTF-8 to be precise) as Nary Tree. When I retrieve the value of the nodes from the tree, it produces the output as bo

Regular expression - Global substitution

2006-03-13 Thread Baskaran Sankaran
Hi Group, Am working with Unicode (UTF8 coded) stuff and facing problem with regular expression. s/(\p{HinNumerals})\s+($tokenize_string)+\s+(\p{HinNumerals})/$1$2$3/g; and, my HinNumerals is defined as, sub HinNumerals { return <

RE: FW: Reading a Unicode text file

2006-03-08 Thread Baskaran Sankaran
features. But, I think Perl doesn’t allow us to I/O with Unicode as encoding in the handle (instead of utf8). Thanks to those who answered earlier. Baskaran -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Phoenix Sent: 20 February 2006 11

FW: Reading a Unicode text file

2006-02-17 Thread Baskaran Sankaran
then in notepad and wordpad. But, the output as you see is garbage and somehow it misses the utf8. This apart, a blank space is added for every character in both English and Hindi. Baskaran

Practical Unicode handling in Perl

2006-02-16 Thread Baskaran Sankaran
Hi group, Is there a source for practical Unicode handling in Perl with example programs (sort of cook book will be useful)? Man pages like perlunicode, perluniintro are fine but I feel they are far less than practical. Any pointers would be great. Thanks, Baskaran

RE: Reading a Unicode text file

2006-02-16 Thread Baskaran Sankaran
close(F2); close(O); And, here I am trying to read two txt files (having equal no. of lines) and print the contents in a single file given in the command prompt. The files are in Unicode. I am using ActivePerl v5.8.7 in windows. Thanks for the help. Baskaran -Original Message- F

Reading a Unicode text file

2006-02-09 Thread Baskaran Sankaran
along with *. Is the problem due to the newline char at the end of every line? Thanks in advance for the help. Baskaran

PDF::API2 module example for edit pdf and save new pdf file

2005-06-01 Thread baskaran
Dear sirs, I want to learn more about open pdf file and edit and save some other new pdf file. I use PDF::API2 module, Kindly give me an example... Thanking you Regards Baskaran NK -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <h

Search pattern not terminated

2005-05-10 Thread baskaran
ot; Kindly suggest me a solution. Thanking you Regards Baskaran NK -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

select the content of matching braces

2005-05-05 Thread baskaran
x) (i.e. i want to select the content of matching braces) if i use (.*) it goes to the last brace in the end of file. Kindly suggest me an idea Thanking you Regards Baskaran NK -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.per

select the content of matching braces

2005-05-05 Thread baskaran
x) (i.e. i want to select the content of matching braces) if i use (.*) it goes to the last brace in the end of file. Kindly suggest me an idea Thanking you Regards Baskaran NK -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.per

search and replace array variables contents

2004-07-20 Thread Baskaran
dea Thanking you Regards Baskaran NK -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>