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-01-28 23:54:12 rss,clean Wed Jan 28 12:54:12 2015 30 20150128125412 Wed Jan 28 12:54:12 2015 http://perlmonks.org/ Anonymous Monk hash symbolic references numele http://perlmonks.org/index.pl?node_id=1114835 I have a piece of code that works, but when I add use strict I get an error "Can't use string ("0") as a HASH ref while "strict refs" in use" I comment out use strict and its fine. ... perlquestion Wed, 28 Jan 2015 23:46:57 +0000 http://perlmonks.org/index.pl?node_id=1114835 1114835 1114563 2015-01-28 18:46:57 numele Converting tesseract box data into 2d grid Anonymous Monk http://perlmonks.org/index.pl?node_id=1114833 I'm using Tesseract to OCR images to read puzzle data. The problem is that Tesseract squashes whitespace so messes with the positions of the found characters. It does have an option to output the boun... perlquestion Wed, 28 Jan 2015 23:43:07 +0000 http://perlmonks.org/index.pl?node_id=1114833 1114833 961 2015-01-28 18:43:07 Anonymous Monk How can I use the pack manager to divide space equally between two buttons? tkguifan http://perlmonks.org/index.pl?node_id=1114827 Currently I have a delete button which is as wide as the application window. $self->{delete_button} = $mw->Button( -text => 'Delete', -command=> <a href="?node=%20%5C%26delete%20%2C%20%24self%20"> \&amp;delete , $self </a> )->pack( -expand => '1'... perlquestion Wed, 28 Jan 2015 23:09:07 +0000 http://perlmonks.org/index.pl?node_id=1114827 1114827 1114745 2015-01-28 18:09:07 tkguifan How to select limited rows randomly in DBIx::Class? phildeman http://perlmonks.org/index.pl?node_id=1114821 Does anyone know how to query a database by randomly selecting limited rows. I know how to do it in SQL. I want to convert this: SELECT column FROM table ORDER BY RAND() LIMIT 20; ... perlquestion Wed, 28 Jan 2015 22:08:13 +0000 http://perlmonks.org/index.pl?node_id=1114821 1114821 518417 2015-01-28 17:08:13 phildeman Learning about Arrays and Hashes - printing pieces of them Anonymous Monk http://perlmonks.org/index.pl?node_id=1114801 I am trying to learn Perl. I have gotten to the section on lists, arrays and hashes. I read through the tutorials, perlman and perldsc. I want to make sure I understand the following snippet from o... perlquestion Wed, 28 Jan 2015 19:23:15 +0000 http://perlmonks.org/index.pl?node_id=1114801 1114801 961 2015-01-28 14:23:15 Anonymous Monk Get only unique values into array Anonymous Monk http://perlmonks.org/index.pl?node_id=1114799 Hi there Monks! I am trying to check if this particular value already is in this array to avoid having duplicated values in it. I just can't get this code to work. I have this code... perlquestion Wed, 28 Jan 2015 18:59:44 +0000 http://perlmonks.org/index.pl?node_id=1114799 1114799 961 2015-01-28 13:59:44 Anonymous Monk German Perl Workshop 6..8 May 2015 Registration open, Call for Papers Happy-the-monk http://perlmonks.org/index.pl?node_id=1114815 Links in this post lead to mostly German language web sites. Translating an email message originally written in German by <a href="?node=reneeb">reneeb</a>: Hi Perl mongers, By now you will... perlnews Wed, 28 Jan 2015 20:21:30 +0000 http://perlmonks.org/index.pl?node_id=1114815 1114815 146055 2015-01-28 15:21:30 Happy-the-monk Re: How can I use the pack manager to divide space equally between two buttons? Eily http://perlmonks.org/index.pl?node_id=1114834 My crystal ball might be broken because it won't tell me what module you are using. But for some reason I think you are doing Tk GUIs, <a href="?node=tkguifan">tkguifan</a>. Just a huncht. But please do think about giving mo... note Wed, 28 Jan 2015 23:43:36 +0000 http://perlmonks.org/index.pl?node_id=1114834 1114834 1039428 2015-01-28 18:43:36 Eily Re^2: How can I access object data in a user defined sort cmp function? sundialsvc4 http://perlmonks.org/index.pl?node_id=1114832 &ldquo;Schweee-e-ee-t!&rdquo; &nbsp; An extremely elegant solution. ++ &nbsp; ++ &nbsp; ++ &nbsp; ... And, just for completeness, just for the &ld... note Wed, 28 Jan 2015 23:38:38 +0000 http://perlmonks.org/index.pl?node_id=1114832 1114832 647953 2015-01-28 18:38:38 sundialsvc4 Re: How to select limited rows randomly in DBIx::Class? Your Mother http://perlmonks.org/index.pl?node_id=1114831 :P my @tickers = $schema ->resultset('TickerTable') ->search({}, { order_by => \"RAND()", columns => <a href="?node=%27DisplayName%27">&#39;DisplayName&#39;</a>, rows => 20 }); ... note Wed, 28 Jan 2015 23:25:47 +0000 http://perlmonks.org/index.pl?node_id=1114831 1114831 248054 2015-01-28 18:25:47 Your Mother Re: Get only unique values into array stonecolddevin http://perlmonks.org/index.pl?node_id=1114830 Take a look at <a href="http://metacpan.org/search?q=Set%3A%3AScalar">Set::Scalar</a>. Three thousand years of beautiful trad... note Wed, 28 Jan 2015 23:23:17 +0000 http://perlmonks.org/index.pl?node_id=1114830 1114830 203787 2015-01-28 18:23:17 stonecolddevin Re: How can I access object data in a user defined sort cmp function? mr_mischief http://perlmonks.org/index.pl?node_id=1114829 If sorting is something you care about within your class, then don't tell sort how to handle your object. Design a method that sorts your data within the object. ... note Wed, 28 Jan 2015 23:15:23 +0000 http://perlmonks.org/index.pl?node_id=1114829 1114829 62512 2015-01-28 18:15:23 mr_mischief Re^2: How to Encrypt Authentication and Data to DB? stonecolddevin http://perlmonks.org/index.pl?node_id=1114828 (SHA1 is recommended today over MD5) Use <a href="http://metacpan.org/search?q=Crypt%3A%3AEksblowfish%3A%3ABcrypt">Crypt::Eksblowfish::Bcrypt</a> if you're doing any sort of encryption like this. I mean, MD5 sh... note Wed, 28 Jan 2015 23:13:40 +0000 http://perlmonks.org/index.pl?node_id=1114828 1114828 203787 2015-01-28 18:13:40 stonecolddevin Re^2: How can I access object data in a user defined sort cmp function? sundialsvc4 http://perlmonks.org/index.pl?node_id=1114826 &lbrack;deleted: got attached to the wrong reply!!&rbrack; ... note Wed, 28 Jan 2015 22:59:47 +0000 http://perlmonks.org/index.pl?node_id=1114826 1114826 647953 2015-01-28 17:59:47 sundialsvc4 Re^3: How to read contents of a file without opening it and print the contents LanX http://perlmonks.org/index.pl?node_id=1114825 It took you 4 years to return to this thread? Wow! Could it be that your assignment is rather HTTP than regex related? but even then .... a very stupid question. update ... note Wed, 28 Jan 2015 22:53:29 +0000 http://perlmonks.org/index.pl?node_id=1114825 1114825 708738 2015-01-28 17:53:29 LanX Re^2: How to read contents of a file without opening it and print the contents Anonymous Monk http://perlmonks.org/index.pl?node_id=1114824 I am attempting to fulfill an assignment that involves searching the file using regular expressions. "write a script called xxx.pl. This script should read the contents of /httpd/conf/httpd.conf wi... note Wed, 28 Jan 2015 22:48:53 +0000 http://perlmonks.org/index.pl?node_id=1114824 1114824 961 2015-01-28 17:48:53 Anonymous Monk Re: Breaking the indecipherable cipher, courtesy Charles Babbage. Anonymous Monk http://perlmonks.org/index.pl?node_id=1114823 prophicies this is david anthony winans clark asvab of 91 aout god world goverments people death hope love lust love yahshua coming back and human and satan thinking that we have any chance against a ... note Wed, 28 Jan 2015 22:16:09 +0000 http://perlmonks.org/index.pl?node_id=1114823 1114823 961 2015-01-28 17:16:09 Anonymous Monk Re: How to select limited rows randomly in DBIx::Class? erix http://perlmonks.org/index.pl?node_id=1114822 Can you say what database (DBMS) this should work in?... note Wed, 28 Jan 2015 22:12:08 +0000 http://perlmonks.org/index.pl?node_id=1114822 1114822 399498 2015-01-28 17:12:08 erix Re: How to Encrypt Authentication and Data to DB? nikosv http://perlmonks.org/index.pl?node_id=1114820 Oracle supports network level encryption,which means all your data and passwords can be transfered over SSL. You don't have to encrypt and decrypt credentials yourself Check &#91;href://... note Wed, 28 Jan 2015 22:03:31 +0000 http://perlmonks.org/index.pl?node_id=1114820 1114820 658643 2015-01-28 17:03:31 nikosv Re^3: The Boy Scout Rule RonW http://perlmonks.org/index.pl?node_id=1114819 Software does get treated differently. The perception being that is is "soft", therefore malleable. Our requirements group prepares requirements for 3 other groups: Mechanical, Electrical a... note Wed, 28 Jan 2015 21:53:46 +0000 http://perlmonks.org/index.pl?node_id=1114819 1114819 1080444 2015-01-28 16:53:46 RonW Re^4: localtime function Anonymous Monk http://perlmonks.org/index.pl?node_id=1114818 Without knowing what your input file exactly looks like, I can only guess that the problem is that you've got "invalid" time values in there that you might want to filter out or fix when converting... note Wed, 28 Jan 2015 21:36:07 +0000 http://perlmonks.org/index.pl?node_id=1114818 1114818 961 2015-01-28 16:36:07 Anonymous Monk Re^4: In place editing without reading further trippledubs http://perlmonks.org/index.pl?node_id=1114814 Okay. Here is the code I came up with attempting to implement your suggestion and anon's. I will adopt for the real deal shortly and post soon. HEADER a1 a2 a3 a4 a5 a6 a7 a8 a9 a... note Wed, 28 Jan 2015 20:21:22 +0000 http://perlmonks.org/index.pl?node_id=1114814 1114814 979877 2015-01-28 15:21:22 trippledubs Re^3: Learning about Arrays and Hashes - printing pieces of them NetWallah http://perlmonks.org/index.pl?node_id=1114813 You can answer these questions by running the code yourself, under the perl built-in debugger. Just run you rprogam like this: perl -d Inside the debugger pro... note Wed, 28 Jan 2015 20:10:46 +0000 http://perlmonks.org/index.pl?node_id=1114813 1114813 159887 2015-01-28 15:10:46 NetWallah Re^2: Get only unique values into array Anonymous Monk http://perlmonks.org/index.pl?node_id=1114812 Yes, as long as it will only have unique values in there. I don't see any other way.... note Wed, 28 Jan 2015 20:05:26 +0000 http://perlmonks.org/index.pl?node_id=1114812 1114812 961 2015-01-28 15:05:26 Anonymous Monk Re^3: use sqlldr with perl CountZero http://perlmonks.org/index.pl?node_id=1114811 What do you mean with "pre-treatment" of the data text? The perl part of your program does not do anything with the data-file. ... note Wed, 28 Jan 2015 20:04:01 +0000 http://perlmonks.org/index.pl?node_id=1114811 1114811 198160 2015-01-28 15:04:01 CountZero Re^2: Get only unique values into array Laurent_R http://perlmonks.org/index.pl?node_id=1114810 Hum, it looks like what you are asking is more complicated than what I originally understood. And I am not sure I do understand what your are asking... ... note Wed, 28 Jan 2015 20:01:17 +0000 http://perlmonks.org/index.pl?node_id=1114810 1114810 992570 2015-01-28 15:01:17 Laurent_R Re: Get only unique values into array Anonymous Monk http://perlmonks.org/index.pl?node_id=1114809 @loop_names = map /$row_data{FULL_NAME}/ ? () : $_, @loop_names; @loop_names doesn't contain strings, it has hashrefs, which stringify to something useless. So that's not going to wo... note Wed, 28 Jan 2015 19:59:50 +0000 http://perlmonks.org/index.pl?node_id=1114809 1114809 961 2015-01-28 14:59:50 Anonymous Monk Re^2: Learning about Arrays and Hashes - printing pieces of them Anonymous Monk http://perlmonks.org/index.pl?node_id=1114808 Hi Mom! I see my dog forgot to point to my hound.... I was missing the > pointing to hound. Thank you! What happens when I try: print $rec -> <a href="?node=Buick">Buick</a>, "\n"; Does that... note Wed, 28 Jan 2015 19:56:23 +0000 http://perlmonks.org/index.pl?node_id=1114808 1114808 961 2015-01-28 14:56:23 Anonymous Monk Re: Get only unique values into array pme http://perlmonks.org/index.pl?node_id=1114805 You can do this way: my %h = map { $_, 1 } @arr; my @uniq_arr = keys %h; or module <a href="http://search.cpan.org/perldoc?List%3A%3AMoreUtils">List::MoreUtils</a> can be used. ... note Wed, 28 Jan 2015 19:53:59 +0000 http://perlmonks.org/index.pl?node_id=1114805 1114805 104470 2015-01-28 14:53:59 pme Re: Get only unique values into array poj http://perlmonks.org/index.pl?node_id=1114804 # I just want @loop_names to have what is unique # add --------------- @loop_names = map { $_->{'NAMES'}=~/$row_data{FULL_NAME}/ ? () : $_ } @loop_names; ... note Wed, 28 Jan 2015 19:53:59 +0000 http://perlmonks.org/index.pl?node_id=1114804 1114804 221725 2015-01-28 14:53:59 poj Re: Get only unique values into array Laurent_R http://perlmonks.org/index.pl?node_id=1114803 Whenever you think about unique value, think hash. In other terms, use a hash to check whether the value has already been seen. ... note Wed, 28 Jan 2015 19:49:09 +0000 http://perlmonks.org/index.pl?node_id=1114803 1114803 992570 2015-01-28 14:49:09 Laurent_R Re: Learning about Arrays and Hashes - printing pieces of them Your Mother http://perlmonks.org/index.pl?node_id=1114802 You have an error in the LOOKUP hashref. Here’s a simplified version that will output what you expect– use strict; use warnings; my $rec = { TEXT => "Fred loves Ethel", ... note Wed, 28 Jan 2015 19:29:17 +0000 http://perlmonks.org/index.pl?node_id=1114802 1114802 248054 2015-01-28 14:29:17 Your Mother Re^3: How can I access object data in a user defined sort cmp function? LanX http://perlmonks.org/index.pl?node_id=1114800 just if hacked directly and uncompiled like in this case, Python would be a muuuuuuuuuch bigger mess. Cheers Rolf PS: &#91;http://www.perlmo... note Wed, 28 Jan 2015 19:11:00 +0000 http://perlmonks.org/index.pl?node_id=1114800 1114800 708738 2015-01-28 14:11:00 LanX Re^2: How can I access object data in a user defined sort cmp function? Laurent_R http://perlmonks.org/index.pl?node_id=1114798 (I came to the conclusion Guido was right about whitespace) Hilarious! ++ ... note Wed, 28 Jan 2015 18:58:15 +0000 http://perlmonks.org/index.pl?node_id=1114798 1114798 992570 2015-01-28 13:58:15 Laurent_R Re^3: How can I access object data in a user defined sort cmp function? LanX http://perlmonks.org/index.pl?node_id=1114797 your code is very hard to read and your real intention hard to guess. I wanted to show another way, with one method ->sort combined with various ->by_val , ->by_something bu... note Wed, 28 Jan 2015 18:54:07 +0000 http://perlmonks.org/index.pl?node_id=1114797 1114797 708738 2015-01-28 13:54:07 LanX Re^3: poll ideas quest 2015 chacham http://perlmonks.org/index.pl?node_id=1114796 Good points. The second and third options seem like answers to "How do you find movies you might want to watch?" The first and fourth seems like answers to "When presented with a mov... note Wed, 28 Jan 2015 18:36:37 +0000 http://perlmonks.org/index.pl?node_id=1114796 1114796 934209 2015-01-28 13:36:37 chacham Re^3: How can I access object data in a user defined sort cmp function? LanX http://perlmonks.org/index.pl?node_id=1114795 &gt; but whenever I type TAB, it takes me off the edit box <a href="https://www.youtube.com/watch?v=XCbAEkfXSDE">SPACE! Man!</a> ;-) Cheers Rol... note Wed, 28 Jan 2015 18:19:26 +0000 http://perlmonks.org/index.pl?node_id=1114795 1114795 708738 2015-01-28 13:19:26 LanX slangridge slangridge http://perlmonks.org/index.pl?node_id=1114816 user Wed, 28 Jan 2015 21:10:24 +0000 http://perlmonks.org/index.pl?node_id=1114816 1114816 1114816 2015-01-28 16:10:24 slangridge misterduh misterduh http://perlmonks.org/index.pl?node_id=1114806 user Wed, 28 Jan 2015 19:55:10 +0000 http://perlmonks.org/index.pl?node_id=1114806 1114806 1114806 2015-01-28 14:55:10 misterduh Samsung star pro Samsung star pro http://perlmonks.org/index.pl?node_id=1114793 user Wed, 28 Jan 2015 18:11:48 +0000 http://perlmonks.org/index.pl?node_id=1114793 1114793 1114793 2015-01-28 13:11:48 Samsung star pro