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-03-27 18:10:43 rss,clean Fri Mar 27 08:10:43 2015 30 20150327081043 Fri Mar 27 08:10:43 2015 http://perlmonks.org/ Anonymous Monk Exporter not behaving as expected davies http://perlmonks.org/index.pl?node_id=1121536 I'm trying to set up some constants in a module that will be accessible from other code. The final things will be capitalised and I may experiment with other modules to lock them, but for the momen... perlquestion Fri, 27 Mar 2015 17:50:00 +0000 http://perlmonks.org/index.pl?node_id=1121536 1121536 436161 2015-03-27 13:50:00 davies Logic Issues with conditionals jmneedhamco http://perlmonks.org/index.pl?node_id=1121511 Greetings: I am working on a script that updates some files for user access on a propritory system. Basically, I need to update 12 files based on some very weird logic. The Eng... perlquestion Fri, 27 Mar 2015 14:05:27 +0000 http://perlmonks.org/index.pl?node_id=1121511 1121511 1119511 2015-03-27 10:05:27 jmneedhamco Convert Hash To Array in Perl Catalyst jphani225 http://perlmonks.org/index.pl?node_id=1121510 Hi I am working with perl catalyst I am new to this. Now I am facing a problem regarding variables. Here I am getting input as hash. Now I need to send this hash variable to another subroutine. Pleas... perlquestion Fri, 27 Mar 2015 14:04:41 +0000 http://perlmonks.org/index.pl?node_id=1121510 1121510 1110910 2015-03-27 10:04:41 jphani225 Trigger refresh after changing wallpaper when called from scheduled task ice94 http://perlmonks.org/index.pl?node_id=1121501 Hello to you, enlightened monks. First of all, the technical environment : OS: Windows 7 x64 Perl: Strawberry Perl x86 v5.16.3001 Modules: Win32::API a... perlquestion Fri, 27 Mar 2015 13:26:41 +0000 http://perlmonks.org/index.pl?node_id=1121501 1121501 1087541 2015-03-27 09:26:41 ice94 Tring to write script to add and get employee detials to hash yedukondalu http://perlmonks.org/index.pl?node_id=1121500 Hi all .I need to add employee details to a hash,i mean i need employe id as key and i need to move all other details to be value storing them in a list. i tried this. %database; @employ... perlquestion Fri, 27 Mar 2015 13:23:47 +0000 http://perlmonks.org/index.pl?node_id=1121500 1121500 1115607 2015-03-27 09:23:47 yedukondalu Re: Exporter not behaving as expected ikegami http://perlmonks.org/index.pl?node_id=1121543 @rry isn't declared in case 1 because you didn't export anything (@EXPORT = ();). Case 2 prints zero since you never assign anything to the array named rray in the MyM... note Fri, 27 Mar 2015 18:10:01 +0000 http://perlmonks.org/index.pl?node_id=1121543 1121543 381608 2015-03-27 14:10:01 ikegami Re^2: Exporter not behaving as expected davies http://perlmonks.org/index.pl?node_id=1121542 Yes, I understand that. I'm not concerned about whether it's by default or not - case 1 merely demonstrates that I am catching errors when no symbol is found. My problem is that an array that is as... note Fri, 27 Mar 2015 18:09:11 +0000 http://perlmonks.org/index.pl?node_id=1121542 1121542 436161 2015-03-27 14:09:11 davies Re: Exporter not behaving as expected Anonymous Monk http://perlmonks.org/index.pl?node_id=1121539 For @rray to be exported by default, it would need to be in @EXPORT.... note Fri, 27 Mar 2015 18:03:34 +0000 http://perlmonks.org/index.pl?node_id=1121539 1121539 961 2015-03-27 14:03:34 Anonymous Monk Re^3: XML::CSV out of memory stonecolddevin http://perlmonks.org/index.pl?node_id=1121538 Yea I actually agree with this the most. There are far too many options for this to dick around with something that's not immediately easy.... note Fri, 27 Mar 2015 17:52:58 +0000 http://perlmonks.org/index.pl?node_id=1121538 1121538 203787 2015-03-27 13:52:58 stonecolddevin Re^2: [OT] The interesting problem of comparing bit-strings. Anonymous Monk http://perlmonks.org/index.pl?node_id=1121537 Show us the code. No one here who knows <a href="?node_id=1090653">the quality of your technical advice</a> will trust that you know what you are talking about until you show us the code.... note Fri, 27 Mar 2015 17:52:31 +0000 http://perlmonks.org/index.pl?node_id=1121537 1121537 961 2015-03-27 13:52:31 Anonymous Monk Re: [OT] The interesting problem of comparing bit-strings. Anonymous Monk http://perlmonks.org/index.pl?node_id=1121535 Having now calmed-down slightly, let me now append to my previous comment, so that you can NodeReap both of them. This is a classic example of the sort of problem which has two s... note Fri, 27 Mar 2015 17:44:08 +0000 http://perlmonks.org/index.pl?node_id=1121535 1121535 961 2015-03-27 13:44:08 Anonymous Monk Re^2: Logic Issues with conditionals Your Mother http://perlmonks.org/index.pl?node_id=1121534 Let’s sum that up with easier language for the Perl n00bies and drive-by ESL hackers– Phase 1: Collect underpants Phase 2: ? ... note Fri, 27 Mar 2015 17:42:45 +0000 http://perlmonks.org/index.pl?node_id=1121534 1121534 248054 2015-03-27 13:42:45 Your Mother Re^5: Tring to write script to add and get employee detials to hash Anonymous Monk http://perlmonks.org/index.pl?node_id=1121533 i would like for you to give more details as to why you have this opinion, please The opinion was perhaps stated a little more strongly than it should have been. Wh... note Fri, 27 Mar 2015 17:31:09 +0000 http://perlmonks.org/index.pl?node_id=1121533 1121533 961 2015-03-27 13:31:09 Anonymous Monk Re^2: [OT] The interesting problem of comparing bit-strings. Anonymous Monk http://perlmonks.org/index.pl?node_id=1121532 Show us the code.... note Fri, 27 Mar 2015 17:28:56 +0000 http://perlmonks.org/index.pl?node_id=1121532 1121532 961 2015-03-27 13:28:56 Anonymous Monk Re: [OT] The interesting problem of comparing bit-strings. sundialsvc4 http://perlmonks.org/index.pl?node_id=1121531 NO, IT IS NOT &ldquo;PUERILE TROLLING!&rdquo; Yes, I am unfortuantely well aware that <a href="?node=BrowserUK">BrowserUK</a> and (by my rough estimate of downvote counts) about ±7 ot... note Fri, 27 Mar 2015 17:22:49 +0000 http://perlmonks.org/index.pl?node_id=1121531 1121531 647953 2015-03-27 13:22:49 sundialsvc4 Re^5: Help with file test operators RonW http://perlmonks.org/index.pl?node_id=1121530 As I recall, <a href="http://en.wikipedia.org/wiki/Project_Xanadu">Project Xanadu</a> tried to address this in a way that did not require the original document to have either links or anchors - and without mak... note Fri, 27 Mar 2015 17:18:04 +0000 http://perlmonks.org/index.pl?node_id=1121530 1121530 1080444 2015-03-27 13:18:04 RonW Re: Logic Issues with conditionals sundialsvc4 http://perlmonks.org/index.pl?node_id=1121529 In all such cases like this, I suggest that you break the &ldquo;very wierd logic&rdquo; into a clear separation of concerns, so that you wind up addressing only one problem at a time, and thus y... note Fri, 27 Mar 2015 17:05:35 +0000 http://perlmonks.org/index.pl?node_id=1121529 1121529 647953 2015-03-27 13:05:35 sundialsvc4 Re: XML::CSV out of memory sundialsvc4 http://perlmonks.org/index.pl?node_id=1121528 You could be running into a memory-problem in any one of three places: The CSV import.The XML translation. An unknown bug in a module that hasn&rsquo;t been attended-to ... note Fri, 27 Mar 2015 16:49:30 +0000 http://perlmonks.org/index.pl?node_id=1121528 1121528 647953 2015-03-27 12:49:30 sundialsvc4 Re: Trigger refresh after changing wallpaper when called from scheduled task silent11 http://perlmonks.org/index.pl?node_id=1121527 I had the below code running daily with no issues. I'm not sure what "refresh" you're referring to, or why you have to play with the registry. I ran this from a scheduled task or by hand and the backg... note Fri, 27 Mar 2015 16:47:13 +0000 http://perlmonks.org/index.pl?node_id=1121527 1121527 95704 2015-03-27 12:47:13 silent11 Re^4: Tring to write script to add and get employee detials to hash jeffa http://perlmonks.org/index.pl?node_id=1121526 "&#91;YAML&#93; maps to Perl data structures better than JSON ..." I was not aware of that. I do recall having some issues with de-serializing anonymous subs into Perl data fro... note Fri, 27 Mar 2015 16:30:56 +0000 http://perlmonks.org/index.pl?node_id=1121526 1121526 18800 2015-03-27 12:30:56 jeffa Re^4: What is (a => b => c) ? Schmunzie http://perlmonks.org/index.pl?node_id=1121525 That's fascinating, amazing and scary in equal measure.... note Fri, 27 Mar 2015 16:19:01 +0000 http://perlmonks.org/index.pl?node_id=1121525 1121525 1120040 2015-03-27 12:19:01 Schmunzie Re^3: What is (a => b => c) ? jeffa http://perlmonks.org/index.pl?node_id=1121524 Not if you declare/define it first: no strict; sub c { print "see?\n" } @x = ( a => b => c ); or no strict; sub c; @x = ( a => b => c ); sub c { print ... note Fri, 27 Mar 2015 16:12:42 +0000 http://perlmonks.org/index.pl?node_id=1121524 1121524 18800 2015-03-27 12:12:42 jeffa Re^2: What is (a => b => c) ? Schmunzie http://perlmonks.org/index.pl?node_id=1121523 Doesn't it need to be &c to be a function call?... note Fri, 27 Mar 2015 16:04:46 +0000 http://perlmonks.org/index.pl?node_id=1121523 1121523 1120040 2015-03-27 12:04:46 Schmunzie Re^3: Are old obfus gone forever? LanX http://perlmonks.org/index.pl?node_id=1121522 I'm sure the <a href="?node=gods">gods</a> can identify your account when you <a href="?node=%2Fmsg">/msg</a> them your old email address. Cheers Rolf (addicted to the Perl Progr... note Fri, 27 Mar 2015 16:03:29 +0000 http://perlmonks.org/index.pl?node_id=1121522 1121522 708738 2015-03-27 12:03:29 LanX Re^2: Are old obfus gone forever? Schmunzie http://perlmonks.org/index.pl?node_id=1121521 That'll be on hard drive in a landfill site.... note Fri, 27 Mar 2015 15:57:06 +0000 http://perlmonks.org/index.pl?node_id=1121521 1121521 1120040 2015-03-27 11:57:06 Schmunzie Re^4: Including modules exclusively for testing with ExtUtils::MakeMaker jeffa http://perlmonks.org/index.pl?node_id=1121520 Thanks for pointing that out. I use <a href="http://search.cpan.org/search?mode=module&amp;query=FindBin">FindBin</a> from time to time, mostly when i write code that others will be using. In this case, i always run my tests like so: (from the DesignPatter... note Fri, 27 Mar 2015 15:55:20 +0000 http://perlmonks.org/index.pl?node_id=1121520 1121520 18800 2015-03-27 11:55:20 jeffa Re: Logic Issues with conditionals GotToBTru http://perlmonks.org/index.pl?node_id=1121519 I'm with <a href="?node_id=1121518">Athanasius</a> on this one. There might be a clever way to make it work in a single loop. But I would prefer to go the wordier route for the sake of clearer documentation. The ... note Fri, 27 Mar 2015 15:51:16 +0000 http://perlmonks.org/index.pl?node_id=1121519 1121519 844862 2015-03-27 11:51:16 GotToBTru Re: Logic Issues with conditionals Athanasius http://perlmonks.org/index.pl?node_id=1121518 Hello <a href="?node=jmneedhamco">jmneedhamco</a>, So the jist of what I tried is a nested loop. I suspect that is the wrong approach here. A structure like this: ... note Fri, 27 Mar 2015 15:33:56 +0000 http://perlmonks.org/index.pl?node_id=1121518 1121518 968231 2015-03-27 11:33:56 Athanasius Re: Logic Issues with conditionals fishmonger http://perlmonks.org/index.pl?node_id=1121517 I'd cleanup your @files assignments via the use of a hash. Something like this: my %files = ( dev => <a href="?node=qw%28dev_file1%20dev_file2%20dev_file3%20dev_file4%29">qw(dev_file1 dev_file2 dev_file3 dev_file4)</a>, prod => &#91;qw(prod_... note Fri, 27 Mar 2015 15:07:41 +0000 http://perlmonks.org/index.pl?node_id=1121517 1121517 626694 2015-03-27 11:07:41 fishmonger Re^2: Help with removing duplicates in array Anonymous Monk http://perlmonks.org/index.pl?node_id=1121516 The fourth line of the OP's code shows that s/he already tried that.... note Fri, 27 Mar 2015 14:52:29 +0000 http://perlmonks.org/index.pl?node_id=1121516 1121516 961 2015-03-27 10:52:29 Anonymous Monk Re^3: Tring to write script to add and get employee detials to hash Anonymous Monk http://perlmonks.org/index.pl?node_id=1121515 Does the text file need to be in a particular format? If not, you're free to choose any serialization format you like, be it XML, YAML, JSON, or something else. Personally, I might recommend YAML, ... note Fri, 27 Mar 2015 14:51:00 +0000 http://perlmonks.org/index.pl?node_id=1121515 1121515 961 2015-03-27 10:51:00 Anonymous Monk Re: Logic Issues with conditionals choroba http://perlmonks.org/index.pl?node_id=1121514 In a for-loop, you don't need <a href="http://perldoc.perl.org/functions/break.html">break</a>, you need <a href="http://perldoc.perl.org/functions/last.html">last</a>. &#1604;&#1405;&#4... note Fri, 27 Mar 2015 14:45:45 +0000 http://perlmonks.org/index.pl?node_id=1121514 1121514 832495 2015-03-27 10:45:45 choroba Re: Convert Hash To Array in Perl Catalyst choroba http://perlmonks.org/index.pl?node_id=1121513 Crossposted to <a href="http://stackoverflow.com/q/29298572/1030675">StackOverflow</a>. It's considered polite to inform about crossposting, so people not attending both sites don't waste time hacking a solution ... note Fri, 27 Mar 2015 14:43:04 +0000 http://perlmonks.org/index.pl?node_id=1121513 1121513 832495 2015-03-27 10:43:04 choroba Re^3: Multiple Device Logon execute the same command vinoth.ree http://perlmonks.org/index.pl?node_id=1121512 Hi <a href="?node=PerlCramps">PerlCramps</a>, Did you read how to execute command in remote machine? You can execute commands on remote machines from a Perl script using the <a href="http://search.cpan.org/perldoc?Net%3A%3ASSH%3A%3APerl">Net::SSH::Perl</a> module.... note Fri, 27 Mar 2015 14:27:38 +0000 http://perlmonks.org/index.pl?node_id=1121512 1121512 734134 2015-03-27 10:27:38 vinoth.ree Re: Help with removing duplicates in array BillKSmith http://perlmonks.org/index.pl?node_id=1121509 You can use the uniq function in <a href="http://search.cpan.org/perldoc?List%3A%3AMoreUtils">List::MoreUtils</a> Bill ... note Fri, 27 Mar 2015 13:59:53 +0000 http://perlmonks.org/index.pl?node_id=1121509 1121509 957973 2015-03-27 09:59:53 BillKSmith Re^2: Tring to write script to add and get employee detials to hash yedukondalu http://perlmonks.org/index.pl?node_id=1121508 Thanks for the reply. How can i store this hash into a text file and how to access the hash from text file using file handle ... note Fri, 27 Mar 2015 13:58:19 +0000 http://perlmonks.org/index.pl?node_id=1121508 1121508 1115607 2015-03-27 09:58:19 yedukondalu Re^5: When putting a smiley right before a closing parenthesis, do you: (Russian emoticons ))) chacham http://perlmonks.org/index.pl?node_id=1121507 It is possible to have a lisp with a <a href="http://ars.userfriendly.org/cartoons/?id=19980723&amp;mode=classic">Slavic accent</a>?... note Fri, 27 Mar 2015 13:53:07 +0000 http://perlmonks.org/index.pl?node_id=1121507 1121507 934209 2015-03-27 09:53:07 chacham Re^3: Help with removing duplicates in array hdb http://perlmonks.org/index.pl?node_id=1121506 And what do you get? Does it run w/o warnings? Do you still get duplicates? Are you aware that you only remove duplicates from the same $file but that there could be duplicates across? ... note Fri, 27 Mar 2015 13:46:56 +0000 http://perlmonks.org/index.pl?node_id=1121506 1121506 1021810 2015-03-27 09:46:56 hdb Re^3: Help with removing duplicates in array hippo http://perlmonks.org/index.pl?node_id=1121505 Are you perhaps confusing a string with a list? use strict; use warnings; use feature 'say'; sub uniq { #and this to handle the duplicated emails return keys %{ { map { $_... note Fri, 27 Mar 2015 13:44:59 +0000 http://perlmonks.org/index.pl?node_id=1121505 1121505 885521 2015-03-27 09:44:59 hippo Re: Tring to write script to add and get employee detials to hash Anonymous Monk http://perlmonks.org/index.pl?node_id=1121504 Have a look at "hashes of arrays" in <a href="http://perldoc.perl.org/perldsc.html">perldsc</a>, that gives lots of code examples on how to access data structures like that, and see also <a href="http://perldoc.perl.org/perlreftut.html">perlreftut</a>. For example: my %databa... note Fri, 27 Mar 2015 13:35:36 +0000 http://perlmonks.org/index.pl?node_id=1121504 1121504 961 2015-03-27 09:35:36 Anonymous Monk Re: Tring to write script to add and get employee details to hash toolic http://perlmonks.org/index.pl?node_id=1121503 This (ugly) code seems to "work" for me: my($employee_name,$employee_salary,$employee_ph,$employee_id) = 5..8; %database; @employee_details=($employee_name, $employee_salary,$employee_ph,... note Fri, 27 Mar 2015 13:29:45 +0000 http://perlmonks.org/index.pl?node_id=1121503 1121503 622051 2015-03-27 09:29:45 toolic Re^2: Help with removing duplicates in array beanscake http://perlmonks.org/index.pl?node_id=1121502 good i have done that' use strict; use warnings; #use List::MoreUtils qw(uniq); // i have tried this to handle the duplicated emails use Data::Dumper qw(Dumper); my $Directory = $A... note Fri, 27 Mar 2015 13:29:09 +0000 http://perlmonks.org/index.pl?node_id=1121502 1121502 1070054 2015-03-27 09:29:09 beanscake Re: Help with removing duplicates in array hdb http://perlmonks.org/index.pl?node_id=1121499 Can you try with use strict; use warnings; As a minimum it will tell you that in the line where you use $#filtered, the underlying array @filtered i... note Fri, 27 Mar 2015 12:51:42 +0000 http://perlmonks.org/index.pl?node_id=1121499 1121499 1021810 2015-03-27 08:51:42 hdb Re^3: I want you to convince me to learn Perl einhverfr http://perlmonks.org/index.pl?node_id=1121498 Completely agree beyond the novice level. One might see Perl as a bridge between C and Lisp where you can seemlessly move between both approaches.... note Fri, 27 Mar 2015 12:45:43 +0000 http://perlmonks.org/index.pl?node_id=1121498 1121498 615234 2015-03-27 08:45:43 einhverfr Re^2: Help with removing duplicates in array beanscake http://perlmonks.org/index.pl?node_id=1121496 ok thanks, i mean it's not removing duplicates as i intended it to work.. please if you can put this to a txt and run the script and see it's not removing these duplicates =>'aaaa@jjj.net aaaa@jjj.ne... note Fri, 27 Mar 2015 12:36:17 +0000 http://perlmonks.org/index.pl?node_id=1121496 1121496 1070054 2015-03-27 08:36:17 beanscake jsnicaise jsnicaise http://perlmonks.org/index.pl?node_id=1121540 user Fri, 27 Mar 2015 18:04:55 +0000 http://perlmonks.org/index.pl?node_id=1121540 1121540 1121540 2015-03-27 14:04:55 jsnicaise