Re: split

2013-05-03 Thread Edward and Erica Heim
otype access to a specific website where I know the data that I am looking for and extract it with a simple script. I do appreciate the feedback that ultimately - as part of my journey with web client programming - I need to learn how to use HTML parsers. Best regards, Edward On 3/05/2013 9:

split

2013-05-03 Thread Edward and Erica Heim
I print $data, I can see the individual lines of the HTML data but I'm not clear on the "pattern" that I should use in split or if there is a better way to do this. I understand that there are packages to parse HTML code but this is also a learning exercise for me. Thanks in adv

Re: Mozilla::CA installation

2013-03-25 Thread Edward and Erica Heim
Hi Raf, Yours is the first email that I have received on this topic. Not sure why I missed the other. I tried a forced installation but this didn't work. See below. Thanks and best regards, Edward On 26/03/2013 9:14 AM, rjc wrote: On Thu, Mar 14, 2013 at 10:57:15PM GMT, Edward and

Mozilla::CA installation

2013-03-14 Thread Edward and Erica Heim
with the paths in @INC (see below) but why should a standard install process fail? LWP was the first CPAN package that I tried to install and I didn't have any problems with this. Any help

Finding time difference from two strings

2007-10-26 Thread Wijaya Edward
columns (begin + end) which I need to find the time difference between them -- Edward Institute For Infocomm Research - Disclaimer -This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do

Verified for Spam -RODIN- I2R: Howto Create An Acti onable Button with CGI.pm

2007-04-25 Thread Wijaya Edward
ame=>'action', -value => 'Run MySCRIPT'), print endform; Can anybody suggest how can it be done with CGI.pm? The complete code can be found here: http://dpaste.com/9026/plain/ -- Regards, Edward WIJAYA Institute For Infocomm Research - Disclaimer ---

RE: Problem Accessing Perl ModulesThrough .htaccess

2007-04-09 Thread Wijaya Edward
without "use lib"). But not in through Apache. -- Edward WIJAYA SINGAPORE -- > mailto: [EMAIL PROTECTED] > http://home.arcor.de/jeffpang/ Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you are not t

RE: Problem Accessing Perl ModulesThrough .htaccess

2007-04-09 Thread Wijaya Edward
nv" direction in the httpd.conf. How do you do that? I can't see any directive related to that. Please advice. -- Edward WIJAYA SINGAPORE 2007/4/9, Wijaya Edward <[EMAIL PROTECTED]>: > > > Dear experts, > > I have the following simple Perl script (called "

Verified for Spam -RODIN- I2R: Problem Accessing Pe rl Modules Through .htaccess

2007-04-09 Thread Wijaya Edward
Dear experts, I have the following simple Perl script (called "hellom.cgi"): __BEGIN__ #!/usr/bin/perl use CGI qw/:standard :html3/; use CGI::Carp qw( fatalsToBrowser ); $CGI::POST_MAX=1024 * 100; # max 100K posts1 #-- # BEGIN { # if ( $EN

RE: how to make a perl script run in background..?

2006-10-15 Thread Wijaya Edward
$arg2, $filename ); ### Do anything else the main thread needs to do here, *before* calling join. ### The joins will block until their threads complete. ### The values returned by the functions are returned when you join the thread. my @array = $thrArray->join; print "@array\n"; __EN

RE: Maximum value in Hash

2006-10-02 Thread Wijaya Edward
It depends what do you mean by maximum. Assume you have numerical value as hash values. You can do: use List::Util qw(max) my %hash = { foo => 3, bar=>2, qux=> 1}; my $max_val = max values %hash; Hope that helps. -- Regards, Edward WIJAYA Fro

RE: Position Weight Matrix of Set of Strings with Perl

2006-09-06 Thread Wijaya Edward
;G' => [ 0, 0, '0.5', '0.5', 0, '0.5' ] }; Instead of the correct: $VAR1 = { 'A' => [ '0', '1', '0', '0', '0', '0' ], 'T' => [ '0', '0', '0',

Position Weight Matrix of Set of Strings with Perl

2006-09-06 Thread Wijaya Edward
; => ['0.25','0','0.25'] } In this link you can find my incredibly naive and inefficient code. Can any body suggest a better and faster solution than this: http://www.rafb.net/paste/results/c6T7B629.html Thanks and Regards, Edward WIJAYA SINGAPORE -

RE: Create HTML code with perl

2006-09-03 Thread Wijaya Edward
asier. Regards, Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpos

RE: get week numeration in a year?

2006-09-01 Thread Wijaya Edward
Hi Look for a CPAN module called Date::Calc. There you can find a method called Week_of_Year. Hope that's what you want. Regards, -- Edward WIJAYA SINGAPORE From: Practical Perl [mailto:[EMAIL PROTECTED] Sent: Fri 9/1/2006 3:34 PM To: beginners

RE: Problem with library paths

2006-08-21 Thread Wijaya Edward
rsion when running as root, and is the directory subtree it is under readable by your user? Salam, Edward WIJAYA From: Toddy Prawiraharjo [mailto:[EMAIL PROTECTED] Sent: Tue 8/22/2006 9:48 AM To: Perl Beginners Subject: Problem with library paths Hello al

Re: Modifying a string

2006-06-02 Thread Wijaya Edward
gt; $ perl -e '$str = "0a0a0a0a0a"; $str2 =join(":",$str=~ /(..)/g); > print "$str2\n";' > > prints: > > 0a:0a:0a:0a:0a I think this is even better, since this doesn't restrict you to have even number of characters $ perl -e '$

Re: Modifying a string

2006-06-02 Thread Wijaya Edward
0a0a0a"; $str2 =join(":",$str=~ /(..)/g); print "$str2\n";' prints: 0a:0a:0a:0a:0a Regards, Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you are not the intended

Re: sorting?

2006-05-29 Thread Wijaya Edward
(["foo woo","[EMAIL PROTECTED]"], ["bar woz","[EMAIL PROTECTED]"], ["foo qux", "[EMAIL PROTECTED]"],); foreach my $disp_name ( sort {$a->[0] <=> $b->[0]} @AoA ) { # do whatever

Howto check a parameter size in CGI.pm

2006-05-22 Thread Wijaya Edward
27;) # of file field I've tried with: uploadInfo($file)->{'Content-Length'}; But it doesn't print anything. Regards, Edward Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you are not the int

Converting a string to a filehandle

2006-05-21 Thread Wijaya Edward
ample, my $filehandle = do_sth_to_convert($string); Such that I can straight away do things like: while (<$file_handle>) { print; } [download] Regards, Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and may be

Re: Howto include string in system call - Answering (a) suggestion

2006-05-19 Thread Wijaya Edward
;[EMAIL PROTECTED]', '-type', 'sugar', '-unit', '10' ]; TOTAL: 1000 - [EMAIL PROTECTED] __END OUTPUT__ Hope to hear from you again. -- Regards, Edward WIJAYA Institute For Infocomm Resea

Re: Howto include string in system call

2006-05-19 Thread Wijaya Edward
ript can be found here: http://rafb.net/paste/results/8oFtJS58.html I tried not to trouble you again after this. But your expert advice is highly valued Regards, Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and

Re: Howto include string in system call

2006-05-19 Thread Wijaya Edward
!}; __END__ But why it still doesn't do the job? If you don't mind you can try it. The accompanying simple script for "compute_price.pl" can be found here: http://rafb.net/paste/results/t6kbE092.html Truly hope to hear from you again. Regards, Edward WIJAYA I

Re: RE: Howto include string in system call

2006-05-19 Thread Wijaya Edward
this:: __BEGIN__ use Acme::Spork; my $req_id = spork( sub { system("perl compute_price.pl -eml \"$uemail\" -type $ct -unit $nu"); } ) or die qq {Could not fork for spork: $!}; __END__ Any idea? -- Regards, Edward WIJAYA Institute For Infocomm Research - Discl

Howto include string in system call

2006-05-19 Thread Wijaya Edward
unit $some_unit"); But while debugging for mycode.pl I can't see the value for under EMAIL option, while I can see the value for TYPE and UNIT option. What's wrong with it? -- Regards. Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer

Looking for strategy advice for perl based cgi script

2006-05-18 Thread Wijaya Edward
trategy to achieve all these steps? PS. actually I do have the script ready, and it is accessible here: http://defiant.i2r.a-star.edu.sg/~ewijaya/MyTest/cgi-bin/mail_result.cgi But it still doesn't do the job as I mentioned above. -- Regards, Edward WIJAYA SINGAPORE Institu

Mismatch Positions of Two Ambiguous Strings

2006-04-26 Thread Wijaya Edward
BEGIN__ sub mismatches { my($source, $target) = @_; my @sparts = ($source =~ /(\[.*?\]|.)/g); my @tparts = ($target =~ /(\[.*?\]|.)/g); scalar grep $tparts[$_] !~ /^$sparts[$_]/, 0 .. $#sparts; } __END__ Where did I go wrong? I humbly seek advice. Regards Edward WIJAYA -

Re: arguments

2006-04-20 Thread Wijaya Edward
Hi, > It's probably slower and higher memory usage, but it seems to make > sense. > Any one else have suggestions on how to keep the args straight? > I would document my functions first. Pod is good. The hash ref idea is good for constructors with lots of optional params.

Re: Split function

2006-04-16 Thread Wijaya Edward
> Hi, > > To run/use Split function in the perl script , is it necessary to > include/add any perl module ? No no need. It is a built in function. perldoc -f split -- Regards, Edward WIJAYAA Institute For Infocomm Research - Disclaimer - T

Simple Issues with Pod (on verbose and help page without param).

2006-04-03 Thread Edward WIJAYA
=head1 OPTIONS =over 8 =item B<-help> Print a brief help message and exits. =item B<-man> Prints the manual page and exits. =back =head1 DESCRIPTION B will read the given input file(s) and do someting useful with the contents thereof. =cut -- Regards, Edward WIJAYA SINGAPOR

Re: How to extract the path of the file name in perl

2006-03-28 Thread Wijaya Edward
Hi, > How to extract the path of the file name in perl use File::Basename especially the method: fileparse() Do: perldoc File::Basename Regards, Edward WIJAYA --- I²R Disclaimer -- This email is confidential

Re: Howto Install a Perl Wrapper Module for a C Library in HomeDirectory

2006-03-24 Thread Wijaya Edward
config file that needs edited. I'd try DL > (the Perl.pm) > the tar.gz and extract to disk then look for readme and/or > installation > (directions/instructions). > Still, I got the same error report. Can't get it working. Regards, Edward WIJAYA

Howto Install a Perl Wrapper Module for a C Library in Home Directory

2006-03-24 Thread Wijaya Edward
estion: perl Makefile.PL CCFLAGS="$CCFLAGS -I$HOME/MyBioTool/libstree-0.4.2/include" LDDLFLAGS="$LDDLFLAGS -L$HOME/ MyBioTool/libstree-0.4.2/lib" But without any success. It returns: Note (probably harmless): No library found for -lstree Writing Makefile for Tree::Suffix Does

Fast way to find neighboring strings ( wth Hamming Distance)

2006-03-02 Thread Edward WIJAYA
$source =~ /(\[.*?\]|.)/g ); my $mismatch_count = scalar grep substr( $target, $_, 1 ) !~ /^$sparts[$_]/, 0 .. $#sparts; return ( $mismatch_count, scalar(@sparts) ); } sub enum { return @{ $_[1] } unless --$_[0]; map { my $nuc = $_; map { $nuc .

Re: new for reading file containing multiple records

2006-01-06 Thread Wijaya Edward
q() ) { push @seqs, $seq->seq(); } #end while return [EMAIL PROTECTED]; } Hope that helps. Regards, Edward WIJAYA - Original Message - From: chen li <[EMAIL PROTECTED]> Date: Saturday, January 7, 2006 9:27 am Subject: Re: new for reading file containing multiple records >

Re: Hash '... => +{ ...' synatx

2005-12-10 Thread Edward WIJAYA
There's probably no need for the plus in that case (after a =>) -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Run *.pl file from Emacs

2005-12-09 Thread Edward WIJAYA
On Fri, 09 Dec 2005 19:46:56 +0800, Andrej Kastrin <[EMAIL PROTECTED]> wrote: but is there any solution to run it too. ESC-X path/to/executable or other alternative is to run it under "e-shell" accessible through CTRL-C-D. -- Regards, Edward WIJAYA SINGAPORE -- To uns

Problem obtaining rows with HTML::TableExtract

2005-12-07 Thread Wijaya Edward
PPV', 'sASP', ] ); $te->parse($temp_file); my @all_table_content = $te->tables; # Here to extract the 'last' row my @total = @{ $all_table_content[0]->[-1] }; print Dumper [EMAIL PROTECTED] ; __END__ --- Regards, Edward WIJAYA SINGAPORE --

Re: how to get file's creation time

2005-11-27 Thread Wijaya Edward
. Read this comment by Randall Schwartz, http://www.perlmonks.org/index.pl?node_id=479799 Hope it gives you a hint ... --- Regards, Edward WIJAYA SINGAPORE -- This email is confidential and may be privileged. If you are not the intended recipie

Replacing a Bracketed String with "N"

2005-11-22 Thread Edward Wijaya
, and number of strings enclosed by the bracket can consist up to 4 bases, i.e. [ATCG]. -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: chomp and chop

2005-11-16 Thread Edward WIJAYA
cific (like \r). To view the hidden string you can use this command: cat -A filename.txt Then in Perl you can remove them using regex: sub remove_trailing_newline { $_[0] =~ s/[\r\n]+\Z//; } Hope that helps. -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PRO

Shortest One-liner to Rename Files

2005-11-10 Thread Wijaya Edward
}' Hope to hear from you again. -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Connecting to a database using perl

2005-11-08 Thread Wijaya Edward
Check this out: http://www.perlmonks.org/?node=Tutorials#datafiles -- Regards, Edward WIJAYA - Original Message - From: Manish Uskaikar <[EMAIL PROTECTED]> Date: Wednesday, November 9, 2005 1:53 pm Subject: Connecting to a database using perl > Hi, > > I am a real newb

Input Example Errata -- How to put brackets ....

2005-10-28 Thread Edward WIJAYA
Dear John, Just small correction in the input sample. my @ar5 = qw(GTATG-4 TGGGT-1); should be this: my @ar5 = qw(GTATG-4 TGGGT-7); In short they are already ordered. -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: How to put brackets in a string given substrings

2005-10-28 Thread Edward WIJAYA
s/i ) { $id += $-[ 0 ]; substr( $str, $id, length $subs ) =~ tr/A-Z/a-z/; } } $str =~ s/([a-z]+)/[\U$1\E]/g; return $str; } print "\n"; __END__ -- Regards, Edward WIJAYA SINGAPORE On Fri, 28 Oct 2005 18:42:11 +0800, John W. Krah

How to put brackets in a string given substrings

2005-10-28 Thread Wijaya Edward
$ar ) { my $idx = index($str,$subs); my $bgn = $idx; my $end = $idx+$slen+1; substr($str,$bgn,0,"["); substr($str,$end,0,"]"); } print "$str\n"; return ; __END__ Really hope to hear from you again. --- Regards, Edward WIJ

Enlisting All Possible Ranges of An Array

2005-10-25 Thread Edward Wijaya
'BCDE', 'CD', 'CDE', 'DE' ]; Later, I also want to extend this to deal with AoA as an input. But with the same concept. Is there an efficient way to achieve it? I truly do not know how to go about

Re: how to get defined number of digits after point of a variable

2005-10-20 Thread Wijaya Edward
ints: 2.56 Read: perldoc perlretut. Hope that helps -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: perl equivalent of ps

2005-10-16 Thread Edward WIJAYA
ample snippet to measure total memory used up with our script. Hope that helps. -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: for each

2005-10-07 Thread Wijaya Edward
Hi Mark, > > > > Edward, for a beginner, would you mind explaining what the >(1 .. $#arr) $#arr is the index of the last element in the array > and qw actually do in this code.? Cheers with "qw" you are treating values inside as individual words automatically

Re: for each

2005-10-07 Thread Wijaya Edward
arr[$_]\n"; }' prints: b c Is that what you want? -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

How to Update Hash to Itself Recursively

2005-09-16 Thread Wijaya Edward
X' => 1, 'BY' => 1, 'BZ' => 1, 'CW' => 1, 'CX' => 1, 'CY' => 1, 'CZ' => 1, 'AWW' => 1, 'AWX' => 1, 'AWY' => 1, 'AWZ' => 1, 'AXW' => 1, 'AXX

Re: Help with sprintf

2005-09-12 Thread Wijaya Edward
-MPOSIX=strftime -e ' my $time = time; $time -= 24*60*60*( strftime('%u', localtime($time)) - 1); print strftime ':%y%m%d', ' > Any ideas what I'm doing wrong? > Regards, Edward WIJAYA SINGAPORE -- To unsubscri

Re: dereferencing

2005-08-24 Thread Edward WIJAYA
quot;Array Size: $asize\n"; print Dumper $aref;' Prints: Array Size: 3 $VAR1 = [ 1, 2, [ 'a', 'b', 'c', 'd' ] ]; -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Passing nested hash to a function

2005-08-13 Thread Wijaya Edward
> Hi Hi > output. What am I missing? Perhaps this is what you want? sub func { my $h = shift; for $k (keys %$h) { print "$k\n"; for $n ( keys %{ $h->{$k} } ) { print "$n => $h->{$k}{$n}\n"; } Read: perldoc perldsc Hope

Re: Remembering Positions in Array after processing the element

2005-07-31 Thread Wijaya Edward
Dear John, Thanks so much for your snippet. It's been really really helpful. > I guess you didn't see Chris' posting. :-) I'm really sorry. Will try to be more attentive next time. --- Regards, Edward WIJAYA -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

Re: Remembering Positions in Array after processing the element

2005-07-31 Thread Wijaya Edward
Hi John, I was testing your code below with this array: my @x = qw( * * A B C D ); but how come in the end it gives: * XA * XB XC XD X instead of * * XA XB XC XD -- Regards, Edward WIJAYA SINGAPORE - Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]&

Remembering Positions in Array after processing the element

2005-07-29 Thread Edward WIJAYA
x27;,'*'); # returns: ['AB', 'BA','CB','*'] my @array3 = ('A','B','C','D'); # returns: ['AB', 'BA', 'CB','DC'] my @result = get_array(@array); print Dumper [EMAIL PR

Re: perl newbie question

2005-07-25 Thread Edward WIJAYA
erl -e ' open FH, "; close FH or die $!; foreach $i (($#lines - $n) .. $#lines) { print "$lines[$i]\n";} ' -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Can anyone guide me for : Data Structures in Perl

2005-07-17 Thread Wijaya Edward
You can find everything you need in: perldoc perldsc -- Regards, Edward WIJAYA SINGAPORE > > can anybody help me with a link or a tutorial for > understanding the Datastructures in perl. > > Example, Array of Array, Hash of Array, Hash of Hash, > Array of Hash. -- To u

Re: How do I get a Hash name after passing the ref?

2005-07-04 Thread Edward WIJAYA
On Mon, 04 Jul 2005 17:31:03 +0800, Tielman Koekemoer (TNE) <[EMAIL PROTECTED]> wrote: After I passed a hash ref to a subroutine, how can I see what the hash name was? i.e.: I don't think that's possible. Why do you need that? -- Regards, Edward WIJAYA SINGAPORE -- To uns

Re: how to append blocks in same file

2005-06-22 Thread Wijaya Edward
> and i want to append(or i should say merge) these blocks and get a > file like this: > aaabbbccc > aaabbbccc I've asked the same question some time ago, check this out: http://groups-beta.google.com/group/perl.beginners/browse_thread/thread/4f28012f744d10e0/7638b6eb94a626d

Re: where to get perldoc Net::Telnet? missing in the perldoc from perldoc.perl.org

2005-06-20 Thread Wijaya Edward
Which version are you using? Check the standard CPAN site, you will find: http://search.cpan.org/~jrogers/Net-Telnet-3.03/lib/Net/Telnet.pm HtH -- Regards, Edward WIJAYA SINGAPORE - Original Message - From: MEENA SELVAM <[EMAIL PROTECTED]> Date: Tuesday, June 21, 2005 12:29 pm S

Re: Tabular Data, Group By Functions

2005-06-14 Thread Edward WIJAYA
Day by IN\n"; print Dumper \%group_day_in ; print "Group Day by Out\n"; print Dumper \%group_day_out ; __DATA__ ID In Out Day 1 5 2 1 2 4 9 2 3 3 3 2 4 6 7 3 5 5 0 5 6 7 9 3 7 8 9 4 8 6 6 4 -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Hash of Lists

2005-06-06 Thread Wijaya Edward
the Hash with key "flinstones" ---> @{$array_ref} is dereferncing an array $array_ref 2. Thus you have an array of that hash (i.e. flinstones as key). 3. Finally you push "wilma" and "betty" into that array Hope it's clear. --- Regards, Edward WIJAYA S

Re: Can erpl support recursice call?

2005-05-22 Thread Wijaya Edward
re sensible to me? Which also works. > recursive(0); -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Can perl support recursive call?

2005-05-22 Thread Wijaya Edward
ectories closedir(DIR); foreach (@subdirs) { # Process subdirectory files push(@out,$path.$_.$delim."\n"); proc_files($path.$_.$delim); proc_dirs("$path$_$delim"); # RECURSIVE CALL } } __END__ -- Regards, Edward WIJAYA SINGAPORE Hi, ever

Re: columnwise analysis

2005-05-13 Thread Edward WIJAYA
Dumper; my %hash; my $sub_length = 2; while () { chomp; for my $j (0 .. length - $sub_length) { push @{$hash{$j}}, substr $_, $j, $sub_length; } } print Dumper \%hash; foreach my $hkey (keys %hash) { foreach my $i ( 0 .. $#{ $hash{$hkey} } ) { print "$hash{$hkey}[$i]

Re: about substring

2005-05-09 Thread Edward WIJAYA
After second thought This line: my @y = grep { $_ if ($_ =~ /\d+/)} @list; could be simplified with this: my @y = grep { /\d+/ } split(/\s+/,$file); Since grep { $_ if /\d+/ } wouldn't match on 0, but grep /\d+/ would. I'm still wondering how can I do that with "unpack" :-

Re: about substring

2005-05-09 Thread Edward WIJAYA
=~ /\d+/)} @list; print Dumper [EMAIL PROTECTED]; __END__ Gives: $VAR1 = [ '12', '1', '12.435', '13.66', '34.6', '32.1', '32' ]; Hope that's what yo w

Re: Where will I find perl scripts

2005-05-07 Thread Edward WIJAYA
Charles, On Sat, 7 May 2005 14:50:37 -0500, Charles K. Clarkson <[EMAIL PROTECTED]> wrote: plain scary. (Wait, I think _she_ wrote that module, too. Just stay away from _her_. :) _HE_ you mean! :-) http://www.abigail.nl/ -- Regards, Edward WIJAYA Singapore -- To unsubscribe, e-mail:

Re: Howto Dynamically Combine Multiple Array in HoA

2005-05-04 Thread Wijaya Edward
er apart from your suggestion, this also worked: my $iter = Algorithm::ChooseSubsets->new([ sort keys %hoa], 2, 1); Thanks so much. --- Regards, Edward WIJAYA -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Howto Dynamically Combine Multiple Array in HoA

2005-05-03 Thread Wijaya Edward
my $value = reverse (join '', map $_->[$i], @[EMAIL PROTECTED]); push @{$hoa{$composite_key}}, $value; } } return %hoa; } -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] Fo

Howto Dynamically Combine Multiple Array in HoA

2005-05-03 Thread Edward WIJAYA
with single key for my $key (keys %hoa ) { $new_hoa{$key} = $hoa{$key}; } # This is an idiot way (manual) to do it and it's not dynamic # i.e. only satisfy for %set_hoa1 # How can I construct automatically so that it may apply to va

Re: DFA::Simple

2005-04-25 Thread Edward Wijaya
--- Alex Lisbaron <[EMAIL PROTECTED]> wrote: > How can I install this package on WIN2K? Use PPM, like: dos-prompt> ppm then ppm> install DFA-Simple --- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL P

Re: Require / Use

2005-04-21 Thread Wijaya Edward
This is the reading suggested when I asked the same questions some time ago . http://perldoc.perl.org/perlfaq8.html#What-s-the-difference-between-require-and-use- --- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Measuring Substring with Hash

2005-04-08 Thread Edward Wijaya
_score; my $offset = 0; [snip] my $idx = index($str, $frag, $offset) + 1; [snip] $offset = $idx; Don't mean to nitpick. Just wondering if it's possible to modify Krahn's snippet to accomodate the overlapping cases? yet another fans request ;-) -- Edward WIJAYA Singap

Measuring Substring with Hash

2005-04-08 Thread Edward Wijaya
my $idx = index($str, $frag) + 1; for my $pos ($idx .. $idx + (length($frag) - 1)) { $position_score{$pos} = 1; }; }; my $total_score = 0; for my $score (values %position_score) { $total_score += $score; }; return $total_score; }; __END__ -- Edward WIJAY

Re: ideintifying whether a module is already installed or not

2005-03-27 Thread Edward Wijaya
On Sun, 27 Mar 2005 20:28:42 +0800, Manish Sapariya <[EMAIL PROTECTED]> wrote: Hi list, Hi How do I know whether a given module is installed on machine or not? perl -MModule::Name -e 'print "it is installed\n";' or it's simpler variant perl -MModule::Name -e1

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
Dear Steven, Sorry, don't mean to nitpick. On Sat, 26 Mar 2005 23:09:26 +0800, Steven Schubiger <[EMAIL PROTECTED]> wrote: On 26 Mar, Edward Wijaya wrote: It's fine, as it is. Typedefs most often reside in header files, although, they can be used in the main file without suf

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
int j; y = x = xx; tmp= x+5.5; tmp -= (x+0.5)*log(tmp); ser=1.0190015; for (j=0;j<=5;j++) ser += cof[j]/++y; return -tmp+log(2.5066282746310005*ser/x); } -- Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
Hi Steven, On Sat, 26 Mar 2005 22:08:44 +0800, Steven Schubiger <[EMAIL PROTECTED]> wrote: Try "long double" instead, which gives you 10 Bytes and the format char %Lf. Still wont' do. It still return 'inf' for N>500 -- Edward WIJAYA Singapore -- To unsubscr

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
e around 1000-2000. Any other possibility? -- Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
-0.5395239384953e-5}; int j; y = x = xx; tmp= x+5.5; tmp -= (x+0.5)*log(tmp); ser=1.0190015; for (j=0;j<=5;j++) ser += cof[j]/++y; return -tmp+log(2.5066282746310005*ser/x); } #-End of My Code-- -- Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PRO

Re: Taking Multiple Files in Pairs and Run it Iteratively

2005-03-17 Thread Edward Wijaya
On Tue, 15 Mar 2005 02:29:06 +0800, John W. Krahn <[EMAIL PROTECTED]> wrote: Edward Wijaya wrote: [snip] Here is one way to do it: my %files; for ( @ARGV ) { next unless /(.+)\.(?:fa|rs)$/; push @{ $files{ $1 } }, $_; } for my $base ( keys %files ) { if ( @{ $files{

Taking Multiple Files in Pairs and Run it Iteratively

2005-03-13 Thread Edward Wijaya
um (@sum){ print "$sum\n"; } __END__ How can I make my code above such that it can take all multiple files iteratively? to give output sth like this: data1 sum_of_elements from data1.fa and data1.rs data2 sum_of_elements from data2.fa and data2.rs -- Edward WIJAYA Singapore -- To unsubs

Re: Calling Files automatically

2005-02-25 Thread Edward WIJAYA
e directory? For example, will there sometimes be a data14R.fa file and no corresponding data14P.fa file? No, there will always be a corresponding file. i.e. *R.fa always have its *P.fa file Will there be other files located in this directory? Yes, but they won't be any other *R.fa *P.fa type.

Calling Files automatically

2005-02-25 Thread Edward Wijaya
Hi, How can I modify the early part of code below such that I don't have to manually key in the files this way: perl mycode.pl data1P.fa data1R.fa data2P.fa data2R.fa etc I.e. just by typing this will do: perl mycode.pl Thanks so much for your time beforehand. -- Edward WIJAYA Sing

Re: rename all files

2005-02-19 Thread Edward Wijaya
ontents before the directories themselves. BTW your code would have been clear, btw, if you'd said, for example: rename $old, $new or warn "rename: $!\n"; also, "$new = lc $old" is more readable than $new = "\L$old" My suggestion is untested, it'l

Re: Getting the content of a .doc file under Unix

2005-02-14 Thread Edward WIJAYA
/search.cpan.org/~mschwartz/OLE-Storage-0.386/tools/lhalw Of course it's rather outated. HtH -- Regards, Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Trying mod_perl for the first time

2005-01-26 Thread Edward Wijaya
approach? Hopefully this question is not far off topic. Thanks a lot beforehand. -- Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Benchmarking a sort with array reference problem

2005-01-21 Thread Edward Wijaya
blem occur. Any idea? Thanks so much beforehand. -- Edward WIJAYA Singapore __BEGIN__ #!/usr/bin/perl -w use strict; use Benchmark 'cmpthese'; my @array = qw(flow loop pool Wolf root sort tour); #The script runs ok if I remove this 'cmpthese' snippet cmpthese (-5, {ra

Re: Extracting and email address

2005-01-21 Thread Edward Wijaya
On Fri, 21 Jan 2005 10:47:33 +, Andrew Black <[EMAIL PROTECTED]> wrote: Is there a module to extract the real email address from a header. e.g. Yes there is "Email::Find" Why would you want to extract email addresses? Spamming? -- Edward WIJAYA Singapore -- To unsubscribe

Re: A second beginner's question

2005-01-15 Thread Edward Wijaya
On Fri, 14 Jan 2005 09:47:50 -0800, John W. Krahn <[EMAIL PROTECTED]> wrote: Perl has a FAQ on shuffling, have you read that yet? perldoc -q shuffle or use CPAN module: List::Util it has a built in *shuffle* function. -- Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTE

Re: Choosing between Regexp and Substr

2005-01-06 Thread Edward Wijaya
_distance_jkrahn1 { my $ret = ( $_[0] ^ $_[1] ) =~ tr/\0//; $ret } sub hamming_distance_jkrahn2 { my $ret = () = ( $_[0] ^ $_[1] ) =~ /\0/g; $ret } __END__ -- Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Choosing between Regexp and Substr

2005-01-03 Thread Edward Wijaya
etween these two? sub hamming_distance_string { ( $_[0] ^ $_[1] ) =~ tr/\0// } sub hamming_distance_string { () = ( $_[0] ^ $_[1] ) =~ /\0/g } PS: Thanks to Ted and Jenda for the response as well. -- Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [E

Choosing between Regexp and Substr

2005-01-02 Thread Edward WIJAYA
Thanks so much for your time. And wishing you all a very Happy and Prosperous New Year 2005! -- Regards, Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: How to install Tk.pm,LWP.pm?

2004-12-15 Thread Edward WIJAYA
e State: Dos> PPM then: ppm> install Module-Name HtH -- Regards, Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: basic search engine

2004-12-15 Thread Edward WIJAYA
/search.cpan.org/dist/Plucene/lib/Plucene.pm It is a search engine in itself. HtH -- Regards, Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

  1   2   3   4   5   6   7   8   9   10   >