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 2015-07-28 16:18:17 rss,clean Tue Jul 28 06:18:17 2015 30 20150728061817 Tue Jul 28 06:18:17 2015 http://perlmonks.org/ Anonymous Monk use File::Path qw(make_path); fails with php 5.6.11 windjammer http://perlmonks.org/index.pl?node_id=1136627 I have recently upgraded my php from 5.3.8 to 5.6.11 (security issues requirment). Previous: PHP 5.3.8 (cli) (built: Sep 19 2011 13:29:27) Copyright (c) 1997-2011 The PHP Grou... perlquestion Tue, 28 Jul 2015 15:07:13 +0000 http://perlmonks.org/index.pl?node_id=1136627 1136627 1136624 2015-07-28 11:07:13 windjammer Test::Exception error on Strawberry Perl 5.14.3 ('Bareword "xception" ...') 1nickt http://perlmonks.org/index.pl?node_id=1136626 Hello monks, Before I file an issue report I seek to check my sanity here. I just got a Fail from CPAN testers for a recent update to a module that implemented Test::Exception. ... perlquestion Tue, 28 Jul 2015 15:04:30 +0000 http://perlmonks.org/index.pl?node_id=1136626 1136626 1130276 2015-07-28 11:04:30 1nickt Consistent xml formatting Haloric http://perlmonks.org/index.pl?node_id=1136612 Hi Monks, I have many xml files that I am attempting to compare with either XML::SemanticDiff or XML::SemanticCompare. Is there a way to get the XML ordered in a consistent way be... perlquestion Tue, 28 Jul 2015 14:05:40 +0000 http://perlmonks.org/index.pl?node_id=1136612 1136612 719776 2015-07-28 10:05:40 Haloric perl: comparing words in the arrays GSperlbio http://perlmonks.org/index.pl?node_id=1136608 I have two sequences stored in two arrays as shown below: @seq1 = "ATGC TGCT GCTA CTAA TAAC" @seq2 = "GTCA" i want to compare string in @seq2 with each and every words in @seq1 and need to print th... perlquestion Tue, 28 Jul 2015 13:19:02 +0000 http://perlmonks.org/index.pl?node_id=1136608 1136608 1136606 2015-07-28 09:19:02 GSperlbio "used only once" for symbolic references irata73 http://perlmonks.org/index.pl?node_id=1136588 Hi, the script: use strict; use Data::Dumper; { my( $key ) = 'Statistic::Test'; my( $val ) = <a href="?node=%201%2C%202%2C%203%2C%204%20"> 1, 2, 3, 4 </a>; { no strict 'refs'; ${$key} = $val; } print Dumper( $St... perlquestion Tue, 28 Jul 2015 10:54:01 +0000 http://perlmonks.org/index.pl?node_id=1136588 1136588 1136586 2015-07-28 06:54:01 irata73 Re^3: use File::Path qw(make_path); fails with php 5.6.11 Your Mother http://perlmonks.org/index.pl?node_id=1136632 Or you can show exactly what you did, in what context, and how it failed; error messages, log, etc. If it's Perl related we'll try to help. "This fails" is a difficult error report to dig into. :P ... note Tue, 28 Jul 2015 16:13:10 +0000 http://perlmonks.org/index.pl?node_id=1136632 1136632 248054 2015-07-28 12:13:10 Your Mother Re^2: use File::Path qw(make_path); fails with php 5.6.11 windjammer http://perlmonks.org/index.pl?node_id=1136631 Sorry I am a newbie (really big time) We have a webpage that calls our perl program and passes the appropriate parameters. It worked when we used the old version of php and failed when I up... note Tue, 28 Jul 2015 16:09:55 +0000 http://perlmonks.org/index.pl?node_id=1136631 1136631 1136624 2015-07-28 12:09:55 windjammer Re: use File::Path qw(make_path); fails with php 5.6.11 Your Mother http://perlmonks.org/index.pl?node_id=1136630 Since no one has stepped up to be serious- :P Perl is not PHP; and this is PerlMonks, hence the monk(y) snark. PHP and Perl cannot be mixed directly. If you are trying to use a Per... note Tue, 28 Jul 2015 15:57:54 +0000 http://perlmonks.org/index.pl?node_id=1136630 1136630 248054 2015-07-28 11:57:54 Your Mother Re: use File::Path qw(make_path); fails with php 5.6.11 1nickt http://perlmonks.org/index.pl?node_id=1136629 Change use File::Path qw(make_path); to /* use File::Path qw(make_path); */ and you should be fine. ... note Tue, 28 Jul 2015 15:14:26 +0000 http://perlmonks.org/index.pl?node_id=1136629 1136629 1130276 2015-07-28 11:14:26 1nickt Re: use File::Path qw(make_path); fails with php 5.6.11 Your Mother http://perlmonks.org/index.pl?node_id=1136628 Because it's PHP. Ah, I'm just kidding. You're all right! Of all the off-topics in the world... <a href="?node=windjammer">windjammer</a> had to wander into mine. :P... note Tue, 28 Jul 2015 15:09:00 +0000 http://perlmonks.org/index.pl?node_id=1136628 1136628 248054 2015-07-28 11:09:00 Your Mother Re^4: Stop Using Perl marjetika http://perlmonks.org/index.pl?node_id=1136623 quote: And big one, warn about anyone using using ReadParse/->Vars What is the problem with readParse? I've been searching for "readParse vulnerability" all over the inter... note Tue, 28 Jul 2015 14:57:34 +0000 http://perlmonks.org/index.pl?node_id=1136623 1136623 1136618 2015-07-28 10:57:34 marjetika Re^2: Time for an application portfolio Your Mother http://perlmonks.org/index.pl?node_id=1136622 I like this advice but godaddy is the Devil. I would suggest name.com as a good alternative; while mentioning, in case the similar name throws anyone, namecheap.com is a minor minion of Hell. There... note Tue, 28 Jul 2015 14:44:40 +0000 http://perlmonks.org/index.pl?node_id=1136622 1136622 248054 2015-07-28 10:44:40 Your Mother Re: Pack + Fat32 timestamp SimonClinch http://perlmonks.org/index.pl?node_id=1136621 Take a look at that stack overflow reply that shows how the bitmask is constructed. This bitmask breakdown should be almost a blueprint to your code. I also tend to struggle with pack so using the lef... note Tue, 28 Jul 2015 14:44:34 +0000 http://perlmonks.org/index.pl?node_id=1136621 1136621 468275 2015-07-28 10:44:34 SimonClinch Re: Capture uncommented keywords afoken http://perlmonks.org/index.pl?node_id=1136620 Is there another way? Remove comments from the input before matching. For trivial code containing only // comments (not /* */) and without string con... note Tue, 28 Jul 2015 14:41:42 +0000 http://perlmonks.org/index.pl?node_id=1136620 1136620 747201 2015-07-28 10:41:42 afoken Re^3: GetTimeSysInfoFunc function afoken http://perlmonks.org/index.pl?node_id=1136617 The modules that you proposed look promising. To avoid confusion: Most modules in the Win32::* namespace work only on Windows, they will not be available on other p... note Tue, 28 Jul 2015 14:32:39 +0000 http://perlmonks.org/index.pl?node_id=1136617 1136617 747201 2015-07-28 10:32:39 afoken Re^4: Recognizing numbers afoken http://perlmonks.org/index.pl?node_id=1136616 Also, <a href="?node=0-9">0-9</a> can be simplified with a single \d. In the old ASCII times: yes. Today: No. Unicode has more digits than <a href="?node=0-9">0-9</a>. You can li... note Tue, 28 Jul 2015 14:25:13 +0000 http://perlmonks.org/index.pl?node_id=1136616 1136616 747201 2015-07-28 10:25:13 afoken Re: Consistent xml formatting choroba http://perlmonks.org/index.pl?node_id=1136615 Order of attribute doesn't matter, therefore they can be normalized. Order of elements is significant, though, so the two XML documents with swapped elements are not equivalent. If your application do... note Tue, 28 Jul 2015 14:20:18 +0000 http://perlmonks.org/index.pl?node_id=1136615 1136615 832495 2015-07-28 10:20:18 choroba Re: perl: comparing words in the arrays johngg http://perlmonks.org/index.pl?node_id=1136613 <a href="?node=choroba">choroba</a> has provided a <a href="?node_id=1136610">solution</a> giving the number of mismatches but if you also want their positions (as I think you say) then a regex and <a href="http://perldoc.perl.org/functions/pos.html">pos</a> might help. This code gives 1... note Tue, 28 Jul 2015 14:16:09 +0000 http://perlmonks.org/index.pl?node_id=1136613 1136613 401112 2015-07-28 10:16:09 johngg Re^5: Scoping question - will file handle be closed? ("global") tye http://perlmonks.org/index.pl?node_id=1136611 Update: in your second example your variable is specifically of lexical scope, but there is an underlying global that gets assigned to $fh which doesn't go out of sc... note Tue, 28 Jul 2015 13:59:27 +0000 http://perlmonks.org/index.pl?node_id=1136611 1136611 22609 2015-07-28 09:59:27 tye Re: perl: comparing words in the arrays choroba http://perlmonks.org/index.pl?node_id=1136610 It would be better if @seq1 was an array of words, not an array with just a single element. You can use an old trick: XOR the two strings and count the number of non-null characters: #!/usr/... note Tue, 28 Jul 2015 13:59:25 +0000 http://perlmonks.org/index.pl?node_id=1136610 1136610 832495 2015-07-28 09:59:25 choroba Re: perl: comparing words in the arrays thanos1983 http://perlmonks.org/index.pl?node_id=1136609 Hello <a href="?node_id=1136606">GSperlbio</a> I think you will find anything you need here <a href="?node_id=1102555">Compare two arrays</a> Update: I was reading again your question and I go... note Tue, 28 Jul 2015 13:42:17 +0000 http://perlmonks.org/index.pl?node_id=1136609 1136609 1069339 2015-07-28 09:42:17 thanos1983 Re^5: issue with code to save config on brocade swicth Corion http://perlmonks.org/index.pl?node_id=1136605 You could help us help you better by providing the following information: Your current code, as relevant to the problem The input data you have The output data yo... note Tue, 28 Jul 2015 12:45:51 +0000 http://perlmonks.org/index.pl?node_id=1136605 1136605 5348 2015-07-28 08:45:51 Corion Re^3: How to call a perl function without its context? Monk::Thomas http://perlmonks.org/index.pl?node_id=1136603 Basicly I want to write pure functions that will throw a compile-time error when they are not pure. Your definition of 'pure' is different from my definition of 'pure'. A... note Tue, 28 Jul 2015 12:38:37 +0000 http://perlmonks.org/index.pl?node_id=1136603 1136603 989451 2015-07-28 08:38:37 Monk::Thomas Re^4: issue with code to save config on brocade swicth janasec http://perlmonks.org/index.pl?node_id=1136602 it didnt work ....any other way i could try.... note Tue, 28 Jul 2015 12:37:56 +0000 http://perlmonks.org/index.pl?node_id=1136602 1136602 1119843 2015-07-28 08:37:56 janasec Re: "used only once" for symbolic references Athanasius http://perlmonks.org/index.pl?node_id=1136601 Hello <a href="?node=irata73">irata73</a>, and welcome to the Monastery! Sorry, but symbolic references are unnecessary in Perl, and almost always a bad idea! Please see: &#91;doc://... note Tue, 28 Jul 2015 12:31:15 +0000 http://perlmonks.org/index.pl?node_id=1136601 1136601 968231 2015-07-28 08:31:15 Athanasius Re: "used only once" for symbolic references stevieb http://perlmonks.org/index.pl?node_id=1136600 Please read this entertaining and informative three-part story by Mark-Jason Dominus on the matter. You're much safer to use a hash to... note Tue, 28 Jul 2015 12:31:14 +0000 http://perlmonks.org/index.pl?node_id=1136600 1136600 789891 2015-07-28 08:31:14 stevieb Re^3: CSV file info into xml tags 2teez http://perlmonks.org/index.pl?node_id=1136599 What about using this: foreach my $t ( sort keys %sidHash ) { if ( scalar @{ $sidHash{$t}{state} } > 1 ) { print map { sprintf "%s: State %s rate: %s\n" => $... note Tue, 28 Jul 2015 12:20:29 +0000 http://perlmonks.org/index.pl?node_id=1136599 1136599 918402 2015-07-28 08:20:29 2teez Re^6: Overwriting Hash / Array iRemix94 http://perlmonks.org/index.pl?node_id=1136598 Yes, that's how the import times are held. Basically, the import start time is the export finish time. As soon as the export finished, the import starts. The variable $scheduled_export_da... note Tue, 28 Jul 2015 12:08:41 +0000 http://perlmonks.org/index.pl?node_id=1136598 1136598 1134717 2015-07-28 08:08:41 iRemix94 Re^3: How to call a perl function without its context? BrowserUk http://perlmonks.org/index.pl?node_id=1136597 I want to write pure functions that will throw a compile-time error when they are not pure. Could you explain why? ... note Tue, 28 Jul 2015 12:07:18 +0000 http://perlmonks.org/index.pl?node_id=1136597 1136597 171588 2015-07-28 08:07:18 BrowserUk Re^3: How to call a perl function without its context? Corion http://perlmonks.org/index.pl?node_id=1136596 If you want to reject functions that access global state, consider what <a href="http://search.cpan.org/perldoc?B%3A%3AXref">B::Xref</a> provides you. With that, you can get at a list of global variables used by a function.... note Tue, 28 Jul 2015 12:05:00 +0000 http://perlmonks.org/index.pl?node_id=1136596 1136596 5348 2015-07-28 08:05:00 Corion Re: How to call a perl function without its context? KurtSchwind http://perlmonks.org/index.pl?node_id=1136595 You could make a package that doesn't reference anything else. Slap a function in the object and call it. package MyIsolatedFunction; my $singleton = undef; sub new { ... note Tue, 28 Jul 2015 11:59:41 +0000 http://perlmonks.org/index.pl?node_id=1136595 1136595 646951 2015-07-28 07:59:41 KurtSchwind Re^5: Overwriting Hash / Array poj http://perlmonks.org/index.pl?node_id=1136594 Are the import times held like this and if so how do they relate to variable $scheduled_export_days ?. #!perl use strict; use Data::Dump 'pp'; my $bi->{customer}{domain}{host}{BACKUP... note Tue, 28 Jul 2015 11:49:59 +0000 http://perlmonks.org/index.pl?node_id=1136594 1136594 221725 2015-07-28 07:49:59 poj Re^2: How to call a perl function without its context? kitomer http://perlmonks.org/index.pl?node_id=1136593 I do not have any code to show at the moment because I am just "thinking about the problem" right now. I want to automatically create testsuites for functions that create random inputs to detect any e... note Tue, 28 Jul 2015 11:46:59 +0000 http://perlmonks.org/index.pl?node_id=1136593 1136593 875755 2015-07-28 07:46:59 kitomer Re^2: How to call a perl function without its context? kitomer http://perlmonks.org/index.pl?node_id=1136592 Thats a start, thank you!... note Tue, 28 Jul 2015 11:44:32 +0000 http://perlmonks.org/index.pl?node_id=1136592 1136592 875755 2015-07-28 07:44:32 kitomer Re^4: split function not working as expected derby http://perlmonks.org/index.pl?node_id=1136591 Right ... as I said, if you want to use quotes instead of a regex pattern, use single quotes. Double quotes cause interpolation to happen which you don't want here. ... note Tue, 28 Jul 2015 11:43:02 +0000 http://perlmonks.org/index.pl?node_id=1136591 1136591 8930 2015-07-28 07:43:02 derby Re^2: How to call a perl function without its context? kitomer http://perlmonks.org/index.pl?node_id=1136590 Yes for security reasons I want to make sure a function does not access anything beyond its "lexical variables declared within the function scope" (Thank you BrowserUk). Basicly I want to write pure f... note Tue, 28 Jul 2015 11:42:32 +0000 http://perlmonks.org/index.pl?node_id=1136590 1136590 875755 2015-07-28 07:42:32 kitomer Re: "used only once" for symbolic references Anonymous Monk http://perlmonks.org/index.pl?node_id=1136589 irata73: Is there another way than using "no warnings 'once'" to avoid the "used only once" warning? This type of question is frequently asked; If you can't find the answer yourself, sh... note Tue, 28 Jul 2015 10:58:50 +0000 http://perlmonks.org/index.pl?node_id=1136589 1136589 961 2015-07-28 06:58:50 Anonymous Monk Re^4: Overwriting Hash / Array iRemix94 http://perlmonks.org/index.pl?node_id=1136585 my wished structure is like the dumper result in my original post. As you can see there, the SCHEDULE_COLUMNS_IMPORT has several entries. The schedule value here should display the value of $imp_f... note Tue, 28 Jul 2015 10:48:19 +0000 http://perlmonks.org/index.pl?node_id=1136585 1136585 1134717 2015-07-28 06:48:19 iRemix94 Re: How to call a perl function without its context? GrandFather http://perlmonks.org/index.pl?node_id=1136584 This is Perl we are talking about? Not JavaScript? If you have come from a JavaScript background you have a bunch of stuff about scope and lifetime to unlearn. If you don't have JavaScript ... note Tue, 28 Jul 2015 10:39:18 +0000 http://perlmonks.org/index.pl?node_id=1136584 1136584 461912 2015-07-28 06:39:18 GrandFather Re^3: Overwriting Hash / Array poj http://perlmonks.org/index.pl?node_id=1136583 I've refactored your code slightly and I hope you can see how the act loop is setting the same hash element each time. Add the $debug variable to see. What structure do you want ? ... note Tue, 28 Jul 2015 10:36:18 +0000 http://perlmonks.org/index.pl?node_id=1136583 1136583 221725 2015-07-28 06:36:18 poj Re^3: CSV file info into xml tags CSharma http://perlmonks.org/index.pl?node_id=1136582 Have got it, accessed this way! foreach my $t (sort keys %midHash){ print $t . "\t" . join(", ", @{$midHash{$t}{state}}) . "\n"; } ... note Tue, 28 Jul 2015 10:33:02 +0000 http://perlmonks.org/index.pl?node_id=1136582 1136582 1136464 2015-07-28 06:33:02 CSharma Re^2: Overwriting Hash / Array iRemix94 http://perlmonks.org/index.pl?node_id=1136581 sadly, I still don't know how to fix the proplem .. As I've understood it, I have to declare the hash inside the loop that gets the information, but with it, I have to put the "push" line into tha... note Tue, 28 Jul 2015 10:21:44 +0000 http://perlmonks.org/index.pl?node_id=1136581 1136581 1134717 2015-07-28 06:21:44 iRemix94 windjammer windjammer http://perlmonks.org/index.pl?node_id=1136624 user Tue, 28 Jul 2015 15:00:08 +0000 http://perlmonks.org/index.pl?node_id=1136624 1136624 1136624 2015-07-28 11:00:08 windjammer marjetika marjetika http://perlmonks.org/index.pl?node_id=1136618 user Tue, 28 Jul 2015 14:38:37 +0000 http://perlmonks.org/index.pl?node_id=1136618 1136618 1136618 2015-07-28 10:38:37 marjetika GSperlbio GSperlbio http://perlmonks.org/index.pl?node_id=1136606 user Tue, 28 Jul 2015 12:57:33 +0000 http://perlmonks.org/index.pl?node_id=1136606 1136606 1136606 2015-07-28 08:57:33 GSperlbio irata73 irata73 http://perlmonks.org/index.pl?node_id=1136586 user Tue, 28 Jul 2015 10:48:46 +0000 http://perlmonks.org/index.pl?node_id=1136586 1136586 1136586 2015-07-28 06:48:46 irata73