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-23 13:11:11 rss,clean Wed Jul 23 03:11:11 2014 30 20140723031111 Wed Jul 23 03:11:11 2014 http://perlmonks.org/ Anonymous Monk Basic mod-perl question : why my variable is undefined ? pcouderc http://perlmonks.org/index.pl?node_id=1094757 O monks, I am lost with the following (simplified) script under apache and ModPerl::Registry : my $lig; ... $lig=4; print STDERR "ligA >\n"; sub xxxx { ... print STDERR "... perlquestion Wed, 23 Jul 2014 10:29:15 +0000 http://perlmonks.org/index.pl?node_id=1094757 1094757 234054 2014-07-23 06:29:15 pcouderc subroutine no error adriang http://perlmonks.org/index.pl?node_id=1094754 Hi all I realy don't understand why I dont get "Global symbol "%CS101" requires explicit" when I run: #!/usr/bin/perl # use warnings; use strict; use Carp; use 5.016; ave(... perlquestion Wed, 23 Jul 2014 10:19:53 +0000 http://perlmonks.org/index.pl?node_id=1094754 1094754 1088431 2014-07-23 06:19:53 adriang stuck during CPAN configuration all4perl http://perlmonks.org/index.pl?node_id=1094751 Dear folks, I am new to perl Monk. Please help me to solve the problem.. problem in running following command ./configure --prefix=/home/rose/temp/ bash: ./configure: No such file or directory... perlquestion Wed, 23 Jul 2014 10:04:35 +0000 http://perlmonks.org/index.pl?node_id=1094751 1094751 1094748 2014-07-23 06:04:35 all4perl Net::SMTP halts script nperrins http://perlmonks.org/index.pl?node_id=1094744 Hi Guys, This is not something I had ever considered before, but I can find no solution on the web. We have a script that loops round, does some work and sends an email with Net... perlquestion Wed, 23 Jul 2014 09:39:44 +0000 http://perlmonks.org/index.pl?node_id=1094744 1094744 1008142 2014-07-23 05:39:44 nperrins Re^2: Filter and writing error log file newtoperlprog http://perlmonks.org/index.pl?node_id=1094784 Dear All, Thank you very much for your time and suggestions. I agree Laurent R that these DNA files could be very long and loading them in an array at the beginning could pose a m... note Wed, 23 Jul 2014 13:08:02 +0000 http://perlmonks.org/index.pl?node_id=1094784 1094784 1093243 2014-07-23 09:08:02 newtoperlprog Re^12: How can I expand my substring? Anonymous Monk http://perlmonks.org/index.pl?node_id=1094783 I wrote this and it seems to work... Do you think it's correct? if($initial_string=~/((-*)(B+)(-*))/) { $total=$1; $position_total=index($initial_string, $total); $substring_unti... note Wed, 23 Jul 2014 13:03:32 +0000 http://perlmonks.org/index.pl?node_id=1094783 1094783 961 2014-07-23 09:03:32 Anonymous Monk Re^3: Basic mod-perl question : why my variable is undefined ? hippo http://perlmonks.org/index.pl?node_id=1094782 Perhaps I have not been clear enough. The string "lgeX" appears in your reported output but does not appear anywhere in your provided code. Can you explain that, please?... note Wed, 23 Jul 2014 12:52:11 +0000 http://perlmonks.org/index.pl?node_id=1094782 1094782 885521 2014-07-23 08:52:11 hippo Re^8: Append new line in excel sheets perl_new_b http://perlmonks.org/index.pl?node_id=1094781 Hi robotics, Thanks a lot. but kindly can u guide, actually i got confused at where you are appending a new row at the end in the code mentioned by you. ... note Wed, 23 Jul 2014 12:49:30 +0000 http://perlmonks.org/index.pl?node_id=1094781 1094781 1093052 2014-07-23 08:49:30 perl_new_b Re: stuck during CPAN configuration QM http://perlmonks.org/index.pl?node_id=1094780 A quick test shows that your result is consistent with ./configure not existing in the current directory. (There may be other possibilities, but this is the most likely.) If, for example, the fi... note Wed, 23 Jul 2014 12:42:04 +0000 http://perlmonks.org/index.pl?node_id=1094780 1094780 294463 2014-07-23 08:42:04 QM Re^2: Basic mod-perl question : why my variable is undefined ? pcouderc http://perlmonks.org/index.pl?node_id=1094779 Thank you. Well, there is no mistake. You see lgeX> because $lig is not correct and seems to be undef. I have simplified the code. In fact $lig is incremented in xxxx().... note Wed, 23 Jul 2014 12:32:36 +0000 http://perlmonks.org/index.pl?node_id=1094779 1094779 234054 2014-07-23 08:32:36 pcouderc Re: How can I expand my substring? GrandFather http://perlmonks.org/index.pl?node_id=1094778 use strict; use warnings; my $maxLen = 20; my @tests = ( <a href="?node=%27N%27%20.%20%28%27-%27%20x%20%28%24maxLen%20%2B%2020%29%29%20.%20%27B%27%2C%20%27N%27%20.%20%28%27-%27%20x%2020%29%20.%20%28%27B%27%20x%20%28%24maxLen%20%2B%201%29%29">&#39;N&#39; . (&#39;-&#39; x ($maxLen + 20)) . &#39;B&#39;, &#39;N&#39; . (&#39;-&#39; x 20) . (&#39;B&#39; x ($maxLen + 1))</a>, &#91;'-B' . ('-' x ($maxLen + 20)), '-B' . ('B'... note Wed, 23 Jul 2014 12:29:59 +0000 http://perlmonks.org/index.pl?node_id=1094778 1094778 461912 2014-07-23 08:29:59 GrandFather Re: Basic mod-perl question : why my variable is undefined ? hippo http://perlmonks.org/index.pl?node_id=1094777 Your reported output lgeX > does not match any of the I/O lines in your provided code. Are you perhaps confusing the $lig variable with something else? Why is $lig... note Wed, 23 Jul 2014 12:15:58 +0000 http://perlmonks.org/index.pl?node_id=1094777 1094777 885521 2014-07-23 08:15:58 hippo Re^7: Append new line in excel sheets roboticus http://perlmonks.org/index.pl?node_id=1094776 <a href="?node=perl_new_b">perl_new_b</a>: I should've read the entire thread before posting my last response. If you're just trying to convert the spreadsheets to .CSV files and add some data to the end, then it's re... note Wed, 23 Jul 2014 11:49:02 +0000 http://perlmonks.org/index.pl?node_id=1094776 1094776 533863 2014-07-23 07:49:02 roboticus Re^2: Basic mod-perl question : why my variable is undefined ? pcouderc http://perlmonks.org/index.pl?node_id=1094775 Thank you. Did you try under mod-perl ? Anyway, my script is much more complex. And sometimes the result is ok. Other times it is not.... note Wed, 23 Jul 2014 11:47:40 +0000 http://perlmonks.org/index.pl?node_id=1094775 1094775 234054 2014-07-23 07:47:40 pcouderc Re^2: Basic mod-perl question : why my variable is undefined ? pcouderc http://perlmonks.org/index.pl?node_id=1094774 Thank you. Well, I fear that you answer without knowing mod_perl. I suggest you read that http://perl.apache.org/docs/1.0/guide/porting.html#Exposing_Apache__Registry_secrets... note Wed, 23 Jul 2014 11:44:02 +0000 http://perlmonks.org/index.pl?node_id=1094774 1094774 234054 2014-07-23 07:44:02 pcouderc Re: Can I use the OO DESTROY method ... for a good cause choroba http://perlmonks.org/index.pl?node_id=1094773 crack out the attachments into files This might be <a href="http://research.swtch.com/zip">dangerous</a>. ... note Wed, 23 Jul 2014 11:44:01 +0000 http://perlmonks.org/index.pl?node_id=1094773 1094773 832495 2014-07-23 07:44:01 choroba Re^2: Basic mod-perl question : why my variable is undefined ? pcouderc http://perlmonks.org/index.pl?node_id=1094772 Thenk you, 1- You give me very muche reading. Thank you. I have read most of that many times and I am lost in it, and this is the reason that I ask. 2- OK, I know that there are problems wi... note Wed, 23 Jul 2014 11:38:44 +0000 http://perlmonks.org/index.pl?node_id=1094772 1094772 234054 2014-07-23 07:38:44 pcouderc Re^11: How to use win32::OLE with multiple versions of Microsoft Office? roboticus http://perlmonks.org/index.pl?node_id=1094771 <a href="?node=perl_new_b">perl_new_b</a>: The file and data format(s) in Excel are complex. So you're going to have to (a) use <a href="http://search.cpan.org/search?mode=module&amp;query=Win32%3A%3AOLE">Win32::OLE</a> or an equivalent to let your program tell Excel (or OpenOffice or oth... note Wed, 23 Jul 2014 11:33:24 +0000 http://perlmonks.org/index.pl?node_id=1094771 1094771 533863 2014-07-23 07:33:24 roboticus Re: Basic mod-perl question : why my variable is undefined ? kcott http://perlmonks.org/index.pl?node_id=1094770 G'day <a href="?node=pcouderc">pcouderc</a>, I was unable to replicate your results: #!/usr/bin/env perl use strict; use warnings; my $lig; #... $lig=4; print STDERR "ligA >\n"; s... note Wed, 23 Jul 2014 11:33:19 +0000 http://perlmonks.org/index.pl?node_id=1094770 1094770 861371 2014-07-23 07:33:19 kcott Re^2: Net::SMTP halts script jellisii2 http://perlmonks.org/index.pl?node_id=1094769 The version of perl you're using may come into play. If you're on a production machine and want to upgrade, I highly recommend <a href="http://perlbrew.pl">Perlbrew</a>. The more direct method of deali... note Wed, 23 Jul 2014 11:23:32 +0000 http://perlmonks.org/index.pl?node_id=1094769 1094769 554517 2014-07-23 07:23:32 jellisii2 Re: Basic mod-perl question : why my variable is undefined ? sundialsvc4 http://perlmonks.org/index.pl?node_id=1094766 Well, first of all, the usual questions ... do you have use strict; use warnings; and in that situation does it &ldquo;compile cleanly?&rdquo; Next, well, there is no... note Wed, 23 Jul 2014 11:03:28 +0000 http://perlmonks.org/index.pl?node_id=1094766 1094766 647953 2014-07-23 07:03:28 sundialsvc4 Re: Basic mod-perl question : why my variable is undefined ? Anonymous Monk http://perlmonks.org/index.pl?node_id=1094765 Write code like this, create subs that take arguments , subs that don't work on global variables, its good practice everywhere and especially for registry , see &#91;http://perl.apache.org/docs/1.0/gu... note Wed, 23 Jul 2014 11:00:09 +0000 http://perlmonks.org/index.pl?node_id=1094765 1094765 961 2014-07-23 07:00:09 Anonymous Monk Re: subroutine no error Anonymous Monk http://perlmonks.org/index.pl?node_id=1094764 Well, because my %CS101 is not a global, its a lexical , lexicals don't have package names, ... what you have there is fake global This is what you should have written my %CS101... note Wed, 23 Jul 2014 10:53:52 +0000 http://perlmonks.org/index.pl?node_id=1094764 1094764 961 2014-07-23 06:53:52 Anonymous Monk Re^2: Search/format Across Multiple Lines HDTVJohn http://perlmonks.org/index.pl?node_id=1094763 Wow! These responses greatly surpassed my expectations. Thank you Anonymous Monk for the hints and GrandFather and Athanasius for the clever and succinct coding for a soluti... note Wed, 23 Jul 2014 10:52:48 +0000 http://perlmonks.org/index.pl?node_id=1094763 1094763 1094711 2014-07-23 06:52:48 HDTVJohn Re^4: subroutine no error adriang http://perlmonks.org/index.pl?node_id=1094762 Thanks for the explanation. Now all is clear. Adrian ... note Wed, 23 Jul 2014 10:51:44 +0000 http://perlmonks.org/index.pl?node_id=1094762 1094762 1088431 2014-07-23 06:51:44 adriang Re^3: subroutine no error AppleFritter http://perlmonks.org/index.pl?node_id=1094761 Good question, actually: and my apologies, I misread your post. Looking at the script again, I think that the reason is as follows. When Perl compiles your script, the fact tha... note Wed, 23 Jul 2014 10:40:22 +0000 http://perlmonks.org/index.pl?node_id=1094761 1094761 1084031 2014-07-23 06:40:22 AppleFritter Re^2: subroutine no error adriang http://perlmonks.org/index.pl?node_id=1094760 Thanks for the quick replay. Yes, this is true but the question is why I didn't get any error? Thanks in advance ... note Wed, 23 Jul 2014 10:31:51 +0000 http://perlmonks.org/index.pl?node_id=1094760 1094760 1088431 2014-07-23 06:31:51 adriang Re^10: How to use win32::OLE with multiple versions of Microsoft Office? perl_new_b http://perlmonks.org/index.pl?node_id=1094759 I did looked them. But one requires to parse them before editing. And for large files in this case, memory goes out of bound. Also to add, I used cell handler to minimize the usage bu... note Wed, 23 Jul 2014 10:31:18 +0000 http://perlmonks.org/index.pl?node_id=1094759 1094759 1093052 2014-07-23 06:31:18 perl_new_b Re^3: Is it possible to write to STDIN ? DrHyde http://perlmonks.org/index.pl?node_id=1094758 You could close STDIN and re-open it as a normal filehandle: close(STDIN); open(STDIN, 'foo'); print $_ foreach(); The <a href="http://perldoc.perl.org/functions/open.html">documentation for 'open'</a> shows how t... note Wed, 23 Jul 2014 10:31:13 +0000 http://perlmonks.org/index.pl?node_id=1094758 1094758 84630 2014-07-23 06:31:13 DrHyde Re: subroutine no error AppleFritter http://perlmonks.org/index.pl?node_id=1094756 Howdy <a href="?node=adriang">adriang</a>, welcome back to the Monastery! You're only declaring %CS101 after calling ave(), so at the time ave is running, it does not exist ye... note Wed, 23 Jul 2014 10:27:09 +0000 http://perlmonks.org/index.pl?node_id=1094756 1094756 1084031 2014-07-23 06:27:09 AppleFritter Re^3: count number of lines with + Anonymous Monk http://perlmonks.org/index.pl?node_id=1094755 It's not a script meant to be saved to a file - it's a "one-liner", meaning a command that you enter on the command line (aka in your shell). That's the same place you would normally enter, for exa... note Wed, 23 Jul 2014 10:23:19 +0000 http://perlmonks.org/index.pl?node_id=1094755 1094755 961 2014-07-23 06:23:19 Anonymous Monk Re^2: Perl vs Angular-Node choroba http://perlmonks.org/index.pl?node_id=1094753 Facebook, IIRC, translates PHP to C++ and compiles it for better performance: <a href="http://en.wikipedia.org/wiki/Special:Search?search=HipHop%20for%20PHP">HipHop for PHP</a>. ... note Wed, 23 Jul 2014 10:16:27 +0000 http://perlmonks.org/index.pl?node_id=1094753 1094753 832495 2014-07-23 06:16:27 choroba Re: stuck during CPAN configuration marto http://perlmonks.org/index.pl?node_id=1094752 You're going to have to be specific. What are you trying to do, and to what? <a href="http://search.cpan.org/perldoc?CPAN">CPAN</a> has no configure scipt. Please read and understand <a href="?node_id=174051">How do I post a question effectively?</a> and <a href="?node_id=237057">Where should I post X?</a>.... note Wed, 23 Jul 2014 10:08:11 +0000 http://perlmonks.org/index.pl?node_id=1094752 1094752 324763 2014-07-23 06:08:11 marto Re^2: How to find the number of days with DateTime ? pcouderc http://perlmonks.org/index.pl?node_id=1094750 Thank you all. Yes, DateTime::Moonpig seems fine. ... note Wed, 23 Jul 2014 10:02:46 +0000 http://perlmonks.org/index.pl?node_id=1094750 1094750 234054 2014-07-23 06:02:46 pcouderc Re: Net::SMTP halts script Athanasius http://perlmonks.org/index.pl?node_id=1094747 According to the <a href="http://search.cpan.org/perldoc?Net%3A%3ASMTP">documentation</a>, on failure new returns undef and $@ contains an appropriate error message. This seems to work as advertised for me: ... note Wed, 23 Jul 2014 09:55:05 +0000 http://perlmonks.org/index.pl?node_id=1094747 1094747 968231 2014-07-23 05:55:05 Athanasius Re: Permanent utf8 pcouderc http://perlmonks.org/index.pl?node_id=1094746 Thank you all. I see that there is no satisfactory answer. PERL has not invented UTF8 We still remain after Babel... ... note Wed, 23 Jul 2014 09:48:44 +0000 http://perlmonks.org/index.pl?node_id=1094746 1094746 234054 2014-07-23 05:48:44 pcouderc Re^5: count number of lines with + oiskuu http://perlmonks.org/index.pl?node_id=1094745 #! /usr/bin/perl exec diffstat => @ARGV ... note Wed, 23 Jul 2014 09:41:45 +0000 http://perlmonks.org/index.pl?node_id=1094745 1094745 1057415 2014-07-23 05:41:45 oiskuu Re^2: Selling swimsuits to a drowning man eyepopslikeamosquito http://perlmonks.org/index.pl?node_id=1094743 At my employer everyone who works as a scrum team member gets certified as a Scrum Master to understand the process better Just curious, do... note Wed, 23 Jul 2014 09:37:08 +0000 http://perlmonks.org/index.pl?node_id=1094743 1094743 176576 2014-07-23 05:37:08 eyepopslikeamosquito Re^9: How to use win32::OLE with multiple versions of Microsoft Office? Corion http://perlmonks.org/index.pl?node_id=1094742 Have you looked at what <a href="http://search.cpan.org/search?mode=module&amp;query=Excel">Excel</a> shows? I recommend <a href="http://search.cpan.org/perldoc?Excel%3A%3AWriter%3A%3AXSLX">Excel::Writer::XSLX</a>, and there also is <a href="http://search.cpan.org/perldoc?Spreadsheet%3A%3ASaveParser%3A%3AWriteExcel">Spreadsheet::SaveParser::WriteExcel</a> for "modifying" spreadsheets (by loading... note Wed, 23 Jul 2014 09:19:53 +0000 http://perlmonks.org/index.pl?node_id=1094742 1094742 5348 2014-07-23 05:19:53 Corion Re^8: How to use win32::OLE with multiple versions of Microsoft Office? perl_new_b http://perlmonks.org/index.pl?node_id=1094741 Ok thanks for the reply. :) can I append a row in excel file without parsing it and without using Win32::OLE? ... note Wed, 23 Jul 2014 09:17:10 +0000 http://perlmonks.org/index.pl?node_id=1094741 1094741 1093052 2014-07-23 05:17:10 perl_new_b Re^3: Filtering out IP addresses AppleFritter http://perlmonks.org/index.pl?node_id=1094740 Great idea. Let's generalize to respect the length of each field and make the substitutions in the original text. Not matching the original field lengths ... note Wed, 23 Jul 2014 09:16:49 +0000 http://perlmonks.org/index.pl?node_id=1094740 1094740 1084031 2014-07-23 05:16:49 AppleFritter Re: Filtering out IP addresses wjw http://perlmonks.org/index.pl?node_id=1094737 This seems to work as well, though obviously not a 1 liner.. #!/usr/bin/perl use Modern::Perl qw(2014); while () { my @octets = split('\.',$_); chomp @octets; f... note Wed, 23 Jul 2014 08:34:27 +0000 http://perlmonks.org/index.pl?node_id=1094737 1094737 310300 2014-07-23 04:34:27 wjw Re^4: count number of lines with + ladnjay http://perlmonks.org/index.pl?node_id=1094736 below is a sample. i should get the output as 2. counting lines starting by a single + and also not being the only character in the line. I know its tricky, thank you for helping me. thanks. ... note Wed, 23 Jul 2014 08:27:53 +0000 http://perlmonks.org/index.pl?node_id=1094736 1094736 1094596 2014-07-23 04:27:53 ladnjay Re^2: Insecure Environment ? dave_the_m http://perlmonks.org/index.pl?node_id=1094735 you can use local to create a lexically-scoped version of the variable Strictly speaking, local is dynamically scoped rather than lexically scoped. Dave.... note Wed, 23 Jul 2014 07:55:35 +0000 http://perlmonks.org/index.pl?node_id=1094735 1094735 341121 2014-07-23 03:55:35 dave_the_m Re^3: count number of lines with + vinoth.ree http://perlmonks.org/index.pl?node_id=1094734 Could you please share your sample input data, I will check with my script and let you know. All is well ... note Wed, 23 Jul 2014 07:18:34 +0000 http://perlmonks.org/index.pl?node_id=1094734 1094734 734134 2014-07-23 03:18:34 vinoth.ree Re^10: Append new line in excel sheets CountZero http://perlmonks.org/index.pl?node_id=1094733 Honestly, I have no idea. You will have to check the documentation, but as it is "only" a viewer I really doubt it can even export, let alone change, the data in Excel.... note Wed, 23 Jul 2014 07:17:33 +0000 http://perlmonks.org/index.pl?node_id=1094733 1094733 198160 2014-07-23 03:17:33 CountZero Re: My favorite superfluous repetitious redundant duplicative phrase is: hdb http://perlmonks.org/index.pl?node_id=1094732 Most optimal... ... note Wed, 23 Jul 2014 07:16:22 +0000 http://perlmonks.org/index.pl?node_id=1094732 1094732 1021810 2014-07-23 03:16:22 hdb Re^7: How to use win32::OLE with multiple versions of Microsoft Office? Anonymous Monk http://perlmonks.org/index.pl?node_id=1094731 can I use Win32::OLE without installing MS Office?? Sure, for other things, like controlling internet explorer (some versions of), but not for controlling MS Office, you need MS offic... note Wed, 23 Jul 2014 07:16:18 +0000 http://perlmonks.org/index.pl?node_id=1094731 1094731 961 2014-07-23 03:16:18 Anonymous Monk Re^6: How to use win32::OLE with multiple versions of Microsoft Office? perl_new_b http://perlmonks.org/index.pl?node_id=1094730 Hi guys, can I use Win32::OLE without installing MS Office?? Kindly suggest me something for this. ... note Wed, 23 Jul 2014 07:12:13 +0000 http://perlmonks.org/index.pl?node_id=1094730 1094730 1093052 2014-07-23 03:12:13 perl_new_b NimoBiotech NimoBiotech http://perlmonks.org/index.pl?node_id=1094767 user Wed, 23 Jul 2014 11:12:48 +0000 http://perlmonks.org/index.pl?node_id=1094767 1094767 1094767 2014-07-23 07:12:48 NimoBiotech all4perl all4perl http://perlmonks.org/index.pl?node_id=1094748 user Wed, 23 Jul 2014 09:58:50 +0000 http://perlmonks.org/index.pl?node_id=1094748 1094748 1094748 2014-07-23 05:58:50 all4perl amit4perl amit4perl http://perlmonks.org/index.pl?node_id=1094738 user Wed, 23 Jul 2014 09:10:56 +0000 http://perlmonks.org/index.pl?node_id=1094738 1094738 1094738 2014-07-23 05:10:56 amit4perl