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-09-16 09:26:36 rss,clean Mon Sep 15 23:26:36 2014 30 20140915232636 Mon Sep 15 23:26:36 2014 http://perlmonks.org/ Anonymous Monk How to push the first two elements of an array in another array Anonymous Monk http://perlmonks.org/index.pl?node_id=1100715 Hey Monks, I have a simple question, i really do not know, how to write it down. I have an Array @array1 = (1,2,3,4,5); and I want the first two elements (1 and 2) use in an... perlquestion Tue, 16 Sep 2014 09:25:32 +0000 http://perlmonks.org/index.pl?node_id=1100715 1100715 961 2014-09-16 05:25:32 Anonymous Monk Net::SSH2 to capture multiple commands on remote system bellis http://perlmonks.org/index.pl?node_id=1100705 Hello Monks, Long time viewer, first time poster. Love the work of everyone in this community. I am attempting to SSH into a node, run and capture various different commands, th... perlquestion Tue, 16 Sep 2014 07:46:43 +0000 http://perlmonks.org/index.pl?node_id=1100705 1100705 1100699 2014-09-16 03:46:43 bellis Net::SSH2 to capture multiple commands on remote system Anonymous Monk http://perlmonks.org/index.pl?node_id=1100704 Hello Monks, Long time viewer, first time poster. Love the work of everyone in this community. I am attempting to SSH into a node, run and capture various different commands, th... perlquestion Tue, 16 Sep 2014 07:44:07 +0000 http://perlmonks.org/index.pl?node_id=1100704 1100704 961 2014-09-16 03:44:07 Anonymous Monk How to access hash and push it in scalar variable Anonymous Monk http://perlmonks.org/index.pl?node_id=1100694 Hey Monks, I have a Little question for you and I hope you can help me. I have a hash, which Looks like this: VAR1 = 'key' => { 'individual name' = > &#91; <a href="?node=coordinates">coordinates</a>, <a href="?node=Rotation">Rotation</a>, &#91;... perlquestion Tue, 16 Sep 2014 06:28:06 +0000 http://perlmonks.org/index.pl?node_id=1100694 1100694 961 2014-09-16 02:28:06 Anonymous Monk Reaped: nike ͨ؜ NodeReaper http://perlmonks.org/index.pl?node_id=1100702 This node was taken out by the <a href="?node=NodeReaper">NodeReaper</a> on Sep 16, 2014 at 07:43&nbsp;UTCReason: &#91;<a href="?node=erix">erix</a>&#93;: reap without reading!You may view &#91;href://?node=Visit%20Reaped%20Nodes&nodenum=1100702|the... poem Tue, 16 Sep 2014 07:19:08 +0000 http://perlmonks.org/index.pl?node_id=1100702 1100702 52855 2014-09-16 03:19:08 NodeReaper Re^2: The Case for Macros in Perl BrowserUk http://perlmonks.org/index.pl?node_id=1100714 I like to see, right there in front of me, the source-code that the interpreter is going to finally execute. That makes as much sense as &#91;http://www.bbc.co.uk... note Tue, 16 Sep 2014 09:21:51 +0000 http://perlmonks.org/index.pl?node_id=1100714 1100714 171588 2014-09-16 05:21:51 BrowserUk Re^2: Perl CGI + Bash script output in wrong order Anonymous Monk http://perlmonks.org/index.pl?node_id=1100713 Hi Hari, I am in a similar situation and would request your help. can you please elaborate on how did you fix the issue? Thanks RS... note Tue, 16 Sep 2014 08:58:11 +0000 http://perlmonks.org/index.pl?node_id=1100713 1100713 961 2014-09-16 04:58:11 Anonymous Monk Re^2: How to access hash and push it in scalar variable Anonymous Monk http://perlmonks.org/index.pl?node_id=1100712 thank you a lot. works perfektly for me!!... note Tue, 16 Sep 2014 08:52:38 +0000 http://perlmonks.org/index.pl?node_id=1100712 1100712 961 2014-09-16 04:52:38 Anonymous Monk Re: Net::SSH2 to capture multiple commands on remote system salva http://perlmonks.org/index.pl?node_id=1100711 Well, nothing stops you from pushing the retrieved data in an array instead of passing it to print. For instance: $chan->shell(); print $chan "$cmd1\n"; @out1 = ; print $chan "$cmd2\... note Tue, 16 Sep 2014 08:44:29 +0000 http://perlmonks.org/index.pl?node_id=1100711 1100711 446266 2014-09-16 04:44:29 salva Re^5: poll ideas quest 2014 soonix http://perlmonks.org/index.pl?node_id=1100710 I guess it simply uses "<a href="http://$language.wikipedia.org/wiki/$whateverthetextis">http://$language.wikipedia.org/wiki/$whateverthetextis</a>". The most correct, but convoluted way would be to use node author's language to look up the entry, get th... note Tue, 16 Sep 2014 08:37:54 +0000 http://perlmonks.org/index.pl?node_id=1100710 1100710 1015412 2014-09-16 04:37:54 soonix Re^3: How to filter few key value pairs from hash reference choroba http://perlmonks.org/index.pl?node_id=1100709 Typically, I would use a hash slice Time to upgrade to 5.20, it seems: <a href="http://perldoc.perl.org/perl5200delta.html#New-slice-syntax">New slice syntax</a>. ... note Tue, 16 Sep 2014 08:21:52 +0000 http://perlmonks.org/index.pl?node_id=1100709 1100709 832495 2014-09-16 04:21:52 choroba Re^4: issue with DBI and MS SQL SERVER DanBev http://perlmonks.org/index.pl?node_id=1100708 yes, of course. The configuration file is in /usr/local/etc/freetds.conf (depends by version anyway). It's recommended to add an entry for your database connection, such this &#91;MY_DB_NAM... note Tue, 16 Sep 2014 07:53:12 +0000 http://perlmonks.org/index.pl?node_id=1100708 1100708 1100604 2014-09-16 03:53:12 DanBev Re: generating an array of array AnomalousMonk http://perlmonks.org/index.pl?node_id=1100707 <a href="?node=Marshall">Marshall</a>: You appear to have deleted part or all of your OP. This is considered inconsiderate here in the Monastery. Please see <a href="?node_id=174051">How do I post a question effectively?</a>, especially the second point under "And a few added... note Tue, 16 Sep 2014 07:49:32 +0000 http://perlmonks.org/index.pl?node_id=1100707 1100707 634253 2014-09-16 03:49:32 AnomalousMonk Re: MySQL Parameterized Query with Functions mje http://perlmonks.org/index.pl?node_id=1100706 As others have explained you cannot change the SQL itself with parameters, you can only change values. However, there should be no reason why you cannot use: insert into download_log... note Tue, 16 Sep 2014 07:48:45 +0000 http://perlmonks.org/index.pl?node_id=1100706 1100706 492557 2014-09-16 03:48:45 mje Re^3: Removing everything before the first comma separator on each line of a text file soonix http://perlmonks.org/index.pl?node_id=1100703 nope, <a href="http://perldoc.perl.org/functions/split.html">split</a> leaves the delimiters in after the LIMIT (just tested with perl 5.14.2). Admittedly, the <a href="http://perldoc.perl.org/functions/split.html">documentation</a> says "substrings (called "fields") that do not ... note Tue, 16 Sep 2014 07:37:25 +0000 http://perlmonks.org/index.pl?node_id=1100703 1100703 1015412 2014-09-16 03:37:25 soonix Re^2: Removing everything before the first comma separator on each line of a text file Tux http://perlmonks.org/index.pl?node_id=1100701 Not that his example has empty first fields, but your regexes will keep the comma of leading empty fields, which IMHO is not correct. ... note Tue, 16 Sep 2014 07:12:37 +0000 http://perlmonks.org/index.pl?node_id=1100701 1100701 200365 2014-09-16 03:12:37 Tux Re: How to access hash and push it in scalar variable Athanasius http://perlmonks.org/index.pl?node_id=1100696 This should get you started: #! perl use strict; use warnings; my %hash = ( key => {'individual name' => &#91;<a href="?node=%27coordinates%27">&#39;coordinates&#39;</a>, <a href="?node=%27Rotation%27">&#39;Rotation&#39;</a>, <a href="?node=%27height%27">&#39;height&#39;</a>&#93;}, ); my $coords ... note Tue, 16 Sep 2014 06:41:20 +0000 http://perlmonks.org/index.pl?node_id=1100696 1100696 968231 2014-09-16 02:41:20 Athanasius Re: Removing everything before the first comma separator on each line of a text file Laurent_R http://perlmonks.org/index.pl?node_id=1100695 You may just apply one of the following regexes: s/^<a href="?node=%5E%2C">^,</a>+,//; or s/^.+?,//; to each line of input. ... note Tue, 16 Sep 2014 06:30:14 +0000 http://perlmonks.org/index.pl?node_id=1100695 1100695 992570 2014-09-16 02:30:14 Laurent_R Re^2: Removing everything before the first comma separator on each line of a text file Tux http://perlmonks.org/index.pl?node_id=1100693 That will remove all the comma's from the rest of the line. It will also break if one of the fields is quoted and contains a newline. Bad advice update: The comma aft... note Tue, 16 Sep 2014 06:21:31 +0000 http://perlmonks.org/index.pl?node_id=1100693 1100693 200365 2014-09-16 02:21:31 Tux Re: regex multi-line Laurent_R http://perlmonks.org/index.pl?node_id=1100692 From what I gathered from another post this: "s*(.+?)\s*" should get me to the next line because *s in this context is line feed. Do you mean s* or *s? In both cases, I wonder where you've ... note Tue, 16 Sep 2014 06:20:40 +0000 http://perlmonks.org/index.pl?node_id=1100692 1100692 992570 2014-09-16 02:20:40 Laurent_R Re: Removing everything before the first comma separator on each line of a text file Tux http://perlmonks.org/index.pl?node_id=1100691 You declare a <a href="http://search.cpan.org/perldoc?Text%3A%3ACSV">Text::CSV</a> object but you don't use it. Dit you read <a href="https://metacpan.org/pod/Text::CSV">its docs</a>? If you safely want to drop the first column, here's a simple alterna... note Tue, 16 Sep 2014 06:19:39 +0000 http://perlmonks.org/index.pl?node_id=1100691 1100691 200365 2014-09-16 02:19:39 Tux Re: How to filter few key value pairs from hash reference einhverfr http://perlmonks.org/index.pl?node_id=1100690 A simple way to do this would be to copy using map and grep. Note since you are doing this multiple times you will probably be better off with a for loop in this case, but this is good to know bec... note Tue, 16 Sep 2014 05:43:57 +0000 http://perlmonks.org/index.pl?node_id=1100690 1100690 615234 2014-09-16 01:43:57 einhverfr Re^2: generating an array of array Marshall http://perlmonks.org/index.pl?node_id=1100689 I did bollix the she-bang line! No doubt about it. Under Windows, this doesn't matter. Under Unix, this matters a lot. The AofA works with formatting suggestions. I just screwed up with missi... note Tue, 16 Sep 2014 05:26:24 +0000 http://perlmonks.org/index.pl?node_id=1100689 1100689 732669 2014-09-16 01:26:24 Marshall Re: generating an array of array GrandFather http://perlmonks.org/index.pl?node_id=1100686 I strongly recommend you use use warnings which will give you some information about your problem even with a bollixed bang-splat line. Your first line should include a !, although if you ar... note Tue, 16 Sep 2014 04:18:28 +0000 http://perlmonks.org/index.pl?node_id=1100686 1100686 461912 2014-09-16 00:18:28 GrandFather Re^3: Multiline Regex replacement in Multiline file Athanasius http://perlmonks.org/index.pl?node_id=1100685 Hello again, <a href="?node=akamboj84">akamboj84</a>, But I wanted to avoid the below "for" loop and instead do multi regex replacement. ...as my regex file is a long one and also i n... note Tue, 16 Sep 2014 03:57:59 +0000 http://perlmonks.org/index.pl?node_id=1100685 1100685 968231 2014-09-15 23:57:59 Athanasius Re: generating an array of array Cristoforo http://perlmonks.org/index.pl?node_id=1100684 You need to have your list enclosed with parenthesis.... note Tue, 16 Sep 2014 03:47:02 +0000 http://perlmonks.org/index.pl?node_id=1100684 1100684 421781 2014-09-15 23:47:02 Cristoforo Re: Can't locate, But it IS there! thewebsi http://perlmonks.org/index.pl?node_id=1100683 On the command-line, try: perl -e 'use Net::Telnet;' and also perl -e 'print join("\n",@INC);' That should help narrow it down. For example, ther... note Tue, 16 Sep 2014 03:46:31 +0000 http://perlmonks.org/index.pl?node_id=1100683 1100683 650421 2014-09-15 23:46:31 thewebsi bellis bellis http://perlmonks.org/index.pl?node_id=1100699 user Tue, 16 Sep 2014 07:07:57 +0000 http://perlmonks.org/index.pl?node_id=1100699 1100699 1100699 2014-09-16 03:07:57 bellis Farouq Farouq http://perlmonks.org/index.pl?node_id=1100697 user Tue, 16 Sep 2014 06:49:28 +0000 http://perlmonks.org/index.pl?node_id=1100697 1100697 1100697 2014-09-16 02:49:28 Farouq dinil dinil http://perlmonks.org/index.pl?node_id=1100687 user Tue, 16 Sep 2014 04:35:00 +0000 http://perlmonks.org/index.pl?node_id=1100687 1100687 1100687 2014-09-16 00:35:00 dinil