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-10-01 17:38:44 rss,clean Wed Oct 1 07:38:44 2014 30 20141001073844 Wed Oct 1 07:38:44 2014 http://perlmonks.org/ Anonymous Monk Compare two arrays Anonymous Monk http://perlmonks.org/index.pl?node_id=1102555 Hi Monks! I have two arrays, I need to find if the elements of the first array matchs any element on the second array. I am getting stuck once I have the account numbers into a hash: ... perlquestion Wed, 01 Oct 2014 16:10:23 +0000 http://perlmonks.org/index.pl?node_id=1102555 1102555 961 2014-10-01 12:10:23 Anonymous Monk perl: How to comapre and manipulate csv file in perl? Ankur_kuls http://perlmonks.org/index.pl?node_id=1102531 Hi friends. Below is the sample of my csv file Amount ChoiceId Allowed PID AmountId MultiplyingFactor PF new ServiceTax ExtraTalkTime MRP Recharge Type FRC/SRC 13 na 285 100 1.1236 8... perlquestion Wed, 01 Oct 2014 11:55:13 +0000 http://perlmonks.org/index.pl?node_id=1102531 1102531 1084250 2014-10-01 07:55:13 Ankur_kuls Re^3: Compare two arrays Eily http://perlmonks.org/index.pl?node_id=1102563 %seen{$_} is incorrect, you're only accessing one element (ie: a scalar) so you have to use the sigil $: $seen{$_} Now, look at your dump of \%test, you'll see that the valu... note Wed, 01 Oct 2014 17:25:47 +0000 http://perlmonks.org/index.pl?node_id=1102563 1102563 1039428 2014-10-01 13:25:47 Eily Re^2: Compare two arrays Anonymous Monk http://perlmonks.org/index.pl?node_id=1102562 Why can't this work? ... for my $filename (@file) { next unless $filename =~ /^\d+/; if(grep { %seen{$_} =~ $filename} keys %seen) { print " $filename\n"; } else {... note Wed, 01 Oct 2014 17:14:04 +0000 http://perlmonks.org/index.pl?node_id=1102562 1102562 961 2014-10-01 13:14:04 Anonymous Monk Re: What is your favourite meta-syntactic variable name? Not_a_Number http://perlmonks.org/index.pl?node_id=1102561 dave... note Wed, 01 Oct 2014 16:54:48 +0000 http://perlmonks.org/index.pl?node_id=1102561 1102561 258724 2014-10-01 12:54:48 Not_a_Number Re^6: Count in intervals -- PM policy ww http://perlmonks.org/index.pl?node_id=1102560 Perhaps you would like to explain the relevance of a link to the OP that's labeled "improper considerations" ...or is this mere spew? Please say what you mean. I kno... note Wed, 01 Oct 2014 16:54:05 +0000 http://perlmonks.org/index.pl?node_id=1102560 1102560 352046 2014-10-01 12:54:05 ww Re^3: perl: How to comapre and manipulate csv file in perl? Eily http://perlmonks.org/index.pl?node_id=1102559 Oh, right! I keep forgetting that autovivification isn't just when you do something like $name{KEY}&#91;0&#93;<a href="?node=1">1</a>. ... note Wed, 01 Oct 2014 16:45:36 +0000 http://perlmonks.org/index.pl?node_id=1102559 1102559 1039428 2014-10-01 12:45:36 Eily Re: Compare two arrays Eily http://perlmonks.org/index.pl?node_id=1102558 You should uncomment print Dumper %seen; and write \%seen instead of %seen: you are probably not getting what you expect in your %seen hash. You may need to use captu... note Wed, 01 Oct 2014 16:38:50 +0000 http://perlmonks.org/index.pl?node_id=1102558 1102558 1039428 2014-10-01 12:38:50 Eily Re^2: perl: How to comapre and manipulate csv file in perl? AnomalousMonk http://perlmonks.org/index.pl?node_id=1102557 if(!exists $result{$uniqueKey}) # If this combinaison is unknown { $result{$uniqueKey} = <a href="?node=%5C%25currentRow">\%currentRow</a>; # save the current row to it } else { push @{ $... note Wed, 01 Oct 2014 16:34:56 +0000 http://perlmonks.org/index.pl?node_id=1102557 1102557 634253 2014-10-01 12:34:56 AnomalousMonk Re^3: Count in intervals no_slogan http://perlmonks.org/index.pl?node_id=1102556 Seriously, though, read <a href="http://hop.perl.plover.com/">Higher-Order Perl</a>.... note Wed, 01 Oct 2014 16:24:29 +0000 http://perlmonks.org/index.pl?node_id=1102556 1102556 78006 2014-10-01 12:24:29 no_slogan Re^5: Finding node with attribute XML::LibXML ikegami http://perlmonks.org/index.pl?node_id=1102554 Thanks, fixed... note Wed, 01 Oct 2014 16:09:06 +0000 http://perlmonks.org/index.pl?node_id=1102554 1102554 381608 2014-10-01 12:09:06 ikegami Re^5: Count in intervals -- PM policy Anonymous Monk http://perlmonks.org/index.pl?node_id=1102551 Good help is hard to come by, especially when <a href="?node_id=1102490">improper considerations</a> are provided. Also, GIGO.... note Wed, 01 Oct 2014 15:05:36 +0000 http://perlmonks.org/index.pl?node_id=1102551 1102551 961 2014-10-01 11:05:36 Anonymous Monk Re: What is your favourite meta-syntactic variable name? chacham http://perlmonks.org/index.pl?node_id=1102550 I tend to use A and B. Why use something longer? As it so happens, i added the following comment to a VIEW just this morning: -- This causes a problem as ROLLUP adds a record even... note Wed, 01 Oct 2014 15:05:09 +0000 http://perlmonks.org/index.pl?node_id=1102550 1102550 934209 2014-10-01 11:05:09 chacham Re^4: Count in intervals -- PM policy QM http://perlmonks.org/index.pl?node_id=1102549 I agree with your sentiments about the nature of the OP. However, suggesting <a href="http://search.cpan.org/search?mode=module&amp;query=Iterator">Iterator</a> to someone who's struggling with <a href="http://www.google.com/search?q=while%20site%3Aperldoc.perl.org">while</a> and <a href="http://perldoc.perl.org/functions/grep.html">grep</a> is, to my mind, like saying "P... note Wed, 01 Oct 2014 14:59:20 +0000 http://perlmonks.org/index.pl?node_id=1102549 1102549 294463 2014-10-01 10:59:20 QM Re: What is your favourite meta-syntactic variable name? karlgoethebier http://perlmonks.org/index.pl?node_id=1102548 $nose = $cuke; «The Crux of the Biscuit is the Apostrophe» ... note Wed, 01 Oct 2014 14:58:48 +0000 http://perlmonks.org/index.pl?node_id=1102548 1102548 1001958 2014-10-01 10:58:48 karlgoethebier Re: perl: How to comapre and manipulate csv file in perl? misterperl http://perlmonks.org/index.pl?node_id=1102545 I have many comments on your code , but Im not really sure what you're trying to accomplish so I'l keep it short. It seems like you're trying to operate on 2-row blocks? Like if the first row m... note Wed, 01 Oct 2014 14:53:09 +0000 http://perlmonks.org/index.pl?node_id=1102545 1102545 863613 2014-10-01 10:53:09 misterperl Re: Count in intervals CountZero http://perlmonks.org/index.pl?node_id=1102544 In Perl's spirit of TIMTOWTDI:use Modern::Perl '2014'; use Number::Interval; use List::Util qw/sum/; my %raw_intervals = ( so => &#91; <a href="?node=%2010%2C%2020%20"> 10, 20 </a>, <a href="?node=%2030%2C%2040%20"> 30, 40 </a> &#93;, ge => &#91; <a href="?node=%2010%2C%2030%20"> 10, 30 </a>, &#93;, )... note Wed, 01 Oct 2014 14:37:41 +0000 http://perlmonks.org/index.pl?node_id=1102544 1102544 198160 2014-10-01 10:37:41 CountZero Re: What is your favourite meta-syntactic variable name? Old_Gray_Bear http://perlmonks.org/index.pl?node_id=1102543 I've always been fond of 'twiddle' and 'twiddly' ---- I Go Back to Slee... note Wed, 01 Oct 2014 14:32:27 +0000 http://perlmonks.org/index.pl?node_id=1102543 1102543 290905 2014-10-01 10:32:27 Old_Gray_Bear Re: What is your favourite meta-syntactic variable name? DrHyde http://perlmonks.org/index.pl?node_id=1102540 The One True Sequence of meta-syntactic variables is ... foo bar baz barf garbleflux quux quuux ...... note Wed, 01 Oct 2014 14:22:58 +0000 http://perlmonks.org/index.pl?node_id=1102540 1102540 84630 2014-10-01 10:22:58 DrHyde Re^2: What is your favourite meta-syntactic variable name? MidLifeXis http://perlmonks.org/index.pl?node_id=1102539 Those aren't meta-syntactic if they are used in real code :-) --MidLifeXis ... note Wed, 01 Oct 2014 13:33:32 +0000 http://perlmonks.org/index.pl?node_id=1102539 1102539 272364 2014-10-01 09:33:32 MidLifeXis Re: What is your favourite meta-syntactic variable name? Anonymous Monk http://perlmonks.org/index.pl?node_id=1102538 Names are dependents on context ... @list = ( 'p' , 'q' ) ; %map = ( @list ); %uniq ; @uniq{ @list } = (); ... else, I really like *var types. ... note Wed, 01 Oct 2014 13:26:55 +0000 http://perlmonks.org/index.pl?node_id=1102538 1102538 961 2014-10-01 09:26:55 Anonymous Monk Re: perl: How to comapre and manipulate csv file in perl? Eily http://perlmonks.org/index.pl?node_id=1102537 Your script is hard to read indeed. Not just because you got confused on how to do the work, but also because of bad names. First, if your variables are numbered (like @row1, @row2), there's a high... note Wed, 01 Oct 2014 13:14:29 +0000 http://perlmonks.org/index.pl?node_id=1102537 1102537 1039428 2014-10-01 09:14:29 Eily Re: How to compare and manipulate csv file? hippo http://perlmonks.org/index.pl?node_id=1102536 Cross-posted at StackOverflow You wrote: my $csv = Text::CSV->... note Wed, 01 Oct 2014 13:03:59 +0000 http://perlmonks.org/index.pl?node_id=1102536 1102536 885521 2014-10-01 09:03:59 hippo Re: What is your favourite meta-syntactic variable name? GotToBTru http://perlmonks.org/index.pl?node_id=1102535 Definitely other. I use foo and bar as the values. The variables are $customer_name, %hash, $hashref or @array. ... note Wed, 01 Oct 2014 12:46:44 +0000 http://perlmonks.org/index.pl?node_id=1102535 1102535 844862 2014-10-01 08:46:44 GotToBTru Re: What is your favourite meta-syntactic variable name? gsiems http://perlmonks.org/index.pl?node_id=1102534 $foo ( or sub foo {} ) $bar $baz $baggybumbeerbelly @ary %h ... note Wed, 01 Oct 2014 12:39:51 +0000 http://perlmonks.org/index.pl?node_id=1102534 1102534 178085 2014-10-01 08:39:51 gsiems Re: What is your favourite meta-syntactic variable name? jonadab http://perlmonks.org/index.pl?node_id=1102533 I like quux because you can add arbitrarily many companion variables simply by inserting another extra u. ... note Wed, 01 Oct 2014 12:01:45 +0000 http://perlmonks.org/index.pl?node_id=1102533 1102533 230012 2014-10-01 08:01:45 jonadab Re: perl: How to comapre and manipulate csv file in perl? Corion http://perlmonks.org/index.pl?node_id=1102532 How do you expect us to help you with your program if you don't show it? <a href="http://search.cpan.org/perldoc?Text%3A%3ACSV_XS">Text::CSV_XS</a> has many highly convenient functions for reading and writing CSV files.... note Wed, 01 Oct 2014 12:00:01 +0000 http://perlmonks.org/index.pl?node_id=1102532 1102532 5348 2014-10-01 08:00:01 Corion Re^3: Count in intervals -- PM policy ww http://perlmonks.org/index.pl?node_id=1102530 <a href="?node_id=1102516">Discipulus' answer</a> seems pretty fair to me. OP posted no code; gave no evidence that the SOPW showed any effort on the author's part; nor even followed the instructions in... note Wed, 01 Oct 2014 11:54:20 +0000 http://perlmonks.org/index.pl?node_id=1102530 1102530 352046 2014-10-01 07:54:20 ww ajitrai ajitrai http://perlmonks.org/index.pl?node_id=1102552 user Wed, 01 Oct 2014 15:56:28 +0000 http://perlmonks.org/index.pl?node_id=1102552 1102552 1102552 2014-10-01 11:56:28 ajitrai pato pato http://perlmonks.org/index.pl?node_id=1102546 user Wed, 01 Oct 2014 14:55:43 +0000 http://perlmonks.org/index.pl?node_id=1102546 1102546 1102546 2014-10-01 10:55:43 pato rfmasIII rfmasIII http://perlmonks.org/index.pl?node_id=1102541 user Wed, 01 Oct 2014 14:27:35 +0000 http://perlmonks.org/index.pl?node_id=1102541 1102541 1102541 2014-10-01 10:27:35 rfmasIII