PrePAN

Sign in to PrePAN

PrePAN provides a place
to discuss your modules.

CLOSE

Requests for Reviews Feed

XML::LibXML::Proxy Force LibXML to use a proxy for HTTP(S) external entities

This is my first expedition into CPAN territory. :) For the name, I have the blessing of Shlomi Fish, the current maintainer of XML::LibXML, so that part's settled.

Motivation: my project validates potentially a lot of different DTDs, so I needed to set up some form of local caching. Libxml2's "catalogs" are not appropriate for this because my project doesn't know in advance what versions it'll have to validate (it's not something popular like HTML) and I didn't want to reinvent an entire caching mechanism from scratch. I looked into using XML::LibXML::InputCallback of course, but those cannot be used to override Libxml's built-in "nanohttp" client for HTTP, it only allows adding new protocols. So I resorted to the extreme: XML::LibXML::externalEntityLoader().

With that, I just use LWP::UserAgent to request the URL through the defined proxy, which in my specific case is a local Nginx caching forward proxy.

I documented in KNOWN BUGS that using this quick hack breaks support for "file:///" and other schemes, because externalEntityLoader() is a catch-all. A future version could handle those but I simply had no need for it in my project and wanted to keep things simple.

The core of it is really just a few lines, and I found no elegant tests to include, so "t/" only includes the basics.

vphantom@github 0 comments

Device::TPLink Control TPLink smart home devices with Perl

Device::TPLink is a collection of modules designed to make it easy to control TP-Link's family of smart home products with Perl. They should support all devices that are supported by the Kasa cloud service, but as of now I have only been able to test with the HS200(US) smart light switch and the HS105(US) mini smart plug. If you are on the same LAN as the device (or can reach the device with a TCP connection, you can send commands directly to the device, otherwise you will need to get a token from the Kasa service and interact with the device through the cloud.

This is the first module I've written in many moons and the first that I've thought was worth submitting to CPAN. Before submitting, the module needs to be cleaned up. Right now the POD documentation is largely boilerplate from the module-starter script, and tests need to be written. That said, you can turn lights on and off with this thing right now,

I am not associated with TP-Link in any way, except as a user of their products. The TP-Link protocol information came from several sources, including the "IT Nerd Space" blog, softScheck's "tplink-smartplug" project on GitHub, and GadgetReactor's "pyHS100" project on GitHub.

Feedback is appreciated. I guess that's obvious, since I'm posting here...

verlin@github 0 comments

SVG::Timeline::Compact Compact SVG Timeline Drawing Module

This module originated because SVG::Timeline did not meet my requirements.

I communicated with the author and went through the code with an intention of contributing to it, but realized that it follows a different design philosophy and use case.

The major difference with SVG::Timeline are as follows

  • Start and End are actual DateTime Objects.
  • Auto-calculation of timescale ( min, hours, days, months, years ) based on the events and grid size.
  • Auto Layout to fit multiple events on same row.
  • Tooltips.

jahagirdar@github 0 comments

DBIx::DA A CRUD wrapper for databasess

I am right now looking to put it in a differnt namespace.

As I have come to relaise that DBIx is not the place for it as it does not extend DBI at all or wrap very muuch.

Perhaps becuse is will have many Modules under it does it need its own Brand?

DA::*

DataAccessor::*

Accessor::*

Was thinking of thinking of sticking it under

DB::*

but that is suppose to be for Debug (tough most of the moduels in that space have to do with DB)

Data::*

might not be a good place as that really deals with the data itself not a DB

Any suggestions??

byterock@github 3 comments

Net::ISC::DHCPClient Perl module for reading ISC dhclient leases

The library is intended for determining if a network interface gets its information via DHCP and the known details of the leases issued to the interface.

HQJaTu@github 0 comments

Perl::Critic::Policy::ProhibitSmartmatch Perl::Critic policies which help to avoid both explicit and implicit smartmatching

holcapek@github 1 comment

Device::Network::ConfigParser Network Device Configuration Parser

This module is a harness to take in network device (think switches, routers, etc) configuration, parse them, and output them in specified formats.

As an example, it takes an Cisco ASA config, parse the objects, object-groups, NATs, etc.

The harness is used by the command line utility 'ncp'.

The specific parsers and output drivers are dynamically loaded based on the command line arguments.

gregfoletta@github 2 comments

IO::ReadHandle::Chain Chain read handles

This module provides a mechanism to chain any number of data sources together for reading through a single file handle. This is convenient if you have multiple sources of which some are very large and you need to pretend that they are all inside a single source.

One application is to pretend to wrap a huge file of XML elements in a root element so that it becomes acceptable to XML parsers such as XML::Twig, without actually having to create a modified copy of the huge file:

use IO::ReadHandle::Chain;
use XML::Twig;

$prefix = '<wrapper>';
$suffix = '</wrapper>';
$cfh = IO::ReadHandle::Chain->new(\$prefix, 'huge.xml', \$suffix);
$twig = XML::Twig->new( twig_handlers => { ... } );
$twig->parse($cfh);

NOTE: Read < for &lt; and > for &gt; above. I cannot figure out the Markdown to make them show up correctly.

LouisStrous@github 1 comment

WebApp-Snippy minimalist note-taking web application

A demonstration Perl Dancer CRUD web application written for my capstone course at Independence University

mjgardner@github 0 comments

Sort::Naturally::ICU Perl extension for human-friendly ("natural") sort order, which using ICU library for locale aware sorting.

DESCRIPTION

See: http://search.cpan.org/~serval/Sort-Naturally-XS-0.7.8/lib/Sort/Naturally/XS.pm#DESCRIPTION

LOCALE AWARE SORTING

The following example demonstrates default way to locale aware sorting:

use POSIX;

my @list = ('a'..'c', 'A'..'C');

setlocale(POSIX::LC_ALL, 'en_US.utf8');
my @result = sort @list;
# @result contains  a, A, b, B, c, C

setlocale(POSIX::LC_ALL, 'en_CA.utf8');
@result = sort @list;
# @result contains  A, a, B, b, C, c

The problem is that not all Unix-like OSs completely support POSIX, in fact only Linux fully POSIX compatible. Therefore you can't use above approach in Mac OS or FreeBSD. This module is designed to solve this issue.

To be able to sort a list with an arbitrary locale at any platform it's necessary to use the sorted function with a locale keyword argument. locale should be LDML locale identifier:

use Sort::Naturally::ICU qw/sorted/;

my $list = ['a'..'c', 'A'..'C'];

my $result_us = sorted($list, locale => 'en-US-u-va-posix');
# $result_us contains A, B, C, a, b, c

my $result_ca = sorted($list, locale => 'en-CA-u-va-posix');
# $result_ca contains a, A, b, B, c, C

the_serval@twitter 0 comments