perl.beginners http://www.nntp.perl.org/group/perl.beginners/ ... Copyright 1998-2008 perl.org Sun, 18 May 2008 04:06:53 +0000 ask@perl.org Re: learning perl 3rd vs 4th by merlyn &gt;&gt;&gt;&gt;&gt; &quot;Jerald&quot; == Jerald Sheets &lt;questy@gmail.com&gt; writes:<br/><br/>Jerald&gt; On May 17, 2008, at 12:07 PM, Randal L. Schwartz wrote:<br/>&gt;&gt; <br/>&gt;&gt; ... and shuffle a bit of content between the<br/>&gt;&gt; llama and alpaca to reflect the corresponding changes we&#39;ve made in our<br/>&gt;&gt; courseware.<br/><br/>Jerald&gt; Courseware...<br/><br/>Jerald&gt; Do tell. I&#39;m interested.<br/><br/>Eh?<br/><br/>You must be new in town.<br/><br/>Stonehenge Consulting Services has been (and continues to be) one of the<br/>leading providers of on-site and open-enrollment Perl training, dating all the<br/>way back to 1994. We count 17 of the Fortune 100 as our clients.<br/><br/>Man, I need to fire my marketing staff if you don&#39;t know that. I guess you<br/>never read the back cover of the llama or alpaca or early camel books, eh?<br/><br/>-- <br/>Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095<br/>&lt;merlyn@stonehenge.com&gt; &lt;URL:http://www.stonehenge.com/merlyn/&gt;<br/>Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.<br/>See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100787.html Sat, 17 May 2008 19:15:58 +0000 Re: learning perl 3rd vs 4th by Jerald Sheets <br/>On May 17, 2008, at 12:07 PM, Randal L. Schwartz wrote:<br/>&gt;<br/>&gt; ... and shuffle a bit of content between the<br/>&gt; llama and alpaca to reflect the corresponding changes we&#39;ve made in <br/>&gt; our<br/>&gt; courseware.<br/><br/>Courseware...<br/><br/>Do tell. I&#39;m interested.<br/><br/><br/>--jms<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100786.html Sat, 17 May 2008 19:12:44 +0000 Re: perl source code encryption by Chas. Owens On Sat, May 17, 2008 at 11:12 AM, Gowtham M &lt;gowthamgowtham@gmail.com&gt; wrote:<br/>snip<br/>&gt; This may not be encryption but it might help in hiding your perl code.<br/>&gt;<br/>&gt; You might consider compiling your perl code to a native binary.<br/>&gt;<br/>&gt; http://www.indigostar.com/perl2exe.htm<br/>snip<br/><br/>perl2exe suffers from the same problems all solutions will: you can<br/>recover the source fairly easily*. Of course, that is only an issue<br/>if you are trying to hide your source code (which is futile even with<br/>things like ANSI C). If you don&#39;t want your users &quot;stealing&quot; your<br/>code all you need is a proper license and a handy lawyer.<br/><br/>All of that said, there is a case to be made for presenting end-users<br/>with a single file they run to get your program and PAR::Packer**<br/>fills that need completely.<br/><br/>* http://www.net-security.org/vuln.php?id=2464<br/>** http://search.cpan.org/dist/PAR-Packer/lib/PAR/Packer.pm<br/><br/>-- <br/>Chas. Owens<br/>wonkden.net<br/>The most important skill a programmer can have is the ability to read.<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100785.html Sat, 17 May 2008 16:04:04 +0000 Re: perl source code encryption by Paul Johnson On Sat, May 17, 2008 at 08:42:54PM +0530, Gowtham M wrote:<br/><br/>&gt; I believe there is one such tool available in standard perl distro (perlcc)<br/>&gt; This perlcc was experimental when I first had a look at it (long time back),<br/>&gt; not sure how stable it is now.<br/><br/>You&#39;ll no doubt be very pleased to hear that it is now 100% stable.<br/><br/>AKA dead and buried.<br/><br/>-- <br/>Paul Johnson - paul@pjcj.net<br/>http://www.pjcj.net<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100784.html Sat, 17 May 2008 12:00:48 +0000 Re: learning perl 3rd vs 4th by merlyn &gt;&gt;&gt;&gt;&gt; &quot;Richard&quot; == Richard Lee &lt;rich.japh@gmail.com&gt; writes:<br/><br/>Richard&gt; I was going to order 5th version in june but does anyone in here know<br/>Richard&gt; the different between 3rd and 4th version? Is there a big<br/>Richard&gt; difference?<br/><br/>As I recall, the big changes between 3rd and 4th were to finally acknowledge<br/>the existance of the alpaca book, and shuffle a bit of content between the<br/>llama and alpaca to reflect the corresponding changes we&#39;ve made in our<br/>courseware. We released an updated alpaca after that as well.<br/><br/>The 5th edition covers the new 5.10 features of interest to beginners,<br/>including some of the new regex options.<br/><br/>print &quot;Just another Perl hacker,&quot;; <br/><br/>-- <br/>Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095<br/>&lt;merlyn@stonehenge.com&gt; &lt;URL:http://www.stonehenge.com/merlyn/&gt;<br/>Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.<br/>See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100783.html Sat, 17 May 2008 09:08:16 +0000 Re: learning perl 3rd vs 4th by Richard Lee Rob Dixon wrote:<br/>&gt; Richard Lee wrote:<br/>&gt; <br/>&gt;&gt; Currently I own a &#39;learning perl&#39; 3rd edition and I noticed that 5th <br/>&gt;&gt; version is coming out in june.<br/>&gt;&gt; What I didn&#39;t realize was that learning perl 4th edition&#39;s been out <br/>&gt;&gt; since 2005.<br/>&gt;&gt;<br/>&gt;&gt; I was going to order 5th version in june but does anyone in here know <br/>&gt;&gt; the different between 3rd and 4th version?<br/>&gt;&gt; Is there a big difference?<br/>&gt;&gt; <br/>&gt;<br/>&gt; Randal will tell you exactly what has changed if you can be patient until he<br/>&gt; notices this thread. But unless you&#39;re keen to save money by buying an old copy<br/>&gt; I&#39;m sure it will be well worth waiting for the 5th edition in a few weeks.<br/>&gt;<br/>&gt; Rob<br/>&gt; <br/>ok thanks.<br/><br/>I wanted to actually get another learning perl book but if 3rd and 4th <br/>is different enough, I will get 4th and 5th book.<br/><br/>just wanted to know the difference and google does not have readily <br/>comparision as I searched.<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100782.html Sat, 17 May 2008 08:53:01 +0000 Re: perl source code encryption by Gowtham M On Wed, Apr 30, 2008 at 10:41 AM, Anirban Adhikary &lt;<br/>anirban.adhikary@gmail.com&gt; wrote:<br/><br/>&gt; Dear list<br/><br/><br/>Hello<br/><br/>&gt;<br/>&gt; I want to encrypt my perl source code. I am using some modules in my code.<br/>&gt; Among them some are downloaded from CPAn as well as some are written by my<br/>&gt; -self. So how to encrypt all perl codes includes the modules.<br/><br/><br/>This may not be encryption but it might help in hiding your perl code.<br/><br/>You might consider compiling your perl code to a native binary.<br/><br/>http://www.indigostar.com/perl2exe.htm<br/><br/>I believe there is one such tool available in standard perl distro (perlcc)<br/>This perlcc was experimental when I first had a look at it (long time back),<br/>not sure how stable it<br/>is now.<br/><br/><br/>&gt;<br/>&gt; Thanks&amp;Regards in advance<br/>&gt; Anirban Adhikary<br/>&gt;<br/><br/><br/>- Gowtham<br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100781.html Sat, 17 May 2008 08:13:12 +0000 Re: learning perl 3rd vs 4th by Rob Dixon Richard Lee wrote:<br/>&gt; Currently I own a &#39;learning perl&#39; 3rd edition and I noticed that 5th <br/>&gt; version is coming out in june.<br/>&gt; What I didn&#39;t realize was that learning perl 4th edition&#39;s been out <br/>&gt; since 2005.<br/>&gt; <br/>&gt; I was going to order 5th version in june but does anyone in here know <br/>&gt; the different between 3rd and 4th version?<br/>&gt; Is there a big difference?<br/><br/>Randal will tell you exactly what has changed if you can be patient until he<br/>notices this thread. But unless you&#39;re keen to save money by buying an old copy<br/>I&#39;m sure it will be well worth waiting for the 5th edition in a few weeks.<br/><br/>Rob<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100780.html Sat, 17 May 2008 07:59:44 +0000 learning perl 3rd vs 4th by Richard Lee Currently I own a &#39;learning perl&#39; 3rd edition and I noticed that 5th <br/>version is coming out in june.<br/>What I didn&#39;t realize was that learning perl 4th edition&#39;s been out <br/>since 2005.<br/><br/>I was going to order 5th version in june but does anyone in here know <br/>the different between 3rd and 4th version?<br/>Is there a big difference?<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100779.html Sat, 17 May 2008 06:23:26 +0000 Re: Multiline comment in Perl by Octavian Rasnita From: &quot;Rob Dixon&quot; &lt;rob.dixon@gmx.com&gt;<br/>&gt; (Once again, please bottom-post replies to this group. It maintains <br/>&gt; readability<br/>&gt; for extended threads. Salutations and signatures should always be edited <br/>&gt; out.<br/>&gt; You are responsible for the whole of your post, not just your own <br/>&gt; material.)<br/><br/>Maybe it improves the readability for the sighted, but well... I am blind <br/>and I usually don&#39;t like to parse and read tens of lines until I reach the <br/>few lines I need.<br/>There is not a single accepted way of posting to a group. On the lists that <br/>most of the users are Unix/Linux users, the most easy way is to bottom-post, <br/>and I usually do that, unless I forget that I need to temporary change my <br/>style, but when I want to send a final message and I don&#39;t need any answer <br/>for it, I use to top-post.<br/><br/>&gt; There are many things that &quot;don&#39;t break the program&quot; but are far from good<br/>&gt; programming practice. Start by taking out all whitespace, for example.<br/>&gt; When we think there is very little chance of our code being read by <br/>&gt; someone else<br/>&gt; or processed in a way we didn&#39;t anticipate, the World will surprise us. <br/>&gt; Being<br/>&gt; nice to the people who expect our program to be Pod-clean is part of the <br/>&gt; Perl<br/>&gt; ethos, and should be honoured.<br/><br/>As I said, for commenting more lines of text, perl doesn&#39;t have a mark, so I <br/>am not creating a perl documentation. Why should I use a certain style for <br/>creating a comment?<br/>Other users won&#39;t see it, because those comments are usually temporary, <br/>sometimes used when I don&#39;t want to include a piece of code in the program.<br/><br/>&gt; The documentation that John referred you to recommends<br/>&gt;<br/>&gt; =begin comment<br/>&gt; :<br/>&gt; =end<br/><br/>And is this a valid perldoc mark?<br/><br/>&gt; As a last resort you could make a case for not being nice to people and we <br/>&gt; will<br/>&gt; consider it here.<br/><br/>Please be so kind and explain what do you want to say, because I don&#39;t <br/>understand your phrase. English is not my native language.<br/>Do you want to say that I wasn&#39;t kind or that I said something badly to <br/>someone?<br/><br/>Octavian<br/><br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100778.html Fri, 16 May 2008 22:31:12 +0000 Re: Multiline comment in Perl by Rob Dixon Octavian Rasnita wrote:<br/>&gt; <br/>&gt; From: &quot;John W. Krahn&quot; &lt;krahnj@telus.net&gt;<br/>&gt; <br/>&gt;&gt; Octavian Rasnita wrote:<br/>&gt;&gt;<br/>&gt;&gt;&gt; ----- Original Message ----- From: &quot;sivasakthi&quot; &lt;msivasakthi@gmail.com&gt;<br/>&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt; How to comment Multiple lines in Perl?<br/>&gt;&gt;&gt;<br/>&gt;&gt;&gt; Perl doesn&#39;t have a multiline comment mark.<br/>&gt;&gt;&gt;<br/>&gt;&gt;&gt; You can use perldoc marks in order to comment what you want, or include <br/>&gt;&gt;&gt; the content in a string, like:<br/>&gt;&gt;&gt;<br/>&gt;&gt;&gt; Perldoc style:<br/>&gt;&gt;&gt;<br/>&gt;&gt;&gt; =start<br/>&gt;&gt;&gt; Here<br/>&gt;&gt;&gt; are the<br/>&gt;&gt;&gt; lines you<br/>&gt;&gt;&gt; want to comment<br/>&gt;&gt;&gt; =cut<br/>&gt;&gt;<br/>&gt;&gt; $ echo &quot;<br/>&gt;&gt;<br/>&gt;&gt; =start<br/>&gt;&gt; Here<br/>&gt;&gt; are the<br/>&gt;&gt; lines you<br/>&gt;&gt; want to comment<br/>&gt;&gt; =cut<br/>&gt;&gt;<br/>&gt;&gt; &quot; | podchecker<br/>&gt;&gt; *** ERROR: Unknown command &#39;start&#39; at line 3 in file &lt;standard input&gt;<br/>&gt;&gt; &lt;&amp;STDIN does not contain any pod commands.<br/>&gt;&gt;<br/>&gt;<br/>&gt; I know that =start is not a valid POD command, but it doesn&#39;t break the <br/>&gt; program. When I use it, I don&#39;t need to use it to add real POD docs, so the <br/>&gt; commands shouldn&#39;t be valid.<br/>&gt; <br/>&gt; =head1 NAME<br/>&gt; is too long...<br/><br/>(Once again, please bottom-post replies to this group. It maintains readability<br/>for extended threads. Salutations and signatures should always be edited out.<br/>You are responsible for the whole of your post, not just your own material.)<br/><br/>There are many things that &quot;don&#39;t break the program&quot; but are far from good<br/>programming practice. Start by taking out all whitespace, for example.<br/><br/>When we think there is very little chance of our code being read by someone else<br/>or processed in a way we didn&#39;t anticipate, the World will surprise us. Being<br/>nice to the people who expect our program to be Pod-clean is part of the Perl<br/>ethos, and should be honoured.<br/><br/>Neither<br/><br/> =start<br/><br/>nor<br/><br/> =comment<br/><br/>are valid POD, and<br/><br/> =head1 NAME<br/><br/>is even worse, because it means something that you don&#39;t intend.<br/><br/>The documentation that John referred you to recommends<br/><br/> =begin comment<br/> :<br/> =end<br/><br/>Which may be a trifle awkward, but I&#39;m sure there are worse things that happen<br/>to you in your day. It takes less than a second to type, and if you do it a lot<br/>you could set up a macro in your editor.<br/><br/>As a last resort you could make a case for not being nice to people and we will<br/>consider it here.<br/><br/>HTH,<br/><br/>Rob<br/><br/><br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100777.html Fri, 16 May 2008 16:03:05 +0000 Re: Multiline comment in Perl by Octavian Rasnita I know that =start is not a valid POD command, but it doesn&#39;t break the <br/>program. When I use it, I don&#39;t need to use it to add real POD docs, so the <br/>commands shouldn&#39;t be valid.<br/><br/>=head1 NAME<br/>is too long...<br/><br/>Octavian<br/><br/>----- Original Message ----- <br/>From: &quot;John W. Krahn&quot; &lt;krahnj@telus.net&gt;<br/>To: &quot;Perl Beginners&quot; &lt;beginners@perl.org&gt;<br/>Sent: Friday, May 16, 2008 7:53 PM<br/>Subject: Re: Multiline comment in Perl<br/><br/><br/>&gt; Octavian Rasnita wrote:<br/>&gt;&gt;<br/>&gt;&gt; ----- Original Message ----- From: &quot;sivasakthi&quot; &lt;msivasakthi@gmail.com&gt;<br/>&gt;&gt;&gt;<br/>&gt;&gt;&gt; How to comment Multiple lines in Perl?<br/>&gt;&gt;<br/>&gt;&gt; Perl doesn&#39;t have a multiline comment mark.<br/>&gt;&gt;<br/>&gt;&gt; You can use perldoc marks in order to comment what you want, or include <br/>&gt;&gt; the content in a string, like:<br/>&gt;&gt;<br/>&gt;&gt; Perldoc style:<br/>&gt;&gt;<br/>&gt;&gt; =start<br/>&gt;&gt; Here<br/>&gt;&gt; are the<br/>&gt;&gt; lines you<br/>&gt;&gt; want to comment<br/>&gt;&gt; =cut<br/>&gt;<br/>&gt; $ echo &quot;<br/>&gt;<br/>&gt; =start<br/>&gt; Here<br/>&gt; are the<br/>&gt; lines you<br/>&gt; want to comment<br/>&gt; =cut<br/>&gt;<br/>&gt; &quot; | podchecker<br/>&gt; *** ERROR: Unknown command &#39;start&#39; at line 3 in file &lt;standard input&gt;<br/>&gt; &lt;&amp;STDIN does not contain any pod commands.<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; John<br/>&gt; -- <br/>&gt; Perl isn&#39;t a toolbox, but a small machine shop where you<br/>&gt; can special-order certain sorts of tools at low cost and<br/>&gt; in short order. -- Larry Wall<br/>&gt;<br/>&gt; -- <br/>&gt; To unsubscribe, e-mail: beginners-unsubscribe@perl.org<br/>&gt; For additional commands, e-mail: beginners-help@perl.org<br/>&gt; http://learn.perl.org/<br/>&gt;<br/>&gt; <br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100776.html Fri, 16 May 2008 14:53:06 +0000 Re: Initialize object permanently by Rob Dixon anthony brooke wrote:<br/>&gt;<br/>&gt; Rob Dixon wrote:<br/>&gt;&gt;<br/>&gt;&gt; (I couldn&#39;t be bothered to reformat your post this time. Please bottom-post<br/>&gt;&gt; on this group. It&#39;s said several times a week.)<br/>&gt; <br/>&gt; (Sorry, I really don&#39;t know about that, could you tell why must it in<br/>&gt; bottom ?)<br/><br/>Because extended threads become very hard to read if they&#39;re top-posted. Making<br/>tidy posts about a programming language that may include embedded code is hard<br/>to do anyway, and if they have to be read from the end backwards it makes them<br/>even less likely to be understood. You should remove all sigs and salutations<br/>and anything that&#39;s irrelevant to your own post. Each of us is responsible for<br/>the formatting of all that we quote as well as our own material, and all posts<br/>should make sense in isolation if read from the beginning to the end.<br/><br/>&gt; Someone has given me a seems good solution,<br/>&gt; http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/5e2d923994e833d9#<br/>&gt; <br/>&gt; I am going to dig more about mod_perl<br/><br/>Good. It would be nice if you let us know if you find a solution, or indeed if<br/>you still need help :)<br/><br/>Rob<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100775.html Fri, 16 May 2008 11:55:02 +0000 Re: Initialize object permanently by Rob Dixon anthony brooke wrote:<br/>&gt;<br/>&gt; Thanks for the reply, it&#39;s a dynamic server side script that currently<br/>&gt; using CGI, but I am going for mod_perl. The interface is something like<br/>&gt; Google, so everytime the user make a request to lookup let&#39;s say the<br/>&gt; meaning of a word, the WordNet object have to be initialized. Is there a<br/>&gt; work around of this with mod_perl ? Thanks<br/><br/>(I couldn&#39;t be bothered to reformat your post this time. Please bottom-post on<br/>this group. It&#39;s said several times a week.)<br/><br/>mod_perl is very lovely, but is also a niche application of Perl. From my<br/>limited understanding of how it works I feel certain that it can maintain an<br/>open dictionary for you, but you need more specific help than I can offer.<br/><br/>Does anybody have a simple answer to this, or know about a mod_perl list?<br/><br/>Rob<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100774.html Fri, 16 May 2008 11:22:49 +0000 Re: Initialize object permanently by anthony brooke Thanks for the reply, it&#39;s a dynamic server side script that currently using CGI, but I am going for mod_perl. The interface is something like Google, so everytime the user make a request to lookup let&#39;s say the meaning of a word, the WordNet object have to be initialized. Is there a work around of this with mod_perl ? Thanks<br/><br/><br/>----- Original Message ----<br/>From: Rob Dixon &lt;rob.dixon@gmx.com&gt;<br/>To: beginner perl mailling list &lt;beginners@perl.org&gt;<br/>Cc: anthony brooke &lt;esia168@yahoo.com&gt;<br/>Sent: Saturday, May 17, 2008 0:47:52<br/>Subject: Re: Initialize object permanently<br/><br/>anthony brooke wrote:<br/>&gt;<br/>&gt; Hello, I am using Wordnet::QueryData which allow access to a very huge dictionary data. The initialization of object <br/>&gt; my $wn = WordNet::QueryData-&gt;new;<br/>&gt; <br/>&gt; took <br/>&gt; 2 wallclock secs ( 2.36 usr + 0.07 sys = 2.43 CPU)<br/>&gt; <br/>&gt; Then the subsequent request for the data is exetremely fast <br/>&gt; <br/>&gt; For the lines below took<br/>&gt; 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)<br/>&gt; <br/>&gt; print &quot;Synset: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;cat#n#7&quot;, &quot;syns&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Hyponyms: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;cat#n#1&quot;, &quot;hypo&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Parts of Speech: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;run&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Senses: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;run#v&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Forms: &quot;, join(&quot;, &quot;, $wn-&gt;validForms(&quot;lay down#v&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Noun count: &quot;, scalar($wn-&gt;listAllWords(&quot;noun&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Antonyms: &quot;, join(&quot;, &quot;, $wn-&gt;queryWord(&quot;dark#n#1&quot;, &quot;ants&quot;)), &quot;\n&quot;;<br/>&gt; <br/>&gt; I<br/>&gt; am developing a web application, is there a way to make the<br/>&gt; initialization of object permanently in memory ? I tried to use the<br/>&gt; Storable module. But that only give me a little increase in<br/>&gt; performance. Anybody&#39;s idea is very much appreciated, Thank you.<br/><br/>When you say &#39;web application&#39;, do you mean a server-side CGI script or a<br/>client-side program that interrogates the Web and also needs access to the<br/>dictionary?<br/><br/>Rob<br/><br/>-- <br/>To unsubscribe, e-mail: beginners-unsubscribe@perl.org<br/>For additional commands, e-mail: beginners-help@perl.org<br/>http://learn.perl.org/<br/><br/>Send instant messages to your online friends http://uk.messenger.yahoo.com<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100773.html Fri, 16 May 2008 11:05:24 +0000 Re: Multiline comment in Perl by John W. Krahn Octavian Rasnita wrote:<br/>&gt; <br/>&gt; ----- Original Message ----- From: &quot;sivasakthi&quot; &lt;msivasakthi@gmail.com&gt;<br/>&gt;&gt;<br/>&gt;&gt; How to comment Multiple lines in Perl?<br/>&gt; <br/>&gt; Perl doesn&#39;t have a multiline comment mark.<br/>&gt; <br/>&gt; You can use perldoc marks in order to comment what you want, or include <br/>&gt; the content in a string, like:<br/>&gt; <br/>&gt; Perldoc style:<br/>&gt; <br/>&gt; =start<br/>&gt; Here<br/>&gt; are the<br/>&gt; lines you<br/>&gt; want to comment<br/>&gt; =cut<br/><br/>$ echo &quot;<br/><br/>=start<br/>Here<br/>are the<br/>lines you<br/>want to comment<br/>=cut<br/><br/>&quot; | podchecker<br/>*** ERROR: Unknown command &#39;start&#39; at line 3 in file &lt;standard input&gt;<br/>&lt;&amp;STDIN does not contain any pod commands.<br/><br/><br/><br/>John<br/>-- <br/>Perl isn&#39;t a toolbox, but a small machine shop where you<br/>can special-order certain sorts of tools at low cost and<br/>in short order. -- Larry Wall<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100772.html Fri, 16 May 2008 09:53:09 +0000 Re: Multiline comment in Perl by John W. Krahn Beau E. Cox wrote:<br/>&gt; On Thu, May 15, 2008 at 11:24 PM, sivasakthi &lt;msivasakthi@gmail.com&gt; wrote:<br/>&gt;&gt;<br/>&gt;&gt; How to comment Multiple lines in Perl?<br/>&gt; <br/>&gt; =comment<br/>&gt; like this<br/>&gt; example<br/>&gt; =cut<br/><br/>$ echo &quot;<br/><br/>=comment<br/>like this<br/>example<br/>=cut<br/><br/>&quot; | podchecker<br/>*** ERROR: Unknown command &#39;comment&#39; at line 3 in file &lt;standard input&gt;<br/>&lt;&amp;STDIN does not contain any pod commands.<br/><br/><br/><br/>John<br/>-- <br/>Perl isn&#39;t a toolbox, but a small machine shop where you<br/>can special-order certain sorts of tools at low cost and<br/>in short order. -- Larry Wall<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100771.html Fri, 16 May 2008 09:49:47 +0000 Re: Initialize object permanently by Rob Dixon anthony brooke wrote:<br/>&gt;<br/>&gt; Hello, I am using Wordnet::QueryData which allow access to a very huge dictionary data. The initialization of object <br/>&gt; my $wn = WordNet::QueryData-&gt;new;<br/>&gt; <br/>&gt; took <br/>&gt; 2 wallclock secs ( 2.36 usr + 0.07 sys = 2.43 CPU)<br/>&gt; <br/>&gt; Then the subsequent request for the data is exetremely fast <br/>&gt; <br/>&gt; For the lines below took<br/>&gt; 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)<br/>&gt; <br/>&gt; print &quot;Synset: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;cat#n#7&quot;, &quot;syns&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Hyponyms: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;cat#n#1&quot;, &quot;hypo&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Parts of Speech: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;run&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Senses: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;run#v&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Forms: &quot;, join(&quot;, &quot;, $wn-&gt;validForms(&quot;lay down#v&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Noun count: &quot;, scalar($wn-&gt;listAllWords(&quot;noun&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Antonyms: &quot;, join(&quot;, &quot;, $wn-&gt;queryWord(&quot;dark#n#1&quot;, &quot;ants&quot;)), &quot;\n&quot;;<br/>&gt; <br/>&gt; I<br/>&gt; am developing a web application, is there a way to make the<br/>&gt; initialization of object permanently in memory ? I tried to use the<br/>&gt; Storable module. But that only give me a little increase in<br/>&gt; performance. Anybody&#39;s idea is very much appreciated, Thank you.<br/><br/>When you say &#39;web application&#39;, do you mean a server-side CGI script or a<br/>client-side program that interrogates the Web and also needs access to the<br/>dictionary?<br/><br/>Rob<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100770.html Fri, 16 May 2008 09:48:03 +0000 Re: Multiline comment in Perl by John W. Krahn sivasakthi wrote:<br/>&gt; Hi all,<br/><br/>Hello,<br/><br/>&gt; How to comment Multiple lines in Perl?<br/><br/>perldoc -q &quot;How can I comment out a large block of perl code&quot;<br/><br/><br/><br/>John<br/>-- <br/>Perl isn&#39;t a toolbox, but a small machine shop where you<br/>can special-order certain sorts of tools at low cost and<br/>in short order. -- Larry Wall<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100769.html Fri, 16 May 2008 09:45:58 +0000 Re: Initialize object permanently by Chas. Owens On May 16, 2008, at 04:55, anthony brooke wrote:<br/><br/>&gt; Hello, I am using Wordnet::QueryData which allow access to a very <br/>&gt; huge dictionary data. The initialization of object<br/>&gt; my $wn = WordNet::QueryData-&gt;new;<br/>&gt;<br/>&gt; took<br/>&gt; 2 wallclock secs ( 2.36 usr + 0.07 sys = 2.43 CPU)<br/>&gt;<br/>&gt; Then the subsequent request for the data is exetremely fast<br/>&gt;<br/>&gt; For the lines below took<br/>&gt; 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)<br/>&gt;<br/>&gt; print &quot;Synset: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;cat#n#7&quot;, &quot;syns&quot;)), <br/>&gt; &quot;\n&quot;;<br/>&gt; print &quot;Hyponyms: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;cat#n#1&quot;, &quot;hypo&quot;)), <br/>&gt; &quot;\n&quot;;<br/>&gt; print &quot;Parts of Speech: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;run&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Senses: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;run#v&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Forms: &quot;, join(&quot;, &quot;, $wn-&gt;validForms(&quot;lay down#v&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Noun count: &quot;, scalar($wn-&gt;listAllWords(&quot;noun&quot;)), &quot;\n&quot;;<br/>&gt; print &quot;Antonyms: &quot;, join(&quot;, &quot;, $wn-&gt;queryWord(&quot;dark#n#1&quot;, &quot;ants&quot;)), <br/>&gt; &quot;\n&quot;;<br/>&gt;<br/>&gt; I<br/>&gt; am developing a web application, is there a way to make the<br/>&gt; initialization of object permanently in memory ? I tried to use the<br/>&gt; Storable module. But that only give me a little increase in<br/>&gt; performance. Anybody&#39;s idea is very much appreciated, Thank you.<br/><br/>Your best bet is to take a daemon like approach. Startup a script <br/>that does nothing but respond to requests by other scripts. Take a <br/>look at the IPC::* modules to see how to do inter-process communication.<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100768.html Fri, 16 May 2008 07:54:34 +0000 Re: website by oryann9 On Thu, May 15, 2008 at 3:45 PM, Dr.Ruud &lt;rvtol+news@isolution.nl&gt; wrote:<br/>&gt; It contains a lot of bad advice too.<br/><br/>You have been helpful in the past so please be so kind to point out<br/>the *bad Advice*... Just saying it&#39;s bad really helps no one on a<br/>&quot;beginners&quot; list. The way I see it, people will read that information,<br/>begin to code with it, then when they run into problems they come here<br/>only to be chastised by using such examples. Why not end that loop by<br/>good examples?<br/><br/>-<br/><br/>Horray, Horray! I agree with all stated here. I have been doing Perl for seven years now and still consider myself a beginner at many concepts.<br/><br/><br/> <br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100767.html Fri, 16 May 2008 05:54:22 +0000 Re: website by Dr.Ruud Jerald Sheets schreef:<br/>&gt; Dr.Ruud:<br/>&gt;&gt; Richard Lee:<br/><br/>&gt;&gt;&gt; [www.raycosoft.com/rayco/support/perl_tutor.html]<br/>&gt;&gt;&gt; this is very helpful to me. I always have trouble w/ map and<br/>&gt;&gt;&gt; grep(still do..) but this website is helpful<br/>&gt;&gt;<br/>&gt;&gt; It contains a lot of bad advice too.<br/>&gt;<br/>&gt; Look, someone asked for it by name, and I just obliged. Don&#39;t shoot<br/>&gt; the messenger... He packs a gun too...<br/><br/>Jerald, sorry for that.<br/><br/>Could you start quoting sensibly?<br/>Only quote what you react on, certainly not quote signatures.<br/><br/>Each quote should contain just enough context to place your reaction<br/>that follows it.<br/><br/>-- <br/>Affijn, Ruud<br/><br/>&quot;Gewoon is een tijger.&quot;<br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100766.html Fri, 16 May 2008 03:15:39 +0000 Re: Multiline comment in Perl by Octavian Rasnita Hi,<br/><br/>Perl doesn&#39;t have a multiline comment mark.<br/><br/>You can use perldoc marks in order to comment what you want, or include the <br/>content in a string, like:<br/><br/>Perldoc style:<br/><br/>=start<br/>Here<br/>are the<br/>lines you<br/>want to comment<br/>=cut<br/><br/>Or using a string:<br/><br/>q/<br/>Here are<br/>the<br/>lines you<br/>want to comment<br/>/;<br/><br/>The program will work fine, but in the second example, if you use<br/><br/>use warnings;<br/><br/>it will tell you that you used this string in a void context.<br/>If you don&#39;t like the warning, you could use:<br/><br/>my $zzz = q/<br/>...<br/>/;<br/><br/>The first way is prefered, but the second way allows you to comment one line <br/>or more lines using the same syntax.<br/><br/>Octavian<br/><br/>----- Original Message ----- <br/>From: &quot;sivasakthi&quot; &lt;msivasakthi@gmail.com&gt;<br/>To: &quot;beginners perl&quot; &lt;beginners@perl.org&gt;<br/>Sent: Friday, May 16, 2008 12:24 PM<br/>Subject: Multiline comment in Perl<br/><br/><br/>&gt; Hi all,<br/>&gt;<br/>&gt;<br/>&gt; How to comment Multiple lines in Perl?<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; Thanks,<br/>&gt; Siva<br/>&gt;<br/>&gt;<br/>&gt; <br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100765.html Fri, 16 May 2008 03:08:44 +0000 Re: Multiline comment in Perl by Beau E. Cox On Thu, May 15, 2008 at 11:24 PM, sivasakthi &lt;msivasakthi@gmail.com&gt; wrote:<br/>&gt; Hi all,<br/>&gt;<br/>&gt;<br/>&gt; How to comment Multiple lines in Perl?<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; Thanks,<br/>&gt; Siva<br/>&gt;<br/><br/>=comment<br/>like this<br/>example<br/>=cut<br/><br/>Aloha =&gt; Beau;<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100764.html Fri, 16 May 2008 02:28:39 +0000 Multiline comment in Perl by sivasakthi Hi all,<br/><br/><br/>How to comment Multiple lines in Perl?<br/><br/><br/><br/>Thanks,<br/>Siva<br/><br/><br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100763.html Fri, 16 May 2008 02:26:03 +0000 Initialize object permanently by anthony brooke Hello, I am using Wordnet::QueryData which allow access to a very huge dictionary data. The initialization of object <br/>my $wn = WordNet::QueryData-&gt;new;<br/><br/>took <br/>2 wallclock secs ( 2.36 usr + 0.07 sys = 2.43 CPU)<br/><br/>Then the subsequent request for the data is exetremely fast <br/><br/>For the lines below took<br/>0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)<br/><br/>print &quot;Synset: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;cat#n#7&quot;, &quot;syns&quot;)), &quot;\n&quot;;<br/> print &quot;Hyponyms: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;cat#n#1&quot;, &quot;hypo&quot;)), &quot;\n&quot;;<br/> print &quot;Parts of Speech: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;run&quot;)), &quot;\n&quot;;<br/> print &quot;Senses: &quot;, join(&quot;, &quot;, $wn-&gt;querySense(&quot;run#v&quot;)), &quot;\n&quot;;<br/> print &quot;Forms: &quot;, join(&quot;, &quot;, $wn-&gt;validForms(&quot;lay down#v&quot;)), &quot;\n&quot;;<br/> print &quot;Noun count: &quot;, scalar($wn-&gt;listAllWords(&quot;noun&quot;)), &quot;\n&quot;;<br/> print &quot;Antonyms: &quot;, join(&quot;, &quot;, $wn-&gt;queryWord(&quot;dark#n#1&quot;, &quot;ants&quot;)), &quot;\n&quot;;<br/><br/>I<br/>am developing a web application, is there a way to make the<br/>initialization of object permanently in memory ? I tried to use the<br/>Storable module. But that only give me a little increase in<br/>performance. Anybody&#39;s idea is very much appreciated, Thank you.<br/><br/><br/>William<br/><br/>Send instant messages to your online friends http://uk.messenger.yahoo.com<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100762.html Fri, 16 May 2008 01:55:39 +0000 Re: website by Omega -1911 On Thu, May 15, 2008 at 3:45 PM, Dr.Ruud &lt;rvtol+news@isolution.nl&gt; wrote:<br/>&gt; It contains a lot of bad advice too.<br/><br/>You have been helpful in the past so please be so kind to point out<br/>the *bad Advice*... Just saying it&#39;s bad really helps no one on a<br/>&quot;beginners&quot; list. The way I see it, people will read that information,<br/>begin to code with it, then when they run into problems they come here<br/>only to be chastised by using such examples. Why not end that loop by<br/>good examples?<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100761.html Thu, 15 May 2008 21:25:19 +0000 Re: How to get perl (for Windows) with modules like OLE and Spreadsheet and such included by roger61611 On May 15, 9:34&nbsp;am, nore...@gunnar.cc (Gunnar Hjalmarsson) wrote:<br/>&gt; roger61...@yahoo.com wrote:<br/>&gt; &gt; Hello, Is there someplace I can get perl (for Windows) with modules<br/>&gt; &gt; like OLE and Spreadsheet and such included already ? &nbsp;The PC here is<br/>&gt; &gt; sort of old and it would be neat to just download oerl (w/ modules)<br/>&gt; &gt; and start working vs downloading perl and then downlading/installing<br/>&gt; &gt; module by module.<br/>&gt;<br/>&gt; http://www.indigostar.com/indigoperl.htm<br/>&gt;<br/>&gt; --<br/>&gt; Gunnar Hjalmarsson<br/>&gt; Email:http://www.gunnar.cc/cgi-bin/contact.pl<br/><br/>thank you !<br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100760.html Thu, 15 May 2008 16:36:59 +0000 Re: website by Jerald Sheets Look, someone asked for it by name, and I just obliged. Don&#39;t shoot <br/>the messenger... He packs a gun too...<br/><br/>:)<br/><br/>Jerald Sheets<br/><br/>Sent from my iPhone<br/>Please disregard spelling/grammar errors<br/><br/>On May 15, 2008, at 3:45 PM, &quot;Dr.Ruud&quot; &lt;rvtol+news@isolution.nl&gt; wrote:<br/><br/>&gt; Richard Lee schreef:<br/>&gt;&gt; Jerald Sheets:<br/>&gt;<br/>&gt;&gt;&gt;<br/>&gt; http://web.archive.org/web/20021004030027/www.raycosoft.com/rayco/support/perl_tutor.html<br/>&gt;&gt;<br/>&gt;&gt; this is very helpful to me. I always have trouble w/ map and<br/>&gt;&gt; grep(still do..) but this website is helpful<br/>&gt;&gt;<br/>&gt;&gt; thank you to bring up this website!!<br/>&gt;<br/>&gt; It contains a lot of bad advice too.<br/>&gt;<br/>&gt; -- <br/>&gt; Affijn, Ruud (and Richard, see how I quoted, start to trim your posts)<br/>&gt;<br/>&gt; &quot;Gewoon is een tijger.&quot;<br/>&gt;<br/>&gt;<br/>&gt; -- <br/>&gt; To unsubscribe, e-mail: beginners-unsubscribe@perl.org<br/>&gt; For additional commands, e-mail: beginners-help@perl.org<br/>&gt; http://learn.perl.org/<br/>&gt;<br/>&gt;<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100759.html Thu, 15 May 2008 14:28:11 +0000 Re: website by Dr.Ruud Richard Lee schreef:<br/>&gt; Jerald Sheets:<br/><br/>&gt;&gt;<br/>http://web.archive.org/web/20021004030027/www.raycosoft.com/rayco/support/perl_tutor.html<br/>&gt;<br/>&gt; this is very helpful to me. I always have trouble w/ map and<br/>&gt; grep(still do..) but this website is helpful<br/>&gt;<br/>&gt; thank you to bring up this website!!<br/><br/>It contains a lot of bad advice too.<br/><br/>-- <br/>Affijn, Ruud (and Richard, see how I quoted, start to trim your posts)<br/><br/>&quot;Gewoon is een tijger.&quot;<br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100758.html Thu, 15 May 2008 12:46:25 +0000 Re: website by Richard Lee Jerald Sheets wrote:<br/>&gt;<br/>&gt; Here&#39;s one that&#39;s still in there:<br/>&gt;<br/>&gt; http://web.archive.org/web/20021004030027/www.raycosoft.com/rayco/support/perl_tutor.html <br/>&gt;<br/>&gt;<br/>&gt; Get it while it&#39;s good.<br/>&gt;<br/>&gt; Also, check out PerlMonks &amp; The OReilley Perl site. Also, PlanetPerl <br/>&gt; is very helpful from time to time.<br/>&gt;<br/>&gt; --jms<br/>&gt;<br/>&gt;<br/>&gt; On May 15, 2008, at 11:42 AM, oryann9 wrote:<br/>&gt;<br/>&gt;&gt; Does anyone know what happened to this website: <br/>&gt;&gt; http://web.archive.org/web/20041123005900/http://www.raycosoft.com/rayco/support/perl_tutor.html <br/>&gt;&gt;<br/>&gt;&gt; It says its not available. I thought it was a great reference and <br/>&gt;&gt; explained the diffs between map and grep and even sort.<br/>&gt;&gt; Does anyone have a softcopy of its data that you can send me?<br/>&gt;&gt;<br/>&gt;&gt; thank you!<br/>&gt;&gt;<br/>&gt;&gt;<br/>&gt;&gt;<br/>&gt;&gt;<br/>&gt;&gt;<br/>&gt;&gt; -- <br/>&gt;&gt; To unsubscribe, e-mail: beginners-unsubscribe@perl.org<br/>&gt;&gt; For additional commands, e-mail: beginners-help@perl.org<br/>&gt;&gt; http://learn.perl.org/<br/>&gt;&gt;<br/>&gt;&gt;<br/>&gt;<br/>&gt;<br/>this is very helpful to me. I always have trouble w/ map and grep(still <br/>do..) but this website is helpful<br/><br/>thank you to bring up this website!!<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100757.html Thu, 15 May 2008 12:28:49 +0000 Re: Sorting and grouping question by Li, Jialin On Thu, May 15, 2008 at 12:13 PM, ANJAN PURKAYASTHA &lt;<br/>anjan.purkayastha@gmail.com&gt; wrote:<br/><br/>&gt; Hi,<br/>&gt; here is a problem I&#39;m working on. It&#39;s not PERL-specific, rather it is a<br/>&gt; problem in sorting followed by grouping.<br/>&gt; Suppose I have a set of lines that have tab-delimited text, thus:<br/>&gt; 1 w 3 wer<br/>&gt; 2 a 4 rte<br/>&gt; 4 w 2 weg<br/>&gt; 6 d 4 fhg<br/>&gt; 5 d 7 dfl<br/>&gt; 6 w 4 ald<br/>&gt; 8 a 3 dsl<br/>&gt;<br/>&gt; I would like to first sort the lines based on the 2nd token (w,a, w, d,<br/>&gt; etc)<br/>&gt; and then group the lines based on the 2nd token.<br/>&gt;<br/>&gt; At the end of this sorting/grouping I should have the lines grouped thus:<br/>&gt; 2 a 4 rte<br/>&gt; 8 a 3 dsl<br/>&gt;<br/>&gt; 6 d 4 fhg<br/>&gt; 5 d 7 dfl<br/>&gt;<br/>&gt; 1 w 3 wer<br/>&gt; 4 w 2 weg<br/>&gt; 6 w 4 ald<br/>&gt;<br/>&gt;<br/>&gt; I can figure out the sorting. Are they any command/modules to do the<br/>&gt; grouping based on identical tokens?<br/>&gt;<br/>&gt; appreciate your input.<br/>&gt;<br/>&gt;<br/>&gt; tia,<br/>&gt; anjan<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; --<br/>&gt; ANJAN PURKAYASTHA, PhD.<br/>&gt; Senior Computational Biologist<br/>&gt; ==========================<br/>&gt;<br/>&gt; 1101 King Street, Suite 310,<br/>&gt; Alexandria, VA 22314.<br/>&gt; 703.518.8040 (office)<br/>&gt; 703.740.6939 (mobile)<br/>&gt;<br/>&gt; email:<br/>&gt; anjan@vbi.vt.edu;<br/>&gt; anjan.purkayastha@gmail.com<br/>&gt;<br/>&gt; http://www.vbi.vt.edu<br/>&gt;<br/>&gt; ==========================<br/>&gt;<br/><br/><br/>hash of array will solve your problem<br/><br/>use strict;<br/>use warnings;<br/><br/>my %HofA;<br/><br/>map { push @{ $HofA{ (split)[1] } }, $_ } &lt;DATA&gt; ;<br/><br/>for my $key (sort keys %HofA) {<br/> print $_ for @{ $HofA{$key} };<br/> print &quot;\n&quot;;<br/>}<br/><br/><br/>__DATA__<br/>1 w 3 wer<br/>2 a 4 rte<br/>4 w 2 weg<br/>6 d 4 fhg<br/>5 d 7 dfl<br/>6 w 4 ald<br/>8 a 3 dsl<br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100756.html Thu, 15 May 2008 11:00:04 +0000 Sorting and grouping question by ANJAN PURKAYASTHA Hi,<br/>here is a problem I&#39;m working on. It&#39;s not PERL-specific, rather it is a<br/>problem in sorting followed by grouping.<br/>Suppose I have a set of lines that have tab-delimited text, thus:<br/>1 w 3 wer<br/>2 a 4 rte<br/>4 w 2 weg<br/>6 d 4 fhg<br/>5 d 7 dfl<br/>6 w 4 ald<br/>8 a 3 dsl<br/><br/>I would like to first sort the lines based on the 2nd token (w,a, w, d, etc)<br/>and then group the lines based on the 2nd token.<br/><br/>At the end of this sorting/grouping I should have the lines grouped thus:<br/>2 a 4 rte<br/>8 a 3 dsl<br/><br/>6 d 4 fhg<br/>5 d 7 dfl<br/><br/>1 w 3 wer<br/>4 w 2 weg<br/>6 w 4 ald<br/><br/><br/>I can figure out the sorting. Are they any command/modules to do the<br/>grouping based on identical tokens?<br/><br/>appreciate your input.<br/><br/><br/>tia,<br/>anjan<br/><br/><br/><br/>-- <br/>ANJAN PURKAYASTHA, PhD.<br/>Senior Computational Biologist<br/>==========================<br/><br/>1101 King Street, Suite 310,<br/>Alexandria, VA 22314.<br/>703.518.8040 (office)<br/>703.740.6939 (mobile)<br/><br/>email:<br/>anjan@vbi.vt.edu;<br/>anjan.purkayastha@gmail.com<br/><br/>http://www.vbi.vt.edu<br/><br/>==========================<br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100755.html Thu, 15 May 2008 10:13:22 +0000 Re: pushing errors to another sub by Chas. Owens <br/>On May 14, 2008, at 20:25, Robert Hicks wrote:<br/><br/>&gt; just &quot;bad&quot; pseudo code:<br/>&gt;<br/>&gt; sub one {<br/>&gt; $process-&gt;name(\$html) || $errors_from_one( $process-&gt;error() );<br/>&gt;<br/>&gt; $process-&gt;name(\$text) || $errors_from_one( $process-&gt;error() );<br/>&gt; }<br/>&gt;<br/>&gt; sub errors_from_one {<br/>&gt; my $error = @_;<br/>&gt;<br/>&gt; push (my @errors, $error);<br/>&gt;<br/>&gt; # do stuff to make sure the errors are uniq<br/>&gt;<br/>&gt; return my @uniq_error_list;<br/>&gt; }<br/>&gt;<br/>&gt;<br/>&gt; I want to be able to get at those errors later. Will something like <br/>&gt; that work?<br/>&gt;<br/>&gt; Robert<br/><br/>You may be better off creating a set of objects to handle this, but <br/>here is a lightweight solution:<br/><br/>{ #limit visibility of @queue to these two functions<br/>my @queue;<br/>sub save_errors { push @queue, @_; }<br/>sub handle_errors {<br/> for my $error (@queue) {<br/> #do something<br/> }<br/>}<br/>}<br/><br/>sub one {<br/> $process-&gt;name(\$html) or save_errors($process-&gt;error);<br/> $process-&gt;name(\$text) or save_errors($process-&gt;error);<br/>}<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100754.html Thu, 15 May 2008 09:41:50 +0000 Re: website by Jerald Sheets <br/>Here&#39;s one that&#39;s still in there:<br/><br/>http://web.archive.org/web/20021004030027/www.raycosoft.com/rayco/support/perl_tutor.html<br/><br/>Get it while it&#39;s good.<br/><br/>Also, check out PerlMonks &amp; The OReilley Perl site. Also, PlanetPerl <br/>is very helpful from time to time.<br/><br/>--jms<br/><br/><br/>On May 15, 2008, at 11:42 AM, oryann9 wrote:<br/><br/>&gt; Does anyone know what happened to this website: http://web.archive.org/web/20041123005900/http://www.raycosoft.com/rayco/support/perl_tutor.html<br/>&gt; It says its not available. I thought it was a great reference and <br/>&gt; explained the diffs between map and grep and even sort.<br/>&gt; Does anyone have a softcopy of its data that you can send me?<br/>&gt;<br/>&gt; thank you!<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; -- <br/>&gt; To unsubscribe, e-mail: beginners-unsubscribe@perl.org<br/>&gt; For additional commands, e-mail: beginners-help@perl.org<br/>&gt; http://learn.perl.org/<br/>&gt;<br/>&gt;<br/><br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100753.html Thu, 15 May 2008 08:51:12 +0000 website by oryann9 Does anyone know what happened to this website: http://web.archive.org/web/20041123005900/http://www.raycosoft.com/rayco/support/perl_tutor.html<br/>It says its not available. I thought it was a great reference and explained the diffs between map and grep and even sort.<br/>Does anyone have a softcopy of its data that you can send me?<br/><br/>thank you!<br/><br/><br/><br/> <br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100752.html Thu, 15 May 2008 08:43:24 +0000 Re: How to get perl (for Windows) with modules like OLE and Spreadsheetand such included by Gunnar Hjalmarsson roger61611@yahoo.com wrote:<br/>&gt; Hello, Is there someplace I can get perl (for Windows) with modules<br/>&gt; like OLE and Spreadsheet and such included already ? The PC here is<br/>&gt; sort of old and it would be neat to just download oerl (w/ modules)<br/>&gt; and start working vs downloading perl and then downlading/installing<br/>&gt; module by module.<br/><br/>http://www.indigostar.com/indigoperl.htm<br/><br/>-- <br/>Gunnar Hjalmarsson<br/>Email: http://www.gunnar.cc/cgi-bin/contact.pl<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100751.html Thu, 15 May 2008 06:34:42 +0000 How to get perl (for Windows) with modules like OLE and Spreadsheet and such included by roger61611 Hello, Is there someplace I can get perl (for Windows) with modules<br/>like OLE and Spreadsheet and such included already ? The PC here is<br/>sort of old and it would be neat to just download oerl (w/ modules)<br/>and start working vs downloading perl and then downlading/installing<br/>module by module.<br/><br/>Thank you.<br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100750.html Thu, 15 May 2008 04:20:34 +0000 pushing errors to another sub by Robert Hicks just &quot;bad&quot; pseudo code:<br/><br/>sub one {<br/> $process-&gt;name(\$html) || $errors_from_one( $process-&gt;error() );<br/><br/> $process-&gt;name(\$text) || $errors_from_one( $process-&gt;error() );<br/>}<br/><br/>sub errors_from_one {<br/> my $error = @_;<br/><br/> push (my @errors, $error);<br/><br/> # do stuff to make sure the errors are uniq<br/><br/> return my @uniq_error_list;<br/>}<br/><br/><br/>I want to be able to get at those errors later. Will something like that <br/>work?<br/><br/>Robert<br/><br/><br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100749.html Wed, 14 May 2008 17:25:41 +0000 Re: items in array by Gunnar Hjalmarsson [ Please do not top-post! ]<br/><br/>Tech list wrote:<br/>&gt; Dr.Ruud wrote:<br/>&gt;&gt; &quot;Li, Jialin&quot; schreef:<br/>&gt;&gt;&gt; On Wed, May 14, 2008 at 4:01 PM, Tech list<br/>&gt;&gt;&gt; &lt;tech_list@womenshealth.com&gt; wrote:<br/>&gt;&gt;&gt;&gt; what is the correct way to get the number of items in an array?<br/>&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt; I used to use $#array<br/>&gt;&gt;&gt;<br/>&gt;&gt;&gt; $#array is the index of the last item, so the number should be<br/>&gt;&gt;&gt; $#array + 1, or<br/>&gt;&gt;&gt; scalar @array<br/>&gt;&gt; <br/>&gt;&gt; Please read perlvar about $[. Normally it is 0, but you can set it to a<br/>&gt;&gt; different value, like -3 or 27.<br/>&gt;&gt; <br/>&gt;&gt; The $#array is the last index of @array, so $array[$#array] is<br/>&gt;&gt; equivalent to $array[-1].<br/>&gt;&gt; <br/>&gt;&gt; The number of items in an array is returned by @array in scalar context,<br/>&gt;&gt; examples:<br/>&gt;&gt; <br/>&gt;&gt; scalar(@array)<br/>&gt;&gt; <br/>&gt;&gt; (0+ @array)<br/>&gt;&gt; <br/>&gt;&gt; if (0 &lt; @array) { ... }<br/>&gt;&gt; <br/>&gt;&gt; if (@array) { ... }<br/>&gt; <br/>&gt; Is $#array deprecated or not?<br/><br/>It&#39;s not deprecated. But, as others already have explained, it does not <br/>represent the number of items in an array, which is what you asked <br/>about, after all.<br/><br/>-- <br/>Gunnar Hjalmarsson<br/>Email: http://www.gunnar.cc/cgi-bin/contact.pl<br/> http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100748.html Wed, 14 May 2008 15:55:52 +0000