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-07-10 22:02:48 rss,clean Thu Jul 10 12:02:48 2014 30 20140710120248 Thu Jul 10 12:02:48 2014 http://perlmonks.org/ Anonymous Monk Reversing Arabic String direction wael_ahmed http://perlmonks.org/index.pl?node_id=1093127 Hi all, I have an Arabic string that contains both letters and digits. The problem is that the string appears reversed, I tried using the reverse function but it reverses both the letters and digits ... perlquestion Thu, 10 Jul 2014 21:20:03 +0000 http://perlmonks.org/index.pl?node_id=1093127 1093127 1093125 2014-07-10 17:20:03 wael_ahmed Compress a entire directory kepler http://perlmonks.org/index.pl?node_id=1093122 Hi, Does anyone has a clue how to compress in zip or tar format several files in the SAME compressed file? Kind regards, Kepler... perlquestion Thu, 10 Jul 2014 20:55:26 +0000 http://perlmonks.org/index.pl?node_id=1093122 1093122 886676 2014-07-10 16:55:26 kepler accessing elements of reference to hash of arrays johnguillory http://perlmonks.org/index.pl?node_id=1093117 Hello, The following code successfully prints all content of a hash of arrays: for $x ( keys %HoA ) { print "$x: "; for $i ( 0 .. $#{ $HoA{$x} } ) {... perlquestion Thu, 10 Jul 2014 20:28:14 +0000 http://perlmonks.org/index.pl?node_id=1093117 1093117 1030694 2014-07-10 16:28:14 johnguillory modulino and perldoc neilwatson http://perlmonks.org/index.pl?node_id=1093114 Greetings again, Regarding <a href="http://search.cpan.org/perldoc?Modulino%3A%3ADemo">Modulino::Demo</a>, specifically the following sections. How does the doc sub work? Is it supposed to run when the module is called using perldoc? I did try... perlquestion Thu, 10 Jul 2014 19:43:57 +0000 http://perlmonks.org/index.pl?node_id=1093114 1093114 104468 2014-07-10 15:43:57 neilwatson Moose, Class::DBI, and builder perldiverx http://perlmonks.org/index.pl?node_id=1093105 Hello, I'm having a problem getting a builder to run in a subclass. Whenever I try and run a script that calls $obj->{'manual_phone'} it comes back undefined and I'm not sure why. I t... perlquestion Thu, 10 Jul 2014 18:59:13 +0000 http://perlmonks.org/index.pl?node_id=1093105 1093105 1016400 2014-07-10 14:59:13 perldiverx installation of FireFox :: Mechanize fails - [again] Perlbeginner1 http://perlmonks.org/index.pl?node_id=1093100 well i tried it several times - on differnet installations of suselinux. now - on opensuse 13.1 i have issues again to install mozrepl firefox - once - years ago i managed to get... perlquestion Thu, 10 Jul 2014 18:40:03 +0000 http://perlmonks.org/index.pl?node_id=1093100 1093100 861402 2014-07-10 14:40:03 Perlbeginner1 Windows SSH Help PerlCramps http://perlmonks.org/index.pl?node_id=1093094 I have strawberry perl working on my windows 7 laptop. I am trying to remote into some Brocade switches that I manage. I tried to load the Net-SSH-W32Perl module it fail because it has a requirment fo... perlquestion Thu, 10 Jul 2014 17:39:17 +0000 http://perlmonks.org/index.pl?node_id=1093094 1093094 1093088 2014-07-10 13:39:17 PerlCramps modulino and $VERSION neilwatson http://perlmonks.org/index.pl?node_id=1093093 Greetings, I'm attempting to learn <a href="?node=brian_d_foy">brian_d_foy</a>'s modulino. In this early prototype I'm getting an uninitialized error about $VERSION. What is the cause? #!/usr/bin/perl ... perlquestion Thu, 10 Jul 2014 17:35:41 +0000 http://perlmonks.org/index.pl?node_id=1093093 1093093 104468 2014-07-10 13:35:41 neilwatson Sorting By Column Roguehorse http://perlmonks.org/index.pl?node_id=1093085 Hello, I'm having a problem sorting between two files that I hope someone can help me with as I'm still pretty new to Perl. I need to separate all values where key 1 first page t... perlquestion Thu, 10 Jul 2014 16:46:35 +0000 http://perlmonks.org/index.pl?node_id=1093085 1093085 1068280 2014-07-10 12:46:35 Roguehorse Trapping errors mcoblentz http://perlmonks.org/index.pl?node_id=1093083 Brothers and Sisters, I'm pretty sure I have made a rookie mistake somewhere but the obvious is eluding me. I have a script which is not throwing any errors and should be. (Sounds like... perlquestion Thu, 10 Jul 2014 16:34:24 +0000 http://perlmonks.org/index.pl?node_id=1093083 1093083 674384 2014-07-10 12:34:24 mcoblentz Reaped: Womens Nike Air Max NodeReaper http://perlmonks.org/index.pl?node_id=1093080 This node was taken out by the <a href="?node=NodeReaper">NodeReaper</a> on Jul 10, 2014 at 16:34&nbsp;UTCReason: &#91;<a href="?node=marto">marto</a>&#93;: Reap: SPAM.You may view &#91;href://?node=Visit%20Reaped%20Nodes&nodenum=1093080|the original... CUFP Thu, 10 Jul 2014 16:16:43 +0000 http://perlmonks.org/index.pl?node_id=1093080 1093080 52855 2014-07-10 12:16:43 NodeReaper Re^2: Reversing Arabic String direction boftx http://perlmonks.org/index.pl?node_id=1093136 The question I had was how to handle things like "name21" or even "name_21". Both yours and my "solutions" have a problem with words like that. <a href="?node=AppleFritter">AppleFritter</a> is on the right track, but I think t... note Thu, 10 Jul 2014 21:56:54 +0000 http://perlmonks.org/index.pl?node_id=1093136 1093136 1049510 2014-07-10 17:56:54 boftx Re^5: poll ideas quest 2014 (chewing gum) Bethany http://perlmonks.org/index.pl?node_id=1093135 Whether or not bubble gum is a flavor, it's a sort of gum. But isn't it always better to use the quick sort? (Sorry. A monk should be able to resist temptation.)... note Thu, 10 Jul 2014 21:56:03 +0000 http://perlmonks.org/index.pl?node_id=1093135 1093135 1092513 2014-07-10 17:56:03 Bethany Re: Reversing Arabic String direction AppleFritter http://perlmonks.org/index.pl?node_id=1093134 Without knowing anything at all about Arabic script... off the top of my head, I'd suggest splitting your string into chunks along letter/digit boundaries, reversing not reversing each chunk as approp... note Thu, 10 Jul 2014 21:51:07 +0000 http://perlmonks.org/index.pl?node_id=1093134 1093134 1084031 2014-07-10 17:51:07 AppleFritter Re: Reversing Arabic String direction LanX http://perlmonks.org/index.pl?node_id=1093133 I think it can be done more elegantly, but this works for me DB $str ="a123bc45de" => "a123bc45de" DB join "", reverse map { /\d/ ? $_ : scalar reverse $_ } split /(\d+)/... note Thu, 10 Jul 2014 21:49:17 +0000 http://perlmonks.org/index.pl?node_id=1093133 1093133 708738 2014-07-10 17:49:17 LanX Re: Reversing Arabic String direction boftx http://perlmonks.org/index.pl?node_id=1093132 Here is a very crude, brute-force approach. I've no doubt that one of the regex masters here can do it much more efficiently. use strict; use warnings; # I have no idea how uni... note Thu, 10 Jul 2014 21:46:32 +0000 http://perlmonks.org/index.pl?node_id=1093132 1093132 1049510 2014-07-10 17:46:32 boftx Re: Compress a entire directory Laurent_R http://perlmonks.org/index.pl?node_id=1093131 Just a side note: tar is not really a compression utility and is not aimed at compressing data. The tar utility is for building an archive of several files (i.e. storing several files into a single fi... note Thu, 10 Jul 2014 21:45:53 +0000 http://perlmonks.org/index.pl?node_id=1093131 1093131 992570 2014-07-10 17:45:53 Laurent_R Re^2: Out of Memory while using Spreadsheet::XLSX runrig http://perlmonks.org/index.pl?node_id=1093130 <a href="http://search.cpan.org/search?mode=module&amp;query=Spreadsheet%3A%3AParseExcel">Spreadsheet::ParseExcel</a> parses XLS files, not XLSX files. <a href="http://search.cpan.org/search?mode=module&amp;query=Spreadsheet%3A%3AXLSX">Spreadsheet::XLSX</a> does not have the same sort of memory-saving cell handler functionality.... note Thu, 10 Jul 2014 21:42:02 +0000 http://perlmonks.org/index.pl?node_id=1093130 1093130 31503 2014-07-10 17:42:02 runrig Re^2: accessing elements of reference to hash of arrays johnguillory http://perlmonks.org/index.pl?node_id=1093129 LanX, I found my mistake after trying dumper. I wasn't even passing the correct hash into the function. Geez. Thank you! John... note Thu, 10 Jul 2014 21:36:33 +0000 http://perlmonks.org/index.pl?node_id=1093129 1093129 1030694 2014-07-10 17:36:33 johnguillory Re^2: Sorting By Column Roguehorse http://perlmonks.org/index.pl?node_id=1093128 You're right, there are no duplicates in the sample, however there ARE duplicates in the original file and thus only duplicates that share the same column 2 and column 3... note Thu, 10 Jul 2014 21:27:11 +0000 http://perlmonks.org/index.pl?node_id=1093128 1093128 1068280 2014-07-10 17:27:11 Roguehorse Re^4: Sorting By Column Roguehorse http://perlmonks.org/index.pl?node_id=1093124 Thanks AppleFritter! The original file is combined such as what I'm trying to achieve so for every key 1 there is a key 2. This should work fine and I will work with i... note Thu, 10 Jul 2014 21:12:35 +0000 http://perlmonks.org/index.pl?node_id=1093124 1093124 1068280 2014-07-10 17:12:35 Roguehorse Re: Compress a entire directory roboticus http://perlmonks.org/index.pl?node_id=1093123 <a href="?node=kepler">kepler</a>: You can do it with <a href="http://search.cpan.org/search?mode=module&amp;query=Archive%3A%3AZIP">Archive::ZIP</a>. Just traverse your directory tree and add the files to the ZIP file. ...<a href="?node=roboticus">roboticus</a> When your only tool is a hammer, a... note Thu, 10 Jul 2014 21:00:00 +0000 http://perlmonks.org/index.pl?node_id=1093123 1093123 533863 2014-07-10 17:00:00 roboticus Re: accessing elements of reference to hash of arrays Laurent_R http://perlmonks.org/index.pl?node_id=1093121 Hi, I would suggest, for a start, that you change this part: } elsif (ref($aref) eq “HASH”){ #This foreach of the hash ref doesn't print anything! foreach ... note Thu, 10 Jul 2014 20:45:20 +0000 http://perlmonks.org/index.pl?node_id=1093121 1093121 992570 2014-07-10 16:45:20 Laurent_R Re: accessing elements of reference to hash of arrays LanX http://perlmonks.org/index.pl?node_id=1093120 &gt; I’m failing to do this inside the function. Could you please be more specific? Did you check the passed ref with <a href="https://metacpan.org/module/Data%3A%3ADumper">Data::Dumper</a> to see if its populated? Did you... note Thu, 10 Jul 2014 20:40:04 +0000 http://perlmonks.org/index.pl?node_id=1093120 1093120 708738 2014-07-10 16:40:04 LanX Re: Meaning of command Bethany http://perlmonks.org/index.pl?node_id=1093119 This info might be useful to a beginner. If you aren't used to Perl's way of doing things, the square brackets in $A =~ tr<a href="?node=%5Cn">\n</a>&#91;&#93;d; can look confusingly like array subscripting or references ... note Thu, 10 Jul 2014 20:35:39 +0000 http://perlmonks.org/index.pl?node_id=1093119 1093119 1092513 2014-07-10 16:35:39 Bethany Re: Trapping errors Laurent_R http://perlmonks.org/index.pl?node_id=1093118 I am also not familiar with this module, but this does not seem to be quite right: if ($loop new(apiver => 3); eval{ ... note Thu, 10 Jul 2014 20:30:15 +0000 http://perlmonks.org/index.pl?node_id=1093118 1093118 992570 2014-07-10 16:30:15 Laurent_R Re: Permanent utf8 farang http://perlmonks.org/index.pl?node_id=1093116 <a href="http://search.cpan.org/perldoc?utf8%3A%3Aall">utf8::all</a> Not a total cure-all, but easy and effective for a great number of situations. ... note Thu, 10 Jul 2014 19:47:34 +0000 http://perlmonks.org/index.pl?node_id=1093116 1093116 1021749 2014-07-10 15:47:34 farang Re^2: installation of FireFox :: Mechanize fails - [again] Anonymous Monk http://perlmonks.org/index.pl?node_id=1093115 You should give up. Stop cross posting this spam at StackOverlfow, OS forums. Programming is not for you.... note Thu, 10 Jul 2014 19:45:42 +0000 http://perlmonks.org/index.pl?node_id=1093115 1093115 961 2014-07-10 15:45:42 Anonymous Monk Re^2: Moose, Class::DBI, and builder perldiverx http://perlmonks.org/index.pl?node_id=1093113 Thanks, that got it! I must have misunderstood the Moose docs. As for the column names, yes, they are stored in all caps. I didn't create the DB though, just working with it. ... note Thu, 10 Jul 2014 19:36:21 +0000 http://perlmonks.org/index.pl?node_id=1093113 1093113 1016400 2014-07-10 15:36:21 perldiverx Re: Moose, Class::DBI, and builder boftx http://perlmonks.org/index.pl?node_id=1093112 Yes, it should be built when the method is called. You are accessing the attribute element directly instead of calling the method on the object. print "\$obj->{'manual_pnone'} " . $o... note Thu, 10 Jul 2014 19:28:13 +0000 http://perlmonks.org/index.pl?node_id=1093112 1093112 1049510 2014-07-10 15:28:13 boftx Re: installation of FireFox :: Mechanize fails - [again] Perlbeginner1 http://perlmonks.org/index.pl?node_id=1093111 i just did it - just see what happened: http://pastebin.com/5ZkrC2WY well - i have to study the results... later the evening. after studying the terminal... note Thu, 10 Jul 2014 19:14:14 +0000 http://perlmonks.org/index.pl?node_id=1093111 1093111 861402 2014-07-10 15:14:14 Perlbeginner1 Re^8: WxPerl and drag and dropping files james28909 http://perlmonks.org/index.pl?node_id=1093110 im back, can you point me in the right direction of how i would also get the directory of said dropped file? let me be a little more specific. the program outputs to the root directory in which the gu... note Thu, 10 Jul 2014 19:10:08 +0000 http://perlmonks.org/index.pl?node_id=1093110 1093110 1018106 2014-07-10 15:10:08 james28909 Re: Sorting By Column Laurent_R http://perlmonks.org/index.pl?node_id=1093109 Sorry, I also don't really understand what you are trying to do, but only have a relatively vague idea. Perhaps it would be clearer if you showed your coding attempts. ... note Thu, 10 Jul 2014 19:05:28 +0000 http://perlmonks.org/index.pl?node_id=1093109 1093109 992570 2014-07-10 15:05:28 Laurent_R Re^3: Sorting By Column AppleFritter http://perlmonks.org/index.pl?node_id=1093108 You're right -- based on the sample data the OP shared, I assumed that both files would have the same number of lines. Thanks for pointing this out, I should have mentioned it explicitely.... note Thu, 10 Jul 2014 19:05:01 +0000 http://perlmonks.org/index.pl?node_id=1093108 1093108 1084031 2014-07-10 15:05:01 AppleFritter Re: installation of FireFox :: Mechanize fails - [again] Perlbeginner1 http://perlmonks.org/index.pl?node_id=1093107 hello dear Marto - hello dear Applefitter first of all - many thanks for the replies. i am happy that you have answered. @Marto: youre right;: years ago i was lucky ... note Thu, 10 Jul 2014 19:02:50 +0000 http://perlmonks.org/index.pl?node_id=1093107 1093107 861402 2014-07-10 15:02:50 Perlbeginner1 Re^2: Sorting By Column dasgar http://perlmonks.org/index.pl?node_id=1093106 I could be wrong, but I think your while loop is going to have problems if the two specified files do not have the same number of lines. If the first file has less lines than the second file, your... note Thu, 10 Jul 2014 19:02:41 +0000 http://perlmonks.org/index.pl?node_id=1093106 1093106 377770 2014-07-10 15:02:41 dasgar Re: Sorting By Column dasgar http://perlmonks.org/index.pl?node_id=1093104 I'm not sure that I totally understand what you're trying to do. It kind of sounds like you're merging multiple lists (from different files) and then wanting to do multiple column sorting of the d... note Thu, 10 Jul 2014 18:58:30 +0000 http://perlmonks.org/index.pl?node_id=1093104 1093104 377770 2014-07-10 14:58:30 dasgar Re: installation of FireFox :: Mechanize fails - [again] AppleFritter http://perlmonks.org/index.pl?node_id=1093103 This bit: you may need to install the WWW::Mechanize::Firefox module gives a valuable clue: fire up a cpan shell, and install WWW::Mechanize::Firefox... note Thu, 10 Jul 2014 18:47:49 +0000 http://perlmonks.org/index.pl?node_id=1093103 1093103 1084031 2014-07-10 14:47:49 AppleFritter Re: installation of FireFox :: Mechanize fails - [again] marto http://perlmonks.org/index.pl?node_id=1093102 At this stage I'd advise you to either look at your many previous threads on this exact topic and read the responses you have been given. Some are very in depth, you had this module installed and work... note Thu, 10 Jul 2014 18:46:44 +0000 http://perlmonks.org/index.pl?node_id=1093102 1093102 324763 2014-07-10 14:46:44 marto Re: Windows SSH Help dasgar http://perlmonks.org/index.pl?node_id=1093101 What buiild of Strawberry Perl are you using? Also, are you using the 32-bit or the 64-bit version? I just took a quick look at the release notes for the 32-bit and 64-bit versions of th... note Thu, 10 Jul 2014 18:45:36 +0000 http://perlmonks.org/index.pl?node_id=1093101 1093101 377770 2014-07-10 14:45:36 dasgar Re: Windows SSH Help AppleFritter http://perlmonks.org/index.pl?node_id=1093097 I've just tried this myself, though not using Strawberry on a Windows machine. There is indeed a dependency on <a href="http://search.cpan.org/perldoc?Math%3A%3APari">Math::Pari</a> in there somewhere, and that module in turn requires ... note Thu, 10 Jul 2014 18:07:12 +0000 http://perlmonks.org/index.pl?node_id=1093097 1093097 1084031 2014-07-10 14:07:12 AppleFritter Re: Sorting By Column Anonymous Monk http://perlmonks.org/index.pl?node_id=1093096 Your question is pretty hard to understand, to be honest. Maybe try to ask again, in a different way. Give some examples of this: The trick is that the file has 90k+ entries and line 1... note Thu, 10 Jul 2014 18:05:41 +0000 http://perlmonks.org/index.pl?node_id=1093096 1093096 961 2014-07-10 14:05:41 Anonymous Monk Re: modulino and $VERSION AppleFritter http://perlmonks.org/index.pl?node_id=1093095 UNITCHECK blocks are run right after a unit has been compiled, before runtime (see <a href="http://www.google.com/search?q=perlmod%20site%3Aperldoc.perl.org">perlmod</a>), so $VERSION has not been initialized by the time you call run()... note Thu, 10 Jul 2014 17:53:32 +0000 http://perlmonks.org/index.pl?node_id=1093095 1093095 1084031 2014-07-10 13:53:32 AppleFritter Re: [Win32] Overriding dmake's $(AS) VinsWorldcom http://perlmonks.org/index.pl?node_id=1093092 Maybe not exactly what you want, but it sounds to me like you have different versions of Perl, potentially different bit-tedness and want to be able to install / compile modules correctly fo... note Thu, 10 Jul 2014 17:27:21 +0000 http://perlmonks.org/index.pl?node_id=1093092 1093092 749850 2014-07-10 13:27:21 VinsWorldcom Re: Trapping errors AppleFritter http://perlmonks.org/index.pl?node_id=1093091 In addition to what my anonymous brother said, I'd suggest checking $@ after using eval -- when using an eval block to catch exceptions, it's a good idea to check if an exception act... note Thu, 10 Jul 2014 17:08:04 +0000 http://perlmonks.org/index.pl?node_id=1093091 1093091 1084031 2014-07-10 13:08:04 AppleFritter Re: Task orchestrator or distributed state machine choroba http://perlmonks.org/index.pl?node_id=1093090 What about <a href="http://search.cpan.org/perldoc?Workflow">Workflow</a>? I only remember I once tried to understand its documentation, but wasn't able at that time. ... note Thu, 10 Jul 2014 17:05:55 +0000 http://perlmonks.org/index.pl?node_id=1093090 1093090 832495 2014-07-10 13:05:55 choroba Re: Sorting By Column AppleFritter http://perlmonks.org/index.pl?node_id=1093087 Read the files line-by-line, split each pair of lines along whitespace, compare the relevant field, and output the lines if they differ: #!/usr/bin/perl use feature qw/say/; us... note Thu, 10 Jul 2014 17:00:08 +0000 http://perlmonks.org/index.pl?node_id=1093087 1093087 1084031 2014-07-10 13:00:08 AppleFritter Re: Trapping errors Anonymous Monk http://perlmonks.org/index.pl?node_id=1093086 I'm trying to trap those so I can get a realistic geocoding, but my error routine is just skipping it. I'm not familiar with this module, but eval{ $latl... note Thu, 10 Jul 2014 16:52:41 +0000 http://perlmonks.org/index.pl?node_id=1093086 1093086 961 2014-07-10 12:52:41 Anonymous Monk Re: Out of Memory while using Spreadsheet::XLSX runrig http://perlmonks.org/index.pl?node_id=1093084 You don't say whether you run out of memory (1) as soon as the file is parsed at: my $excel = Spreadsheet::XLSX->new($in_file); ..or (2) if you are running out of memory while you... note Thu, 10 Jul 2014 16:45:36 +0000 http://perlmonks.org/index.pl?node_id=1093084 1093084 31503 2014-07-10 12:45:36 runrig Re^2: Permanent utf8 Anonymous Monk http://perlmonks.org/index.pl?node_id=1093082 there are reasons why Unicode isn't the default Let's be frank here. The reason why UTF-8 isn't the default is that Latin-1 is the default.... note Thu, 10 Jul 2014 16:20:59 +0000 http://perlmonks.org/index.pl?node_id=1093082 1093082 961 2014-07-10 12:20:59 Anonymous Monk Re: Overloading the name of a proposed download Preceptor http://perlmonks.org/index.pl?node_id=1093081 Bah, you could have at least let me comment here too, and claim the credit twice!... note Thu, 10 Jul 2014 16:17:31 +0000 http://perlmonks.org/index.pl?node_id=1093081 1093081 168083 2014-07-10 12:17:31 Preceptor Re: Permanent utf8 AppleFritter http://perlmonks.org/index.pl?node_id=1093079 I wondered about the same thing a while ago, and was given the following "magic incantation" for defaulting to UTF-8 for both opening files and the STD* filehandles: use o... note Thu, 10 Jul 2014 16:11:18 +0000 http://perlmonks.org/index.pl?node_id=1093079 1093079 1084031 2014-07-10 12:11:18 AppleFritter wael_ahmed wael_ahmed http://perlmonks.org/index.pl?node_id=1093125 user Thu, 10 Jul 2014 21:13:52 +0000 http://perlmonks.org/index.pl?node_id=1093125 1093125 1093125 2014-07-10 17:13:52 wael_ahmed busi386 busi386 http://perlmonks.org/index.pl?node_id=1093098 user Thu, 10 Jul 2014 18:18:19 +0000 http://perlmonks.org/index.pl?node_id=1093098 1093098 1093098 2014-07-10 14:18:19 busi386 PerlCramps PerlCramps http://perlmonks.org/index.pl?node_id=1093088 user Thu, 10 Jul 2014 17:04:23 +0000 http://perlmonks.org/index.pl?node_id=1093088 1093088 1093088 2014-07-10 13:04:23 PerlCramps