[30702] in Perl-Users-Digest
Perl-Users Digest, Issue: 1947 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 27 16:09:54 2008
Date: Mon, 27 Oct 2008 13:09:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 27 Oct 2008 Volume: 11 Number: 1947
Today's topics:
Re: Connect to MS SQL 2005 server from UNIX <slick.users@gmail.com>
Re: Connect to MS SQL 2005 server from UNIX <slick.users@gmail.com>
Re: Connect to MS SQL 2005 server from UNIX <glex_no-spam@qwest-spam-no.invalid>
Re: dealing with time <dontmewithme@got.it>
Re: dealing with time <jurgenex@hotmail.com>
Re: dealing with time <hjp-usenet2@hjp.at>
Re: dealing with time <dontmewithme@got.it>
Re: dealing with time <glennj@ncf.ca>
Re: FAQ 5.28 How can I read in an entire file all at on <hjp-usenet2@hjp.at>
file redirection paul_0403@yahoo.com
Re: file redirection <joost@zeekat.nl>
Re: file redirection <tim@burlyhost.com>
Re: file redirection <someone@example.com>
How to overwrite or mock -e for testing? <helmut@wollmersdorfer.at>
Re: How to overwrite or mock -e for testing? <someone@example.com>
new CPAN modules on Mon Oct 27 2008 (Randal Schwartz)
oop with LibXML/LibXSLT b.sydow@trash-mail.com
Re: perl module to write on a var xhoster@gmail.com
Re: perl module to write on a var <ced@blv-sam-01.ca.boeing.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 26 Oct 2008 22:27:21 -0700 (PDT)
From: Slickuser <slick.users@gmail.com>
Subject: Re: Connect to MS SQL 2005 server from UNIX
Message-Id: <e9d3581a-9a5c-4f09-9bee-f4c944c9392b@b38g2000prf.googlegroups.com>
I tried the specific port (1433) and get this error:
The available DBD drivers are: DBM ExampleP File ODBC Pg Proxy SQLite
Sponge Sybase mysql.
DBI connect('server=xxx,1433','xxx',...) failed: (no error string) at
testSQL.p
If I tried the IP then I get this:
The available DBD drivers are: DBM ExampleP File ODBC Pg Proxy SQLite
Sponge Sybase mysql.
DBI connect('server=IPXXX,1433','xxx',...) failed: (no error string)
at
Cannot log into xx.xx.xx.xx,1433
On windows, I can connect fine to using ODBC with ip or server name
(no port or with port 1433).
------------------------------
Date: Mon, 27 Oct 2008 10:36:47 -0700 (PDT)
From: Slickuser <slick.users@gmail.com>
Subject: Re: Connect to MS SQL 2005 server from UNIX
Message-Id: <0b4adce6-56b1-4ab4-854f-ea280600dc7b@c22g2000prc.googlegroups.com>
On Oct 23, 3:37=A0pm, Dan Rumney <danrum...@warpmail.net> wrote:
> On Oct 23, 2:53=A0pm,Slickuser<slick.us...@gmail.com> wrote:
> <snip>
>
> This isn't really a Perl question, since the problem you're having is
> with the connection to your database.
>
> If I were getting this problem, the first thing I'd check is that port
> 4000. Is that the correct port?
> I'd also look at my Sybase docs and try and determine what the LAYER,
> ORIGIN, SEVERITY, NUMBER messages meant.
>
I tried to use the specific port but it doesn't work either.
Here's the log:
The available DBD drivers are: DBM ExampleP File ODBC Pg Proxy SQLite
Sponge Sybase mysql.
DBI connect('server=3Dxxx,1433','xxx',...) failed: (no error string) at
testSQL.p
The available DBD drivers are: DBM ExampleP File ODBC Pg Proxy SQLite
Sponge Sybase mysql.
DBI connect('server=3DIPXXX,1433','xxx',...) failed: (no error string)
at
Cannot log into xx.xx.xx.xx,1433
------------------------------
Date: Mon, 27 Oct 2008 13:35:25 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Connect to MS SQL 2005 server from UNIX
Message-Id: <490609ed$0$87075$815e3792@news.qwest.net>
Slickuser wrote:
> On Oct 23, 3:37 pm, Dan Rumney <danrum...@warpmail.net> wrote:
>> On Oct 23, 2:53 pm,Slickuser<slick.us...@gmail.com> wrote:
>> <snip>
>>
>
>> This isn't really a Perl question, since the problem you're having is
>> with the connection to your database.
>>
>> If I were getting this problem, the first thing I'd check is that port
>> 4000. Is that the correct port?
>> I'd also look at my Sybase docs and try and determine what the LAYER,
>> ORIGIN, SEVERITY, NUMBER messages meant.
>>
>
> I tried to use the specific port but it doesn't work either.
>
> Here's the log:
>
> The available DBD drivers are: DBM ExampleP File ODBC Pg Proxy SQLite
> Sponge Sybase mysql.
>
> DBI connect('server=xxx,1433','xxx',...) failed: (no error string) at
> testSQL.p
>
>
>
> The available DBD drivers are: DBM ExampleP File ODBC Pg Proxy SQLite
> Sponge Sybase mysql.
>
> DBI connect('server=IPXXX,1433','xxx',...) failed: (no error string)
> at
> Cannot log into xx.xx.xx.xx,1433
>
Can you connect to the port on that server from your machine?
telnet your.server.name 1433
Does the database allow connections from your machine for that username
and password?
------------------------------
Date: Mon, 27 Oct 2008 08:51:37 +0100
From: Larry <dontmewithme@got.it>
Subject: Re: dealing with time
Message-Id: <dontmewithme-62A388.08513627102008@news.tin.it>
In article <ct2ag4pp8eagjmcn3sn20dt20bdc76fqc9@4ax.com>,
J?rgen Exner <jurgenex@hotmail.com> wrote:
> Oh, please.......
>
> print "$seconds seconds are ";
> print "$h hours, " if $h;
> print "$m minutes, " if $m;
> print "$s seconds" if $s;
> print "\n";
I got this. But what If I have 2hr 0 min 10 secs? it'll show up 2hr 10
secs. Anyway, I'll make do with it. Thanks
------------------------------
Date: Mon, 27 Oct 2008 04:46:02 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: dealing with time
Message-Id: <h1abg4h6c9el4qjp16ogs7i4uqri0d7ujn@4ax.com>
Larry <dontmewithme@got.it> wrote:
>In article <ct2ag4pp8eagjmcn3sn20dt20bdc76fqc9@4ax.com>,
> J?rgen Exner <jurgenex@hotmail.com> wrote:
>
>> Oh, please.......
>>
>> print "$seconds seconds are ";
>> print "$h hours, " if $h;
>> print "$m minutes, " if $m;
>> print "$s seconds" if $s;
>> print "\n";
>
>I got this. But what If I have 2hr 0 min 10 secs? it'll show up 2hr 10
>secs. Anyway, I'll make do with it. Thanks
In your last posting you wrote:
<quote>
now I would love to show hours if $h has value >
0, minutes if $m > 0.
<\quote>
That is exactly, what the code above does.
Before that you were asking for
<quote>
I would like to keep showing hours like 25,26 etc... (not days)
</quote>
Before that
<quote>
Is there anyway to sprintf the $diff value to rappresent: hours, mins,
secs ??
And before that
<quote>
I would like know how many minutes ago was that file modified
</quote>
Do you think you could make up you rmind and tell us under
_EXACTLY_WHICH_ CONDITIONS_ you want to print _EXACTLY_ WHAT_?
Chasing a running target is no fun, you know....
jue
------------------------------
Date: Mon, 27 Oct 2008 15:20:08 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: dealing with time
Message-Id: <slrnggbjgo.oe0.hjp-usenet2@hrunkner.hjp.at>
On 2008-10-26 23:20, John W. Krahn <someone@example.com> wrote:
> Peter J. Holzer wrote:
>> On 2008-10-26 13:08, John W. Krahn <someone@example.com> wrote:
>>> Larry wrote:
>>>> I'm using File::stat to get the last mod time of a file:
>>>>
>>>> my $sb = stat $file;
>>>> my $lmod = $sb->mtime;
>>>>
>>>> Now I would like know how many minutes ago (from now) was that file
>>>> modified. Can it actually be done?
>>> my $minutes_last_modified = 1440 * -M $file;
>>
>> Nope. -M computes the difference between the modification time and the
>> time the program was started. There may be a considerable difference
>> between "when the program was started" and "now".
>
> $^T = time;
> my $minutes_last_modified = 1440 * -M $file;
Do you want to win some kind of obfuscation contest?
What's wrong with
my $sb = stat $file;
my $minutes_last_modified = (time - $sb->mtime) / 60;
?
hp
------------------------------
Date: Mon, 27 Oct 2008 19:26:31 +0100
From: Larry <dontmewithme@got.it>
Subject: Re: dealing with time
Message-Id: <dontmewithme-875693.19263127102008@news.tin.it>
In article <h1abg4h6c9el4qjp16ogs7i4uqri0d7ujn@4ax.com>,
J?rgen Exner <jurgenex@hotmail.com> wrote:
> Chasing a running target is no fun, you know....
yeah, I know. The is that your code MAY show: "X hour X secs" if minutes
is 0 or it may show "X hour X min" if seconds is 0. Also, it may show "X
min X secs" if hours is 0 which is OK! How can I get the code show value
nontheless its 0 value based on the value next to it? "X hour 0 min X
secs"
thanks
------------------------------
Date: 27 Oct 2008 18:45:02 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: dealing with time
Message-Id: <slrnggc31g.bt6.glennj@smeagol.ncf.ca>
At 2008-10-27 02:26PM, "Larry" wrote:
> In article <h1abg4h6c9el4qjp16ogs7i4uqri0d7ujn@4ax.com>,
> J?rgen Exner <jurgenex@hotmail.com> wrote:
>
> > Chasing a running target is no fun, you know....
>
> yeah, I know. The is that your code MAY show: "X hour X secs" if minutes
> is 0 or it may show "X hour X min" if seconds is 0. Also, it may show "X
> min X secs" if hours is 0 which is OK! How can I get the code show value
> nontheless its 0 value based on the value next to it? "X hour 0 min X
> secs"
What should happen if both minutes and seconds are zero? Or hours and
seconds are both zero?
Keep it simple and always show hours, minutes and seconds regardless.
prinf "%d hr %d min %d sec\n", $h, $m, $s;
--
Glenn Jackman
Write a wise saying and your name will live forever. -- Anonymous
------------------------------
Date: Mon, 27 Oct 2008 16:22:36 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: FAQ 5.28 How can I read in an entire file all at once?
Message-Id: <slrnggbn5s.oe0.hjp-usenet2@hrunkner.hjp.at>
On 2008-10-27 07:03, PerlFAQ Server <brian@stonehenge.com> wrote:
> 5.28: How can I read in an entire file all at once?
[...]
> You can read the entire filehandle contents into a scalar.
>
> {
> local(*INPUT, $/);
> open (INPUT, $file) || die "can't open $file: $!";
> $var = <INPUT>;
> }
>
> That temporarily undefs your record separator, and will automatically
> close the file at block exit.
Instead of local(*INPUT), these days a lexical file handle should be
used:
{
local $/;
open (my $input, $file) || die "can't open $file: $!";
$var = <$input>;
}
Similarily, in the other examples, a lexical file handle can be used.
(Personally, I use the suffix "_fh" to mark file handles, so that would
be
{
local $/;
open (my $input_fh, $file) || die "can't open $file: $!";
$var = <$input_fh>;
}
or more likely (the shorter the scope, the shorter the variable names):
{
local $/;
open (my $fh, $file) || die "can't open $file: $!";
$var = <$fh>;
}
but YMMV. Oh, and I use "or" instead of "||" for the "in case of error"
idiom.)
hp
------------------------------
Date: Mon, 27 Oct 2008 12:20:33 -0700 (PDT)
From: paul_0403@yahoo.com
Subject: file redirection
Message-Id: <fe1bfb3c-c64f-432b-ae76-36ac9d3308ae@p59g2000hsd.googlegroups.com>
I have a perl program that opens a log file and than prints to it,
that part works well
ie
if (! open (LOG, ">>$logfile"))
{
print STDERR "Cannot open logfile $logfile $!\n";
exit 1;
}
print LOG "Hello world\n";
I want to do something like this and it is not working. Note I want
to redirect the output of the kill command to the same logfile, is
this
possible? If so, what am I missing. Note: at this point LOG is still
open.
system("kill -USR1 \"$1\" > LOG 2>\&1");
Thanks
------------------------------
Date: Mon, 27 Oct 2008 20:43:00 +0100
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: file redirection
Message-Id: <87k5btlt8b.fsf@zeekat.nl>
paul_0403@yahoo.com writes:
> I have a perl program that opens a log file and than prints to it,
> that part works well
>
> ie
>
> if (! open (LOG, ">>$logfile"))
> {
> print STDERR "Cannot open logfile $logfile $!\n";
> exit 1;
> }
>
> print LOG "Hello world\n";
>
>
> I want to do something like this and it is not working. Note I want
> to redirect the output of the kill command to the same logfile, is
> this
> possible? If so, what am I missing. Note: at this point LOG is still
> open.
>
> system("kill -USR1 \"$1\" > LOG 2>\&1");
LOG is not available as a filehandle name in any exec'd programs, and
you have to use numeric arguments in the shell (which you can get from
fileno) to denote file descriptors.
The only file descriptors that are passed on to child processes by
default are STDOUT, STDIN and STDERR. This is handled using the
FD_CLOEXEC (close-on-exec) flag. See the POSIX standard, or a decent
book on UNIX programming.
So, you basically have 2 options: remove the close-on-exec flag on LOG
(see the code below), or redirect STDERR to some log file and then
exec. The latter is simpler and usually what you want anyway for perl
code, since it means your die()/warn() messages go to that log.
#!/usr/bin/perl
use strict;
use warnings;
use Fcntl qw(FD_CLOEXEC F_SETFD F_GETFD);
open LOG,">log.log" or die $!;
# remove the close-on-exec flag from LOG
fcntl(LOG, F_SETFD, fcntl(LOG, F_GETFD, 0) & (-1 ^ FD_CLOEXEC));
my $fn = fileno(LOG);
system qq(echo "test" >&$fn 2>&$fn) and die;
--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
------------------------------
Date: Mon, 27 Oct 2008 12:47:08 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: file redirection
Message-Id: <1VoNk.28705$4u2.20705@newsfe01.iad>
paul_0403@yahoo.com wrote:
> system("kill -USR1 \"$1\" > LOG 2>\&1");
system doesn't know what the LOG filehandler is there.
Since you're doing it this way, perhaps just only use:
system("kill -USR1 \"$1\" > $logfile 2>\&1");
Instead of using open() and then system()?
Also, you probably want >> instead of > to append to the file, rather
than overwrite it by the sound of it.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
------------------------------
Date: Mon, 27 Oct 2008 12:49:12 -0700
From: "John W. Krahn" <someone@example.com>
Subject: Re: file redirection
Message-Id: <ZWoNk.24015$xs1.9958@newsfe05.iad>
paul_0403@yahoo.com wrote:
> I have a perl program that opens a log file and than prints to it,
> that part works well
>
> ie
>
> if (! open (LOG, ">>$logfile"))
> {
> print STDERR "Cannot open logfile $logfile $!\n";
> exit 1;
> }
>
> print LOG "Hello world\n";
>
>
> I want to do something like this and it is not working. Note I want
> to redirect the output of the kill command to the same logfile, is
> this possible? If so, what am I missing.
perldoc -f kill
> Note: at this point LOG is still open.
>
> system("kill -USR1 \"$1\" > LOG 2>\&1");
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
------------------------------
Date: Mon, 27 Oct 2008 21:21:47 +0100
From: Helmut Wollmersdorfer <helmut@wollmersdorfer.at>
Subject: How to overwrite or mock -e for testing?
Message-Id: <ge54eg$j5h$1@geiz-ist-geil.priv.at>
Hi,
to test a module like this
package MyModule;
sub get_foo {
my $file = '/etc/foo.conf';
if (-e $file) {
open my $fh,'<',$file;
my $content = <$fh>;
return $content;
}
}
I tried to mock '-e'
=== get_foo.t ===
#!perl -T
use strict;
use warnings;
my %file;
use overload
'-e' => sub {
my ($name) = @_;
print 'trying mocked -e',"\n";
return exists $file{$name};
};
use Test::More qw(no_plan);
$file{foo} = 1;
ok(-e 'foo', 'file foo exists'); # does not work
__END__
The above does not overwrite the behaviour of -e.
How can I do it?
TIA
Helmut Wollmersdorfer
------------------------------
Date: Mon, 27 Oct 2008 12:53:10 -0700
From: "John W. Krahn" <someone@example.com>
Subject: Re: How to overwrite or mock -e for testing?
Message-Id: <H_oNk.8750$3w.3461@newsfe19.iad>
Helmut Wollmersdorfer wrote:
>
> to test a module like this
>
> package MyModule;
>
> sub get_foo {
> my $file = '/etc/foo.conf';
>
> if (-e $file) {
Why are you using -e? You have a race condition.
> open my $fh,'<',$file;
> my $content = <$fh>;
> return $content;
> }
> }
sub get_foo { my $fh; open $fh, '<', '/etc/foo.conf' and return scalar
<$fh> }
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
------------------------------
Date: Mon, 27 Oct 2008 04:42:22 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Oct 27 2008
Message-Id: <K9DrqM.1yy7@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
AnyEvent-Mojo-0.3
http://search.cpan.org/~melo/AnyEvent-Mojo-0.3/
Run Mojo apps using AnyEvent framework
----
App-Rad-0.4
http://search.cpan.org/~garu/App-Rad-0.4/
Rapid (and easy!) creation of command line applications
----
App-ZofCMS-0.0106
http://search.cpan.org/~zoffix/App-ZofCMS-0.0106/
web framework and templating system for small-medium sites.
----
App-ZofCMS-Plugin-DBI-0.0202
http://search.cpan.org/~zoffix/App-ZofCMS-Plugin-DBI-0.0202/
DBI access from ZofCMS templates
----
App-ZofCMS-Plugin-FormChecker-0.0201
http://search.cpan.org/~zoffix/App-ZofCMS-Plugin-FormChecker-0.0201/
plugin to check HTML form data.
----
App-ZofCMS-Plugin-FormChecker-0.0301
http://search.cpan.org/~zoffix/App-ZofCMS-Plugin-FormChecker-0.0301/
plugin to check HTML form data.
----
App-ZofCMS-Plugin-FormFiller-0.0101
http://search.cpan.org/~zoffix/App-ZofCMS-Plugin-FormFiller-0.0101/
fill HTML form elements' values.
----
Bundle-Net-SNMP-Mixin-0.11
http://search.cpan.org/~gaissmai/Bundle-Net-SNMP-Mixin-0.11/
A bundle for Net::SNMP::Mixins
----
Business-DPD-0.13
http://search.cpan.org/~domm/Business-DPD-0.13/
handle DPD lable generation
----
Business-ISBN-2.04
http://search.cpan.org/~bdfoy/Business-ISBN-2.04/
work with International Standard Book Numbers
----
CGI-Lazy-1.00
http://search.cpan.org/~vayde/CGI-Lazy-1.00/
----
CPAN-Testers-ParseReport-0.0.13
http://search.cpan.org/~andk/CPAN-Testers-ParseReport-0.0.13/
parse reports to www.cpantesters.org from various sources
----
CPAN-Testers-ParseReport-0.0.14
http://search.cpan.org/~andk/CPAN-Testers-ParseReport-0.0.14/
parse reports to www.cpantesters.org from various sources
----
Catalyst-Authentication-Store-DBIx-Class-0.108
http://search.cpan.org/~jayk/Catalyst-Authentication-Store-DBIx-Class-0.108/
A storage class for Catalyst Authentication using DBIx::Class
----
Catalyst-Plugin-Authentication-0.10008
http://search.cpan.org/~jayk/Catalyst-Plugin-Authentication-0.10008/
Infrastructure plugin for the Catalyst authentication framework.
----
Catalyst-View-RRDGraph-0.03
http://search.cpan.org/~jlmartin/Catalyst-View-RRDGraph-0.03/
RRD Graph View Class
----
Class-DBI-Lite-0.015
http://search.cpan.org/~johnd/Class-DBI-Lite-0.015/
Lightweight ORM for Perl
----
Config-Augeas-0.302
http://search.cpan.org/~ddumont/Config-Augeas-0.302/
Edit configuration files through Augeas C library
----
DBIx-Class-InflateColumn-Object-Enum-0.02
http://search.cpan.org/~jmmills/DBIx-Class-InflateColumn-Object-Enum-0.02/
Allows a DBIx::Class user to define a Object::Enum column
----
Data-CloudWeights-0.2.70
http://search.cpan.org/~pjfl/Data-CloudWeights-0.2.70/
Calculate values for an HTML tag cloud
----
Data-Util-0.04
http://search.cpan.org/~gfuji/Data-Util-0.04/
A selection of utilities for data and data types
----
Event-RPC-1.01
http://search.cpan.org/~jred/Event-RPC-1.01/
Event based transparent Client/Server RPC framework
----
File-Find-Object-0.1.2
http://search.cpan.org/~shlomif/File-Find-Object-0.1.2/
An object oriented File::Find replacement
----
Finance-Quote-1.15
http://search.cpan.org/~ecocode/Finance-Quote-1.15/
Get stock and mutual fund quotes from various exchanges
----
Games-Go-Referee-0.07
http://search.cpan.org/~deg/Games-Go-Referee-0.07/
Check the moves of a game of Go for rule violations.
----
Games-Go-SGF-0.10
http://search.cpan.org/~deg/Games-Go-SGF-0.10/
Parse and dissect Standard Go Format files
----
Games-Go-SGF-0.11
http://search.cpan.org/~deg/Games-Go-SGF-0.11/
Parse and dissect Standard Go Format files
----
Gtk2-1.202
http://search.cpan.org/~tsch/Gtk2-1.202/
Perl interface to the 2.x series of the Gimp Toolkit library
----
HTTP-DownloadLimit-0.1
http://search.cpan.org/~nanobit/HTTP-DownloadLimit-0.1/
module to set restrictions for files downloading from your webserver
----
HTTP-Session-0.05
http://search.cpan.org/~tokuhirom/HTTP-Session-0.05/
simple session
----
IPTables-ChainMgr-0.8
http://search.cpan.org/~mrash/IPTables-ChainMgr-0.8/
Perl extension for manipulating iptables policies
----
IPTables-Parse-0.7
http://search.cpan.org/~mrash/IPTables-Parse-0.7/
Perl extension for parsing iptables firewall rulesets
----
Image-ExifTool-7.50
http://search.cpan.org/~exiftool/Image-ExifTool-7.50/
Read and write meta information
----
POE-Component-IRC-Plugin-CoinFlip-0.0101
http://search.cpan.org/~zoffix/POE-Component-IRC-Plugin-CoinFlip-0.0101/
flip coins on IRC.
----
Padre-0.13
http://search.cpan.org/~szabgab/Padre-0.13/
Perl Application Development and Refactoring Environment
----
Padre-Plugin-PAR-0.03
http://search.cpan.org/~smueller/Padre-Plugin-PAR-0.03/
PAR generation from Padre
----
ParaDNS-1.8
http://search.cpan.org/~msergeant/ParaDNS-1.8/
a DNS lookup class for the Danga::Socket framework
----
Path-Extended-0.02
http://search.cpan.org/~ishigaki/Path-Extended-0.02/
yet another Path class
----
Scion-0.01
http://search.cpan.org/~gfuji/Scion-0.01/
Support Class for Inside-Out Nature of objects
----
Sledge-HTTPSession-0.01_01
http://search.cpan.org/~tokuhirom/Sledge-HTTPSession-0.01_01/
HTTP::Session to Sledge bindings
----
Snort-Rule-1.07
http://search.cpan.org/~saxjazman/Snort-Rule-1.07/
Perl extension for dynamically building snort rules
----
String-Diff-0.04
http://search.cpan.org/~yappo/String-Diff-0.04/
Simple diff to String
----
Text-ParseWords-3.27
http://search.cpan.org/~chorny/Text-ParseWords-3.27/
parse text into an array of tokens or array of arrays
----
WWW-Contact-0.05
http://search.cpan.org/~fayland/WWW-Contact-0.05/
Get contacts/addressbook from Web
----
WWW-Contact-0.06
http://search.cpan.org/~fayland/WWW-Contact-0.06/
Get contacts/addressbook from Web
----
WWW-NicoVideo-Download-0.01
http://search.cpan.org/~miyagawa/WWW-NicoVideo-Download-0.01/
Download FLV/MP4/SWF files from nicovideo.jp
----
Wiki-Toolkit-Plugin-JSON-0.03
http://search.cpan.org/~dom/Wiki-Toolkit-Plugin-JSON-0.03/
A Wiki::Toolkit plugin to output RecentChanges JSON.
----
XML-FeedPP-0.36
http://search.cpan.org/~kawasaki/XML-FeedPP-0.36/
Parse/write/merge/edit RSS/RDF/Atom syndication feeds
----
XML-TreePP-0.36
http://search.cpan.org/~kawasaki/XML-TreePP-0.36/
Pure Perl implementation for parsing/writing xml files
----
genpass-0.07
http://search.cpan.org/~xsawyerx/genpass-0.07/
Quickly create secure passwords
----
genpass-0.08
http://search.cpan.org/~xsawyerx/genpass-0.08/
Quickly create secure passwords
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Mon, 27 Oct 2008 07:34:31 -0700 (PDT)
From: b.sydow@trash-mail.com
Subject: oop with LibXML/LibXSLT
Message-Id: <f89facf5-d503-46d4-b290-68194e1803bb@l64g2000hse.googlegroups.com>
Hi,
i would like to write a Perl class, that uses the Libarys LibXML/
LibXSLT. But it won't run. Everytime it hangup.
Simple straight forward usage as in the Documentation runs without
hangup.
I've written an Samplecode to demonstrate my Problem.
Thanks
#### Sample code ########
#!c:/programme/perl/bin/perl
use strict;
use xmltttt;
my $test = xmltttt->new();
$test->printXsltOutput();
########### Perl Class #######################
package xmltttt;
use strict;
use XML::LibXSLT;
use XML::LibXML;
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
bless $self, $class;
my $parser = XML::LibXML->new();
$self->{'document'} = $parser->parse_file('xml/katalog.xml');
$self->{'style_doc'} = $parser->parse_file('xml/xslt.xsl');
return $self;
}
sub printXsltOutput {
my $self = shift;
my $xslt = XML::LibXSLT->new();
my $stylesheet = $xslt->parse_stylesheet($self->{'style_doc'});
my $results = $stylesheet->transform($self->{'document'});
print $stylesheet->output_string($results);
}
1;
#############
######## sample xslt ##########
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" encoding="ISO-8859-1"/>
<xsl:template match="menu">
<ul><xsl:apply-templates/></ul>
</xsl:template>
<xsl:template match="link">
<li><xsl:value-of select="."/></li>
</xsl:template>
</xsl:stylesheet>
########### sample xml #########
<?xml version="1.0" encoding="UTF-8"?>
<katalog id="cat1">
<menu name="BHB/Prozesse" id="bhb">
<link type="1" ref="">asfdsd</link>
<link type="1" ref="">asd</link>
<link type="1" ref="">werwe</link>
<link type="1" ref="">OI</link>
</menu>
</katalog>
------------------------------
Date: 27 Oct 2008 14:48:48 GMT
From: xhoster@gmail.com
Subject: Re: perl module to write on a var
Message-Id: <20081027104916.405$VH@newsreader.com>
"C.DeRykus" <ced@blv-sam-01.ca.boeing.com> wrote:
> On Oct 25, 5:49 am, Larry <dontmewit...@got.it> wrote:
> > Hi,
> >
> > I've been using a perl module that writes binary data on a file...now
> > I would like to save this binary data on a var insted of on a
> > file...the following si the code:
> >
> > my $_mp3 = MP3::Tag->new($file);
> >
> > my $_id3v2 = $_mp3->new_tag("ID3v2");
> > $_id3v2->add_frame($key, $value);
> > $_id3v2->write_tag();
> >
> > I'd rather save the data on a var kept in memory (I must not save the
> > data on a file!)
> >
> > so is there anyway to have my $_mp3 = MP3::Tag->new($file); point to a
> > var?
> >
> Probably not unless MP3::Tags'
> docs hint otherwise. To be sure, you might want to look inside
> the constructor itself:
>
> perldoc -m MP3::Tag | perl -ne 'print if /^sub new/../^}/'
The constructor hints that you can't, but it isn't exactly clear. All it
does is stuff the name into a hash. The actual open of any filehandle
based on the name passed to the constructor seems to be delegated 8 ways
from Sunday.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Mon, 27 Oct 2008 11:20:40 -0700 (PDT)
From: "C.DeRykus" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: perl module to write on a var
Message-Id: <333b7e60-82fa-4cf5-8c8d-5fe582d816f6@d10g2000pra.googlegroups.com>
On Oct 25, 5:49 am, Larry <dontmewit...@got.it> wrote:
> Hi,
>
> I've been using a perl module that writes binary data on a file...now
> I would like to save this binary data on a var insted of on a file...the
> following si the code:
>
> my $_mp3 = MP3::Tag->new($file);
>
> my $_id3v2 = $_mp3->new_tag("ID3v2");
> $_id3v2->add_frame($key, $value);
> $_id3v2->write_tag();
>
> I'd rather save the data on a var kept in memory (I must not save the
> data on a file!)
>
> so is there anyway to have my $_mp3 = MP3::Tag->new($file); point to a
> var?
>
If the MP3::Tag docs don't provide any hints, you can usually peek at
the constructor to see what's
possible:
perldoc -m MP3::Tag |
perl -ne'print if /^sub new/../^}/'
--
Charles DeRykus
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 1947
***************************************