60 PerlMonks - Newest Nodes New nodes appearing on PerlMonks http://perlmonks.org/index.pl?node_id=30175 http://blogs.law.harvard.edu/tech/rss PerlMonks Newest Nodes XML Generator Tue Apr 25 07:05:38 2017 20170425070538 2017-04-25 17:05:38 Tue Apr 25 07:05:38 2017 Anonymous Monk rss,clean 961 30 PerlMonks http://perlmonks.org/ Number of Replies Count Wrong perldigious http://perlmonks.org/index.pl?node_id=1188840 I was just looking at the <a href="?node_id=1188731">latest CUFP</a> as I post this and I noticed that in the CUFP home it says "1 reply", but when I click on it to look it appears to have none. A minor thing, bu... monkdiscuss Tue, 25 Apr 2017 13:09:29 +0000 http://perlmonks.org/index.pl?node_id=1188840 1188840 1150057 2017-04-25 09:09:29 perldigious DBI output into browser using CGI billycote http://perlmonks.org/index.pl?node_id=1188857 Hi folks. I have a little bit of code that takes in a couple of arguments and hooks up to a database using DBI. I want it to display back to a web page using CGI methods. It works great on the c... perlquestion Tue, 25 Apr 2017 14:53:16 +0000 http://perlmonks.org/index.pl?node_id=1188857 1188857 1045195 2017-04-25 10:53:16 billycote 'submit' a series of form selections Anonymous Monk http://perlmonks.org/index.pl?node_id=1188839 i am using Perl to construct a web page with a number of dropdown menus. I only want to 'submit' the form once after all the selections have been made. Chrome will not let me paste my source code ... perlquestion Tue, 25 Apr 2017 12:57:52 +0000 http://perlmonks.org/index.pl?node_id=1188839 1188839 961 2017-04-25 08:57:52 Anonymous Monk "my" declaration problem Hosen1989 http://perlmonks.org/index.pl?node_id=1188833 Dear ALL, I was debug some old dirty script of mine (which without strict nor warnings ^_^), and faced this issue: As you can see in case(1), variable $me... perlquestion Tue, 25 Apr 2017 11:17:41 +0000 http://perlmonks.org/index.pl?node_id=1188833 1188833 1088401 2017-04-25 07:17:41 Hosen1989 How to pass an image object to a subroutine?? dazz http://perlmonks.org/index.pl?node_id=1188832 Hi I want to call a subroutine ImageNotDark. I want to pass an Image::Magick object ($pic). By design, the object is not changed inside the subroutine. My problem is that I am not passing the image ... perlquestion Tue, 25 Apr 2017 11:05:51 +0000 http://perlmonks.org/index.pl?node_id=1188832 1188832 1185977 2017-04-25 07:05:51 dazz Re: "my" declaration problem LanX http://perlmonks.org/index.pl?node_id=1188880 &gt; Now,can any monk explain me just what happen here? because ... &gt; without strict nor warnings ^_^ Or differently phrased: Repeated declarations of the same... note Tue, 25 Apr 2017 17:02:11 +0000 http://perlmonks.org/index.pl?node_id=1188880 1188880 708738 2017-04-25 13:02:11 LanX Re^6: Switch.pm Failure ( CGI::Switch? ) huck http://perlmonks.org/index.pl?node_id=1188877 The proof is at <a href="?node_id=1188876">Re^31: global var</a>. It all started with use Switch;, and the subroutine/returns were to get around the initial invalid use of the Switch method. ... note Tue, 25 Apr 2017 16:40:45 +0000 http://perlmonks.org/index.pl?node_id=1188877 1188877 1175204 2017-04-25 12:40:45 huck Re^31: global var huck http://perlmonks.org/index.pl?node_id=1188876 I might re-read that thread in <a href="?node_id=1188496">Re^21: global var</a> #use CGI::Switch; ... #use Switch; That made my day, proving what i said in <a href="?node_id=1182850">Re^4: Switch.pm Failure ( CGI::Switch? )</a>. What is so funny is that in a... note Tue, 25 Apr 2017 16:35:52 +0000 http://perlmonks.org/index.pl?node_id=1188876 1188876 1175204 2017-04-25 12:35:52 huck Re^4: Why do use Windows? Why u so stupid? huck http://perlmonks.org/index.pl?node_id=1188875 But that just means IBM ... built the worldwide computer industry. Didnt they? &#91;http://www-03.ibm.com/ibm/history/ibm100/us/en/icons/sage/|SAGE The First National Air Defense Netwo... note Tue, 25 Apr 2017 16:14:21 +0000 http://perlmonks.org/index.pl?node_id=1188875 1188875 1175204 2017-04-25 12:14:21 huck Re^30: global var shmem http://perlmonks.org/index.pl?node_id=1188874 At this point, and at that level of dicussion: If I was you, I would hire somebody (or ask for a volunteer) that does the code review with me and reads manual pages for me, so I can learn something... note Tue, 25 Apr 2017 16:03:09 +0000 http://perlmonks.org/index.pl?node_id=1188874 1188874 510280 2017-04-25 12:03:09 shmem Re^2: DBI output into browser using CGI billycote http://perlmonks.org/index.pl?node_id=1188873 That was my culprit :) thanks for the help and pointers guys. I'll do my best to clean the other messy parts up too... note Tue, 25 Apr 2017 15:51:29 +0000 http://perlmonks.org/index.pl?node_id=1188873 1188873 1045195 2017-04-25 11:51:29 billycote Re: 'submit' a series of form selections Anonymous Monk http://perlmonks.org/index.pl?node_id=1188872 Chrome will not let me paste my answer on this box so I too apologize. :(... note Tue, 25 Apr 2017 15:44:29 +0000 http://perlmonks.org/index.pl?node_id=1188872 1188872 961 2017-04-25 11:44:29 Anonymous Monk Re: Replacing a block of text inside two keys with another block of text Anonymous Monk http://perlmonks.org/index.pl?node_id=1188871 Try this code instead: sub populateHash{ my $inputFile = 'input.txt'; my $fileContent = do { open(my $fileHandle, $inputFile ) or die "Could not open file '$inputFile ' $!"; ... note Tue, 25 Apr 2017 15:41:07 +0000 http://perlmonks.org/index.pl?node_id=1188871 1188871 961 2017-04-25 11:41:07 Anonymous Monk Re^3: 'submit' a series of form selections choroba http://perlmonks.org/index.pl?node_id=1188870 Did you use ... tags to mark the code as code? ($q=q:Sq=~/;<a href="?node=c">c</a>(.... note Tue, 25 Apr 2017 15:40:16 +0000 http://perlmonks.org/index.pl?node_id=1188870 1188870 832495 2017-04-25 11:40:16 choroba Re^2: DBI output into browser using CGI hippo http://perlmonks.org/index.pl?node_id=1188869 what is weird (at least to me) is that tomcat can't load that. In absence of any evidence to the contrary, best guess would be because the tomcat user doesn't h... note Tue, 25 Apr 2017 15:37:27 +0000 http://perlmonks.org/index.pl?node_id=1188869 1188869 885521 2017-04-25 11:37:27 hippo Reaped: Re: DBI output into browser using CGI NodeReaper http://perlmonks.org/index.pl?node_id=1188868 This node was taken out by the <a href="?node=NodeReaper">NodeReaper</a> on Apr 25, 2017 at 16:03&nbsp;UTCReason: &#91;<a href="?node=hippo">hippo</a>&#93;: reap: trollYou may view &#91;href://?op=viewreaped;node_id=1188868|the original node and the ... note Tue, 25 Apr 2017 15:36:39 +0000 http://perlmonks.org/index.pl?node_id=1188868 1188868 52855 2017-04-25 11:36:39 NodeReaper Re^3: Why do use Windows? Why u so stupid? Anonymous Monk http://perlmonks.org/index.pl?node_id=1188867 But that just means IBM and Compaq built the worldwide computer industry. ... note Tue, 25 Apr 2017 15:32:39 +0000 http://perlmonks.org/index.pl?node_id=1188867 1188867 961 2017-04-25 11:32:39 Anonymous Monk Re^2: 'submit' a series of form selections Anonymous Monk http://perlmonks.org/index.pl?node_id=1188866 Chrome returns a page which say (in effect) that some dangerous code has been detected....I had written the example as: ...example Corion suggested that I needed to use only one f... note Tue, 25 Apr 2017 15:32:31 +0000 http://perlmonks.org/index.pl?node_id=1188866 1188866 961 2017-04-25 11:32:31 Anonymous Monk Re: DBI output into browser using CGI billycote http://perlmonks.org/index.pl?node_id=1188865 I think I may have found something here in the tomcat logs. INFO: cgi: runCGI (stderr):install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD:... note Tue, 25 Apr 2017 15:27:44 +0000 http://perlmonks.org/index.pl?node_id=1188865 1188865 1045195 2017-04-25 11:27:44 billycote Re: DBI output into browser using CGI poj http://perlmonks.org/index.pl?node_id=1188864 Cut your program down to a mimimal working page like shown below then add back the db/table stuff. Try writing the error log to /tmp, cgi directories are not normally writeable for the webse... note Tue, 25 Apr 2017 15:20:44 +0000 http://perlmonks.org/index.pl?node_id=1188864 1188864 221725 2017-04-25 11:20:44 poj Re^2: DBI output into browser using CGI billycote http://perlmonks.org/index.pl?node_id=1188863 $user as well as other parameters comes in from another form that calls this page. What I don't get is why it would work on the command line and not the browser. ... note Tue, 25 Apr 2017 15:20:24 +0000 http://perlmonks.org/index.pl?node_id=1188863 1188863 1045195 2017-04-25 11:20:24 billycote Re: Upgrading CPAN davehorner http://perlmonks.org/index.pl?node_id=1188862 In the latest strawberry perl 5.24.1, cpanm --self-upgrade does not work. Using cpanm App::cpanminus does work, providing a work around. C:\WINDOWS\system32>cpanm --self-upgrade Can't f... note Tue, 25 Apr 2017 15:17:45 +0000 http://perlmonks.org/index.pl?node_id=1188862 1188862 1064341 2017-04-25 11:17:45 davehorner Re^5: add missing elements and remove duplicates....and some more questions. Marshall http://perlmonks.org/index.pl?node_id=1188861 A few additional tips. The indenting of your code levels should be consistent. The "smallest foreach loop" should be moved to the left to match the level of the "biggest". However, better would be to ... note Tue, 25 Apr 2017 15:10:19 +0000 http://perlmonks.org/index.pl?node_id=1188861 1188861 732669 2017-04-25 11:10:19 Marshall Re: DBI output into browser using CGI huck http://perlmonks.org/index.pl?node_id=1188860 Since you didnt see any sign of print $q->end_html; it is clear your program terminated early, and the only path for that is an error termination. as <a href="?node=hippo">hippo</a> <a href="?node_id=1188858">said</a> Always c... note Tue, 25 Apr 2017 15:09:26 +0000 http://perlmonks.org/index.pl?node_id=1188860 1188860 1175204 2017-04-25 11:09:26 huck Re: DBI output into browser using CGI haukex http://perlmonks.org/index.pl?node_id=1188859 I don't have time for a comprehensive answer right now, but I did want to say this: Please read and follow <a href="?node_id=111088">Use strict and warnings</a> as well as <a href="http://bobby-tables.com/">Bobby Tables</a>, your code is vulnerable ... note Tue, 25 Apr 2017 15:02:19 +0000 http://perlmonks.org/index.pl?node_id=1188859 1188859 830549 2017-04-25 11:02:19 haukex Re: DBI output into browser using CGI hippo http://perlmonks.org/index.pl?node_id=1188858 As you never assign a value to $user your database connection attempt will fail. This will be recorded in the web server (or CGI server) error log. Always check the error log. BTW,... note Tue, 25 Apr 2017 15:01:32 +0000 http://perlmonks.org/index.pl?node_id=1188858 1188858 885521 2017-04-25 11:01:32 hippo Re^30: global var huck http://perlmonks.org/index.pl?node_id=1188856 I don't understand how you can say all I have shown you is open connection: I have repeatedly posted That doesnt look like this (<a href="?node_id=1187652">Re^15: global var</a>) at all does it? my $dbh = m... note Tue, 25 Apr 2017 14:49:39 +0000 http://perlmonks.org/index.pl?node_id=1188856 1188856 1175204 2017-04-25 10:49:39 huck Re: 'Missing version identifier' error while connecting to Hive, using Thrift module of Perl talexb http://perlmonks.org/index.pl?node_id=1188855 I'm not familiar with this module -- did you install it using cpan, and did it pass all of it's tests? I don't see any issues with the module currently (1), so it may be you've used ... note Tue, 25 Apr 2017 14:42:20 +0000 http://perlmonks.org/index.pl?node_id=1188855 1188855 131279 2017-04-25 10:42:20 talexb Re: "my" declaration problem talexb http://perlmonks.org/index.pl?node_id=1188854 As has already been pointed out, just get into the habit of always using strict and warnings on all your code. It lets Perl remind you about anything that's a bit dodgy. Secon... note Tue, 25 Apr 2017 14:32:21 +0000 http://perlmonks.org/index.pl?node_id=1188854 1188854 131279 2017-04-25 10:32:21 talexb Re: 'submit' a series of form selections choroba http://perlmonks.org/index.pl?node_id=1188853 &gt; Chrome will not let me paste my source code on this box What happens when you try? ... note Tue, 25 Apr 2017 14:29:46 +0000 http://perlmonks.org/index.pl?node_id=1188853 1188853 832495 2017-04-25 10:29:46 choroba Re^5: 'submit' a series of form selections Anonymous Monk http://perlmonks.org/index.pl?node_id=1188852 Chrome will not let me post a code sample! Then why don't you try a different browser?... note Tue, 25 Apr 2017 14:24:33 +0000 http://perlmonks.org/index.pl?node_id=1188852 1188852 961 2017-04-25 10:24:33 Anonymous Monk Re^5: 'submit' a series of form selections Corion http://perlmonks.org/index.pl?node_id=1188851 A single submit button will only submit all the values from one form. If you want to have all values from the page, you will have to put all values and selections into the same form.... note Tue, 25 Apr 2017 14:03:30 +0000 http://perlmonks.org/index.pl?node_id=1188851 1188851 5348 2017-04-25 10:03:30 Corion Re^4: 'submit' a series of form selections Anonymous Monk http://perlmonks.org/index.pl?node_id=1188850 Chrome will not let me post a code sample! The HTML is executing OK; right now I have two 'submit' commands but the submission string only has one value... http://localhost/?Dessert=pole... note Tue, 25 Apr 2017 13:58:11 +0000 http://perlmonks.org/index.pl?node_id=1188850 1188850 961 2017-04-25 09:58:11 Anonymous Monk Re^9: Installation error; INSTALL.pl program is unable to unzip downloaded file Holly He http://perlmonks.org/index.pl?node_id=1188849 Oh, I must appreciate you at first. But the core problem lies in "INSTALL.pl" will update the ./Bio, nomatter use --NO_BIOPERL and --NO_UPDATE or not. The zip file(whatever it is) in ./Bio/tmp will b... note Tue, 25 Apr 2017 13:57:50 +0000 http://perlmonks.org/index.pl?node_id=1188849 1188849 1188658 2017-04-25 09:57:50 Holly He Re^5: Use of uninitialized value $pic zentara http://perlmonks.org/index.pl?node_id=1188848 Hi, just a thought. Shouldn't $iutImage->Read(@_); # get the image under test (iut) be my $x = $iutImage->ReadImage($_&#91;0&#93;); warn "$x" if "$x"; Also, you can try passing... note Tue, 25 Apr 2017 13:51:08 +0000 http://perlmonks.org/index.pl?node_id=1188848 1188848 131741 2017-04-25 09:51:08 zentara Re^3: 'submit' a series of form selections Corion http://perlmonks.org/index.pl?node_id=1188847 This sounds more like a problem in your HTML and less like a problem with Perl. Can you show a short HTML example together with the server-side Perl (each about 20 lines) that we can run to... note Tue, 25 Apr 2017 13:35:58 +0000 http://perlmonks.org/index.pl?node_id=1188847 1188847 5348 2017-04-25 09:35:58 Corion Re^4: Number of Replies Count Wrong perldigious http://perlmonks.org/index.pl?node_id=1188846 That did the trick. Thanks <a href="?node=Athanasius">Athanasius</a>. Just another Perl hooker - Working on the corner... corner conditions that is. ... note Tue, 25 Apr 2017 13:34:42 +0000 http://perlmonks.org/index.pl?node_id=1188846 1188846 1150057 2017-04-25 09:34:42 perldigious Re^2: 'submit' a series of form selections Anonymous Monk http://perlmonks.org/index.pl?node_id=1188845 My program (in Perl) is constructing an HTML file (using a HERE document). The HTML presents the dropdown boxes and submits the selection(s). Right now it is submitting using 'GET' to localhost... note Tue, 25 Apr 2017 13:33:56 +0000 http://perlmonks.org/index.pl?node_id=1188845 1188845 961 2017-04-25 09:33:56 Anonymous Monk Re^3: Number of Replies Count Wrong Athanasius http://perlmonks.org/index.pl?node_id=1188844 Second guess: &ldquo;Show reaped replies&rdquo; is unchecked in your <a href="?node_id=492848">Newest Nodes Settings</a>. A... note Tue, 25 Apr 2017 13:31:01 +0000 http://perlmonks.org/index.pl?node_id=1188844 1188844 968231 2017-04-25 09:31:01 Athanasius Re^2: Number of Replies Count Wrong perldigious http://perlmonks.org/index.pl?node_id=1188843 It's possible it's something in my settings, but I do have "Show Unapproved Nodes" checked in my settings already. Just another Perl hooker - ... note Tue, 25 Apr 2017 13:23:26 +0000 http://perlmonks.org/index.pl?node_id=1188843 1188843 1150057 2017-04-25 09:23:26 perldigious Re: 'submit' a series of form selections Corion http://perlmonks.org/index.pl?node_id=1188842 Perl only runs on the server, not on the client. If you want to solve this problem using only Perl, you will have to (re)show the forms where no selections have been made yet. If yo... note Tue, 25 Apr 2017 13:22:29 +0000 http://perlmonks.org/index.pl?node_id=1188842 1188842 5348 2017-04-25 09:22:29 Corion Re: Number of Replies Count Wrong Athanasius http://perlmonks.org/index.pl?node_id=1188841 Hello <a href="?node=perldigious">perldigious</a>, Actually, it does have a reply, but <a href="?node_id=1188768">that node</a> has been reaped. I&rsquo;m guessing you have &ldquo;Show Unapproved Nodes&rdquo; disabled under &ldquo;Mi... note Tue, 25 Apr 2017 13:17:51 +0000 http://perlmonks.org/index.pl?node_id=1188841 1188841 968231 2017-04-25 09:17:51 Athanasius Re^29: global var tultalk http://perlmonks.org/index.pl?node_id=1188838 For some reason i doubt that. If you call a c program that starts another program via a system call do you expect the second program to have access to the variables of the first program. when you s... note Tue, 25 Apr 2017 12:24:55 +0000 http://perlmonks.org/index.pl?node_id=1188838 1188838 1182686 2017-04-25 08:24:55 tultalk Re: "my" declaration problem Eily http://perlmonks.org/index.pl?node_id=1188837 The <a href="http://perldoc.perl.org/perlsyn.html#Statement-Modifiers">note on statement modifiers</a> in the doc states: NOTE: The behaviour of a <a href="http://perldoc.perl.org/functions/my.html">my</a>, <a href="http://perldoc.perl.org/functions/state.html">state</a>, or <a href="http://perldoc.perl.org/functions/our.html">our</a> modified with a statement modi... note Tue, 25 Apr 2017 11:56:42 +0000 http://perlmonks.org/index.pl?node_id=1188837 1188837 1039428 2017-04-25 07:56:42 Eily Re^5: Image Conversion: SVG to PNG syphilis http://perlmonks.org/index.pl?node_id=1188836 running Strawberry Perl (v5.12), so good to know Image::LibRSVG works with that I was a little concerned that there might be problems with such an old version of Strawberry, but it wor... note Tue, 25 Apr 2017 11:37:44 +0000 http://perlmonks.org/index.pl?node_id=1188836 1188836 524150 2017-04-25 07:37:44 syphilis Re: "my" declaration problem davies http://perlmonks.org/index.pl?node_id=1188835 Warnings would tell you that your repeated "my" masked a previous declaration. When you use "my", a new variable is created. If several of the same name are created in the same scope, only the last... note Tue, 25 Apr 2017 11:29:20 +0000 http://perlmonks.org/index.pl?node_id=1188835 1188835 436161 2017-04-25 07:29:20 davies Re: "my" declaration problem Anonymous Monk http://perlmonks.org/index.pl?node_id=1188834 Turn on warnings and read the warning generated... note Tue, 25 Apr 2017 11:29:06 +0000 http://perlmonks.org/index.pl?node_id=1188834 1188834 961 2017-04-25 07:29:06 Anonymous Monk TheDonald TheDonald http://perlmonks.org/index.pl?node_id=1188878 user Tue, 25 Apr 2017 17:00:40 +0000 http://perlmonks.org/index.pl?node_id=1188878 1188878 1188878 2017-04-25 13:00:40 TheDonald