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-04-21 01:46:48 rss,clean Mon Apr 20 15:46:48 2015 30 20150420154648 Mon Apr 20 15:46:48 2015 http://perlmonks.org/ Anonymous Monk SVG TT Graph artperl http://perlmonks.org/index.pl?node_id=1124095 hello monks, i was trying to plot a trend line chart using the subject module. everything is working except when i have more than 1000 data to plot, im getting: Template error: undef error - WHI... perlquestion Tue, 21 Apr 2015 00:25:16 +0000 http://perlmonks.org/index.pl?node_id=1124095 1124095 1123349 2015-04-20 20:25:16 artperl Ignoring timezones when comparing dates with Time::Piece Anonymous Monk http://perlmonks.org/index.pl?node_id=1124085 Hi. I want to take a given date, supplied as a text string in YYY-MM-DD format, and determine if it's >= the current day. I'm having trouble with the timezone handling. The strptime seems to return... perlquestion Mon, 20 Apr 2015 23:16:32 +0000 http://perlmonks.org/index.pl?node_id=1124085 1124085 961 2015-04-20 19:16:32 Anonymous Monk How do I go from functional to object oriented programming? Lady_Aleena http://perlmonks.org/index.pl?node_id=1124071 Going from functional programming to object oriented programming has been on my mind a lot lately. I have been told by a couple of people my code is very close to being OO, however when I gave OO a... perlquestion Mon, 20 Apr 2015 20:43:29 +0000 http://perlmonks.org/index.pl?node_id=1124071 1124071 161890 2015-04-20 16:43:29 Lady_Aleena Re: SVG TT Graph ( Template error: undef error - WHILE loop terminated (> 1000 iterations) ) Anonymous Monk http://perlmonks.org/index.pl?node_id=1124096 <a href="http://search.cpan.org/perldoc?Template">Template</a> -> <a href="http://search.cpan.org/grep?cpanid=ABW&amp;release=Template-Toolkit-2.26&amp;string=iterations&amp;i=1&amp;n=1&amp;C=0">http://search.cpan.org/grep?cpanid=ABW&amp;release=Template-Toolkit-2.26&amp;string=iterations&amp;i=1&amp;n=1&amp;C=0</a> -> <a href="https://metacpan.org/pod/Template::Manual::Directives#WHILE">https://metacpan.org/pod/Template::Manual::Directives#WHILE</a> ... note Tue, 21 Apr 2015 01:05:17 +0000 http://perlmonks.org/index.pl?node_id=1124096 1124096 961 2015-04-20 21:05:17 Anonymous Monk Re: How do I go from procedural to object oriented programming? ( ooad ood modeling crc) Anonymous Monk http://perlmonks.org/index.pl?node_id=1124094 You start with a <a href="http://en.wikipedia.org/wiki/Story-driven_modeling">story</a> and some paper index cards ( <a href="?node_id=1089640">Class Responsibility Collaboration(crc)</a> cards ) because there is &#91;id:... note Tue, 21 Apr 2015 00:23:06 +0000 http://perlmonks.org/index.pl?node_id=1124094 1124094 961 2015-04-20 20:23:06 Anonymous Monk Re^2: Want to make an Everything site of your own? thomas895 http://perlmonks.org/index.pl?node_id=1124093 I like your alternate directions, and although old software can be like navigating an Indiana Jones-esque cave, it's not that difficult :-P I tried to make Everything play with... note Mon, 20 Apr 2015 23:59:12 +0000 http://perlmonks.org/index.pl?node_id=1124093 1124093 925806 2015-04-20 19:59:12 thomas895 Re: How do I go from functional to object oriented programming? Jenda http://perlmonks.org/index.pl?node_id=1124092 <a href="http://en.wikipedia.org/wiki/Functional_programming">$functional</a> ne <a href="http://en.wikipedia.org/wiki/Procedural_programming">$procedural</a> I seriously doubt you are comming from Haskell, Clea... note Mon, 20 Apr 2015 23:32:46 +0000 http://perlmonks.org/index.pl?node_id=1124092 1124092 105128 2015-04-20 19:32:46 Jenda Re: Ignoring timezones when comparing dates with Time::Piece::Plus Anonymous Monk http://perlmonks.org/index.pl?node_id=1124089 The <a href="https://metacpan.org/module/Time%3A%3APiece%3A%3APlus">Time::Piece::Plus</a> docs mention timezones all over the place, and if you look at the source you can see my $self = $args->{as_localtime} ? $class->localtime() : $class->gmti... note Mon, 20 Apr 2015 23:24:18 +0000 http://perlmonks.org/index.pl?node_id=1124089 1124089 961 2015-04-20 19:24:18 Anonymous Monk Re^2: How do I go from functional to object oriented programming? marinersk http://perlmonks.org/index.pl?node_id=1124088 You have a class called Movies . You have an object called movie . (It's currently stored in your Perl scalar called $movie ). But this simple example belies th... note Mon, 20 Apr 2015 23:22:17 +0000 http://perlmonks.org/index.pl?node_id=1124088 1124088 210889 2015-04-20 19:22:17 marinersk Re: Ignoring timezones when comparing dates with Time::Piece choroba http://perlmonks.org/index.pl?node_id=1124087 You can set a different time zone: { local $ENV{TZ} = 'GMT'; print scalar 'Time::Piece'->localtime; } ... note Mon, 20 Apr 2015 23:20:50 +0000 http://perlmonks.org/index.pl?node_id=1124087 1124087 832495 2015-04-20 19:20:50 choroba Re^2: How do I go from PROCEDURAL to object oriented programming? Anonymous Monk http://perlmonks.org/index.pl?node_id=1124086 Moose under CGI? Just say no... note Mon, 20 Apr 2015 23:17:42 +0000 http://perlmonks.org/index.pl?node_id=1124086 1124086 961 2015-04-20 19:17:42 Anonymous Monk Re^2: How do I go from functional to object oriented programming? marinersk http://perlmonks.org/index.pl?node_id=1124084 And the final shift necessary to think in Object-Oriented terms: Methods. When you defined your Movies class, you would also have put in subroutines to perform tasks. Simple ones l... note Mon, 20 Apr 2015 23:11:00 +0000 http://perlmonks.org/index.pl?node_id=1124084 1124084 210889 2015-04-20 19:11:00 marinersk Re^2: How do I go from functional to object oriented programming? marinersk http://perlmonks.org/index.pl?node_id=1124081 Okay. You've defined a Class called Movies . The next step will probably be somewhat familiar to you, especially if you've used Perl Modules that are OO. You're ready to sta... note Mon, 20 Apr 2015 23:03:29 +0000 http://perlmonks.org/index.pl?node_id=1124081 1124081 210889 2015-04-20 19:03:29 marinersk Re^12: MJDs Contract Warnings - courtesy of Perlweekly Anonymous Monk http://perlmonks.org/index.pl?node_id=1124080 Wow. You are so unabashed and unashamed. I have nothing left to say. Please, have the last word. Hi ;) "shame" isn't really conducive to learnining or exchange of ideas... note Mon, 20 Apr 2015 22:57:30 +0000 http://perlmonks.org/index.pl?node_id=1124080 1124080 961 2015-04-20 18:57:30 Anonymous Monk Re^2: How do I go from functional to object oriented programming? marinersk http://perlmonks.org/index.pl?node_id=1124079 Okay. So we need a Class called Movies . The other folks on this thread will be far better suited to give technical details. I have no need for objects in my world, and use them only when... note Mon, 20 Apr 2015 22:54:01 +0000 http://perlmonks.org/index.pl?node_id=1124079 1124079 210889 2015-04-20 18:54:01 marinersk Re^2: How do I go from functional to object oriented programming? marinersk http://perlmonks.org/index.pl?node_id=1124078 Okay, so you need an object called movie. So how do we do that? This is OO -- it's all about the thing. So let's back off a bit and think about what a movie is. A bu... note Mon, 20 Apr 2015 22:48:33 +0000 http://perlmonks.org/index.pl?node_id=1124078 1124078 210889 2015-04-20 18:48:33 marinersk Re^2: How do I go from functional to object oriented programming? marinersk http://perlmonks.org/index.pl?node_id=1124077 So, you don't start by creating a monster hash called %movies_data. That would be thinking about the data. OO is about thinking about the thing. So what you need is an objec... note Mon, 20 Apr 2015 22:35:31 +0000 http://perlmonks.org/index.pl?node_id=1124077 1124077 210889 2015-04-20 18:35:31 marinersk Re: How do I go from functional to object oriented programming? marinersk http://perlmonks.org/index.pl?node_id=1124076 I'll let the others continue their guidance on the how of OO, but I wanted to point out the one piece of information which transformed my understanding of OO. I believe it came from &#91;http:/... note Mon, 20 Apr 2015 22:29:07 +0000 http://perlmonks.org/index.pl?node_id=1124076 1124076 210889 2015-04-20 18:29:07 marinersk Re: How do I go from functional to object oriented programming? choroba http://perlmonks.org/index.pl?node_id=1124075 Your code is indeed very close to Object Oriented. I translated part of it to <a href="https://metacpan.org/module/Moo">Moo</a>: #!/usr/bin/perl use strict; use warnings; my %movies_data = ( 'F... note Mon, 20 Apr 2015 22:06:09 +0000 http://perlmonks.org/index.pl?node_id=1124075 1124075 832495 2015-04-20 18:06:09 choroba Re: How do I go from PROCEDURAL to object oriented programming? jeffa http://perlmonks.org/index.pl?node_id=1124074 How close? Very close. Why don't you install Moose and then try this code out. Feel free to ask lots of questions. #!/usr/bin/env perl package Base; use Moose; has title => ... note Mon, 20 Apr 2015 21:42:00 +0000 http://perlmonks.org/index.pl?node_id=1124074 1124074 18800 2015-04-20 17:42:00 jeffa Re: How do I go from functional to object oriented programming? NetWallah http://perlmonks.org/index.pl?node_id=1124073 The main concept in OO is that you construct a "Class" - representing generic properties, then you "Instantiate" one or more instances of that class. In your case, the "Class" that stands out is ... note Mon, 20 Apr 2015 21:35:32 +0000 http://perlmonks.org/index.pl?node_id=1124073 1124073 159887 2015-04-20 17:35:32 NetWallah Re^3: Creating Perl5 plugin for Intellij IDEA (criterias ?) LanX http://perlmonks.org/index.pl?node_id=1124072 &gt; but need some inspiration. The thread I linked was meant as such. :) &gt; Komodo 8 autocompletion for defined variables doesn't work, jump to definistion by click works fro... note Mon, 20 Apr 2015 21:12:56 +0000 http://perlmonks.org/index.pl?node_id=1124072 1124072 708738 2015-04-20 17:12:56 LanX Re^3: Differences between Perl 5.8 and Perl 5.18.2 toolic http://perlmonks.org/index.pl?node_id=1124070 You transcribed at least one line incorrectly. Change: $im_thinking_of=int(rand10); to (space between <a href="http://perldoc.perl.org/functions/rand.html">rand</a> and 10): $im_thinking_of=int(rand 10); ... note Mon, 20 Apr 2015 20:34:52 +0000 http://perlmonks.org/index.pl?node_id=1124070 1124070 622051 2015-04-20 16:34:52 toolic Re^2: Non-Formula based Text Encoding - with Compression marinersk http://perlmonks.org/index.pl?node_id=1124069 ++ for the warning to future hobby crypologists. However, I would point out the OP was careful to say "encoded", not "encrypted", and emphasized "compression". I'll withhold ... note Mon, 20 Apr 2015 20:32:59 +0000 http://perlmonks.org/index.pl?node_id=1124069 1124069 210889 2015-04-20 16:32:59 marinersk Re^2: Differences between Perl 5.8 and Perl 5.18.2 mbgbioinfo http://perlmonks.org/index.pl?node_id=1124066 Thank you for your prompt reply. The program is this one: #!/usr/bin/perl -w $im_thinking_of=int(rand10); print "Pick a number:"; $guess=; chomp $guess; if ($guess>$im_thinking_of) { ... note Mon, 20 Apr 2015 20:27:53 +0000 http://perlmonks.org/index.pl?node_id=1124066 1124066 1123966 2015-04-20 16:27:53 mbgbioinfo Re: Creating Perl5 plugin for Intellij IDEA mr_mischief http://perlmonks.org/index.pl?node_id=1124065 I think there's an issue with your statement about there being no vim for Windows. Namely, that it is available <a href="http://www.vim.org/download.php#pc">right on vim.org</a> for anyone to download and in... note Mon, 20 Apr 2015 20:11:28 +0000 http://perlmonks.org/index.pl?node_id=1124065 1124065 62512 2015-04-20 16:11:28 mr_mischief Re: Effective Automated Testing RonW http://perlmonks.org/index.pl?node_id=1124064 A test that never finds a bug is poor value. Depends on why it never finds a bug. Which highlights the importance of testing the tests. Ideally, as long as ... note Mon, 20 Apr 2015 20:07:00 +0000 http://perlmonks.org/index.pl?node_id=1124064 1124064 1080444 2015-04-20 16:07:00 RonW Re: 2 txt files comparison and sorting CountZero http://perlmonks.org/index.pl?node_id=1124063 Or think of these two text files as database tables and you can use the power of SQL and DBI to solve your assignment: use Modern::Perl qw /2014/; use DBI; use Data::Dump qw /dump/; my $dbh =... note Mon, 20 Apr 2015 19:57:41 +0000 http://perlmonks.org/index.pl?node_id=1124063 1124063 198160 2015-04-20 15:57:41 CountZero Antic the Fearless Antic the Fearless http://perlmonks.org/index.pl?node_id=1124090 user Mon, 20 Apr 2015 23:28:59 +0000 http://perlmonks.org/index.pl?node_id=1124090 1124090 1124090 2015-04-20 19:28:59 Antic the Fearless dino12 dino12 http://perlmonks.org/index.pl?node_id=1124082 user Mon, 20 Apr 2015 23:09:33 +0000 http://perlmonks.org/index.pl?node_id=1124082 1124082 1124082 2015-04-20 19:09:33 dino12 Desmond Desmond http://perlmonks.org/index.pl?node_id=1124067 user Mon, 20 Apr 2015 20:30:39 +0000 http://perlmonks.org/index.pl?node_id=1124067 1124067 1124067 2015-04-20 16:30:39 Desmond