PageRenderTime 72ms CodeModel.GetById 33ms RepoModel.GetById 1ms app.codeStats 0ms

/blogs.perl.org-entries/blogs.perl.org-journal.xhtml

https://bitbucket.org/shlomif/blogs.perl.org-entries
XHTML | 3501 lines | 2984 code | 517 blank | 0 comment | 0 complexity | 3cc8fd43a43df0870749259985675e4a MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- vim: set indentexpr=: -->
  3. <!DOCTYPE
  4. html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  5. "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
  7. <head>
  8. <title>blogs.perl.org Blog</title>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <style type="text/css">
  11. div.entry
  12. {
  13. border: darkgreen solid medium;
  14. padding: 0.5em;
  15. margin: 0.5em;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <div class="entry" id="text-table-1">
  21. <ul class="info">
  22. <li><b>Date:</b> 21-04-2011</li>
  23. </ul>
  24. <h1>Introduction to blogs.perl.org + Text::Table</h1>
  25. <p>
  26. Hello, Perl bloggers! I decided to start
  27. blogging about a most of my exclusively Perl-related stuff here on
  28. blogs.perl.org, in hope of getting more comments
  29. from active Perlers. (Until now, I've blogged about it
  30. <a href="http://shlomif-tech.livejournal.com/">on
  31. my technical LiveJournal blog</a> and previously on
  32. <a href="http://use.perl.org/~Shlomi+Fish/journal/">use.perl.org Journal</a>.).
  33. You can learn more about me on <a href="http://www.shlomifish.org/">my home
  34. site - www.shlomifish.org</a> .
  35. </p>
  36. <p>
  37. OK, having put that aside - let's move on to the main topic of this post.
  38. </p>
  39. <hr />
  40. <p>
  41. Many months ago I wanted to use the
  42. <a href="http://search.cpan.org/dist/Text-Table/">Text::Table CPAN module</a>
  43. to present a table related to the meta-scan heuristics construction
  44. scheme of <a href="http://fc-solve.berlios.de/">Freecell Solver</a>. Now,
  45. I wanted to present nicely formatted borders, using the
  46. <a href="http://en.wikipedia.org/wiki/Box-drawing_characters">Unicode
  47. box-drawing characters</a> (which some people would recall from DOS).
  48. However, I found it difficult to specify the separators in the
  49. rulers properly based on their indices - they were assumed to be the
  50. same globally. As a result, I've written
  51. <a href="https://rt.cpan.org/Public/Bug/Display.html?id=61610">a patch</a>,
  52. and placed the modifications in
  53. <a href="http://github.com/shlomif/Text-Table">a github repository</a>.
  54. </p>
  55. <p>
  56. The author of Text-Table (ANNO) told me he was working on a new version
  57. of Text-Table, which will contain many improvements. However, I was still
  58. interested in an enhanced version of the old Text-Table codebase with my
  59. patch, and after talking on <a href="irc://irc.freenode.net/#perl">#perl</a>,
  60. ANNO said I could have co-maint
  61. on Text-Table-1.x and continue to improve it. The new Text-Table will be
  62. released under a separate namespace - <tt>Text::Table2</tt> or so.
  63. </p>
  64. <p>
  65. Many thanks go to ANNO for agreeing that I further develop Text::Table.
  66. </p>
  67. <p>
  68. Using my git repository, I did many cleanups, like add
  69. pod.t and pod-coverage.t, tweak the author information, add more strict and
  70. warnings to the file, etc. ANNO 's original licence is
  71. <a href="http://perlbuzz.com/2009/07/help-end-licensing-under-same-terms-as-perl-itself.html">"Same
  72. terms as Perl"</a>, but since it is an iffy licensing, I decided that all
  73. further changes will be under the terms of the Public-Domain/X11L/etc.. People
  74. who send me pull requests on github may wish to add their names to the credits
  75. (in the changes or even in the core module) but must not claim copyrights to
  76. their changes.
  77. </p>
  78. <p>
  79. OK, now for some output of the Unicode table:
  80. </p>
  81. <pre>
  82. Place 1 2 3 4 5
  83. 1 68 317 15 3 381
  84. 2 171 482 31 14 594
  85. 3 275 867 42 22 1007
  86. 4 458 1442 125 30 1630
  87. 5 640 1715 137 47 1730
  88. </pre>
  89. <p>
  90. Future plans are:
  91. </p>
  92. <ol>
  93. <li>
  94. Convert the remaining test scripts to Test::More.
  95. </li>
  96. <li>
  97. Go over the code and clean it up
  98. </li>
  99. <li>
  100. Add CPAN keywords to the <tt>META.yml</tt>. (Perhaps this will require
  101. defining a Module-Build-based Build.PL file).
  102. </li>
  103. <li>
  104. Add URLs to the <tt>META.ym</tt>l - to the module's homepage, to the github repository,
  105. etc..
  106. </li>
  107. <li>
  108. Possibly implement some future features.
  109. </li>
  110. <li>
  111. Add some more tests.
  112. </li>
  113. </ol>
  114. <p>
  115. Contributions are naturally welcome, just fork the github repository and send
  116. me a pull request. (Or patches are also OK.)
  117. </p>
  118. </div>
  119. <div class="entry" id="entry-to-yapc-europe-2011">
  120. <ul class="info">
  121. <li><b>Date:</b> 20-06-2011</li>
  122. <li class="tags">YAPC</li>
  123. </ul>
  124. <h1>Transferring a Ticket to YAPC::Europe::2011</h1>
  125. <p>
  126. I originally planned to attend
  127. <a href="http://yapceurope.lv/ye2011/">YAPC::Europe::2011</a> in Riga, Latvia
  128. (on 15-17 August, 2011), and so bought an early bird ticket, but will no
  129. longer be able to attend due to personal reasons. As a result, I'm now seaking
  130. to transfer the ticket to someone else, for the right price (which will be
  131. cheaper than what I bought it.).
  132. </p>
  133. <p>
  134. If you are interested, please
  135. <a href="http://www.shlomifish.org/me/contact-me/">contact me</a> and we will
  136. negotiate a price. I hope everybody enjoys the YAPCs.
  137. </p>
  138. </div>
  139. <div class="entry" id="resuming-maintenance-of-xml-libxml">
  140. <ul class="info">
  141. <li><b>Date:</b> 20-06-2011</li>
  142. <li class="tags">XML, libxml, CPAN</li>
  143. </ul>
  144. <h1>Resuming Maintenance of XML-LibXML</h1>
  145. <p>
  146. For a long while, work on the
  147. <a href="http://beta.metacpan.org/release/XML-LibXML">XML-LibXML
  148. CPAN module</a> halted as the existing maintainer was busy.
  149. After <a href="http://code.activestate.com/lists/perl-xml/8885/">a
  150. discussion</a> on the Perl-in-XML mailing list, some people and I were
  151. given co-maintainer status and we resumed its maintenance inside
  152. <a href="https://bitbucket.org/shlomif/perl-xml-libxml">a Bitbucket.org
  153. Mercurial repository</a>.
  154. </p>
  155. <p>
  156. So far what I did, was fix some low-hanging fruit
  157. bugs, apply some patches, as well as start the long process of converting
  158. the test suite, which still uses Test.pm to
  159. <a href="http://beta.metacpan.org/module/Test::More">Test::More</a> . There are
  160. still many bugs lurking there, and some of them are XS bugs that are still
  161. beyond my reach, and I could use some assistance there. But it's a start.
  162. </p>
  163. <p>
  164. If you're interested in helping, the clone the repository, write a patch and
  165. send me a pull request.
  166. </p>
  167. <p>
  168. <b>Text::Table Update:</b> I've written about
  169. <a href="http://blogs.perl.org/users/shlomi_fish/2011/04/introduction-to-blogsperlorg-texttable.html">resuming
  170. the maintenance of Text::Table</a> in April, and it progressed nicely:
  171. the tests were converted to Test::More, a lot of the code was cleaned up,
  172. the build system was converted to Module::Build, and keywords and resource
  173. URLs were defined, and some bugs were solved (along with tests). I'm still
  174. looking into ways to clean up the code, and if anyone has an idea for a cool
  175. feature, then they should drop me a line (or provide a patch).
  176. </p>
  177. </div>
  178. <div class="entry" id="convert-away-from-Test.pm">
  179. <ul class="info">
  180. <li><b>Date:</b> 23-06-2011</li>
  181. <li class="tags">QA, PPI, Perl</li>
  182. </ul>
  183. <h1>PPI-Based Script to Convert Test.pm-based Test Programs to Test::More</h1>
  184. <p>
  185. Some CPAN modules I inherited used the old
  186. <a href="http://search.cpan.org/perldoc?Test">Test.pm</a> for some of their
  187. <tt>t/*.t</tt> scripts instead of the more modern
  188. <a href="http://en.wikipedia.org/wiki/Test::More">Test::More</a>. This
  189. annoys me to no end because Test.pm is very limited. When I worked on
  190. <a href="http://beta.metacpan.org/release/Config-IniFiles">Config-IniFiles</a>,
  191. I did the conversion manually, which was a lot of work. More recently, I
  192. <a href="http://blogs.perl.org/users/shlomi_fish/2011/06/resuming-maintenance-of-xml-libxml.html">started
  193. working on XML-LibXML</a> which has over 40 of those pesky Test.pm scripts, and
  194. I did not have the nerve to do all the manual and menial work.
  195. </p>
  196. <p>
  197. As a result, I ended up spending a few hours studying
  198. <a href="http://beta.metacpan.org/release/PPI">PPI</a> (the Perl Parsing
  199. Interface), and writing
  200. <a href="http://www.shlomifish.org/open-source/projects/Test.pm-Converter/">a
  201. script</a> to automatically convert Test.pm-based scripts to Test::More. The
  202. main issue at hand was that in Test.pm, a single argument <tt>ok()</tt>
  203. tests for the scalar's truth, while a double argument <tt>ok()</tt> tests for
  204. simple equivalence (similarly to Test::More's <tt>is()</tt>). Eventually, I got
  205. the script working, with some limitations (see <a
  206. href="http://www.shlomifish.org/open-source/projects/Test.pm-Converter/">the page</a>).
  207. </p>
  208. <p>
  209. So what was my impression of PPI? It naturally seems more robust than using
  210. regular expressions and hacks to process Perl code, but there were a few quirks.
  211. For example, a PPI
  212. <a href="http://beta.metacpan.org/module/PPI::Structure::List">list</a> contains
  213. an array of its contents, and the commas are part of them, as are the
  214. various other tokens in the sub-expressions. Therefore, divining the count of
  215. the arguments is pretty hard. I would have expected to get a more <a href="http://en.wikipedia.org/wiki/Abstract_syntax_tree">abstract
  216. syntax tree</a> of the arguments, and since I didn't I had to work around
  217. it with an ugly kludge.
  218. </p>
  219. <p>
  220. Furthermore, after stringifying the document object, the contents of the
  221. <a href="http://en.wikipedia.org/wiki/Here_document">here-documents</a> were
  222. not included in the output from some reason. However, I may have done something
  223. wrong. I also wish the PPI PODs contained more meaningful examples.
  224. </p>
  225. <p>
  226. Nevertheless, my script is mostly working now and I can utilise it to
  227. "test-lift" legacy test programs. You might find it useful too, so it's there
  228. in case you need it, and patches to fix its limitations would be welcome.
  229. </p>
  230. </div>
  231. <div class="entry" id="Inline-C">
  232. <ul class="info">
  233. <li><b>Date:</b> 09-11-2011</li>
  234. <li class="tags">Perl, QA, XS, Inline, C, ctypes, gcc</li>
  235. </ul>
  236. <h1>My Experience with Inline::C</h1>
  237. <p>
  238. I know I didn’t write here for a long time, and I apologise for it, but I have
  239. this entry and another one in mind and I hope they can compensate for it.
  240. </p>
  241. <p>
  242. For my work on <a href="http://fc-solve.shlomifish.org/">Freecell Solver</a>,
  243. I’ve written some code for encoding and decoding game positions into a
  244. compact format, by encoding them as a delta from the position of origin. I
  245. first wrote it in Perl, in order to prototype it, and later
  246. translated it to C (which is the language that Freecell Solver is written in).
  247. I have written some rudimentary unit tests for it, but also wanted to test the
  248. code against a large number of positions, by runnign it over the solutions of
  249. many Freecell deals.
  250. </p>
  251. <p>
  252. The encoding rearranges the order of the card columns and the freecells, so
  253. testing that the output test is correct requires calculating that arrangement.
  254. This was also done by the Perl code. I decided to write a small wrapper for
  255. an encoding+decoding round-trip in C, and use it from a Perl program I was
  256. writing. So far so good.
  257. </p>
  258. <p>
  259. I first looked at <a href="https://gitorious.org/perl-ctypes">the
  260. Perl version of Ctypes</a>, but it failed a large number of its assertions
  261. on my system, so I could not really trust it. Then I looked at
  262. <a href="http://search.cpan.org/perldoc?Inline::C">Inline::C</a>. I could
  263. not understand from its main page, how to return an <tt>SV *</tt> containing
  264. a string from it, but this was covered in the extensive
  265. <a href="http://search.cpan.org/perldoc?Inline::C-Cookbook">Inline::C
  266. cookbook</a> and I wrote this Inline::C function:
  267. </p>
  268. <pre>
  269. extern char * fc_solve_user_INTERNAL_delta_states_enc_and_dec(
  270. const char * init_state_str_proto,
  271. const char * derived_state_str_proto
  272. );
  273. SV* enc_and_dec(char * init_state_s, char * derived_state_s) {
  274. SV * ret;
  275. char * s;
  276. s = fc_solve_user_INTERNAL_delta_states_enc_and_dec(init_state_s, derived_state_s);
  277. ret = newSVpv(s, 0);
  278. free(s);
  279. return ret;
  280. }
  281. </pre>
  282. <p>
  283. I don't need to use “sv_2mortal” there because Inline::C does that for us.
  284. Then I tried to test it. It failed with this error:
  285. </p>
  286. <pre>
  287. perl: symbol lookup error: /home/shlomif/progs/freecell/trunk/fc-solve/source/_Inline/lib/auto/Mega_Test_for_C_delta_states_pl_9385/Mega_Test_for_C_delta_states_pl_9385.so: undefined symbol: fc_solve_user_INTERNAL_delta_states_enc_and_dec
  288. </pre>
  289. <p>
  290. I was familiar with errors like that, but it took me over an hour of playing
  291. with the various Inline::C configuration options, and trying to figure out
  292. why it didn’t link against the relevant Freecell Solver library to realise
  293. what the problem was. It was that the library in question did not export the
  294. symbol, and gcc realised it didn't give the XS extension anything and omitted
  295. it.
  296. </p>
  297. <p>
  298. After fixing this line in my C source:
  299. </p>
  300. <pre>
  301. char * DLLEXPORT fc_solve_user_INTERNAL_delta_states_enc_and_dec(
  302. </pre>
  303. <p>
  304. To this line:
  305. </p>
  306. <pre>
  307. DLLEXPORT char * fc_solve_user_INTERNAL_delta_states_enc_and_dec(
  308. </pre>
  309. <p>
  310. Everything worked properly, and I was able to run the so-called “mega-test”.
  311. </p>
  312. <p>
  313. If you’re having similar problems with Inline::C, you should try to add
  314. <tt>CLEAN_AFTER_BUILD =&gt; 0</tt> to its configuration. It ended up clarifying
  315. a lot for me.
  316. </p>
  317. <p>
  318. Cheers!
  319. </p>
  320. </div>
  321. <div class="entry" id="exec-portability">
  322. <ul class="info">
  323. <li><b>Date:</b> 09-11-2011</li>
  324. <li class="tags">exec, perl, portability, whitespace, windows, unix</li>
  325. </ul>
  326. <h1>exec's portability</h1>
  327. <p>
  328. Pop quiz! What does this perl 5 program prints when executed with no
  329. arguments?
  330. </p>
  331. <pre>
  332. #!/usr/bin/perl
  333. use strict;
  334. use warnings;
  335. if (! @ARGV)
  336. {
  337. exec($^X, $0, "hello world");
  338. }
  339. else
  340. {
  341. my $arg = shift(@ARGV);
  342. print "Got &lt;$arg&gt;\n";
  343. if (@ARGV)
  344. {
  345. print "Other args are &lt;@ARGV&gt;\n";
  346. }
  347. }
  348. </pre>
  349. <p>
  350. The answer is “it depends.”. On my Linux system it prints
  351. “Got &lt;hello world&gt;”, while on Windows, using Strawberry Perl, it
  352. prints “Got &lt;hello&gt;” and later on that the other args are “world”.
  353. </p>
  354. <p>
  355. I would expect the Linux behaviour were every argument passed to the list
  356. <a href="http://perldoc.perl.org/functions/exec.html">exec</a> arrives as
  357. one argument to <tt>@ARGV</tt> regardless of whitespace as the correct. It
  358. also the behaviour exhibited on both operating systems using
  359. <a href="http://perldoc.perl.org/functions/system.html">system</a>. Is this
  360. a bug?
  361. </p>
  362. <p>
  363. <a href="http://perldoc.perl.org/perlport.html">perlport</a> only has this
  364. to say about whitespace: <q>Whitespace in filenames is tolerated on most
  365. systems, but not all, and even on systems where it might be tolerated, some
  366. utilities might become confused by such whitespace.</q>.
  367. </p>
  368. <p>
  369. I discovered this strange mis-behaviour when working on a commission for
  370. a client who is Windows-based.
  371. </p>
  372. </div>
  373. <div class="entry" id="telaviv_pm_2011_Nov_report">
  374. <ul class="info">
  375. <li><b>Date:</b> 03-12-2011</li>
  376. <li class="tags">Perl, Mongers, Tel Aviv, Israel, meeting, DBI, DBIx-Class, local-lib, perlbrew, cpanminus, CPAN, Firebird, SQL</li>
  377. </ul>
  378. <h1>Report on the Latest Tel Aviv Perl Mongers Meeting</h1>
  379. <p>
  380. I attended the latest
  381. <a href="http://telaviv.pm.org/">Tel Aviv Perl Mongers (TelAviv.pm)</a>
  382. meeting the other
  383. day, and am writing this report in order to encourage more people
  384. to come. We didn't have meetings in September or October due to the Jewish
  385. holidays and some renovations on the site, so it was good to finally have
  386. a meeting.
  387. </p>
  388. <p>
  389. Before the meeting, I had helped publicise it on various online news channels,
  390. and thankfully quite a few people (about 20-30) came. I had a previous
  391. appointment that day at 12:00, and so returned home where I ate, worked on
  392. the computer, and rested before the TelAviv.pm meeting.
  393. </p>
  394. <p>
  395. After I rode the bus, I arrived there a few minutes earlier. I met a fellow
  396. Perl monger on the way. We found the room with some difficulty, as there were
  397. very few signs outside the doors of the various rooms in the building. Several
  398. people
  399. including <a href="http://szabgab.com/">Gabor</a> were already sitting
  400. in the room.
  401. They were discussing the upcoming Israeli Perl Workshop in February. In any
  402. case, I decided to walk to the nearby
  403. grocery store to buy some refreshments for the meeting, and when I returned
  404. there were more people in the room.
  405. </p>
  406. <p>
  407. Quite a few people arrived relatively late, but the talks started mostly on
  408. schedule. The first talk (by Erez Schatz) was short, and it discussed some
  409. recent tools that
  410. facilitate the Perl programmer’s life: <a href="http://search.cpan.org/dist/local-lib/">local-lib</a>, <a href="http://www.perlbrew.pl/">perlbrew</a>, cpanm
  411. and pm-uninstall. The talk was very fun, and he ended up covering some other
  412. tools in brief in the last slide. I’m still not convinced that I should use
  413. CPAN-Minus instead of my CPANPLUS (especially given
  414. <a href="http://search.cpan.org/dist/CPANPLUS-Dist-Mageia/">CPANPLUS-Dist-Mageia</a>
  415. and friends), but I still like perlbrew and local::lib and pm-uninstall seems
  416. useful.
  417. </p>
  418. <p>
  419. Erez mentioned that on Perl forums there were several very common and hated
  420. questions like “How do I uninstall a perl module?” or “How can I use
  421. CPAN without root?” and that these technologies address these needs precisely.
  422. </p>
  423. <p>
  424. After this talk, Erez gave a longer talk about DBIx-Class, which is an
  425. Object-Relational Mapper (ORM) for Perl. For the demo, he used a company
  426. whose employees are dogs, and the slides featured many pictures of dogs in
  427. suits (some of them pretty scary). There were a few glitches in the
  428. demonstration, but they
  429. were promptly overcome, and the <tt>DBIC_TRACE=1</tt> flag was a big help.
  430. One bug in the code was that instead of updating the employee's department
  431. (by looking it up by name), the department's name was updated (globally). I
  432. any case, it was an enjoyable talk, but the person who sat next to me said
  433. that she didn’t like it because she used to be a DBA, and she was worried about
  434. performance.
  435. </p>
  436. <p>
  437. Erez mentioned that DBIx-Class was the “Elephant in the Room” of Perl ORMs,
  438. which I had concluded was the case as well.
  439. </p>
  440. <p>
  441. After that talk, there was a break, where people got to eat more of the
  442. cookies I bought and to chat. Afterwards, Ido Kanner presented about
  443. <a href="http://www.firebirdsql.org/">Firebird SQL</a>. It was a good talk,
  444. and Ido drew some comparisons between Firebird and SQLite, MySQL and
  445. PostgreSQL. Firebird looks interesting and it also has embedded (like
  446. SQLite) and read-only modes.
  447. </p>
  448. <p>
  449. One problem during the talk was that the projector kept shutting down,
  450. and it took us some trouble to restart it. We hoped this problem would be
  451. resolved in upcoming meetings.
  452. </p>
  453. <p>
  454. After the meeting, some of us (about 10) went to Spaghettim (a pasta/etc.
  455. place) and had dinner. We chatted about Atheism, Cable company tech-support,
  456. GNOME 3 and KDE 4, and lots of other stuff. This time I had a pizza, which
  457. although not too bad, made me realise I will be ordering pasta there from now
  458. on.
  459. </p>
  460. <p>
  461. To sum up, it was a very enjoyable meeting, and I’m looking forward for
  462. more future ones. One thing notable about it is that this time Sawyer did not
  463. deliver a talk, which made him happy because other people volunteered to do
  464. so instead.
  465. </p>
  466. </div>
  467. <div class="entry" id="breaking_the_perl_debugger_for_fun_and_profit">
  468. <ul class="info">
  469. <li><b>Date:</b> 26-12-2011</li>
  470. <li class="tags">perl,debugger,debugging,refactoring,features,sopa,telaviv,mongers</li>
  471. </ul>
  472. <h1>Breaking the Perl Debugger for Fun and Profit</h1>
  473. <p>
  474. Before I cover the main topic of this entry, here are some short news and
  475. action items:
  476. </p>
  477. <ol>
  478. <li>
  479. <p>
  480. If you have not acted against
  481. <a href="https://www.eff.org/deeplinks/2011/12/fight-blacklist-toolkit-anti-sopa-activists">SOPA
  482. - the proposed online blacklist/censorship bill</a>, you should. Follow the
  483. link for information on how to act against it.
  484. </p>
  485. </li>
  486. <li>
  487. <p>
  488. I have announced the
  489. <a href="http://shlomif-tech.livejournal.com/60825.html">next Tel Aviv
  490. Perl Mongers meeting</a> on my technical journal on LiveJournal.com. It will
  491. take place this Wednesday, on 28 December, 2011. More information in the link.
  492. </p>
  493. </li>
  494. <li>
  495. <p>
  496. <a href="http://golf.shinh.org/">Anarchy Golf</a> is a new server for Code Golf,
  497. which are online programming competitions for implementing code as shortly as
  498. possible. It supports Perl 5, Perl 6 and many other languages. There is
  499. <a href="http://golf.shinh.org/p.rb?Starburst">an active challenge</a>, where
  500. the only Perl 5 submission so far is mine, so I could use some competition.
  501. </p>
  502. </li>
  503. </ol>
  504. <p>
  505. Now for the main topic of the post. Recently, three patches were integrated
  506. into the perl-5 core implementing new features in the perl debugger:
  507. </p>
  508. <ol>
  509. <li>
  510. <a href="http://www.nntp.perl.org/group/perl.perl5.porters/2011/04/msg171038.html">Add "b &lt;filename&gt;:&lt;line&gt; &lt;cond&gt;" to perl -d</a> by me.
  511. </li>
  512. <li>
  513. <a href="http://www.nntp.perl.org/group/perl.perl5.porters/2011/08/msg176454.html">Add enable/disable commands for breakpoints in perl -d</a> also by me.
  514. </li>
  515. <li>
  516. <a href="https://rt.perl.org/rt3/Public/Bug/Display.html?id=104168">"Trace to max depth"</a> by Peter Scott.
  517. </li>
  518. </ol>
  519. <p>
  520. When Father Chrysostomos tried to apply the first patch, he noticed its tests
  521. started failing. Apparently, the breakpoint functionality (irrespective of
  522. the patch's added functionality) became broken in bleadperl, due to a change
  523. in the internals, and it wasn't caught by the debugger's existing tests. I
  524. ended up submitting another patch to add a test for some of the existing
  525. breakpoint functionality.
  526. </p>
  527. <p>
  528. The other two patches passed all of their own tests and the existing ones, but
  529. that wasn't the end of the story. A short time afterwards
  530. <a href="https://rt.perl.org/rt3/Public/Bug/Display.html?id=104820">a
  531. regression was reported in the debugger</a>, which was caused by one of the
  532. patches that I introduced. While, I fixed it with a test, it was soon followed
  533. by other reports and fixes. None of these bugs were caught by the test suite
  534. of the perl debugger, which is incredibly incomplete.
  535. </p>
  536. <p>
  537. Another E-mail that caused an active discussion was
  538. <a href="http://www.nntp.perl.org/group/perl.perl5.porters/2011/11/msg179847.html">my
  539. proposal to add strict and warnings to lib/perl5db.pl</a>, in which someone
  540. kept arguing against it, and eventually said he confused it (it being the
  541. defualt command-line debugger front-end) with the debugger's guts, and ended
  542. up also supporting adding "use strict;".
  543. </p>
  544. <p>
  545. I ended up working on adding "strict" to the debugger on a git branch, and
  546. was eventually successful (though I temporarily broken no-strict code on the
  547. debugger evaluated lines, to which I added a test.). RJBS (the current
  548. pumpking) said he'd like to integrate this patch only after perl-5.16.x
  549. is released.
  550. </p>
  551. <p>
  552. The morals of this story is that the perl debugger needs more tests, and
  553. that trying to enhance it can easily break it. I started
  554. <a href="https://github.com/shlomif/perl/tree/perl-d-add-tests-3">a branch
  555. on GitHub</a> where I've been committing more tests to the perl debugger
  556. to enhance its coverage.
  557. </p>
  558. <p>
  559. There's also a Google Code-In task for devising a strategy to do that, and
  560. I've volunteered to mentor it. All this will hopefully result in less breakage
  561. in the future.
  562. </p>
  563. <p>
  564. Happy Holidays, and a Happy New Year.
  565. </p>
  566. </div>
  567. <div class="entry" id="report_on_israeli_perl_workshop_2012">
  568. <ul class="info">
  569. <li><b>Date:</b> 27-03-2012</li>
  570. <li class="tags">perl, workshop, israel, events, 2012</li>
  571. </ul>
  572. <h1>Report on the Israeli Perl Workshop 2012</h1>
  573. <p>
  574. Well, I've got a lot of stuff I’d like to blog about in the various blogs of
  575. mine, and so I’m starting with this report on the
  576. <a href="http://act.perl.org.il/ilpw2012/">Israeli Perl Workshop of 2012</a>,
  577. which had taken place in 28 February, 2012. Moreover, April Fools' Day is
  578. approaching, and I had an idea for a Perl-related April Fools' gag, but after
  579. telling it to RJBS (the current Perl pumpking), he and I agreed that it would
  580. hit too many nerves. (PerlJam on IRC said he liked it, though). Maybe I’ll
  581. publish it on 2 April with a big disclaimer on top, just for kicks.
  582. </p>
  583. <p>
  584. Anyway, here is the report. I had originally posted it to the Perl in Israel
  585. mailing list for review, but did not get any reviews, so it may not be too
  586. letter-perfect, but I guess that’s life.
  587. </p>
  588. <p>This is my report about the
  589. <a href="http://act.perl.org.il/ilpw2012/">Israeli Perl Workshop of 2012</a> . It was
  590. a fun and educational event, and I'm glad I was able to attend it. For better
  591. or for worse, all the talks I attended were in Room 1, but I was still able
  592. to hear the ends of a few talks in Room 2 (because the corresponding talks
  593. in Room 1 ended before them).</p>
  594. <p>I set up an alarm the night before in order to wake up early in time for the
  595. event, and ended up waking up some time before it (and even the alarm time was
  596. much earlier than what I was used to). Then I made some preparations, ate
  597. breakfast, and caught the appropriate bus. After I walked from the bus station
  598. to Shenkar, it took me some time to find the place, because it wasn't the
  599. same entrance as our normal rooms, and the signs were confusing. What I needed
  600. to do was to take the stairs down to the yard, and then go to the organisation
  601. room, but it was hard to find.</p>
  602. <p>There I got my name sticker, the schedule, and some swag from booking.com. I’d
  603. like to thank <a href="http://www.booking.com/">Booking.com</a> for sponsoring the Israeli
  604. Perl Workshop 2012 (as well as having a presence there and giving some swag
  605. and chocolates), and they are looking for software developers with Perl
  606. experience to relocate to Amsterdam, so please consider working for them.</p>
  607. <p>In the yard, I met a few people including
  608. <a href="http://search.cpan.org/~flora/">Florian Ragwitz</a> (a.k.a &quot;FLORA&quot; on CPAN or
  609. &quot;rafl&quot; on IRC - he has many cool modules there, including quite a few XS ones),
  610. who was one of the workshop’s visitors from Germany. Despite being German, his
  611. English accent sounded English to us. Later on we discussed accents in English
  612. and he noted that the accents of some Israelis he met sounded like French to
  613. him (while ours seemed less so). This is strange, because Israelis can
  614. distinguish between a French accent in English and an Israeli Hebrew accent in
  615. English. </p>
  616. <p>Anyway, Florian told me that he is planning on reviewing and pulling my
  617. Test::Aggregate GitHub pull request Real Soon Now™, a fact which has brought
  618. me some relief, because I've tried to contact him on IRC and ask him if he
  619. remembers.</p>
  620. <p>For better or for worse, all the talks that I preferred to hear took place in
  621. room #1 (while sometimes visiting Room #2) to hear the ends of talks. I still
  622. would be happy to hear many of the talks that took place in Room #2 in the
  623. normal Tel Aviv Perl Mongers meetings, or alternatively, those talks in room #1
  624. which lacked enough time to be conveyed satisfactorily.</p>
  625. <p>The first talk in the day was
  626. <a href="http://search.cpan.org/~eilara/">Ran Eilam</a>’s talk about &quot;Syntactic Sugar
  627. causes Cancer of the Semicolon”, which had to be trimmed towards the end,
  628. because
  629. the introduction may have taken too long. The talk was interesting starting
  630. from an example of <code>ptr-&gt;val</code> being sugar in the C programming language
  631. for <code>(*ptr).val</code> and continuing to further examples. Ran raised the issue
  632. of whether syntactic sugar was important or not, which turns out to not be
  633. a straightforward question. He then demonstrated some modules for syntactic
  634. sugar on CPAN.</p>
  635. <p>I hope Ran can give a rerun of it on one of the mongers' meetings with more
  636. time allocated for that.</p>
  637. <p>After that I attended the talk of Stefan Hornburg (“racke”, known as
  638. <a href="http://search.cpan.org/~hornburg/">HORNBURG on CPAN</a>) who was another
  639. visitor from Germany, about
  640. <a href="http://act.perl.org.il/ilpw2012/talk/3955">Template::Flute</a> which is a
  641. designer’s friendly template system. In this template, one uses an HTML file
  642. with standard HTML attributes for designating the fields that needs to be
  643. replaced, and then an XML specification file that specifies how to process
  644. the HTML (and in addition one uses Perl to give it data). As a result the
  645. designers can manipulate the HTML with their own tools, while still
  646. allowing the programmers to populate it with data.</p>
  647. <p>This seems like an interesting and potentially useful tool, but it’s
  648. less expressive than template systems such as Template Toolkit. After the talk,
  649. another attendee whom we talked in private questioned the need for both the
  650. HTML file and the XML specification, but I didn't find a way to avoid it
  651. given the constraints that the HTML will be valid HTML 4/XHTML 1.</p>
  652. <p>The next talk about Time Management in Software Projects was cancelled because
  653. the presenter did not come (due to lack of time management as we joked then).
  654. I was able to catch a glimpse of the end of
  655. <a href="http://corky.net/dotan/">Dotan Dimet</a>’s “Perl and JavaScript:
  656. bioinformatics in a browser window” talk, but I don’t remember a lot of
  657. it except for a small amount of demonstration.</p>
  658. <p>The talk about Zero to CPAN was eventually given by
  659. <a href="http://blogs.perl.org/users/sawyer_x/">Sawyer</a> instead of by
  660. <a href="http://blogs.perl.org/users/erez_schatz/">Erez Schatz</a>. It was a nice one, and I’ve learned about
  661. <a href="http://metacpan.org/release/CPAN-Changes">the CPAN-Changes module</a> there
  662. (after Florian mentioned it, though). Sawyer covered the way to get to a
  663. working CPAN-like distribution from scratch using tools such as
  664. module-starter and explained what every file in the CPAN module hierarchy
  665. does, and demonstrated some test-driven-development. I knew most of it already,
  666. but it was still a fun talk.</p>
  667. <p><a href="http://www.linkedin.com/in/amirfr">Amir Friedman</a>‘s talk about software
  668. configuration management (SCM) came next,
  669. and he discussed some open-source solutions for the various parts of SCM,
  670. which include version control, release management, task management, and
  671. project management. He recommended Gitflow (which we had a talk about
  672. on the Tel Aviv mongers mailing list) for version control and release
  673. management, and a different solution called Jenkins for issue tracking (if
  674. I remember correctly). I then asked what he thought of integrated “all-in-one”
  675. solutions for SCM, and he said that those were pricey and he did not have
  676. any significant experience with them.</p>
  677. <p>The lunch break came next and I overheard a talk between two other people
  678. about teaching English to speakers of non-English languages. One of them
  679. said that he once worked with some Spanish Electrical Engineers and that they
  680. were “completely isolated” from the rest of the world because they didn’t
  681. read the literature in English. Then we discussed whether it was economical
  682. to teach English to hundreds of millions of speakers of Spanish, or whether
  683. we should expect most things to be translated. It was compared to the
  684. “give a man a fish” vs. “teach a man to fish”. We also discussed the fact that
  685. Dutchmen tended to have very good English, and one of the other people
  686. commented that it was true, but that they still tended to prefer using
  687. software with Dutch localisation.</p>
  688. <p>I’ve also talked with Sawyer about his upcoming
  689. <a href="http://act.perl.org.il/ilpw2012/talk/3936">“CGI.pm MUST DIE!” talk</a>. He
  690. said that he needs to become mentally energised for that talk because he
  691. feels strongly about it and wants to convey the energy. He passed an
  692. anecdote from a conference in Europe, in which he had given a talk about
  693. Dancer, and said he was so emotional then that people said “You must
  694. see him” and rushed to see his other talk. Moreover, afterwards, when asked
  695. who were the two best presenters in the conference, they said “[Someone
  696. very famous] and that Dancer guy”.</p>
  697. <p>The anti-CGI.pm presenting was indeed energetic and emotional, but kinda fell
  698. below my expectations due to the yard talk that preceded it. It was still
  699. pretty informative. Dotan Dimet later took the stage for the rebuttal
  700. of “CGI.pm - the only web development framework you’ll ever need” which was
  701. less emotional but still interesting. I was not convinced that CGI.pm’s
  702. HTML generation routines were a good way to do output HTML (I never really
  703. liked them), so I may have been more convinced by Sawyer.</p>
  704. <p><a href="http://www.ynonperek.com/">Ynon Perek</a>’s
  705. <a href="http://act.perl.org.il/ilpw2012/talk/3977">talk</a> about
  706. “Implementing Perl (Moose) Design Patterns” came next, which was interesting,
  707. but again lacked adequate time to cover everything, and I hope will be given
  708. with less time constraints. One anecdote from there was that Ynon said there
  709. where three primary ways for polymorphism in Perl: Inheritance (“is-a”),
  710. Roles/Traits (“does-a”) and Containment/Delegation (“has-a”) and that
  711. he could no longer recommend inheritance (but did not get to explain why not
  712. from what I recall).</p>
  713. <p>In any case, I was surprised at Ynon’s implementation of the Factory
  714. pattern, and don’t remember the implementation given by him.</p>
  715. <p>Next came Tamir Lousky’s
  716. <a href="http://act.perl.org.il/ilpw2012/talk/3953">talk</a> about generating vector
  717. graphics with Perl and SVG. Its slides contained a lot of very nice eye candy.
  718. The introduction
  719. to SVG and generating it was quite rudimentary, and did not cover the full
  720. potential of SVG. The demonstration and explanation of the module for
  721. generating random trees using SVG was interesting.</p>
  722. <p><a href="http://act.perl.org.il/ilpw2012/talk/3959">David Tabachnikov</a>’s next gave an
  723. interesting talk called “Scaling Up”. He
  724. contrasted optimisation (which makes your code run faster with the existing
  725. resources) to vertical scaling (= buying faster computers) to Horizontal
  726. scaling (= buying more hardware). He also noted that there’s some speed
  727. difference between the various SQL databases, but he did not encounter a
  728. situation where it would have made too much difference.</p>
  729. <p>The last feature of the evening were the lightning talks. I recall a talk
  730. by Florian Ragwitz about Google Code-In and Google Summer-of-Code. I also
  731. recall <a href="http://szabgab.com/">Gabor</a>’s talk about surviving in an uncooperative
  732. workplace. He said
  733. that if the workplace does not practise best practices such as using version
  734. control systems or writing automated tests, one can create their own
  735. small island of sanity where they make use of that on their own, and gradually
  736. convince the rest of the organisation that it’s beneficial.</p>
  737. <p>After the lightning talks, some people went to a local restaurant for dinner,
  738. but I decided against it because I was too tired from waking up early. As a
  739. result, I found someone who drove up north to drive me home, and got home.</p>
  740. <p>In the schedule I noticed that one could go to a certain URL at
  741. <a href="http://www.oreilly.com/">O’Reilly</a> and
  742. receive a free E-book of their choice. I used this opportunity to get the book
  743. <a href="http://shop.oreilly.com/product/9780596510046.do">Beautiful Code</a> , which
  744. I have started reading.</p>
  745. <p>The day was exhausting but very fun, and I enjoyed all the talks I attended.
  746. I’d like to thank the organisers of the event and most notably
  747. <a href="http://szabgab.com/">Gabor Szabo</a> and Sawyer X,
  748. <a href="http://www.shenkar.ac.il/">Shenkar college</a> for providing the venue,
  749. <a href="http://www.booking.com/">Booking.com</a> for the sponsorship, O’Reilly for
  750. the free book presents, the foreign guests who came to present and to attend,
  751. and all the other presenters, who volunteered to give talks.</p>
  752. <p>I hope we can repeat this the next year.
  753. </p>
  754. </div>
  755. <div class="entry" id="the_perl_april_fools_that_could_have_been">
  756. <ul class="info">
  757. <li><b>Date:</b> 09-04-2012</li>
  758. <li class="tags">perl, april fools, joke</li>
  759. </ul>
  760. <h1>The Perl April Fools' Gag That Could Have Been</h1>
  761. <p>
  762. On my <a href="http://blogs.perl.org/users/shlomi_fish/2012/03/report-on-the-israeli-perl-workshop-2012.html">last entry</a>,
  763. I told you that I have had an idea for a Perl-related April Fools’ day gag,
  764. and that I would possibly reveal it on 2-April with a big disclaimer
  765. on top, just for kicks. Well, it’s already 9-April, but I guess it is better
  766. late than never, right?
  767. </p>
  768. <p>
  769. OK, here is the big disclaimer: <b>THIS IS A JOKE. IT’S NOT SERIOUS. SO
  770. RELAX - IT IS NOT GOING TO HAPPEN SOON (AND HOPEFULLY WILL NOT EVER
  771. HAPPEN).</b>.
  772. </p>
  773. <p>
  774. OK, now let’s move on to the gag itself:
  775. </p>
  776. <blockquote>
  777. <p>
  778. 1 April 2012, Tel Aviv, Israel: the Perl foundation has announced today
  779. that by inspiration from Mozilla Firefox, the perl-porters (formerly known
  780. as perl5-porters) will adopt a schedule of a quarterly major release.
  781. </p>
  782. <p>
  783. “Since version 6 of Perl has been claimed by a malevolent project that
  784. amounted to very little, we will release Perl version 7 next Summer, followed
  785. by Perl 8 in next Fall, and Perl 9 next Winter.” said the designated Perl
  786. pumpking.The Perl foundation commented that it is sure that users will
  787. appreciate the accelerated release schedule, despite the fact that a lot
  788. of backwards’ compatibility will be broken in each release to further
  789. the language’s improvement.
  790. </p>
  791. <p>
  792. Some prominent Perl porters have added that they are looking into ways
  793. to automatically upgrade the Perl version automatically upon new
  794. releases, similar to the approach followed by the Google Chrome browser.
  795. “We are tired of people using outdated versions of Perl, which results in
  796. a maintenance burden for us, to say nothing of the security risk by bugs in
  797. old Perl versions. So we think the best way to mitigate that would be to
  798. simply force people to upgrade.”
  799. </p>
  800. <p>
  801. The Perl porters are hard at work on perl-7.0.0, which will implement the
  802. upcoming Perl 7 specification with many new and exciting features and
  803. incompatibilities.
  804. </p>
  805. </blockquote>
  806. <p>
  807. Well, like I said, after discussing this idea with
  808. <a href="http://rjbs.manxome.org/">RJBS</a> (the current Perl 5 Pumpking),
  809. he and I agreed that it would be too cruel, given that many people
  810. are sensitive about upgrading their versions of Perl 5. Comparisons of how
  811. old the perl that your workplace/client/etc. has deployed on their systems
  812. is a common source of discussion among perl mongers (and someone told me
  813. one of his clients still used perl 4), and many people would have found
  814. such an announcement alarming instead of funny. But I hope you enjoyed reading
  815. it, and hope you're also looking forward to perl-5.16.0, which should be out
  816. soon.
  817. </p>
  818. </div>
  819. <div class="entry" id="perl_begin_news_9_July_2002">
  820. <ul class="info">
  821. <li><b>Date:</b> 09-07-2012</li>
  822. <li class="tags">perl, begin, beginners, perl-begin, learn</li>
  823. </ul>
  824. <h1>What’s new on the Perl Beginners’s Site</h1>
  825. <p>
  826. The last update on the news feed for
  827. <a href="http://perl-begin.org/">The Perl Beginners’s site</a> was almost a
  828. year ago. While the site continued to improve, I neglected writing a new
  829. entry until now, so I hope this one will compensate for that.
  830. </p>
  831. <p>
  832. So without further ado, here is what is new:
  833. </p>
  834. <ol>
  835. <li>
  836. <p>
  837. We now have a page about <a href="http://perl-begin.org/humour/">Perl
  838. Humour</a>, which was restored from a page in the now offline perl.net.au
  839. wiki.
  840. </p>
  841. </li>
  842. <li>
  843. <p>
  844. Also originally from that wiki is the <a
  845. href="http://perl-begin.org/FAQs/freenode-perl/">Freenode’s #perl channel
  846. Frequently Asked Questions (FAQ) List</a>, which is well worth a read.
  847. </p>
  848. </li>
  849. <li>
  850. <p>
  851. Another restored page is
  852. <a href="http://perl-begin.org/topics/cpan/wrappers-for-distributions/">the
  853. list of CPAN Wrappers for Distributions</a>.
  854. </p>
  855. </li>
  856. <li>
  857. <p>
  858. We added <a href="http://perl-begin.org/uses/web-automation/">a page</a>
  859. about web automation in Perl, and <a
  860. href="http://perl-begin.org/topics/files-and-directories/">one about
  861. manipulating files and directories</a>.
  862. </p>
  863. </li>
  864. <li>
  865. <p>
  866. The
  867. <a href="http://perl-begin.org/platforms/windows/">Perl on Windows page</a>
  868. was enhanced with new links to Strawberry Perl and DWIM Perl.
  869. </p>
  870. </li>
  871. <li>
  872. <p>
  873. We have a new page about
  874. <a href="http://perl-begin.org/training/">Perl Training Providers</a>, which
  875. currently only contains a link to <a href="http://perltraining.org/">the Perl
  876. Training Directory</a>.
  877. </p>
  878. </li>
  879. <li>
  880. <p>
  881. <a href="http://perl-begin.org/tutorials/bad-elements/">The “Perl
  882. Elements to Avoid” page</a> contains many new entries.
  883. </p>
  884. </li>
  885. <li>
  886. <p>
  887. <a href="http://perl-begin.org/tutorials/modern-perl/">Our mirror of
  888. the book <i>Modern Perl</i> by chromatic</a> was updated to its latest
  889. edition.
  890. </p>
  891. </li>
  892. </ol>
  893. <p>
  894. We hope you find these additions useful or enlightening.
  895. </p>
  896. </div>
  897. <div class="entry" id="App_Notifier_cpan_distributions">
  898. <ul class="info">
  899. <li><b>Date:</b> 22-07-2012</li>
  900. <li class="tags">perl, cpan, dancer</li>
  901. </ul>
  902. <h1>Announcement: the App-Notifier CPAN Distributions</h1>
  903. <p>
  904. I would like to announce two new CPAN distributions of mine:
  905. <a href="https://metacpan.org/release/App-Notifier-Service">App-Notifier-Service</a>
  906. and
  907. <a href="https://metacpan.org/release/App-Notifier-Client">App-Notifier-Client</a>.
  908. These are derived from a few simplistic scripts I've written in shell and
  909. Perl, to allow me to notify when a task has finished (e.g:
  910. <tt>make ; finish-client</tt>) or a certain time has elapsed (e.g:
  911. <tt>sleep 240 ; finish-client</tt>), and I decided to create something
  912. more serious as CPAN modules.
  913. </p>
  914. <p>
  915. App-Notifier-Service implements an HTTP service (using Dancer), which
  916. listens for requests, and once one arrives, implements a callback, which
  917. notifies the user on the localhost that the event occured. App-Notifier-Client
  918. complements it by implementing a client that connects to the service
  919. and sends the event.
  920. </p>
  921. <p>
  922. Currently documentation may be lacking, and there are almost no automated
  923. tests in the distributions, but it appears to work nicely. To get started,
  924. read the documentation and you may wish to peruse some of these files
  925. from my home directory. First of all, the <tt>.app_notifier.yml</tt> file:
  926. </p>
  927. <pre>
  928. commands:
  929. default:
  930. - /home/shlomif/bin/desktop-finish-cue
  931. cookie:
  932. - /home/shlomif/bin/desktop-finish-cue
  933. - "--song"
  934. - "/home/music/Music/dosd-mp3s/Cookie.mp3"
  935. client:
  936. targets:
  937. default:
  938. url: "http://localhost:6300/"
  939. lap:
  940. url: "http://lap.shlomifish.org:6300/"
  941. </pre>
  942. <p>
  943. The <tt>desktop-finish-cue</tt> file:
  944. </p>
  945. <pre>
  946. #!/bin/bash
  947. song="/home/music/Music/dosd-mp3s/Theme - Eurovision.mp2"
  948. param="$1"
  949. shift
  950. if test "$param" = "--song"; then
  951. arg="$1"
  952. shift
  953. song="$arg"
  954. fi
  955. xmessage "Your task has been finished! Go check it out." &amp;
  956. mplayer "$song"
  957. </pre>
  958. <p>
  959. And the <tt>finish-server</tt> script:
  960. </p>
  961. <pre>
  962. #!/bin/bash
  963. cd "$HOME"/progs/perl/alert/http-based/hg/App-Notifier-Service &amp;&amp;
  964. perl ./bin/app.pl --port=6300
  965. </pre>
  966. <hr />
  967. <p>
  968. Otherwise, if you're in the Tel Aviv or vicinity, you are invited to
  969. <a href="http://mail.perl.org.il/pipermail/perl/2012-July/012671.html">the
  970. next Tel Aviv Perl Mongers meeting on Wednesday, 25 July 2012</a>. Otherwise,
  971. I wish to note that I have written my first Java golf program as part
  972. of <a href="http://golf.shinh.org/p.rb?Alphabet+texture+">Anarchy golf’s
  973. “Alphabet Texture” challenge</a> (Anarchy golf accepts challenges in many
  974. languages). At 167 bytes, it is over 3 times longer than the shortest Perl
  975. entry which is only 50 bytes (my Perl solution is 52 bytes). But it
  976. was fun to write. For your information,
  977. <a href="http://en.wikipedia.org/wiki/Code_golf">code golf</a> is a challenge
  978. in which, participating programmers are challenged to write the shortest
  979. program that achieves a certain objective. I find it fun and addictive.
  980. </p>
  981. </div>
  982. <div class="entry" id="tech_tip_packaging_cpan_distributions_in_mageia">
  983. <ul class="info">
  984. <li><b>Date:</b> 16-08-2012</li>
  985. <li class="tags">perl, cpan, tip, tech, tech tip, mageia, linux</li>
  986. </ul>
  987. <h1>Tech Tip: How to Package and Maintain CPAN Distributions in Mageia</h1>
  988. <p>
  989. <a href="http://www.mageia.org/">Mageia Linux</a> is an RPM-based
  990. Linux distribution, whose repositories contain
  991. <a href="http://jquelin.blogspot.co.il/2012/07/more-than-3000-perl-packages-in-mageia.html">over
  992. 3,000 CPAN packages</a>, and part of the reason why it has so many is
  993. because Jerome Quelin and the other maintainers have worked on tools to
  994. facilitate creating Mageia packages for CPAN distributions and maintaining
  995. them.
  996. </p>
  997. <p>
  998. However, I was a little confused about using
  999. <a href="https://metacpan.org/release/App-Magpie">magpie</a>, so I'd like
  1000. to share my findings here:
  1001. </p>
  1002. <ol>
  1003. <li>
  1004. <p>
  1005. In order to import, upload and submit a new CPAN package into Mageia,
  1006. along with all of its dependencies, one should not use magpie, but rather
  1007. <a href="https://metacpan.org/release/App-CPAN2Pkg">cpan2pkg</a>. Its use
  1008. is very simple: make <tt>rpm</tt> and <tt>urpmi</tt> sudoable, and type
  1009. <tt>cpan2pkg Package::Name</tt> from the command-line inside an X terminal.
  1010. This will start a Tk window where one can monitor the progress of preparing
  1011. new RPM packages and it has an entry box to create more packages (which
  1012. saves time on re-initialising CPAN.pm or CPANPLUS.pm).
  1013. </p>
  1014. </li>
  1015. <li>
  1016. <p>
  1017. In order to upgrade a package, one can type
  1018. <tt>eval $( magpie co -s perl-[PACKAGE_NAME] )</tt> and then
  1019. <tt>magpie update</tt>. magpie requires <a href="https://metacpan.org/release/CPAN-Mini">minicpan</a> to be installed and updated.
  1020. </p>
  1021. </li>
  1022. <li>
  1023. <p>
  1024. In order to install packages, one can do
  1025. <tt>sudo urpmi 'perl(Package::Name)'</tt>. My
  1026. <a href="https://metacpan.org/release/Module-Format">Module-Format module</a>
  1027. facilitates the translation from other notations for writing modules:
  1028. </p>
  1029. <pre>
  1030. up()
  1031. {
  1032. sudo urpmi --auto $(perlmf as_rpm_colon "$@")
  1033. }
  1034. </pre>
  1035. </li>
  1036. </ol>
  1037. </div>
  1038. <div class="entry" id="tpf_debugger_grant_and_new_cpan_distributions">
  1039. <ul class="info">
  1040. <li><b>Date:</b> 01-09-2012</li>
  1041. <li class="tags">perl, foundation, tpf, grant, debugger, cpan, ruby</li>
  1042. </ul>
  1043. <h1>Grant for Improving the Perl Debugger + New CPAN Distributions</h1>
  1044. <p>
  1045. First of all, I am glad to announce that the Perl Foundation grant
  1046. committee has accepted my
  1047. <a href="http://news.perlfoundation.org/2012/08/2012q3-grant-proposal-adding-t.html">grant
  1048. proposal for adding tests and refactoring the built-in perl debugger</a>.
  1049. Here is <a href="http://news.perlfoundation.org/2012/08/2012q3-grant-proposals---resul.html">the announcement</a> for which grant proposals were
  1050. accepted. My grant manager for this grant is
  1051. <a href="http://alanhieu.ml/">Alan Haggai Alavi</a>, whom I've been
  1052. talking with online and have collaborated on a few projects, so I'm really
  1053. happy to work with him again.
  1054. </p>
  1055. <p>
  1056. I have already made some progress with the grant (and this post is part
  1057. of it), and sent a log for Alan Haggai to post as a grant update.
  1058. </p>
  1059. <p>
  1060. That put aside, I'd now like to publicise some of the new distributions
  1061. I have uploaded to CPAN, as I had some ideas for new ones, and am also
  1062. contemplating making enough uploads to have 100 CPAN distributions or more:
  1063. </p>
  1064. <ol>
  1065. <li>
  1066. <p>
  1067. <a href="https://metacpan.org/release/WWW-LinkChecker-Internal">WWW-LinkChecker-Internal</a>
  1068. is a distribution wrapping a script that checks for internal broken links. I
  1069. released the first three versions of it in a day, and it uses WWW::Mechanize.
  1070. The reason why I wrote it was that the WDG HTML validator reported some broken
  1071. links in one of my sites, but not their origins, so I had to trace them in
  1072. a different way, and ended up writing that.
  1073. </p>
  1074. </li>
  1075. <li>
  1076. <p>
  1077. <a href="https://metacpan.org/release/Inline-Ruby">Inline-Ruby</a> is
  1078. an Inline:: distribution I adopted that allows to embed Ruby code inside
  1079. Perl programs. I applied some fixes for it (some of which were not released
  1080. to CPAN yet and some are ugly workarounds), and am planning to maintain it
  1081. further down the road.
  1082. </p>
  1083. </li>
  1084. <li>
  1085. <p>
  1086. <a href="https://metacpan.org/release/Test-TrailingSpace">Test-TrailingSpace</a>
  1087. is a <tt>Test::</tt> namespace distribution for verifying that your code
  1088. does not contain trailing space. Death to trailing space!
  1089. </p>
  1090. </li>
  1091. </ol>
  1092. <p>
  1093. A final anecdote is that when working on one of my CPAN modules I found the
  1094. <tt>b [filename]:[line_num]</tt> feature that I implemented in the perl
  1095. debugger to be of great help, and can be content that I'm eating my own
  1096. dogfood.
  1097. </p>
  1098. <p>
  1099. Cheers for now.
  1100. </p>
  1101. </div>
  1102. <div class="entry" id="tech_tip_overriding_eumm_compiler">
  1103. <ul class="info">
  1104. <li><b>Date:</b> 09-09-2012</li>
  1105. <li class="tags">tech, tip, tech tip, perl, eumm, compiler, gcc, clang</li>
  1106. </ul>
  1107. <h1>Tech Tip: Overriding the C compiler with ExtUtils::MakeMaker</h1>
  1108. <p>
  1109. In order to override the C compiler with ExtUtils::MakeMaker, one can
  1110. do something like:
  1111. </p>
  1112. <pre>
  1113. perl Makefile.PL CC=/usr/bin/clang
  1114. </pre>
  1115. <p>
  1116. Which will make the "CC" variable in the generated makefile be set to
  1117. <tt>/usr/bin/clang</tt> instead of the default. Apparently, setting …

Large files files are truncated, but you can click here to view the full file