Re: fastq file modification help

2011-06-06 Thread Raymond Wan
Hi Nathalie, On Mon, Jun 6, 2011 at 19:29, Nathalie Conte n...@sanger.ac.uk wrote: I need to remove the first 52 bp sequences reads in a fastq file,sequence is on line 2. fastq file from wikipedia:A FASTQ file normally uses four lines per sequence. Line 1 begins with a '@' character and is

Re: Nature of this list

2011-04-27 Thread Raymond Wan
Hi Jenda, 2011/4/26 Jenda Krynicky je...@krynicky.cz: From: Raymond Wan r@aist.go.jp Hm, sounds like you think that if the problem is ignored, it will go away? Some problems are real, some imaginary. The later kind is better ignored. Yes...well, I would think whether

Re: Nature of this list

2011-04-26 Thread Raymond Wan
2011/4/25 Jenda Krynicky je...@krynicky.cz: From: Raymond Wan r@aist.go.jp After reading this, what came to mind is the problem of sexual and power harassment in the workplace, and maybe extending to other types of prejudices but maybe that is a stretch?  Often, the person being accused

Re: Nature of this list

2011-04-25 Thread Raymond Wan
On Mon, Apr 25, 2011 at 04:38, David Christensen dpchr...@holgerdanske.com wrote: On 04/24/2011 02:36 AM, Shlomi Fish wrote: I also think it is a better idea to put someone who is acting in an abusive manner on manual moderation before actually banning them. Good idea.  Does the

Re: Nature of this list

2011-04-23 Thread Raymond Wan
On Sat, Apr 23, 2011 at 04:56, Randal L. Schwartz mer...@stonehenge.com wrote: Ian == Ian  pcs...@gmail.com writes: Ian Randal is arrogant and a bully and is the reason why I moved on from this Ian list years ago. You misunderstood something I said, which when taken in context, was

Re: Nature of this list

2011-04-23 Thread Raymond Wan
On Sat, Apr 23, 2011 at 23:53, Randal L. Schwartz mer...@stonehenge.com wrote: Raymond == Raymond Wan r@aist.go.jp writes: Raymond But, if both sides (both of you) and third-party-people like me still Raymond remember exchanges on this list from almost 2 years ago, I didn't remember

Re: Nature of this list

2011-04-23 Thread Raymond Wan
Hi Tiago, On Sun, Apr 24, 2011 at 01:33, Tiago Hori tiago.h...@gmail.com wrote: No, no one needs to be rude, but some people are. Some people are rude because they are just stupid, but I like to believe that the vast majority is rude because they don't know any better. I just think that

Re: Nature of this list

2011-04-23 Thread Raymond Wan
On Sun, Apr 24, 2011 at 04:00, Brian Fraser frase...@gmail.com wrote: Please people. I urge you all to kindly fuck off. This is getting ridiculous. You are arguing about *tone*. Who gives a flying fuck about tone if the post has substance? Are we fucking two? Are our egos so fragile that we

Re: Nature of this list

2011-04-21 Thread Raymond Wan
On Fri, Apr 22, 2011 at 01:25, Randal L. Schwartz mer...@stonehenge.com wrote: Rob == Rob Dixon rob.di...@gmx.com writes: To discredit this post, as well as your other claims, I'm actually going through the worst period in my life, exceeding my criminal arrest and conviction in 1995, which I

Re: Nature of this list

2011-04-19 Thread Raymond Wan
On Wed, Apr 20, 2011 at 01:17, Rob Dixon rob.di...@gmx.com wrote: On 19/04/2011 16:00, Peter Scott wrote: If anything is clear from that FAQ it is that the intention is to avoid flames on this list.  Casey and Kevin appear to have stopped monitoring this group some time ago, though. I have

Redeclaration of variable [different scope]

2011-01-27 Thread Raymond Wan
Hi all, I was wondering if there is a way for Perl to give me a warning if I redeclare a variable in a different scope (and thus masking the outer one). Just spent some time debugging this (which was obviously not my intention to give two variables the same name)...and I guess it is a silly

Re: advangtes of Perl on various languages

2011-01-09 Thread Raymond Wan
Hi Brandon, On Sat, Jan 8, 2011 at 01:53, Brandon McCaig bamcc...@gmail.com wrote: On Thu, Jan 6, 2011 at 10:08 AM, Raymond Wan r@aist.go.jp wrote: I never said it was. ;) C still has very many important roles and I wouldn't have it any other way. xD There were a lot of other people

Re: advangtes of Perl on various languages

2011-01-07 Thread Raymond Wan
Octavian, For what it's worth, I thought you've done very well with this crowd and that your first and subsequent posts on this topic was balanced and fair. But it seems this crowd was biased toward Perl, so even being fair is hard. A mailing list of users who use Perl and who read job boards

Re: [OT] The Happy, Happy, Feel Good Thread (WAS: New Document: How to Start Contributing to or Using Open Source Software)

2011-01-03 Thread Raymond Wan
On Mon, Jan 3, 2011 at 04:18, Brandon McCaig bamcc...@gmail.com wrote: On Sun, Jan 2, 2011 at 9:39 AM, Raymond Wan r@aist.go.jp wrote: Core Perl experts that think it's just them and beginners on the list risk scaring people in the middle groups away, further making the problem worse

Re: [OT] The Happy, Happy, Feel Good Thread (WAS: New Document: How to Start Contributing to or Using Open Source Software)

2011-01-02 Thread Raymond Wan
On Sun, Jan 2, 2011 at 00:06, Octavian Rasnita orasn...@gmail.com wrote: Better say that bottom-post is an old habit (and advanced programmers usually have old habits and not the newbies) and that the rules are enforced by the advanced programmers because they can help the others, and they

Re: [OT] New Document: How to Start Contributing to or Using Open Source Software

2011-01-01 Thread Raymond Wan
On Sat, Jan 1, 2011 at 03:32, Uri Guttman u...@stemsystems.com wrote: RW == Raymond Wan r@aist.go.jp writes:  RW Saying the other tutorials are garbage is quite harsh and a bit  RW disrespectful to the authors who presumably meant well and didn't do  RW it to sabotage Perl's reputation

Re: [OT] New Document: How to Start Contributing to or Using Open Source Software

2010-12-31 Thread Raymond Wan
On Fri, Dec 31, 2010 at 13:28, Uri Guttman u...@stemsystems.com wrote: NA == Nathan Arthur nart...@rainskit.com writes:  NA from books/tutorials, from this list, and by just writing it.  I spent  NA a bunch of time with online tutorials and books before really getting  NA started, so most of

Re: [OT] New Document: How to Start Contributing to or Using Open Source Software

2010-12-30 Thread Raymond Wan
Hi all, On Thu, Dec 30, 2010 at 19:35, Shlomi Fish shlo...@iglu.org.il wrote: If we take off the parts where you just rip through people's style, platform, or design choices, or reprimand them for not following what you consider to be the One True Way of writing emails, the number is good,

Re: Nested if and elsif and else

2010-04-14 Thread Raymond Wan
Hi Mimi, Mimi Cafe wrote: I think this will work, but is it elegant.? If (condition){ if (nexted_condition){ As others have noted, it will work. But as for elegance, this is a very subjective opinion and contrary to what recent comments have said, my take on it is that it depends on

Re: Decimal representation of binary file (unpack)

2010-04-08 Thread Raymond Wan
: Philip Potter wrote: On 8 April 2010 06:30, Raymond Wan r@aist.go.jp wrote: my $buffer = STDIN; my @buffer = split //, $buffer; for (my $i = 0; $i length ($buffer); $i += 4) { print unpack ('I', $buffer[$i].$buffer[$i + 1].$buffer[$i + 2].$buffer[$i + 3]), \n; } Are you sure you want to read

Decimal representation of binary file (unpack)

2010-04-07 Thread Raymond Wan
Hi all, I would like to read in a binary file and extract the 4-byte ints from it. Under Linux, something like od -t uI. I got it working as follows: my $buffer = STDIN; my @buffer = split //, $buffer; for (my $i = 0; $i length ($buffer); $i += 4) { print unpack ('I',

Re: Decimal representation of binary file (unpack)

2010-04-07 Thread Raymond Wan
Hi Alan, Alan Haggai Alavi wrote: On 8 April 2010 11:00, Raymond Wan r@aist.go.jp wrote: for (my $i = 0; $i length ($buffer); $i += 4) { print unpack ('I', $buffer[$i].$buffer[$i + 1].$buffer[$i + 2].$buffer[$i + 3]), \n; } Hi Raymond, Wildcards can be used within the template

Re: no lstat happens

2010-03-17 Thread Raymond Wan
Hi Harry, Harry Putnam wrote: ls *[eo2] | ./t2 reader ls *[eo2] | ./t2 ... Script content cat t2 #!/usr//bin/perl use strict; use warnings; my $mode; while(){ chomp; $mode = (lstat( $_))[2]; print $_: . $mode . \n; } There are at least two ways of doing what

Re: no lstat happens

2010-03-17 Thread Raymond Wan
Hi Harry, Raymond Wan wrote: The other option is to *not* use ls and get your script to stat the file directly (NB: I guess you want stat and not lstat?). In this case, you should get a list of files in the directory, and then run stat on each one. If you do this (which is perhaps

Re: no lstat happens

2010-03-17 Thread Raymond Wan
Hi Harry, Harry Putnam wrote: Raymond Wan wrote: The other option is to *not* use ls and get your script to stat the file directly (NB: I guess you want stat and not lstat?). In this case, you should get a list of files in the directory, and then run stat on each one. If you do

Re: getting input without hitting return

2010-03-17 Thread Raymond Wan
Hi Greg, Greg wrote: I have a script, where a user can choose between different options (add user (U), add item (I), search (S)). I want the user to hit either U, I or S. However, right now, he needs to hit return as well. Is there a way to get input without hitting return? Take a look

Re: How to convince the Customer

2010-03-17 Thread Raymond Wan
Hi Parag, Parag Kalra wrote: Now the customer wants to use the framework on a Solaris machine (it has Perl installed - 5.8.4). However that Solaris machine doesn't have DBI module as a result of which I can't use my framework. But it has Oracle client installed using which (sqlplus, sqlldr

Re: Any Good SCM tool to manage Perl Code locally

2010-03-14 Thread Raymond Wan
Hi Parag/Shlomi, Shlomi Fish wrote: Here is the thing - I mainly code in Perl and Bash and I don't use any SCM tool. And the reason I don't use it is because even if I configure a SCM server - I should be able to access it both from home and work place (which is unlikely to happen) Then

Re: question on software development

2010-03-08 Thread Raymond Wan
Randal L. Schwartz wrote: ANJAN == ANJAN PURKAYASTHA anjan.purkayas...@gmail.com writes: ANJAN OK, suppose I develop a Perl application. I want to create an icon for the ANJAN program so that a user may download the program and start it in the GUI by ANJAN double-clicking on the icon. Did

Re: question on software development

2010-03-05 Thread Raymond Wan
ANJAN PURKAYASTHA wrote: Steve my man, Although I appreciate your taking the time to answer my question I must say the tone of you mail was immature and unprofessional. Firstly, you misunderstood my question and secondly not every question can be framed in terms of code. Given that there are

Re: How to analyze a URL string?

2009-12-07 Thread Raymond Wan
Hi Grant, Grant wrote: I'm setting up the URL structure for my next website. I'd love to know what you guys think is the best way to analyze the URL in perl in order to generate the resultant page correctly. The URL structure only has 2 variants: /page-name.html /page-name/1/2.html ...

Re: speed test

2009-12-03 Thread Raymond Wan
Hi Xiao, Orchid Fairy (兰花仙子) wrote: reach each line of every file (many files, each is gziped) look for special info (like IP, request url, session_id, datetime etc). count for them and write the result into a database generate the daily report and monthly report I'm afraid perl can't finish

Re: speed test

2009-12-02 Thread Raymond Wan
Hi, Jim Gibson wrote: At 9:58 AM +0800 12/2/09, =?GB2312?B?T3JjaGlkIEZhaXJ5ICjAvLuoz8nX0yk=?= wrote: You should also consider the speed of the programmer. I can write a Perl program in less than half the time it would take me to write the same program in C, C++, or Java. You will have to

Re: Learning Perl Student Workbook

2009-11-01 Thread Raymond Wan
Uri Guttman wrote: mb == mahesh bhasme mbha...@gmail.com writes: mb Hi, mb below link might help to u that is exactly what randal said he didn't want to see, a bootleg copy of his book. you won't be getting any more help from him and probably most of the experts here. that copy is

Re: Fasta format !!

2009-10-29 Thread Raymond Wan
Hi Jyoti, Jyoti wrote: I just want help to open and read a file. I have to make a script so that it should open and read a file which is in fasta format. I have done something with subroutine but getting some errors. May be everyone do not know the fasta format Fasta format have peculiar

Re: Server HELP-urgent

2009-10-07 Thread Raymond Wan
Hi Jyoti, Jyoti wrote: Yepp, i think I need to be more specific. I am trying to design a web server which can upload a user input file which contains number of protien sequences. Then I need to blast this file to get blast results directly as an output file. But as m new to perl, I seriously

Re: Server HELP-urgent

2009-10-06 Thread Raymond Wan
Hi Jyoti, Jyoti wrote: How to upload any file and get results for that uploaded file through a redirected URL, in perl/cgi I mean to ask, for example, I upload a file which contains protein sequences. Now I want blast results for that uploaded file in my server. Can anyone help me with few

Re: tabular printing

2009-10-05 Thread Raymond Wan
Hi Andreas, Andreas Moroder wrote: I want pro print to screen two strings. The problem ist that the length of the strings are variable, so I get a unreadable output. Even using \t does not help because the lenght can vary from 5 to 15 characters. Is there a simple way to expand the first

Re: Burnt Camel Club

2009-09-24 Thread Raymond Wan
Hi Tim, Tim Bowden wrote: Volume isn't always quality. There are some lists around where a significant portion of the volume is the blind leading the blind. The rest is experts trying to clean up the mess. Here the emphasis seems to be a little more on not making a mess in the first place

Re: Giving away my code

2009-09-14 Thread Raymond Wan
Hi Steve, Steve Bertrand wrote: The company that employs me is very small, and although I don't believe there will ever be a problem with giving my code away, I want to take advantage of the fact that I have never signed anything to say I ``can't'' give it away. I'm at a stage where some of

Re: Perl projects for beginners

2009-09-07 Thread Raymond Wan
Hi Gabor, Gabor Szabo wrote: As I think think the best way to learn Perl is tor practice a lot and the best place to practice is an open source project I wonder how can open source project become more beginner friendly? Follow-up to Philip's message...but I didn't reply to his post since I

Re: Perl projects for beginners

2009-09-07 Thread Raymond Wan
Hi Tim, Tim Bowden wrote: I think some (of course, not all) universities would teach a language or programming first by getting students to work alone. And then a year or two later, put them into groups and then that's when the teachers go nuts. :-) I wonder if it's not time well spent

Re: Perl projects for beginners

2009-09-07 Thread Raymond Wan
Hi Fudmer, I didn't think my comments would have piqued your interest so much. :-) Well, we're off-topic from Perl, but let me add just the following: fudmer rieley wrote: The need is for a problem book with real explained answers [producing such a problem book would be a massive

Re: Perl's superior text parsing power

2009-09-06 Thread Raymond Wan
Hi Dave, Dave Tang wrote: explain to me the answer. My motivation for this question is primarily due to interest and if someday someone asks me how is Perl good for biology (most biological data is stored as flat files). As others have said, it is perhaps because Perl got into it first

Re: Perl expert

2009-08-21 Thread Raymond Wan
Hi, Peter Scott wrote: I respect the desire for this thread to die and won't post any more. Since you cc'ed me I don't want to ignore this one though. Yes, I know the dilemma of let it die or would I be seen as ignoring a point. I've purposely dropped you as a CC for this reason...

Re: Perl expert

2009-08-20 Thread Raymond Wan
Hi Peter, Peter Scott wrote: On Thu, 20 Aug 2009 10:34:27 +0900, Raymond Wan wrote: Randal L. Schwartz wrote : Personally (and we're now nit-picking natural [human] language), the fact that these words are coming from my fingers implies it's an opinion. I think... is always implied unless

Re: Perl expert

2009-08-20 Thread Raymond Wan
Ian wrote: Another disclosure: English is not my first language so pardon any grammar and spelling mistakes. I try :-). Ian, this is of course my personal opinion, but I don't think that one needs to apologize for not having English as a first/native language if the other person doesn't

Re: Perl expert

2009-08-20 Thread Raymond Wan
Steve, Steve Bertrand wrote: Not to take away from anyone, but can we please let this thread die, and move on to Perl? I presume the thread will die when it dies... As for me, I didn't let it die because I didn't like the direction it was headed... While I have a different opinion to

Re: A side note

2009-08-19 Thread Raymond Wan
Hi Uri, Uri Guttman wrote: RW == Raymond Wan r@aist.go.jp writes: RW And what if A tries B's code, fails and asks again and B continues RW replying? Ok, A didn't get the best answer immediately; but RW isn't it a bad idea to stop such discussion? And sure, a few RW mails later

Re: Perl expert

2009-08-19 Thread Raymond Wan
Hi Ian/Randal, Ian wrote: Randal L. Schwartz wrote : And I'm with Uri here... I definitely do *not* answer anything that I haven't had experience with, unless I preface my answer with I think... so that Smarter People(tm) can check my work. If only everyone followed that rule, life would

Re: A side note

2009-08-18 Thread Raymond Wan
Hi Uri, Uri Guttman wrote: M == Mark epvt...@gmail.com writes: M Hello, M There is always a better way to do things. That is what makes life M interesting. M I think any contributions from anybody should be appreciated. appreciated for their motivation, yes. but what if the answer

Re: A side note

2009-08-18 Thread Raymond Wan
Uri Guttman wrote: RW == Raymond Wan r@aist.go.jp writes: RW Well, how about this? If A posts a question, B replies but B is flat RW out wrong, then what if expert C replies but not to B's message, but RW to A's? Less frustration for C and both A and B learn something RW

Re: delete 20 000 records in oracle from perl

2009-08-17 Thread Raymond Wan
Hi Luke, luke devon wrote: I wanted to delete some unwanted data in one of my oracle database.20 000 of records are there. This is actually on production . manually to delete a record , it takes 2 mins of time. So now i decided to write a perl script to do this function by learning on the

Re: delete 20 000 records in oracle from perl

2009-08-17 Thread Raymond Wan
Hi Luke, luke devon wrote: Thanks for the reply . Yes , when we going to delete those records , CPU is going high.So then its effecting to the performance. as i beginner in perl , how can i implement multi-threaded env ? Can you help me further ? Hm, well, I don't see any advantage of

Perl expert [Was: Re: Attentipn Please!! Need...]

2009-08-17 Thread Raymond Wan
Hi all, Paul Johnson wrote: On Mon, Aug 17, 2009 at 04:09:34PM -0400, Uri Guttman wrote: I == Ian pcs...@gmail.com writes: I Unfortunately I'm not an expert. I just read a few books and this list etc. a couple of things. it is good that you are offering to help but as you claim not to

Re: Perl expert [Was: Re: Attentipn Please!! Need...]

2009-08-17 Thread Raymond Wan
Hi Steve, Steve Bertrand wrote: I don't know if we should argue with the 'teaching' techniques of those who have exemplary skills and long-term interest in the subject. imho, there are others here who are very, very qualified to light Uri up if he's doing it wrong. My comments, which I

Re: Perl expert

2009-08-17 Thread Raymond Wan
Hi all, Uri Guttman wrote: especially when he admitted he was weak in perl. the situation of the blind leading the blind can be very dangerous and i was trying to head that off in this case. i have seen it lead to very bad situations where the total newbie is suckered in to bad coding by

Re: Perl expert [Was: Re: Attentipn Please!! Need...]

2009-08-17 Thread Raymond Wan
Hi Steve, Steve Bertrand wrote: Raymond Wan wrote: I, myself, am as much an expert in Perl as Uri is. Let's not look too deeply into my comments and extrapolate something that was never there... :-) My apologies... I read in too deeply. I've been entrenched with a lot lately

Re: invoking perl from html

2009-07-16 Thread Raymond Wan
Hi Chuck, Chuck Crisler wrote: This isn't exactly on-topic, but maybe someone can help me with this problem. I need to execute a Perl script on the server from my HTML. I found examples of running a script in the browser and I know how to configure Apache. I just don't know how to invoke a

Re: exit status

2009-06-30 Thread Raymond Wan
Hi Irfan, Irfan Sayed wrote: I have one windows batch script in which i am calling one perl script. now what i want to do is if the exit status of that perl script is non zero then batch script should not continue executing further and if the exit status is zero then only it shud further

Re: How to print errors to both STDERR a file?

2009-06-24 Thread Raymond Wan
Hi Pablo, pa...@compugenic.com wrote: STDERR is where errors go. Error messages are generated as a result of an error, not a 'print' statement. Athough I could manually print to STDERR, I'm trying to log all errors to both a logfile and STDERR. Hm, not quite sure what you mean.

Re: list the user working on a single file

2009-06-18 Thread Raymond Wan
Hi Ajay, Ajay Kumar wrote: Hi all I have one requirement that Suppose I have one file sample.txt I just want one mail if anybody touch this file Can you guys suggest me how I can implement this ? In addition to Steve's code, if you are using a Linux/Unix system, you can make his script

Re: file handle in perl

2009-06-17 Thread Raymond Wan
Hi Irfan, Irfan Sayed wrote: I am struggling with file handling in perl. i want to do following operation . 1: open the file 2: read the file 3: do the changes in specific lines 4: save the file 5: close the file Does this FAQ help? Q: How do I change, delete, or insert a line in a

Re: complex split (when delimiter appears in one of the fields)

2009-06-12 Thread Raymond Wan
Hi Michael, Michael Alipio wrote: I have a string that looks like this: my $string = 1, 3, 0. 0. 0. 0, 22, Zak',adfk $! mac., ; Basically, there are seven fields. after the bird, everything up to the last comma is the 5th field. 6th field is blank. Now my problem is splitting it and

Re: HTML Template

2009-06-08 Thread Raymond Wan
Hi Jenn, practicalp...@gmail.com wrote: I will begin a new project, which is medium large, with about 200 CGI scripts with Perl. We have designers who make HTML/JS/CSS etc. I want to choose a template system which will let perl code be separated from front-page codes (like html,css etc). I

Re: Specifying input file on #! line

2009-06-07 Thread Raymond Wan
Hi Chap, Chap Harrison wrote: On Jun 4, 2009, at 8:10 PM, Raymond Wan wrote: (Actually I dropped the whole idea when I decided to have the script write the filtered results back into the clipboard -- which necessitated hard-coding the path into the script anyway. Moreover, the whole thing

Re: Specifying input file on #! line

2009-06-04 Thread Raymond Wan
Hi Chap, Chap Harrison wrote: I've read perldoc perlrun but find it pretty confusing. Things I've tried unsuccessfully are: #!/usr/bin/perl /dev/clipboard #!/usr/bin/perl /dev/clipboard #!/usr/bin/perl -- /dev/clipboard The body of the script always begins while (defined (my $line = ))

Re: Perl floating point addition oddness

2009-06-03 Thread Raymond Wan
Hi Kelly, Kelly Jones wrote: perl -le 'printf(%f %f %f\n, 4294967295, 2147483647*2**32, 2147483647*2**32+4294967295)' 4294967295.00 9223372032559808512.00 9223372036854775808.00 Why? The answer is really 9223372036854775807 (one number lower), and it's obvious that adding 2 and

Re: calc function's executed time

2009-06-01 Thread Raymond Wan
Hi Jenn, practicalp...@gmail.com wrote: What's the standard way to calculate a subroute's executed time in Perl? Thanks in advance. I don't know what's the standard way, but I use the times function and get the user time before and after the subroutine and then subtract.

Re: interaction with a module and http tags

2009-05-27 Thread Raymond Wan
Hi Joe, jm wrote: then the head ... /head code does not process correctly; it is ignored unless there is a 2nd pair of head/head tags in the print statement (perl inline html) In addition to Gunnar's questions, if you are still stuck, you need to also clarify what does not process

Re: interaction with a module and http tags

2009-05-27 Thread Raymond Wan
Hi Joe, jm wrote: i had actually tried to include that early on but apparently the stars weren't properly aligned just then. that works perfectly. thanks for making me revisit that option. i figured it would be something simple, just threw me off since it hasn't ever been required when i

Re: interaction with a module and http tags

2009-05-25 Thread Raymond Wan
Hi Joe, jm wrote: why do the head tags in the sub work and the page display perfectly with the additional empty head tags, yet only print out the code as ascii output when i remove the 2nd set of head tags? why are the head tags in the sub not considered legitimate html code when the head

Re: Reading/writing binary

2009-05-12 Thread Raymond Wan
Hi Chas., Jenda, On Mon, May 11, 2009 at 6:00 PM, Chas. Owens chas.ow...@gmail.com wrote: On Mon, May 11, 2009 at 04:50, Jenda Krynicky je...@krynicky.cz wrote: From: Raymond Wan rwan.w...@gmail.com I'm on a Linux system too; I guess I've used it for so long, I forgot about

Re: Reading/writing binary

2009-05-11 Thread Raymond Wan
Hi John, On Fri, May 8, 2009 at 8:58 PM, John W. Krahn jwkr...@shaw.ca wrote: That depends on the operating system you are using. I use Linux so there is no difference between binary and text, except for those specific applications that can't handle binary data. If you are on a system

Re: Reading/writing binary

2009-05-08 Thread Raymond Wan
Hi Chas, On 5/7/09, Chas. Owens chas.ow...@gmail.com wrote: You use pack to create a binary value and unpack to read a binary value. So, to write a file containing three 32 bit integers you say [snip] Thanks for the sample code; that worked exactly as you said. I wasn't getting anywhere

Re: Reading/writing binary

2009-05-08 Thread Raymond Wan
Hi John, On 5/8/09, John W. Krahn jwkr...@shaw.ca wrote: [snip] That is equivalent in C to: unsigned char decimal_number = 42; Or another way to write that in Perl is: my $decimal_number = pack 'C', 42; Once you have created the appropriate strings using pack() then just print()

Re: Reading/writing binary

2009-05-08 Thread Raymond Wan
Hi Chas., On 5/8/09, Chas. Owens chas.ow...@gmail.com wrote: The place to go is http://perldoc.perl.org, and in your case http://perldoc.perl.org/functions/pack.html and http://perldoc.perl.org/functions/unpack.html. You can also get these docs on your machine by saying perldoc -f pack

Reading/writing binary

2009-05-07 Thread Raymond Wan
Hi all, I would like to write binary values to disk (as well as read them) but don't know how to do it. In C-speak, something like this: unsigned int foo = 42; fwrite (foo, sizeof (unsigned int), 1, stdout); I think the answer involves something with pack and unpack, but I'm completely lost as

Re: Can anyone comment on Sams Teach Yourself Perl in 21 Days ?

2009-03-14 Thread Raymond Wan
Hi Shlomi, Shlomi Fish wrote: Yes, those or Beginning Perl ( http://www.perl.org/books/beginning-perl/ ) would be my choice too. I admit I haven't read them, but I'm judging them based on reputation. However, my point was that my pupil found this book in a library and borrowed it (which

Re: Can anyone comment on Sams Teach Yourself Perl in 21 Days ?

2009-03-12 Thread Raymond Wan
Hi Shlomi, Shlomi Fish wrote: Hi all! I've been tutoring someone in Perl 5, and as she wants to learn Perl from a paperware book, she borrowed the book Sams Teach Yourself Perl in 21 Days from her workplace's library, and started reading it. Now, all those in 21 Days/in 24

Re: Simple way to do line graphs???

2009-02-22 Thread Raymond Wan
Hi Paul, If you have to do a lot of line graphs, then it might be worth investing some time on learning something like R: http://www.r-project.org/ And no, I didn't mean to do this through Perl -- R can read in CSV files, etc. Ray Paul wrote: Trying to make some kind of script to do

Re: Perl fork() system call

2009-02-19 Thread Raymond Wan
Hi Chuck, Chuck wrote: We have a GUI where, if a button is clicked, Putty (the remote access program) is launched using System(C:\\Progra~1\\Putty\\putty.exe); is launched. However, when this is executed, the original GUI freezes, and we cannot use it unless we close Putty. We tried using

Re: Syntax not clear

2009-02-12 Thread Raymond Wan
Hi Anisha, Anisha Parveen wrote: From the explanations given by you,I doubt if the delay is caused due to the fact that it is executed as a unix command. Rob had explained how it works..So can that be the reason ? If yes, I would like to hear few alternatives, so that I can try them. My

Re: How to speed up two arrays compare.

2009-02-11 Thread Raymond Wan
Hi Kevin, kevin liu wrote: I have two arrays(@nwarray0 and @nwarray1) in my program and i want to make sure that all the elements in @nwarray0 could be found in @nwarray1. Your problem is a common problem that is not specific to Perl. A common solution is to place one of the

Re: How to speed up two arrays compare.

2009-02-11 Thread Raymond Wan
Hi Kevin and all, John W. Krahn wrote: As to whether the algorithm Rob presented is the best algorithm, that depends on the data being used and how often this operation needs to be preformed. For example, the algorithm I presented above has a best case of O( 1 ) while the one Rob

Re: perl sort

2009-02-07 Thread Raymond Wan
Hi Marion, Marion McCoskey wrote: While looking at the documentation for the sort function, I noticed it complaining about the shortcomings of the quick sort. I share that feeling and I have developed a single-buffered count sort that is faster than the quick sort and a lot more stable.

Re: perl sort

2009-02-07 Thread Raymond Wan
Hi all, Chas. Owens wrote: Well, I would suggest taking this to the Perl Porters list*, this is a list for people who are starting to learn Perl. You could also write a module implementing you algorithm either in pure Perl or in XS** (the interface between ISO C and Perl) and upload it to

Re: perl stdout errors due to called script does not exist

2009-01-28 Thread Raymond Wan
Hi, inetquestion wrote: for the example perl script below is there a way to avoid errors from showing up in stdout if the shell script being called does not exist? The shell script being called is not in the same directory as the perl script, but is in the path. Otherwise I would just do a

Re: system(cd /home/tomer/temp) problem

2009-01-28 Thread Raymond Wan
Hi Tomer, tomer wrote: after exectue the command system(cd /home/tomer/temp) I dont see the terminal change the direcotry? maybe the change is valid only in the script? how can i control seeing terminal direcotry with perl script ? system might not be what you want. What it does is that

Re: explanation of @INC

2009-01-23 Thread Raymond Wan
Hi Scott, Ok, I see what you mean now -- thanks for the clarification! Scott Haneda wrote: On Jan 22, 2009, at 10:54 PM, Raymond Wan wrote: Scott Haneda wrote: ... As you can see, the /opt/local/perl lists the @INC paths, and 100% of them are in /opt/local so why when I use #!/opt/local

Re: explanation of @INC

2009-01-22 Thread Raymond Wan
Hi Scott, Scott Haneda wrote: ASSP installed. I edit the ASSP source files to change the first line from: #!/usr/bin/perl -- to #!/opt/local/bin/perl -- ... run as `perl testfile.pl` it will fail, with error that it can not find email valid run as `/opt/local/bin/perl testfile.pl` it

Re: Perl-R bridge

2009-01-19 Thread Raymond Wan
Hi Anjan, ANJAN PURKAYASTHA wrote: Hi, I'm planning to access R from my perl scripts. The only noteworthy bridge seems to be Statistics-R-0.03http://search.cpan.org/%7Ectbrown/Statistics-R/lib/Statistics/R.pm. Would anyone like to share their experience with this Perl-R bridge? I'd like to

Re: GD::Graph::bars - multiple x-axis data sets

2009-01-15 Thread Raymond Wan
Hi Danny, Danny Miller wrote: Hi, I've got two sets of data I'm displaying in a bar graph. I'd like to use two different colors for the different data. I'm not sure how to do this. My code looks like: @xdata1; # bunch of x values @ydata1; # bunch of corresponding y values @xdata2; #

Re: function is executing or not

2008-12-12 Thread Raymond Wan
Hi Irfan, irfan.sa...@cognizant.com wrote: I have several subroutines/functions in Perl script. I just wanted to know how to check whether specific function/subroutine in my Perl script is really executing or not. And if it is executing then what is the exit status of that function.

Re: not understanding pipe command

2008-12-07 Thread Raymond Wan
Hi Richard, I'm no Perl expert, but it sounds like you are right. Richard wrote: still confused by after running this program. 1)when I do #print while READER; program only outputs -- truly done Let's comment out fibonacci, first. Then, my understanding of your posted code is that

Re: Stupid question....

2008-12-06 Thread Raymond Wan
Hi Andy, Andy Dixon wrote: However, coming from a PHP background, things are somewhat different. I dont seem to be able to get my head around it...! Can anyone give me a couple of pointers? Have you looked at the perl documentation: http://perldoc.perl.org/perllol.html ? Sounds like

Re: Stupid question....

2008-12-06 Thread Raymond Wan
Hi Andy, Jeff Pang wrote: Thanks Ray and Jeff. I feel a bit stupid and embarrassed now. Nothing is stupid for a beginner.You can learn,and you will get started. In my defence, I did google, but several websites gave me different stories which did not work.. For your case,

Re: Conditional Operator

2008-12-05 Thread Raymond Wan
Hi Dermot, Dermot wrote: 2008/12/5 Dermot [EMAIL PROTECTED]: +---+---+++ | title1 | title2 | oldtitle --++ | NULL | NULL | The cat jumped over the mat I used this statement to try

Re: not understanding pipe command

2008-12-04 Thread Raymond Wan
Hi Richard, Richard wrote: while going over below example from the book, I am not understanding why/how below program works. Can someone explain this to me in better way? Have you tried running it? does it work like what you expect? what is READER exactly reading from??? and what does

Re: Perl Error with spamassassin

2008-12-01 Thread Raymond Wan
Hi Meghanand, (I appended to your subject as your original one was very vague.) Meghanand Acharekar wrote: While running following IMAP learn script (see attachment) I am getting following error message. config: invalid regexp for rule OEM_SPAM: /Reinstall OEM with different media???/i:

  1   2   >