Stories for 2008-01-21
| Newsgroups | gmane.comp.lang.perl.daily.news |
|---|---|
| Message-ID | <1200881052.478111-23913-slash-slashcluster-http-4.osdn.net@use.perl.org> |
use Perl Daily Newsletter
In this issue:
* It feels good to get rid of those four lines
* Perlcast Interviews Ovid about Logic Programming
* New CPAN Distributions for January 20, 2008
+--------------------------------------------------------------------+
| It feels good to get rid of those four lines |
| posted by brian_d_foy on Sunday January 20, @01:38 (User Journal)|
| http://use.perl.org/article.pl?sid=08/01/20/0619207 |
+--------------------------------------------------------------------+
This has bothered me far more than it should. I quite often end up
writing test code that looks like this:
{
my @log = ();
no warnings 'redefine';
*Some::Package::some_func = sub { push @log, [@_] };
sub get_log {
my @old_log = @log;
@log = ();
return @old_log;
}
}
# Then some tests that call subroutines that end up calling
some_func.
The idea is to [0]monkeypatch (Perl word of the week) the module I'm
testing so I can make sure it calls some_func with the right arguments.
For example with [1]TextMate::JumpTo I wanted to test that it was going
to invoke /usr/bin/open with the correct args - without actually going
through with it and opening something. I didn't want the tests to spew a
bunch of random windows into the user's text editor.
None of that is what bothers me. What I find troubling is that get_log is
five lines of code just to read and reset the contents of a list. That's
really quite upsetting, right?
Today I decided I could endure it no longer (I may be being a little
theatrical here) so I spent some time thinking about it. Ideally I'd like
to do away with the temporary variable altogether but I can't see a way
to do that. Instead I've settled for this:
sub get_log { ( my @got, @log ) = @log }
It's not especially pretty but it's better. That temporary still bugs me
though...
Ads by Boggle
Obsessive? Compulsive? Need Help?
No expensive therapy! No painful brain surgery! You can help yourself.
Just step away from the keyboard, take a walk, smell the fresh air. YOU
ARE FREE!
Discuss this story at:
http://use.perl.org/comments.pl?sid=08/01/20/0619207
Links:
0. http://en.wikipedia.org/wiki/Monkey_patch
1. http://search.cpan.org/dist/TextMate-JumpTo/
+--------------------------------------------------------------------+
| Perlcast Interviews Ovid about Logic Programming |
| posted by brian_d_foy on Sunday January 20, @01:39 (User Journal)|
| http://use.perl.org/article.pl?sid=08/01/20/0619243 |
+--------------------------------------------------------------------+
Back at the Nordic Perl Workshop 2007, I sat down with Ovid to talk about
logic programming. Here is the [0]audio for that interview.
Discuss this story at:
http://use.perl.org/comments.pl?sid=08/01/20/0619243
Links:
0. http://www.perlcast.com/audio/Perlcast_Interview_046.mp3
+--------------------------------------------------------------------+
| New CPAN Distributions for January 20, 2008 |
| posted by pudge on Sunday January 20, @18:30 (Module Listings) |
| http://use.perl.org/article.pl?sid=08/01/20/1530211 |
+--------------------------------------------------------------------+
* [0]AUBBC1.0
* [1]Amazon-S3-0.41.2 -- A portable client library for working with and
managing Amazon S3 buckets and keys.
* [2]Amazon-S3-0.411 -- A portable client library for working with and
managing Amazon S3 buckets and keys.
* [3]CHI-0.02 -- Unified cache interface
* [4]CPAN-Reporter-1.07_02 -- Adds CPAN Testers reporting to CPAN.pm
* [5]CPAN-Reporter-1.07_03 -- Adds CPAN Testers reporting to CPAN.pm
* [6]Compress-LZMA-External-0.31 -- Compress and decompress using LZMA
* [7]Compress-LZMA-External-0.32 -- Compress and decompress using LZMA
* [8]Coro-4.37 -- coroutine process abstraction
* [9]Data-FormValidator-Constraints-Words-0.01 -- Data constraints for
word inputs.
* [10]Data-FormValidator-Constraints-Words-0.02 -- Data constraints for
word inputs.
* [11]Devel-GDB-2.01 -- Open and communicate a gdb session
* [12]Encode-JP-Mobile-0.24 -- 日本の携帯電話向け Shift_JIS
(CP932) / UTF-8 エンコーディング
* [13]Finance-Currency-Convert-WebserviceX-0.06002 -- Lightweight
currency conversion using WebserviceX.NET
* [14]Form-Processor-0.16 -- validate and process form data
* [15]Handel-Storage-RDBO-1.00002 -- RDBO storage layer for Handel 1.x
* [16]Hash-AsObject-0.10 -- treat hashes as objects, with arbitrary
accessors/mutators
* [17]Lingua-JA-Romanize-Japanese-0.23 -- Romanization of Japanese
language
* [18]Lingua-TR-Numbers-0.21 -- Converts numbers into Turkish text.
* [19]Lingua-ZH-Romanize-Pinyin-0.23 -- Romanization of Standard
Chinese language
* [20]Log-Handler-0.38_06 -- Log messages to one or more outputs.
* [21]Math-Wavelet-Haar-0.06 -- Perl extension for transforming data
with the Haar Wavelet
* [22]MetaStore-0.27 -- Set of classes for multiuser web applications.
* [23]Moxy-0.20 -- Mobile web development proxy
* [24]Net-Appliance-Session-0.19 -- Run command-line sessions to
network appliances
* [25]Net-MRIM-1.05 -- Perl implementation of mail.ru agent protocol
* [26]OAuth-Lite-1.07 -- OAuth framework
* [27]PApp-1.4 -- multi-page-state-preserving web applications
* [28]POE-Component-CPAN-YACSmoke-1.14 -- Bringing the power of POE to
CPAN smoke testing.
* [29]POE-Component-WebService-Validator-HTML-W3C-0.02 -- a
non-blocking POE wrapper around WebService::Validator::HTML::W3C
* [30]POE-Loop-EV-0.05 -- a bridge that supports EV from POE
* [31]Perl-Repository-APC-2.000_000279 -- Class modelling "All Perl
Changes" repository
* [32]Proc-Exists-0.05 -- quickly check for process existence
* [33]Search-Estraier-0.09 -- pure perl module to use Hyper Estraier
search engine
* [34]Socket-GetAddrInfo-0.08_1 -- RFC 2553's getaddrinfo and
getnameinfo functions.
* [35]Socket-GetAddrInfo-0.08_2 -- RFC 2553's getaddrinfo and
getnameinfo functions.
* [36]Statistics-Test-WilcoxonRankSum-0.0.1 -- perform the Wilcoxon
(aka Mann-Whitney) rank sum test on two sets of numeric data.
* [37]Text-Editor-Easy-0.01 -- The great new Text::Editor::Easy!
* [38]TextMate-JumpTo-0.04 -- Tell TextMate to jump to a particular
file, line
* [39]Tie-CArray-0.14 -- Space-efficient, typed, external C Arrays
(Alpha)
* [40]Time-Elapsed-0.24 -- Displays the elapsed time as a human
readable string.
* [41]Tk-Bounded-1.0.1 -- Base class for widgets derived and bound
binded from others
* [42]WWW-CDBaby-0.05 -- Automate interaction with cdbaby.com!
* [43]Win32-FindWindow-0.02 -- find windows on Win32 systems
* [44]Win32-TestServerManager-0.03 -- manage simple test servers on
Win32
* [45]Win32-WindowsMedia-0.15.0 -- Base Module for Provisiong and
control for Windows Media Services
* [46]perfSONAR_PS-Base-0.04
* [47]perfSONAR_PS-Client-Echo-0.04 -- A module that provides methods
for interacting with perfSONAR Echo services.
* [48]perfSONAR_PS-Client-LS-Remote-0.04 -- A module that provides a
client API for an LS
* [49]perfSONAR_PS-Client-Status-MA-0.04 -- A module that provides
methods for interacting with Status MA servers.
* [50]perfSONAR_PS-Client-Status-SQL-0.04 -- A module that provides
methods for interacting with a Status MA database directly.
* [51]perfSONAR_PS-Client-Topology-MA-0.04 -- A module that provides
methods for interacting with Topology MA servers.
* [52]perfSONAR_PS-Client-Topology-XMLDB-0.04 -- A module that provides
methods for interacting with a Topology MA database directly.
* [53]perfSONAR_PS-Collectors-Daemon-0.04
* [54]perfSONAR_PS-Collectors-LinkStatus-0.04 -- A module that will
collect link status information and store the results into a Link
Status MA.
* [55]perfSONAR_PS-DB-File-0.04 -- A module that provides methods for
adding 'database like' functions to files that contain XML markup.
* [56]perfSONAR_PS-DB-RRD-0.04 -- A module that provides methods for
dealing with rrd files through the RRDp perl module.
* [57]perfSONAR_PS-DB-SQL-0.04 -- A module that provides methods for
dealing with common SQL databases.
* [58]perfSONAR_PS-DB-XMLDB-0.04 -- A module that provides methods for
dealing with the Sleepycat [Oracle] XML database.
* [59]perfSONAR_PS-Services-Daemon-0.04
* [60]perfSONAR_PS-Services-LS-0.04
* [61]perfSONAR_PS-Services-MA-Base-0.04
* [62]perfSONAR_PS-Services-MA-SNMP-0.04
* [63]perfSONAR_PS-Services-MA-Status-0.04 -- A module that provides
methods for the Status MA.
* [64]perfSONAR_PS-Services-MA-Topology-0.04 -- A module that provides
methods for the Topology MA.
* [65]perfSONAR_PS-Status-Common-0.04 -- A module that provides common
methods for Link Status clients and services within the perfSONAR-PS
framework.
* [66]perfSONAR_PS-Topology-Common-0.04 -- A module that provides
various utility functions for Topology structures.
Discuss this story at:
http://use.perl.org/comments.pl?sid=08/01/20/1530211
Links:
0. http://search.cpan.org/~sflex/AUBBC1.0
1. http://search.cpan.org/~tima/Amazon-S3-0.41.2
2. http://search.cpan.org/~tima/Amazon-S3-0.411
3. http://search.cpan.org/~jswartz/CHI-0.02
4. http://search.cpan.org/~dagolden/CPAN-Reporter-1.07_02
5. http://search.cpan.org/~dagolden/CPAN-Reporter-1.07_03
6. http://search.cpan.org/~lbrocard/Compress-LZMA-External-0.31
7. http://search.cpan.org/~lbrocard/Compress-LZMA-External-0.32
8. http://search.cpan.org/~mlehmann/Coro-4.37
9. http://search.cpan.org/~barbie/Data-FormValidator-Constraints-Words-0.01
10. http://search.cpan.org/~barbie/Data-FormValidator-Constraints-Words-0.02
11. http://search.cpan.org/~jezra/Devel-GDB-2.01
12. http://search.cpan.org/~miyagawa/Encode-JP-Mobile-0.24
13. http://search.cpan.org/~claco/Finance-Currency-Convert-WebserviceX-0.06002
14. http://search.cpan.org/~hank/Form-Processor-0.16
15. http://search.cpan.org/~claco/Handel-Storage-RDBO-1.00002
16. http://search.cpan.org/~nkuitse/Hash-AsObject-0.10
17. http://search.cpan.org/~kawasaki/Lingua-JA-Romanize-Japanese-0.23
18. http://search.cpan.org/~burak/Lingua-TR-Numbers-0.21
19. http://search.cpan.org/~kawasaki/Lingua-ZH-Romanize-Pinyin-0.23
20. http://search.cpan.org/~bloonix/Log-Handler-0.38_06
21. http://search.cpan.org/~simcop/Math-Wavelet-Haar-0.06
22. http://search.cpan.org/~zag/MetaStore-0.27
23. http://search.cpan.org/~tokuhirom/Moxy-0.20
24. http://search.cpan.org/~oliver/Net-Appliance-Session-0.19
25. http://search.cpan.org/~aau/Net-MRIM-1.05
26. http://search.cpan.org/~lyokato/OAuth-Lite-1.07
27. http://search.cpan.org/~mlehmann/PApp-1.4
28. http://search.cpan.org/~bingos/POE-Component-CPAN-YACSmoke-1.14
29. http://search.cpan.org/~zoffix/POE-Component-WebService-Validator-HTML-W3C-0.02
30. http://search.cpan.org/~agrundma/POE-Loop-EV-0.05
31. http://search.cpan.org/~andk/Perl-Repository-APC-2.000_000279
32. http://search.cpan.org/~brianski/Proc-Exists-0.05
33. http://search.cpan.org/~dpavlin/Search-Estraier-0.09
34. http://search.cpan.org/~pevans/Socket-GetAddrInfo-0.08_1
35. http://search.cpan.org/~pevans/Socket-GetAddrInfo-0.08_2
36. http://search.cpan.org/~ingrif/Statistics-Test-WilcoxonRankSum-0.0.1
37. http://search.cpan.org/~grommier/Text-Editor-Easy-0.01
38. http://search.cpan.org/~andya/TextMate-JumpTo-0.04
39. http://search.cpan.org/~rurban/Tie-CArray-0.14
40. http://search.cpan.org/~burak/Time-Elapsed-0.24
41. http://search.cpan.org/~dmpetit/Tk-Bounded-1.0.1
42. http://search.cpan.org/~grantg/WWW-CDBaby-0.05
43. http://search.cpan.org/~pia/Win32-FindWindow-0.02
44. http://search.cpan.org/~ishigaki/Win32-TestServerManager-0.03
45. http://search.cpan.org/~shamrock/Win32-WindowsMedia-0.15.0
46. http://search.cpan.org/~perfsonar/perfSONAR_PS-Base-0.04
47. http://search.cpan.org/~perfsonar/perfSONAR_PS-Client-Echo-0.04
48. http://search.cpan.org/~perfsonar/perfSONAR_PS-Client-LS-Remote-0.04
49. http://search.cpan.org/~perfsonar/perfSONAR_PS-Client-Status-MA-0.04
50. http://search.cpan.org/~perfsonar/perfSONAR_PS-Client-Status-SQL-0.04
51. http://search.cpan.org/~perfsonar/perfSONAR_PS-Client-Topology-MA-0.04
52. http://search.cpan.org/~perfsonar/perfSONAR_PS-Client-Topology-XMLDB-0.04
53. http://search.cpan.org/~perfsonar/perfSONAR_PS-Collectors-Daemon-0.04
54. http://search.cpan.org/~perfsonar/perfSONAR_PS-Collectors-LinkStatus-0.04
55. http://search.cpan.org/~perfsonar/perfSONAR_PS-DB-File-0.04
56. http://search.cpan.org/~perfsonar/perfSONAR_PS-DB-RRD-0.04
57. http://search.cpan.org/~perfsonar/perfSONAR_PS-DB-SQL-0.04
58. http://search.cpan.org/~perfsonar/perfSONAR_PS-DB-XMLDB-0.04
59. http://search.cpan.org/~perfsonar/perfSONAR_PS-Services-Daemon-0.04
60. http://search.cpan.org/~perfsonar/perfSONAR_PS-Services-LS-0.04
61. http://search.cpan.org/~perfsonar/perfSONAR_PS-Services-MA-Base-0.04
62. http://search.cpan.org/~perfsonar/perfSONAR_PS-Services-MA-SNMP-0.04
63. http://search.cpan.org/~perfsonar/perfSONAR_PS-Services-MA-Status-0.04
64. http://search.cpan.org/~perfsonar/perfSONAR_PS-Services-MA-Topology-0.04
65. http://search.cpan.org/~perfsonar/perfSONAR_PS-Status-Common-0.04
66. http://search.cpan.org/~perfsonar/perfSONAR_PS-Topology-Common-0.04
Copyright 1997-2006 pudge. All rights reserved.
======================================================================
# Unsubscribe mailto:[email protected]
# News, archives, discussion http://use.perl.org/
# Perl News in The Perl Journal http://www.tpj.com/
# Feedback and news ideas mailto:[email protected]
# http://use.perl.org/submit.pl