Re: Math::GMP

2010-02-25 Thread Dave Tang
orking fine. Cheers, -- Dave Tang -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Math::GMP

2010-02-25 Thread Dave Tang
On Thu, 25 Feb 2010 19:54:13 +1000, Salvador Fandino wrote: On 02/25/2010 07:14 AM, Dave Tang wrote: Dear list, I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I have installed a GMP library (required for Math::GMP) but when I try to install Math::GMP I get an

Re: Math::GMP

2010-02-25 Thread Dave Tang
On Thu, 25 Feb 2010 19:54:13 +1000, Salvador Fandino wrote: On 02/25/2010 07:14 AM, Dave Tang wrote: Dear list, I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I have installed a GMP library (required for Math::GMP) but when I try to install Math::GMP I get an

Re: Math::GMP

2010-02-25 Thread Dave Tang
On Thu, 25 Feb 2010 18:30:33 +1000, Octavian Rasnita wrote: From: "Dave Tang" Dear list, I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I have installed a GMP library (required for Math::GMP) but when I try to install Math::GMP I get an er

Re: Math::GMP

2010-02-25 Thread Dave Tang
On Thu, 25 Feb 2010 17:27:25 +1000, Shlomi Fish wrote: Hi Dave! Hi Shlomi! Thank you for your reply. [snip] I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I have installed a GMP library (required for Math::GMP) but when I try to install Math::GMP I get an error

Math::GMP

2010-02-24 Thread Dave Tang
0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output Files=6, Tests=0, 0 wallclock secs ( 0.04 usr 0.02 sys + 0.09 cusr 0.03 csys = 0.18 CPU) Result: FAIL Failed 1/6 test programs. 0/0 subtests failed. make: *** [test_dynamic] Error 255 Many thanks, -- Dave

Re: Shorthand for binary bitwise math?

2010-02-22 Thread Dave Tang
On Tue, 23 Feb 2010 11:23:23 +1000, Steve Bertrand wrote: I belong to several technical lists, and the de-facto standard is to Reply-All. Understood and thank you for your answer. -- Dave Tang -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail

Re: Shorthand for binary bitwise math?

2010-02-21 Thread Dave Tang
#x27;s email with my thank you note. -- Dave Tang -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Perl script to monitor memory usage on unix box

2010-02-08 Thread Dave Tang
On Mon, 08 Feb 2010 22:52:37 +1000, Shawn H Corey wrote: Dave Tang wrote: Hi everybody, I want to write a script that checks memory usage of my RHEL box, and ran as a cron job say every 10 minutes. I could write the Perl script to run a system command like "ps aux", parse that i

Perl script to monitor memory usage on unix box

2010-02-08 Thread Dave Tang
Hi everybody, I want to write a script that checks memory usage of my RHEL box, and ran as a cron job say every 10 minutes. I could write the Perl script to run a system command like "ps aux", parse that information and kill a job if >90% of the total system memory (and I realise most of

Re: speed test

2009-12-04 Thread Dave Tang
On Sat, 05 Dec 2009 10:07:34 +1000, Jenda Krynicky wrote: what was the name of that law? Something that said that the speed of computers doubles every ??? years. Were you referring to this? http://en.wikipedia.org/wiki/Moore's_law Dave -- Using Opera's revolutionary e-mail client: http:/

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Dave Tang
On Sun, 29 Nov 2009 23:39:58 +1000, Huub van Niekerk wrote: open my $LPR, '|-', qw/lpr -PDeskJet940C/ or die "can't fork lpr: $!"; $ENV{"PATH"} = ""; at the start of the script, it doesn't seem to complain any more. Hope that helps, Thank you, though I'm not out of problems yet. The m

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Dave Tang
On Sun, 29 Nov 2009 16:30:56 +1000, Huub van Niekerk wrote: Hi, Hello, I started getting this error after upgrading from Fedora 11 to 12. The line of code hasn't been changed: open my $LPR, '|-', qw/lpr -PDeskJet940C/ or die "can't fork lpr: $!"; The error is: "Insecure $ENV{PATH} whil

Re: Regex to get last 3 digits of a number.

2009-11-24 Thread Dave Tang
On Tue, 24 Nov 2009 18:33:30 +1000, Dermot wrote: 2009/11/23 Dave Tang : On Tue, 24 Nov 2009 09:39:09 +1000, Dermot wrote: 2009/11/23 Dave Tang : On Mon, 23 Nov 2009 23:14:51 +1000, Shawn H Corey Hi Shawn et al., I am also intrigued by the \z anchor. I had a look at perldoc

Re: Regex to get last 3 digits of a number.

2009-11-23 Thread Dave Tang
On Mon, 23 Nov 2009 23:14:51 +1000, Shawn H Corey wrote: shadow52 wrote: [snip] The number is 0111 I was just wanting to get the last 3 digits from this number to be able to get an exact word phrase from my already loaded Hash table that I have created for various numbers tha

Re: AW: Perl CGI Incremental find

2009-11-17 Thread Dave Tang
On Tue, 17 Nov 2009 19:20:42 +1000, Thomas Bätzler wrote: Hi, Jeff Pang wrote: On Nov 17, 2009, Dave Tang wrote: > Is it possible to implement an incremental find* feature on a Perl CGI > page? I'm running Apache2 with mod_perl on linux. > > For example, if I have a lis

Perl CGI Incremental find

2009-11-16 Thread Dave Tang
Hi everybody, Is it possible to implement an incremental find* feature on a Perl CGI page? I'm running Apache2 with mod_perl on linux. For example, if I have a list of stuff (A, Aa, B, Bb, C, CA, etc. stored in a file or database) and when a user starts typing in A into the web form, 2 su

Re: AW: AW: How do I pick one random element from an array?

2009-11-03 Thread Dave Tang
On Tue, 03 Nov 2009 17:48:55 +1000, Thomas Bätzler wrote: Dave Tang asked: Just a quick question, how does Perl interpret something like $array[0.7995038473872]? Just like $array[ int(0.7995038473872) ], i.e. the floating point number is coerced into an integer value by cutting off the

Re: AW: How do I pick one random element from an array?

2009-11-02 Thread Dave Tang
On Tue, 03 Nov 2009 17:23:38 +1000, Thomas Bätzler wrote: Majian asked: [...] print "Array of random: $array[rand @array]\n"; I thoght it might work but it doesnt. I hope someone could give me an idea to work this out... TIMTOWTDY: a) print "Array of random: $array[rand( @array ) ] \n

Re: Database Help

2009-10-09 Thread Dave Tang
On Sat, 10 Oct 2009 00:07:01 +1000, Jyoti wrote: Hello All, I am able to connect to postgreSQL database via my server. I used PHP to connect .. now i wanna know how to create databases via php and access queries so that i get the results on my server. I have to make php scripts. But where shou

Re: Server HELP-urgent

2009-10-07 Thread Dave Tang
On Wed, 07 Oct 2009 17:38:59 +1000, Raymond Wan wrote: Did you consider Dave's suggestion about using netblast (which I honestly have never used)? Ah I shouldn't have gotten it wrong in the first place, but its wwwblast. Basically just download the wwwblast-arch-os.tar.gz (so if you're on

Re: BLAST HELP

2009-10-06 Thread Dave Tang
On Tue, 06 Oct 2009 21:34:04 +1000, Jyoti wrote: Thanks for your help Dave. Not a problem Jyo. Yes that was Javascript.. Just as m a beginner, I thot we can convert javascipts to cgi scripts.!!! Am I wrong? You can use Perl to write a cgi script that outputs JavaScript code. You can't u

Re: Error HELP PLZ !!!

2009-10-05 Thread Dave Tang
On Tue, 06 Oct 2009 11:57:53 +1000, Jyoti wrote: Hello All, Can anyone please help with one small error I am getting for line 16( The one which is bold n italic below.) The error is : Can't call method "str" on an undefined value at firstpage.pl line 16. Just a warning, I am also a beginn

Re: BLAST HELP

2009-10-05 Thread Dave Tang
On Tue, 06 Oct 2009 13:33:27 +1000, Dave Tang wrote: On Tue, 06 Oct 2009 12:11:47 +1000, Jyoti wrote: Hello, Hello Jyoti, Can anyone help me to know how to make a script which can take any sequences by user as user input and give blast results as user output. This should work in a

Re: BLAST HELP

2009-10-05 Thread Dave Tang
want to explain your problem in more general terms and elaborate. Thanks in Advance. Kind Regards, Jyo Hope that helps, -- Dave Tang Research Assistant Institute for Molecular Biosciences http://www.imb.uq.edu.au/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: perldoc output looks strange

2009-09-06 Thread Dave Tang
;^H###7m<88><92>r] [###7m<88><92>^H###7m<88><92>ddes###24m<80><90>^H###<80><90> tination_file] [###7m<88><92>^H###7m<88><92>oformatname] [###7m<88><92>^H###7m<88><92>MFo rmatter

Re: Perl's superior text parsing power

2009-09-02 Thread Dave Tang
On Thu, 03 Sep 2009 13:18:44 +1000, Uri Guttman wrote: "TB" == Tim Bowden writes: TB> On Thu, 2009-09-03 at 11:39 +1000, Dave Tang wrote: >> I wanted to ask why is Perl, in comparison to other programming >> languages, so powerful in text pro

Perl's superior text parsing power

2009-09-02 Thread Dave Tang
Hi everybody, I constantly read about Perl's powerful regular expression matching and string manipulation operators, and how it is superior to other programming languages in this aspect. Furthermore, I read this in the wikipedia entry of Perl: "The language provides powerful text processin

Re: Regular expression help

2009-08-26 Thread Dave Tang
On Wed, 26 Aug 2009 16:41:39 +1000, Chas. Owens wrote: On Wed, Aug 26, 2009 at 02:23, Dave Tang wrote: Dear list, I am trying to import entries in a csv file into a relational database, however there are entries such as: a,b,c,d,e,"f1,f2","g1,g2" which spoil my split

Regular expression help

2009-08-25 Thread Dave Tang
Dear list, I am trying to import entries in a csv file into a relational database, however there are entries such as: a,b,c,d,e,"f1,f2","g1,g2" which spoil my split(/,/). The quotes group f1 and f2 as a single entry. I know each each database entry should be atomic, but I'll deal with that

Re: Purpose of $$ in subroutine

2009-08-04 Thread Dave Tang
On Wed, 05 Aug 2009 12:55:22 +1000, Chas. Owens wrote: snip In this case it is telling Perl that compare expects two scalars as arguments. snip Now the compare($$) makes much more sense. snip There are many [pitfalls][2] to prototypes and they should really not be used unless you have a

Purpose of $$ in subroutine

2009-08-04 Thread Dave Tang
Hi everybody, I was reading perlfaq7.pod, 7.15: How can I pass/return a {Function, FileHandle, Array, Hash, Method, Regex}? In one of the examples it shows how regular expressions can be passed to subroutines: sub compare($$) { my ($val1, $regex) = @_;

Perl DBI error

2009-07-07 Thread Dave Tang
Hi everybody, I am having a problem with binding a variable when executing on a DBI object. The code goes: #!/usr/bin/perl use warnings; use strict; use DBI; #DBI variables my $database = 'databaseName'; my $hostname = 'localhost'; my $dsn = "DBI:mysql:database=$database;host=$hostname"; my

Re: Hello there

2009-07-06 Thread Dave Tang
On Tue, 07 Jul 2009 08:19:50 +1000, Emanuele Osimo wrote: Hello there, I'm a biologist and I'm trying to start using bioperl for bioinformatic purposese but I've never programmed. Could you suggest me something to read to start from 0 level? Have you looked at Beginning Perl for Bioinformat

perldoc perlboot

2009-06-18 Thread Dave Tang
Hello, I've been going through perldoc perlboot and I have a question about using the SUPER class. Here's the code in the documentation: #!/usr/bin/perl use strict; use warnings; { package Animal; sub speak { my $class = shift; print "a $class goes ", $class->sound, "!\n";

Efficiently going through results

2009-06-09 Thread Dave Tang
Hello, I have a problem, which I have put into an analogy. Suppose a parent has 11 children. These children like chocolate. If 9 or more of the 11 children from the same parent like a particular chocolate, the parent will like the chocolate. I want to find out what types of chocolate each

Re: CGI

2009-06-08 Thread Dave Tang
On Tue, 09 Jun 2009 16:16:41 +1000, Irfan Sayed wrote: Hi ALL, i have written sample cgi script in perl. here it is #!/usr/bin/perl print "Content-type: text/html\n\n"; print <   Welcome to CGI scripting           HI Try putting the HI at the start of the line. but when i a

Re: Array question

2009-03-30 Thread Dave Tang
On Tue, 31 Mar 2009 04:49:17 +1000, John W. Krahn wrote: Or instead of using arrays you could store the 1s and 0s in strings: $ perl -le' my $string = "10110111001"; print $-[0] while $string =~ /0/g; ' 1 4 8 9 Hi John, Could you explain how the above code works please? I looked up perl -l

Re: Efficient way of comparing items in an array

2008-10-29 Thread Dave Tang
On Thu, 30 Oct 2008 16:04:31 +1000, Dave Tang <[EMAIL PROTECTED]> wrote: Hi everybody, I am working with a sorted array (sorted from smallest to largest), containing coordinates as such: 13645692 13645693 13645694 13645695 13645696 13645697 13645698 13645699 13645700 13645701 13

Efficient way of comparing items in an array

2008-10-29 Thread Dave Tang
Hi everybody, I am working with a sorted array (sorted from smallest to largest), containing coordinates as such: 13645692 13645693 13645694 13645695 13645696 13645697 13645698 13645699 13645700 13645701 13645702 13645703 13645704 13645705 13645706 13645707 13645708 13645709 13645710 13645711

Re: perl file parsing

2008-10-23 Thread Dave Tang
Hello, Use bioperl (http://www.bioperl.org/wiki/Main_Page) for this task. This should do what you want: #!/usr/bin/perl use strict; use warnings; use Bio::SeqIO; my $fastaFile = 'myfile'; my $pattern = 'CTTGGCGAGAAGGGCCGCTACCTGCTGGCCGCCTCCTTCGGCAACGT'; my $blockThreshold = '500'; my $numFasta

Re: using unix command issue...

2008-10-20 Thread Dave Tang
Try moving $utadm_1 up a few lines, before calling the subroutine. #!/usr/bin/perl -w $utadm_l = "/opt/SUNWut/sbin/utadm -l" ; check_LANon () ; sub check_LANon { $LANstat = system(" $utadm_l | grep On") ; print "$LANstat\n" ; } Dave On Tue, 21 Oct 2008 03:06:34 +1000, Ariel C

Re: writing to a .txt file issues

2008-10-09 Thread Dave Tang
Try taking away the "+" in your filehandle line, so that it reads: open (WRITE,">/Users/dave/Documents/Programming/Perl/081008mathables/add.txt"); Dave On Fri, 10 Oct 2008 09:31:02 +1000, David <[EMAIL PROTECTED]> wrote: open(WRITE,"+>/Users/dave/Documents/Programming/Perl/081008mathtables