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 961 PerlMonks 2014-10-20 18:12:40 rss,clean Mon Oct 20 08:12:40 2014 30 20141020081240 Mon Oct 20 08:12:40 2014 http://perlmonks.org/ Anonymous Monk Saving .cgi Output; Passing File As Argument? Ragged Robin http://perlmonks.org/index.pl?node_id=1104466 Hey guys, I have a pretty big script that makes a lot of print calls at various points to generate an html output -- is there anyway I can have the output save to the server automatically each time th... perlquestion Mon, 20 Oct 2014 17:22:26 +0000 http://perlmonks.org/index.pl?node_id=1104466 1104466 1101326 2014-10-20 13:22:26 Ragged Robin Problem with monitoring running tasks cariddiEMC http://perlmonks.org/index.pl?node_id=1104464 Hi, I am pretty new to perl, so please be understanding. Below is a perl subroutine, that I inherited, that is used to run a set of "X" tests simultaneously. This subroutine is called by a scri... perlquestion Mon, 20 Oct 2014 17:04:03 +0000 http://perlmonks.org/index.pl?node_id=1104464 1104464 1104458 2014-10-20 13:04:03 cariddiEMC Iteratively unpack structure from binary file cMonkE http://perlmonks.org/index.pl?node_id=1104462 Perl Monks, I humbly seek your wisdom: I wish to unpack a series of strustures from a binary file. I have used: @array = unpack("f*", join('',)); to load an arra... perlquestion Mon, 20 Oct 2014 16:58:06 +0000 http://perlmonks.org/index.pl?node_id=1104462 1104462 1104460 2014-10-20 12:58:06 cMonkE Debugging a Web Application ron_abraham http://perlmonks.org/index.pl?node_id=1104448 HI Monks, This question is more for knowledge sake, than for a practical problem i am facing . Currently for any debugging purposes, i use logging with the useful LogDispatch plugin for my... perlquestion Mon, 20 Oct 2014 14:38:40 +0000 http://perlmonks.org/index.pl?node_id=1104448 1104448 1052035 2014-10-20 10:38:40 ron_abraham Perltidy indents too much when there are stacked opening tokens will_ http://perlmonks.org/index.pl?node_id=1104442 Perltidy seems to think that this code: sub discover { return <a href="?node=%20%7B%20%27name%27%20%3D%3E%20%24name%2C%20%27version%27%20%3D%3E%20%24VERSION%2C%20%7D%20"> { &#39;name&#39; =&gt; $name, &#39;version&#39; =&gt; $VERSION, } </a>; } ...would look better like this (I disag... perlquestion Mon, 20 Oct 2014 13:56:29 +0000 http://perlmonks.org/index.pl?node_id=1104442 1104442 886643 2014-10-20 09:56:29 will_ Can Perl write multiple files at the same time? westrock2000 http://perlmonks.org/index.pl?node_id=1104438 I have a bunch of USB drives attached to my computer that I use as backup. Currently files are written sequentially and it takes a while. Is there a way to tell Perl to write 6 files each to separate ... perlquestion Mon, 20 Oct 2014 13:33:37 +0000 http://perlmonks.org/index.pl?node_id=1104438 1104438 841145 2014-10-20 09:33:37 westrock2000 combining emacs' cperl-mode formatting with Perltidy LanX http://perlmonks.org/index.pl?node_id=1104427 Hi I love the instant formatting features emacs gives me when typing Perl, but they can't cope with perltidy's detailed control. So I would like to run perltidy from time to time to upda... perlquestion Mon, 20 Oct 2014 12:33:08 +0000 http://perlmonks.org/index.pl?node_id=1104427 1104427 708738 2014-10-20 08:33:08 LanX Re^3: Template, sorting an array with only one member Mr. Muskrat http://perlmonks.org/index.pl?node_id=1104474 Container's one method is returning a single Object object instead of an array reference with a single Object object inside. The fix is quite simple: sub one { my $self = shift;... note Mon, 20 Oct 2014 18:10:05 +0000 http://perlmonks.org/index.pl?node_id=1104474 1104474 155876 2014-10-20 14:10:05 Mr. Muskrat Re: Implement C++ callback in XS jmlynesjr http://perlmonks.org/index.pl?node_id=1104473 There's also a tutorial on the wxPerl wiki - "Internals - Introduction to Wx XS Wrappers by Mark" <a href="http://wiki.wxperl.nl">http://wiki.wxperl.nl</a> James Ther... note Mon, 20 Oct 2014 17:59:07 +0000 http://perlmonks.org/index.pl?node_id=1104473 1104473 982107 2014-10-20 13:59:07 jmlynesjr Re: Displaying the Experience nodelet on your homepage chacham http://perlmonks.org/index.pl?node_id=1104472 Just saw <a href="?node_id=545862">Tidings</a> has <a href="http://perlmonks.org/?node=Tidings#20081101200000">html for the XP nodelet</a>. Though, it doesn't seem to size or align correctly. But, that's not really the point of it... note Mon, 20 Oct 2014 17:53:03 +0000 http://perlmonks.org/index.pl?node_id=1104472 1104472 934209 2014-10-20 13:53:03 chacham Re: Saving .cgi Output; Passing File As Argument? MidLifeXis http://perlmonks.org/index.pl?node_id=1104471 Are the results different if the user-supplied parameters are different? Perhaps you could use a proxy front-end module from your web server to provide this function. I believe that &#91;http://htt... note Mon, 20 Oct 2014 17:49:03 +0000 http://perlmonks.org/index.pl?node_id=1104471 1104471 272364 2014-10-20 13:49:03 MidLifeXis Re: array to hash sunil9009 http://perlmonks.org/index.pl?node_id=1104470 Thank you everyone, that solved my issue.... note Mon, 20 Oct 2014 17:43:21 +0000 http://perlmonks.org/index.pl?node_id=1104470 1104470 1017996 2014-10-20 13:43:21 sunil9009 Re: Iteratively unpack structure from binary file AnomalousMonk http://perlmonks.org/index.pl?node_id=1104469 I would say that the first step is to find the length in bytes of the raw data block represented by 'i i f f f' (remembering that the data sizes of these template specifiers are implemen... note Mon, 20 Oct 2014 17:37:25 +0000 http://perlmonks.org/index.pl?node_id=1104469 1104469 634253 2014-10-20 13:37:25 AnomalousMonk Re: For retirement, I am banking on: jmlynesjr http://perlmonks.org/index.pl?node_id=1104468 Great question. Would like to say all of the above, but it's looking like 1) a younger working wife 2) 401K 3) social security 4) 1st husband's pension 5) paid off house and 6) bad genes. ... note Mon, 20 Oct 2014 17:29:24 +0000 http://perlmonks.org/index.pl?node_id=1104468 1104468 982107 2014-10-20 13:29:24 jmlynesjr Re^2: Template, sorting an array with only one member FloydATC http://perlmonks.org/index.pl?node_id=1104467 I've put together a test script demonstrating how my data model works. Please tell me this fails for you, or I might go insane. Bonus points if you can tell me how to fix it. #!/usr/... note Mon, 20 Oct 2014 17:24:07 +0000 http://perlmonks.org/index.pl?node_id=1104467 1104467 616809 2014-10-20 13:24:07 FloydATC Re: Using Shift with Parameters in a subroutine Jim http://perlmonks.org/index.pl?node_id=1104465 It would only seem rational that we have a way to &#91;condense argument passing&#93;, especially if i am passing 10 references to my subroutine. &hellip; I see there is no formal param... note Mon, 20 Oct 2014 17:12:29 +0000 http://perlmonks.org/index.pl?node_id=1104465 1104465 546548 2014-10-20 13:12:29 Jim Re^2: Using Shift with Parameters in a subroutine RonW http://perlmonks.org/index.pl?node_id=1104463 FYI: <a href="http://search.cpan.org/perldoc?Method%3A%3ASignatures">Method::Signatures</a> (and a few others) don't use source filters. Instead they use the keyword API introduced in Perl 5.14.... note Mon, 20 Oct 2014 17:01:46 +0000 http://perlmonks.org/index.pl?node_id=1104463 1104463 1080444 2014-10-20 13:01:46 RonW Re^2: sql output format chacham http://perlmonks.org/index.pl?node_id=1104457 A simple comment on your excellent post. As a general rule, it is better to use UNION ALL. UNION applies a DISTINCT which forces a(n expensive) sort operation.... note Mon, 20 Oct 2014 16:08:14 +0000 http://perlmonks.org/index.pl?node_id=1104457 1104457 934209 2014-10-20 12:08:14 chacham Re: Can Perl write multiple files at the same time? MidLifeXis http://perlmonks.org/index.pl?node_id=1104454 Perhaps <a href="http://search.cpan.org/search?mode=module&amp;query=AnyEvent">AnyEvent</a> or <a href="http://search.cpan.org/search?mode=module&amp;query=IO%3A%3AAsync">IO::Async</a> might be helpful. --MidLifeXis ... note Mon, 20 Oct 2014 15:40:12 +0000 http://perlmonks.org/index.pl?node_id=1104454 1104454 272364 2014-10-20 11:40:12 MidLifeXis Re^3: Best XML library to validate XML from untrusted source ikegami http://perlmonks.org/index.pl?node_id=1104453 How is my $reader = XML::LibXML::Reader->new( location => $ARGV&#91;0&#93;, load_ext_dtd => 0, expand_entities => 0, ); 1 while $reader->read; unreadable? ... note Mon, 20 Oct 2014 15:16:52 +0000 http://perlmonks.org/index.pl?node_id=1104453 1104453 381608 2014-10-20 11:16:52 ikegami Re: Can Perl write multiple files at the same time? johngg http://perlmonks.org/index.pl?node_id=1104452 Alternatively, have a look at <a href="http://perldoc.perl.org/functions/fork.html">fork</a> and <a href="http://perldoc.perl.org/functions/wait.html">wait</a>. Cheers,Jo... note Mon, 20 Oct 2014 15:11:39 +0000 http://perlmonks.org/index.pl?node_id=1104452 1104452 401112 2014-10-20 11:11:39 johngg Re: Can Perl write multiple files at the same time? no_slogan http://perlmonks.org/index.pl?node_id=1104451 But <a href="http://perldoc.perl.org/perl5200delta.html#Interpreter-based-threads-are-now-_discouraged_">ithreads are now discouraged</a>, which leaves you with <a href="http://perldoc.perl.org/functions/fork.html">fork</a>.... note Mon, 20 Oct 2014 15:09:59 +0000 http://perlmonks.org/index.pl?node_id=1104451 1104451 78006 2014-10-20 11:09:59 no_slogan Re^2: Best XML library to validate XML from untrusted source Jenda http://perlmonks.org/index.pl?node_id=1104450 XML::LibXML::Reader is way too low-level and while the pull style tends to lead to a (very slightly) more readable code than ordinary, node-level push, it's still nothing I would dare to recommend ... note Mon, 20 Oct 2014 15:07:35 +0000 http://perlmonks.org/index.pl?node_id=1104450 1104450 105128 2014-10-20 11:07:35 Jenda Re^2: For retirement, I am banking on: dHarry http://perlmonks.org/index.pl?node_id=1104449 High five :(... note Mon, 20 Oct 2014 14:52:08 +0000 http://perlmonks.org/index.pl?node_id=1104449 1104449 694914 2014-10-20 10:52:08 dHarry Re^3: Using Shift with Parameters in a subroutine bibliophile http://perlmonks.org/index.pl?node_id=1104445 If you just want to scoop the first couple of parameters, you can do something like this: sub f { my ($x,$y,@z) = @_; print "$x\n$y\n@z\n"; } f("first","second","third","fourt... note Mon, 20 Oct 2014 14:09:43 +0000 http://perlmonks.org/index.pl?node_id=1104445 1104445 159943 2014-10-20 10:09:43 bibliophile Re: Template, sorting an array with only one member choroba http://perlmonks.org/index.pl?node_id=1104444 I can't replicate the problem: #!/usr/bin/perl use warnings; use strict; use Template; my @arr = ( { name => 'Foo', value => 1 }, # { name => 'Bar', value => 2 }, ... note Mon, 20 Oct 2014 14:05:23 +0000 http://perlmonks.org/index.pl?node_id=1104444 1104444 832495 2014-10-20 10:05:23 choroba Re^3: Can't get text to print ww http://perlmonks.org/index.pl?node_id=1104443 Update: Intended as response to pre-update version of <a href="?node_id=1104405">Re: Can&#39;t get text to print</a> and misplaced. Mea culpa. &lt;/update&gt; From <a href="http://perldoc.perl.org/functions/open.html">http://perldoc.perl.org/functions/open.html</a> (5.20)... note Mon, 20 Oct 2014 14:02:53 +0000 http://perlmonks.org/index.pl?node_id=1104443 1104443 352046 2014-10-20 10:02:53 ww Re: Can Perl write multiple files at the same time? tune http://perlmonks.org/index.pl?node_id=1104441 You need to learn threads to achieve that. ... note Mon, 20 Oct 2014 13:54:51 +0000 http://perlmonks.org/index.pl?node_id=1104441 1104441 35391 2014-10-20 09:54:51 tune Re: RFC: An on-disk NFS-safe key-value store database (NFSdb) mr_mischief http://perlmonks.org/index.pl?node_id=1104440 Please note that 'over NFS' and 'serverless' are mutually incompatible notions. ... note Mon, 20 Oct 2014 13:38:12 +0000 http://perlmonks.org/index.pl?node_id=1104440 1104440 62512 2014-10-20 09:38:12 mr_mischief Re^3: Why does perltidy mess up whitespace before inline comments and equals? will_ http://perlmonks.org/index.pl?node_id=1104439 To clarify, the lining up of assignments is automatic (and most agreeable). The only time it doesn't happen is when it would make the line too long. ... note Mon, 20 Oct 2014 13:37:53 +0000 http://perlmonks.org/index.pl?node_id=1104439 1104439 886643 2014-10-20 09:37:53 will_ Re^2: Why does perltidy mess up whitespace before inline comments and equals? will_ http://perlmonks.org/index.pl?node_id=1104437 Rolf, I would expect those lines not to change at all. Eily, thanks -msc pointed me in the right direction. After some more experimenting, I've found that this code: $d->{... note Mon, 20 Oct 2014 13:30:44 +0000 http://perlmonks.org/index.pl?node_id=1104437 1104437 886643 2014-10-20 09:30:44 will_ Re^2: monk equator chacham http://perlmonks.org/index.pl?node_id=1104434 Does this mean he has to flip upside-down? Nope, wrong font for that. Flipping will have to wait for 333333. :)... note Mon, 20 Oct 2014 13:23:47 +0000 http://perlmonks.org/index.pl?node_id=1104434 1104434 934209 2014-10-20 09:23:47 chacham Re: Can't get text to print ww http://perlmonks.org/index.pl?node_id=1104433 What warnings or error messages are you seeing? (Makes helping you easier/possible) Are you sure (IOW, have you tested) that Ln 6 (looks funky) performs as intended? And, as requested by ... note Mon, 20 Oct 2014 13:23:41 +0000 http://perlmonks.org/index.pl?node_id=1104433 1104433 352046 2014-10-20 09:23:41 ww Re^4: combining emacs' cperl-mode formatting with Perltidy LanX http://perlmonks.org/index.pl?node_id=1104432 As I said, there is an inline option for comment start (which might be a localized global variable) You can set up indent on return. You have indent region which is hooked in my config to ... note Mon, 20 Oct 2014 13:22:27 +0000 http://perlmonks.org/index.pl?node_id=1104432 1104432 708738 2014-10-20 09:22:27 LanX Re^3: combining emacs' cperl-mode formatting with Perltidy duelafn http://perlmonks.org/index.pl?node_id=1104431 Will they do that much fighting even if they are configured differently? I don't think cperl-mode changes indentation just by typing and certainly not anything further than the current line... at l... note Mon, 20 Oct 2014 13:14:12 +0000 http://perlmonks.org/index.pl?node_id=1104431 1104431 53268 2014-10-20 09:14:12 duelafn Re^2: combining emacs' cperl-mode formatting with Perltidy LanX http://perlmonks.org/index.pl?node_id=1104430 Sure but I don't want the formatting to flip flop between two stiles... Like the column where the comment starts... Maybe one first step is to write a perltidy config parser which transla... note Mon, 20 Oct 2014 12:58:55 +0000 http://perlmonks.org/index.pl?node_id=1104430 1104430 708738 2014-10-20 08:58:55 LanX Re: Where to put an application database? thargas http://perlmonks.org/index.pl?node_id=1104429 It depends on what this application uses the database for. If you're using the database for system-wide configuration of the module, then putting the database with the module makes ... note Mon, 20 Oct 2014 12:55:46 +0000 http://perlmonks.org/index.pl?node_id=1104429 1104429 507458 2014-10-20 08:55:46 thargas Re: combining emacs' cperl-mode formatting with Perltidy duelafn http://perlmonks.org/index.pl?node_id=1104428 Running perltidy using an Idle Timer should get perltidy to run at a reasonable interval and, I would think, help with formatting confli... note Mon, 20 Oct 2014 12:45:41 +0000 http://perlmonks.org/index.pl?node_id=1104428 1104428 53268 2014-10-20 08:45:41 duelafn Re^2: Why does perltidy mess up whitespace before inline comments and equals? LanX http://perlmonks.org/index.pl?node_id=1104426 &gt; don't know how to align assignments though. Neither me, could be a default w/o config option. Cheers Rolf ... note Mon, 20 Oct 2014 12:20:53 +0000 http://perlmonks.org/index.pl?node_id=1104426 1104426 708738 2014-10-20 08:20:53 LanX cMonkE cMonkE http://perlmonks.org/index.pl?node_id=1104460 user Mon, 20 Oct 2014 16:48:14 +0000 http://perlmonks.org/index.pl?node_id=1104460 1104460 1104460 2014-10-20 12:48:14 cMonkE cariddiEMC cariddiEMC http://perlmonks.org/index.pl?node_id=1104458 user Mon, 20 Oct 2014 16:42:52 +0000 http://perlmonks.org/index.pl?node_id=1104458 1104458 1104458 2014-10-20 12:42:52 cariddiEMC hsinlin58 hsinlin58 http://perlmonks.org/index.pl?node_id=1104455 user Mon, 20 Oct 2014 16:00:51 +0000 http://perlmonks.org/index.pl?node_id=1104455 1104455 1104455 2014-10-20 12:00:51 hsinlin58 radulinko251 radulinko251 http://perlmonks.org/index.pl?node_id=1104446 user Mon, 20 Oct 2014 14:19:38 +0000 http://perlmonks.org/index.pl?node_id=1104446 1104446 1104446 2014-10-20 10:19:38 radulinko251 shorty_mu shorty_mu http://perlmonks.org/index.pl?node_id=1104435 user Mon, 20 Oct 2014 13:26:32 +0000 http://perlmonks.org/index.pl?node_id=1104435 1104435 1104435 2014-10-20 09:26:32 shorty_mu