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 2016-02-10 16:00:02 rss,clean Wed Feb 10 05:00:02 2016 30 20160210050002 Wed Feb 10 05:00:02 2016 http://perlmonks.org/ Anonymous Monk Listbox, radio buttons and text box in sub function? Ppeoc http://perlmonks.org/index.pl?node_id=1154859 Hi Monks! I am trying to write a sub function that returns values to the main function using TK GUI. I got the listbox working but cant seem to get the text box to return values to the main functio... perlquestion Wed, 10 Feb 2016 13:26:21 +0000 http://perlmonks.org/index.pl?node_id=1154859 1154859 1145029 2016-02-10 08:26:21 Ppeoc Error opening file handle within while loop rjc33 http://perlmonks.org/index.pl?node_id=1154838 Hi Monks, I've written a short script which loops through a file, using some information from a specific line to extract a section of the file using an external program. This section (ca... perlquestion Wed, 10 Feb 2016 12:28:28 +0000 http://perlmonks.org/index.pl?node_id=1154838 1154838 1152152 2016-02-10 07:28:28 rjc33 Special character in authorization_basic balakrishna_bk http://perlmonks.org/index.pl?node_id=1154833 Hi, I have special character ' 1. add '\' in front... perlquestion Wed, 10 Feb 2016 10:49:27 +0000 http://perlmonks.org/index.pl?node_id=1154833 1154833 1154830 2016-02-10 05:49:27 balakrishna_bk Problem reading Excel File gunther_maier http://perlmonks.org/index.pl?node_id=1154832 Dear Monks, I would appreciate help with the following problem: Situation: I download some data via a weblink, which in my web browser I can either save as XLSX-file or open in E... perlquestion Wed, 10 Feb 2016 10:44:13 +0000 http://perlmonks.org/index.pl?node_id=1154832 1154832 1154828 2016-02-10 05:44:13 gunther_maier CSV headers. Feedback wanted Tux http://perlmonks.org/index.pl?node_id=1154857 Given small CSV data files or big(ger) CSV data files with a filter so that all of the data fits into memory, the <a href="http://search.cpan.org/perldoc?Text%3A%3ACSV_XS">Text::CSV_XS</a>' <a href="https://metacpan.org/pod/Text::CSV_XS#csv">csv</a> function wi... perlmeditation Wed, 10 Feb 2016 13:18:04 +0000 http://perlmonks.org/index.pl?node_id=1154857 1154857 200365 2016-02-10 08:18:04 Tux Re^3: [OT] Software Architecture - Pipe and Filter LanX http://perlmonks.org/index.pl?node_id=1154872 I've been told that the go-language is good in such things, but can't provide much insight. Cheers Rolf (addicted to the Perl Program... note Wed, 10 Feb 2016 15:50:01 +0000 http://perlmonks.org/index.pl?node_id=1154872 1154872 708738 2016-02-10 10:50:01 LanX Re: Problem reading Excel File gunther_maier http://perlmonks.org/index.pl?node_id=1154871 Many thanks! Win32 did the trick. ... note Wed, 10 Feb 2016 15:49:52 +0000 http://perlmonks.org/index.pl?node_id=1154871 1154871 1154828 2016-02-10 10:49:52 gunther_maier Re^2: CSV headers. Feedback wanted Tux http://perlmonks.org/index.pl?node_id=1154870 key/value pairs: I think I agree, but having the thing being used most like as suggested fits better with the other methods. Nothing carved in stone yet, though defaults. Once the ... note Wed, 10 Feb 2016 15:33:26 +0000 http://perlmonks.org/index.pl?node_id=1154870 1154870 200365 2016-02-10 10:33:26 Tux Re: XML for a newbie crusty_collins http://perlmonks.org/index.pl?node_id=1154869 I think this is what you looking for. Its returning a hash ref. just deference it this way. my $C0 = $data->{'s:Body'}->{'QueryXmlResponse'}->{'QueryXmlResult'}->{'queryResult'}->{'da... note Wed, 10 Feb 2016 14:52:49 +0000 http://perlmonks.org/index.pl?node_id=1154869 1154869 458284 2016-02-10 09:52:49 crusty_collins Re: CSV headers. Feedback wanted duelafn http://perlmonks.org/index.pl?node_id=1154868 I like the idea. My comments: Take separators as a key/value pair so that as other auto-detectable features are added they can be configured as well. The auto-detectable fe... note Wed, 10 Feb 2016 14:47:40 +0000 http://perlmonks.org/index.pl?node_id=1154868 1154868 53268 2016-02-10 09:47:40 duelafn Re: Error opening file handle within while loop RichardK http://perlmonks.org/index.pl?node_id=1154867 This is always worth a read <a href="?node=Basic%20debugging%20checklist">Basic debugging checklist</a> as it contains lots of useful suggestions. BTW, I'm surprised that your code works, you write to m2.maf & then ask phastCons to read ... note Wed, 10 Feb 2016 14:09:38 +0000 http://perlmonks.org/index.pl?node_id=1154867 1154867 919638 2016-02-10 09:09:38 RichardK Re: Error opening file handle within while loop GotToBTru http://perlmonks.org/index.pl?node_id=1154866 I cannot recommend highly enough <a href="http://perldoc.perl.org/perldebtut.html">the Perl debugger</a> as a tool for troubleshooting. You can verify that variables contain expected values, that program flow follows the path you ex... note Wed, 10 Feb 2016 13:47:45 +0000 http://perlmonks.org/index.pl?node_id=1154866 1154866 844862 2016-02-10 08:47:45 GotToBTru Re^3: Unable to establish SMB2 connection using Filesys::SmbClient Corion http://perlmonks.org/index.pl?node_id=1154865 It may or may not be related, but libsmbclient seems to have (had) some peculiarities regarding the smb.conf file, as commented on in the module: # Actually ... note Wed, 10 Feb 2016 13:44:16 +0000 http://perlmonks.org/index.pl?node_id=1154865 1154865 5348 2016-02-10 08:44:16 Corion Re^2: Unable to establish SMB2 connection using Filesys::SmbClient Netras http://perlmonks.org/index.pl?node_id=1154864 That is a bit embarrassing: I changed the general smb.conf in /etc/samba, the user didnīt have one. But then I created it and added the global parameter (client max protocol) and something changed!... note Wed, 10 Feb 2016 13:36:31 +0000 http://perlmonks.org/index.pl?node_id=1154864 1154864 1154725 2016-02-10 08:36:31 Netras Re: Listbox, radio buttons and text box in sub function? choroba http://perlmonks.org/index.pl?node_id=1154863 The problem is that the line my $localpath = $entry->get(); runs before the MainLoop(), so nothing is assigned to $localpath. That's why <a href="https://metacpan.org/pod/Tk%3A%3AEntry">Entries</a> have tex... note Wed, 10 Feb 2016 13:36:31 +0000 http://perlmonks.org/index.pl?node_id=1154863 1154863 832495 2016-02-10 08:36:31 choroba Re^2: Building a URL Query String from a Data Structure dorko http://perlmonks.org/index.pl?node_id=1154862 Hi <a href="?node=thomas895">thomas895</a>, If I understand you correctly, you're suggesting something like this: use strict; use warnings; use JSON; use URI::Escape; my $json_string = JSON::to_json($perl_struct... note Wed, 10 Feb 2016 13:34:06 +0000 http://perlmonks.org/index.pl?node_id=1154862 1154862 10261 2016-02-10 08:34:06 dorko Re^8: Error opening file handle within while loop (uninitialized value in array) rjc33 http://perlmonks.org/index.pl?node_id=1154861 Was just checking, seemed to be a problem with splitting by tab (I thought it was a tab delimited file) rather than whitespace, which fixed it and gave the correct number of elements in the array. All... note Wed, 10 Feb 2016 13:33:01 +0000 http://perlmonks.org/index.pl?node_id=1154861 1154861 1152152 2016-02-10 08:33:01 rjc33 Re^7: Error opening file handle within while loop (uninitialized value in array) Corion http://perlmonks.org/index.pl?node_id=1154860 What steps have you undertaken to ascertain your assumption? For example, the following prints the number of elements in the array @columns: print 0+@columns; And... note Wed, 10 Feb 2016 13:27:44 +0000 http://perlmonks.org/index.pl?node_id=1154860 1154860 5348 2016-02-10 08:27:44 Corion Re^6: Error opening file handle within while loop (uninitialized value in array) rjc33 http://perlmonks.org/index.pl?node_id=1154858 This is a good suggestion, but there should be 7 elements in the array (or 0-6). ... note Wed, 10 Feb 2016 13:25:18 +0000 http://perlmonks.org/index.pl?node_id=1154858 1154858 1152152 2016-02-10 08:25:18 rjc33 Re^5: Error opening file handle within while loop (uninitialized value in array) hippo http://perlmonks.org/index.pl?node_id=1154856 Since you are new to coding my guess is because @columnsA (or whatever) has only 2 elements while your code thinks there are three. Arrays are indexed from zero upwards, not from one.... note Wed, 10 Feb 2016 13:16:25 +0000 http://perlmonks.org/index.pl?node_id=1154856 1154856 885521 2016-02-10 08:16:25 hippo Re^2: Unable to establish SMB2 connection using Filesys::SmbClient Netras http://perlmonks.org/index.pl?node_id=1154855 Yes, I have set the global parameter in smb.conf. And it did cause the smbclient call to work without adding the max-protocol tag (-m), so this was successful: smbclient -U domain\\user ... note Wed, 10 Feb 2016 13:12:12 +0000 http://perlmonks.org/index.pl?node_id=1154855 1154855 1154725 2016-02-10 08:12:12 Netras Re^5: Error opening file handle within while loop rjc33 http://perlmonks.org/index.pl?node_id=1154854 Hi, yes well spotted and apologies, this has been fixed. My original code contained slightly different variable names and I changed them to post here to try and simplify things, seems I made a bigger ... note Wed, 10 Feb 2016 13:11:57 +0000 http://perlmonks.org/index.pl?node_id=1154854 1154854 1152152 2016-02-10 08:11:57 rjc33 Re^2: Problem reading Excel File Yary http://perlmonks.org/index.pl?node_id=1154853 Oooops, sorry.... this is a Windows permission thing. Have you tried running your script from a prompt with Administrator permissions? I suspect you may need to look at the Win32 modules and fig... note Wed, 10 Feb 2016 13:08:58 +0000 http://perlmonks.org/index.pl?node_id=1154853 1154853 694176 2016-02-10 08:08:58 Yary Re^4: Error opening file handle within while loop rjc33 http://perlmonks.org/index.pl?node_id=1154852 $columns (or $columnsA, apologies this is just a discrepancy between versions of the script I'm testing) is filled as I expect if I print the array, however when I try to print a single column as a st... note Wed, 10 Feb 2016 13:08:01 +0000 http://perlmonks.org/index.pl?node_id=1154852 1154852 1152152 2016-02-10 08:08:01 rjc33 Re^2: Building a URL Query String from a Data Structure dorko http://perlmonks.org/index.pl?node_id=1154851 Thank you taking the time to help out a poor lost soul. I got it installed and working just before I left work yesterday. (CPAN got stuck in a seemingly infinite loop working out dependencies, ... note Wed, 10 Feb 2016 13:07:43 +0000 http://perlmonks.org/index.pl?node_id=1154851 1154851 10261 2016-02-10 08:07:43 dorko Re: Unable to establish SMB2 connection using Filesys::SmbClient Anonymous Monk http://perlmonks.org/index.pl?node_id=1154850 Did you try to <a href="http://www.freebsd.org/cgi/man.cgi?query=smb.conf&amp;manpath=SuSE+Linux/i386+11.3">configure</a> that option in your ~/.smb/smb.conf? &#91;global&#93; client max protocol = SMB2 ... note Wed, 10 Feb 2016 13:05:49 +0000 http://perlmonks.org/index.pl?node_id=1154850 1154850 961 2016-02-10 08:05:49 Anonymous Monk Re^4: Error opening file handle within while loop poj http://perlmonks.org/index.pl?node_id=1154849 Presumably you fixed this error also my $mafBlock = qx(maf_parse --start $start --end $end $maf); print OUT1 "$mafBlock1\n"; # poj... note Wed, 10 Feb 2016 13:05:07 +0000 http://perlmonks.org/index.pl?node_id=1154849 1154849 221725 2016-02-10 08:05:07 poj Re: Problem reading Excel File Yary http://perlmonks.org/index.pl?node_id=1154848 One of the most popular modules on CPAN is <a href="https://metacpan.org/pod/Spreadsheet%3A%3AParseExcel">Spreadsheet::ParseExcel</a> - and if that isn't a good fit, there are other Excel reading & writing modules out there. Search, find, install, and enj... note Wed, 10 Feb 2016 13:03:40 +0000 http://perlmonks.org/index.pl?node_id=1154848 1154848 694176 2016-02-10 08:03:40 Yary Re: Special character in authorization_basic Yary http://perlmonks.org/index.pl?node_id=1154847 Have you a sample of code that you have verified works with a "plain" password, one that doesn't contain any angle brackets? It would be good to have for comparison.... note Wed, 10 Feb 2016 12:59:59 +0000 http://perlmonks.org/index.pl?node_id=1154847 1154847 694176 2016-02-10 07:59:59 Yary Re^3: Error opening file handle within while loop rjc33 http://perlmonks.org/index.pl?node_id=1154846 Also, apologies but ignore that it says $columnsA, just a discrepancy between the script I'm currently testing and the one I've posted here. ... note Wed, 10 Feb 2016 12:58:59 +0000 http://perlmonks.org/index.pl?node_id=1154846 1154846 1152152 2016-02-10 07:58:59 rjc33 Re^3: Error opening file handle within while loop Corion http://perlmonks.org/index.pl?node_id=1154845 I would then look at the values in @columnsA, and/or how @columnsA gets filled.... note Wed, 10 Feb 2016 12:57:37 +0000 http://perlmonks.org/index.pl?node_id=1154845 1154845 5348 2016-02-10 07:57:37 Corion Re^2: Error opening file handle within while loop rjc33 http://perlmonks.org/index.pl?node_id=1154844 HI, thanks for your time. The syntax error was for the line "open (IN2, "m2.gff") or die;" but as was pointed out I was missing a ; on the preceding line. Now I get the error message: Use of uninitial... note Wed, 10 Feb 2016 12:55:46 +0000 http://perlmonks.org/index.pl?node_id=1154844 1154844 1152152 2016-02-10 07:55:46 rjc33 Re^2: Error opening file handle within while loop rjc33 http://perlmonks.org/index.pl?node_id=1154843 Wow, that was obvious! Apologies for missing such a mistake, and thanks for your answer. OUT1 is re-opened just to clear it's contents, then it is re-filled with the next section of the ... note Wed, 10 Feb 2016 12:53:35 +0000 http://perlmonks.org/index.pl?node_id=1154843 1154843 1152152 2016-02-10 07:53:35 rjc33 Re^6: Find your own monastery: "Perl 6" is not Perl, and Perl is not a Dinosaur Your Mother http://perlmonks.org/index.pl?node_id=1154842 I like this much better. The real issue to me wasn't who put bread on the table, in fact, but who did not even bring a pat of butter and commenced whining like worn break pads about how short-sight... note Wed, 10 Feb 2016 12:41:38 +0000 http://perlmonks.org/index.pl?node_id=1154842 1154842 248054 2016-02-10 07:41:38 Your Mother Re: Error opening file handle within while loop GotToBTru http://perlmonks.org/index.pl?node_id=1154841 Missing a semicolon in the print statement immediately prior to opening IN2. Why do you need to re-open OUT1? ... note Wed, 10 Feb 2016 12:36:57 +0000 http://perlmonks.org/index.pl?node_id=1154841 1154841 844862 2016-02-10 07:36:57 GotToBTru Re^2: Find your own monastery: "Perl 6" is not Perl, and Perl is not a Dinosaur syphilis http://perlmonks.org/index.pl?node_id=1154840 IMO, the reason why Perl6 has to go to a different monastery is because it deserves itI think there's merit in that POV, though I'd put it a little differently: IMO, the reason... note Wed, 10 Feb 2016 12:35:45 +0000 http://perlmonks.org/index.pl?node_id=1154840 1154840 524150 2016-02-10 07:35:45 syphilis Re: Error opening file handle within while loop Corion http://perlmonks.org/index.pl?node_id=1154839 Where do you get the syntax error, and what does it say exactly?... note Wed, 10 Feb 2016 12:31:53 +0000 http://perlmonks.org/index.pl?node_id=1154839 1154839 5348 2016-02-10 07:31:53 Corion Re: Unable to establish SMB2 connection using Filesys::SmbClient u65 http://perlmonks.org/index.pl?node_id=1154837 Welcome to the monastery, <a href="?node=Netras">Netras</a>! Have patience, some knowledgeable monk will help you eventually.... note Wed, 10 Feb 2016 12:23:19 +0000 http://perlmonks.org/index.pl?node_id=1154837 1154837 1127543 2016-02-10 07:23:19 u65 Re: Problem reading Excel File Corion http://perlmonks.org/index.pl?node_id=1154836 Without seeing code, we can only guess. My suggestion is to (re)read <a href="http://perldoc.perl.org/functions/binmode.html">binmode</a> and to apply it to the filehandle before writing the file to disk. Also, have you compared that the file... note Wed, 10 Feb 2016 11:43:56 +0000 http://perlmonks.org/index.pl?node_id=1154836 1154836 5348 2016-02-10 06:43:56 Corion Re: Find your own monastery: "Perl 6" is not Perl, and Perl is not a Dinosaur salva http://perlmonks.org/index.pl?node_id=1154835 IMO, the reason why Perl6 has to go to a different monastery is because it deserves it. For people trying to learn Perl6, looking for information here would be an impossible task. Any search wou... note Wed, 10 Feb 2016 11:11:12 +0000 http://perlmonks.org/index.pl?node_id=1154835 1154835 446266 2016-02-10 06:11:12 salva Re^5: Find your own monastery: "Perl 6" is not Perl, and Perl is not a Dinosaur Anonymous Monk http://perlmonks.org/index.pl?node_id=1154834 Indeed, this is no longer about version numbers. The feature and focus creep have made P6 an entirely different beast. It's a namespace problem now, good luck resolving that! In the wor... note Wed, 10 Feb 2016 11:00:29 +0000 http://perlmonks.org/index.pl?node_id=1154834 1154834 961 2016-02-10 06:00:29 Anonymous Monk balakrishna_bk balakrishna_bk http://perlmonks.org/index.pl?node_id=1154830 user Wed, 10 Feb 2016 10:25:30 +0000 http://perlmonks.org/index.pl?node_id=1154830 1154830 1154830 2016-02-10 05:25:30 balakrishna_bk gunther_maier gunther_maier http://perlmonks.org/index.pl?node_id=1154828 user Wed, 10 Feb 2016 10:21:49 +0000 http://perlmonks.org/index.pl?node_id=1154828 1154828 1154828 2016-02-10 05:21:49 gunther_maier haumich haumich http://perlmonks.org/index.pl?node_id=1154826 user Wed, 10 Feb 2016 10:07:37 +0000 http://perlmonks.org/index.pl?node_id=1154826 1154826 1154826 2016-02-10 05:07:37 haumich