[30130] in Perl-Users-Digest
Perl-Users Digest, Issue: 1373 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 19 09:09:43 2008
Date: Wed, 19 Mar 2008 06:09:08 -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 Wed, 19 Mar 2008 Volume: 11 Number: 1373
Today's topics:
called too early to check prototype at <test@example.com>
Re: called too early to check prototype at <jurgenex@hotmail.com>
Re: called too early to check prototype at <ben@morrow.me.uk>
Re: FAQ 5.39 Why do I get weird spaces when I print an <benkasminbullock@gmail.com>
Re: FAQ 6.5 How do I substitute case insensitively on t <achimpeters@gmx.de>
Force installing an upgrade for a module now many modul <nospam@nospam.com>
Re: hex to binary <benkasminbullock@gmail.com>
Installing strawberry perl on winxp sp2 already with ac <nospam@nospam.com>
Is substr only way of getting nth character of string? <lonewolf@well.com>
Re: Is substr only way of getting nth character of stri <abigail@abigail.be>
Re: Is substr only way of getting nth character of stri <tadmc@seesig.invalid>
Re: Need Perl module to get <TITLE> tag of a web page (J.D. Baldwin)
new CPAN modules on Wed Mar 19 2008 (Randal Schwartz)
Re: opening file for appending doesn't work for me <test@example.com>
Re: opening file for appending doesn't work for me <tadmc@seesig.invalid>
problem starting perl script from cron environment - ps <michael.andrassy@gmail.com>
Re: Problem with loop control LAST exiting prematurely <hjp-usenet2@hjp.at>
Re: Problem with loop control LAST exiting prematurely <tadmc@seesig.invalid>
Re: Problem with loop control LAST exiting prematurely <someone@example.com>
XML Parsing in Perl <deepan.17@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 18 Mar 2008 23:53:12 GMT
From: Ron Eggler <test@example.com>
Subject: called too early to check prototype at
Message-Id: <IBYDj.88320$FO1.80199@edtnps82>
Hi,
I get a "called too early to check prototype at" in my script and i have no
idea what this is referring to.It is pointing to this line:
for(my $count = 0; $count < scalar(@dbset); $count++){ which sits on top of
my file and is part of:
use DBI;
#
# Open the DB connection
#
my @dbset=(xmlparse($nemsconf,"DBNAME"));
for(my $count = 0; $count < scalar(@dbset); $count++){
my $myDBI = 'DBI:mysql:' . $dbset[$count] . ':localhost';
my $dbh = DBI->connect($myDBI,'root','novax')
or die "Couldn't connect to database: " . DBI->errstr . "\n";
Any idea what could be wrong here?
Thank you!
Ron
--
chEErs roN
------------------------------
Date: Wed, 19 Mar 2008 01:01:38 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: called too early to check prototype at
Message-Id: <95p0u3hucsvai5fk8550ga61uo6nigib89@4ax.com>
Ron Eggler <test@example.com> wrote:
>Hi,
>
>I get a "called too early to check prototype at" in my script and i have no
>idea what this is referring to.It is pointing to this line:
>for(my $count = 0; $count < scalar(@dbset); $count++)
This can be rewritten in a much easier to read way as
for my $count (0..@dbset-1)
>for(my $count = 0; $count < scalar(@dbset); $count++){
> my $myDBI = 'DBI:mysql:' . $dbset[$count] . ':localhost';
> my $dbh = DBI->connect($myDBI,'root','novax')
> or die "Couldn't connect to database: " . DBI->errstr . "\n";
However, as you don't do anything with $count but to index the array in a
linear fashion it is even easier to use a simple
for(@dbset){
my $myDBI = "DBI:mysql:$_ :localhost";
....
jue
------------------------------
Date: Wed, 19 Mar 2008 01:03:34 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: called too early to check prototype at
Message-Id: <6c56b5-nu9.ln1@osiris.mauzo.dyndns.org>
Quoth Ron Eggler <test@example.com>:
> Hi,
>
> I get a "called too early to check prototype at" in my script and i have no
> idea what this is referring to.It is pointing to this line:
> for(my $count = 0; $count < scalar(@dbset); $count++){ which sits on top of
> my file and is part of:
> use DBI;
> #
> # Open the DB connection
> #
> my @dbset=(xmlparse($nemsconf,"DBNAME"));
Have you by any chance declared xmlparse below like this
sub xmlparse() {
? This is not how you declare a Perl sub. Remove the ().
If not, you will need to reduce your problem to a *small*
*self-contained* program *we can all run*, or we can't help you.
Ben
------------------------------
Date: Tue, 18 Mar 2008 18:50:01 -0700 (PDT)
From: "benkasminbullock@gmail.com" <benkasminbullock@gmail.com>
Subject: Re: FAQ 5.39 Why do I get weird spaces when I print an array of lines?
Message-Id: <a6800714-fd68-4d20-ba8f-483ca8c755b6@e10g2000prf.googlegroups.com>
On Mar 17, 11:46 pm, Ted Zlatanov <t...@lifelogs.com> wrote:
> I think the FAQ should say:
>
> Saying
>
> print "@lines\n";
>
> prints together the elements of @lines with a space between them (unless
> $" has been changed from the default, see `perldoc perlvar').
That seems like a good idea to me.
------------------------------
Date: Wed, 19 Mar 2008 11:37:48 +0100
From: Achim Peters <achimpeters@gmx.de>
Subject: Re: FAQ 6.5 How do I substitute case insensitively on the LHS while preserving case on the RHS?
Message-Id: <47E0ECFC.8000300@gmx.de>
brian d foy schrieb:
> In article <47DE486E.9060102@gmx.de>, Achim Peters <achimpeters@gmx.de>
> wrote:
>
>> PerlFAQ Server schrieb:
>
>>> 6.5: How do I substitute case insensitively on the LHS while preserving
>>> case on the RHS?
>
>>> $a = "this is a TEsT case";
>> I thought, $a should _NEVER_ be used as variable name, even not in
>> examples, except when in sorting context?
>
> Yes, using $a outside of a sort subroutine is now bad form. It's not
> wrong, just bad practice. It wasn't always a bad practice though,
Interesting. You mean, $a and $b got their special meaning later in the
process of developing the perl language?
Things like these usually fall under the category "It's always been that
way, we don't want to change it now for compatibility reasons and for
the sake of the good ol' times ..." ;-)
But to learn - if I got that right - that the name $a was chosen _after_
the first few initial versions of a programming language instead of
something like the other perl "special" variables $[^a-zA-Z] is
surprising to me.
> I'll adjust the answer.
>
> Thanks,
Thank _you_
Bye
Achim
------------------------------
Date: Tue, 18 Mar 2008 23:29:56 -0000
From: "Nospam" <nospam@nospam.com>
Subject: Force installing an upgrade for a module now many modules won't work
Message-Id: <frpjar$8lq$1@north.jnrs.ja.net>
After force upgrading a module, I tried to search the ppm repository and I
met this error msg:
Searching in Active Repositories
error: can't parse
<SOFTPKG NAME="Nagios-NSCA" VERSION="0,1,0,0">
<TITLE>Nagios-NSCA</TITLE>
<ABSTRACTT>Use the Amazon Simple Queue Service</ABSTRACT>
<AUTHOR>Leon Brocard C<acme@astray.com></AUTHOR>
</SOFTPKG>:
mismatched tag at line 4, column 52, byte 136 at
c:/Perl/site/lib/XML/Parser.pm
line 187
Also on any script I try to run I get this error msg:
Can't locate object method "decoded_content" via package "HTTP::Headers" at
(eva
l 16) line 1.
line 1 is usually the line
#! /usr/bin/perl
or
#! perl/bin/perl.exe
Does anyone know how this may be fixed?
------------------------------
Date: Tue, 18 Mar 2008 19:57:24 -0700 (PDT)
From: "benkasminbullock@gmail.com" <benkasminbullock@gmail.com>
Subject: Re: hex to binary
Message-Id: <68c39306-326e-4676-9398-3a89286cf35f@s8g2000prg.googlegroups.com>
On Mar 18, 8:37 pm, "Venkatesh can....can..."
<venkatesh.sou...@gmail.com> wrote:
> How to convert hexadecimal number to binary in perl ??
#! perl
use warnings;
use strict;
# Create the stuff for matching
my $matches = "0123456789ABCDEF";
my %hex2bin;
for (my $i=0;$i<16;$i++) {
$hex2bin{substr($matches,$i,1)}=int($i/8).int(($i/4)%2).int(($i/
2)%2).int($i%2);
}
# Now test
my $hex_string = "1234BAad12345";
print "Before: $hex_string\n";
$hex_string =~ s/([$matches])/$hex2bin{uc($1)}/gi;
print "After: $hex_string\n";
------------------------------
Date: Wed, 19 Mar 2008 08:20:56 -0000
From: "Nospam" <nospam@nospam.com>
Subject: Installing strawberry perl on winxp sp2 already with activeperl
Message-Id: <frqif8$fgr$1@north.jnrs.ja.net>
I am trying to install strawberry perl on winxp sp2 already with activeperl
5.8.6 each time I try the installer it croaks citing various errors on
various files, I was told activeperl and strawberry perl could be installed
on the same machine as long as they do not share the same compile directory,
so far I have been unable to install strawberry perl (both the 5.8.8 alpha
and the 5.10 stable version), is this a known problem and is there a
solution?
------------------------------
Date: Wed, 19 Mar 2008 03:49:37 -0800
From: "Robbie Hatley" <lonewolf@well.com>
Subject: Is substr only way of getting nth character of string?
Message-Id: <zbedndr-o4wFcn3anZ2dnUVZ_gidnZ2d@giganews.com>
I wrote the following, trying to get it to print a block of
20 rows of 20 random characters from a 96-member character
set. But it doesn't work; just just prints a series of
20 "\n" characters, and that's all:
#!/usr/bin/perl
sub rand_int;
srand;
my $i;
my $j;
my $Lower = "abcdefghijklmnopqrstuvwxyz"; # lower-case (26)
my $Upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; # upper-case (26)
my $Digits = "0123456789"; # digits (10)
my $Symbols = "`~!@#$%^&*()-_=+[{]}\\|;:\'\",<.>/?"; # symbols (32)
my $White = "\11\40"; # tab, space ( 2)
my $Charset = $Lower.$Upper.$Digits.$Symbols.$White; # total: (96)
#print ("$Charset\n");
for ( $i = 0 ; $i < 20 ; ++$i)
{
for ( $j = 0 ; $j < 20 ; ++$j )
{
print($Charset[rand_int(0,96)]);
}
print("\n");
}
sub rand_int
{
my ($min, $max) = @_;
return int ( $min + rand ( $max - $min + 0.999 ) ) ;
}
If I "use strict", it won't even compile; the compiler
complains of an unknown variable "@Charset".
Ok, so I've fallen prey to thinking of strings as being
(more or less) arrays of characters, as they are in C
and C++. (Yes, even with C++'s std::string class, you
can still treat strings as arrays of char. To get the
nth character of string variable "asdf", use "asdf[n]".)
In Perl, however, that obviously doesn't work.
I just discovered substr(EXPR, OFFSET, LENGTH). Ok,
if I set length to 1, that works:
#print($Charset[rand_int(0,96)]); # NO!
print(substr($Charset, rand_int(0,96), 1)); # YES!
That sort-of works. It gives a 1-character-long string
of characters. Maybe in Perl that's considered to be
the same thing as "a character". To me, it seems
not the same at all! But perhaps I'm being too uptight.
Is there any more eloquent way of obtaining the nth
character of a string? Or is substr() the best way?
--
Cheers,
Robbie Hatley
lonewolf aatt well dott com
www dott well dott com slant user slant lonewolf slant
------------------------------
Date: 19 Mar 2008 11:14:41 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Is substr only way of getting nth character of string?
Message-Id: <slrnfu1td1.2fd.abigail@alexandra.abigail.be>
_
Robbie Hatley (lonewolf@well.com) wrote on VCCCXIV September MCMXCIII in
<URL:news:zbedndr-o4wFcn3anZ2dnUVZ_gidnZ2d@giganews.com>:
::
:: Is there any more eloquent way of obtaining the nth
:: character of a string? Or is substr() the best way?
"substr ()" is the best way. If you want the C equivalent of a "character",
use "ord substr ()". Because in C, "characters" are numbers.
Abigail
--
perl -swleprint -- -_=Just\ another\ Perl\ Hacker
------------------------------
Date: Wed, 19 Mar 2008 11:14:35 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Is substr only way of getting nth character of string?
Message-Id: <slrnfu20ch.bvb.tadmc@tadmc30.sbcglobal.net>
Robbie Hatley <lonewolf@well.com> wrote:
>
> I wrote the following, trying to get it to print a block of
> 20 rows of 20 random characters from a 96-member character
> set. But it doesn't work; just just prints a series of
> 20 "\n" characters, and that's all:
>
> #!/usr/bin/perl
>
> sub rand_int;
>
> srand;
>
> my $i;
> my $j;
You should declare variables in the smallest possible scope.
For a loop counter, the smallest possible scope is the loop.
> my $Lower = "abcdefghijklmnopqrstuvwxyz"; # lower-case (26)
> my $Upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; # upper-case (26)
> my $Digits = "0123456789"; # digits (10)
> my $Symbols = "`~!@#$%^&*()-_=+[{]}\\|;:\'\",<.>/?"; # symbols (32)
> my $White = "\11\40"; # tab, space ( 2)
> my $Charset = $Lower.$Upper.$Digits.$Symbols.$White; # total: (96)
>
> #print ("$Charset\n");
>
> for ( $i = 0 ; $i < 20 ; ++$i)
for ( my $i = 0 ; $i < 20 ; ++$i) # declare where used
or
foreach my $i ( 0 .. 19 ) # less chance of introducing a bug
> print($Charset[rand_int(0,96)]);
> If I "use strict", it won't even compile; the compiler
> complains of an unknown variable "@Charset".
The strict pragma has found the bug in your program.
> Ok, so I've fallen prey to thinking of strings as being
> (more or less) arrays of characters, as they are in C
It appears that you have found the bug in your program too. :-)
> Is there any more eloquent way of obtaining the nth
> character of a string? Or is substr() the best way?
No.
But if you convert your string into an actual array of characters,
then you can use array accesses to get the chars:
my @Charset = split //, $Charset; # 2 diff variables with similar names...
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Wed, 19 Mar 2008 12:03:52 +0000 (UTC)
From: INVALID_SEE_SIG@example.com.invalid (J.D. Baldwin)
Subject: Re: Need Perl module to get <TITLE> tag of a web page
Message-Id: <frqvf8$mbr$1@reader2.panix.com>
In the previous article, brian d foy <brian.d.foy@gmail.com> wrote:
> > > > Simple problem. Given a URL http://www.example.com/some/file/here.html,
> > > > retrieve and extract the title of the web page -- i.e., the content
> > > > of the <title> tag. Is there an equally simple solution? Thanks in
> > > > advance for any advice.
>
>
> > Oh, my, "TreeBuilder" is *exactly* what I needed. Thank you!
>
> If you just want to get the title, HTML::HeadParser is what you need.
> It already does all of the hard work for you.
Glancing at it, it looks simple and powerful. I've already
implemented it the other way, but I'll file HeadParser away in my bag
of tricks, so thanks.
--
_+_ From the catapult of |If anyone disagrees with any statement I make, I
_|70|___:)=}- J.D. Baldwin |am quite prepared not only to retract it, but also
\ / baldwin@panix.com|to deny under oath that I ever made it. -T. Lehrer
***~~~~-----------------------------------------------------------------------
------------------------------
Date: Wed, 19 Mar 2008 06:14:04 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Mar 19 2008
Message-Id: <JxyrzG.11Gu@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.
API-Plesk-1.00
http://search.cpan.org/~nrg/API-Plesk-1.00/
OOP interface to the Plesk XML API (http://www.parallels.com/en/products/plesk/).
----
Algorithm-NeedlemanWunsch-0.03
http://search.cpan.org/~vbar/Algorithm-NeedlemanWunsch-0.03/
sequence alignment with configurable scoring
----
Apache2-ASP-1.37
http://search.cpan.org/~johnd/Apache2-ASP-1.37/
Perl extension for ASP on mod_perl2.
----
B-C-1.04_12
http://search.cpan.org/~rurban/B-C-1.04_12/
Perl compiler's C backend
----
B-Debugger-0.01_01
http://search.cpan.org/~rurban/B-Debugger-0.01_01/
optree debugger
----
Baldrick-0.85
http://search.cpan.org/~hucke/Baldrick-0.85/
Baldrick Application Framework
----
C-TCC-0.03
http://search.cpan.org/~hamano/C-TCC-0.03/
An interface to the TCC(Tiny C Compiler)
----
CGI-Apache2-Wrapper-0.215
http://search.cpan.org/~rkobes/CGI-Apache2-Wrapper-0.215/
CGI.pm-compatible methods via mod_perl
----
CGI.pm-3.34
http://search.cpan.org/~lds/CGI.pm-3.34/
----
Catalyst-Controller-Atompub-0.4.0
http://search.cpan.org/~takeru/Catalyst-Controller-Atompub-0.4.0/
A Catalyst controller for the Atom Publishing Protocol
----
Catalyst-Plugin-RedirectAndDetach-0.03
http://search.cpan.org/~drolsky/Catalyst-Plugin-RedirectAndDetach-0.03/
Redirect and detach at the same time
----
Config-AutoConf-0.04
http://search.cpan.org/~ambs/Config-AutoConf-0.04/
A module to implement some of AutoConf macros in pure perl.
----
Config-AutoConf-0.05
http://search.cpan.org/~ambs/Config-AutoConf-0.05/
A module to implement some of AutoConf macros in pure perl.
----
Config-Model-0.620
http://search.cpan.org/~ddumont/Config-Model-0.620/
Model to create configuration validation tool
----
Config-Model-CursesUI-1.006
http://search.cpan.org/~ddumont/Config-Model-CursesUI-1.006/
Curses interface to edit config data
----
Continuity-0.99
http://search.cpan.org/~awwaiid/Continuity-0.99/
Abstract away statelessness of HTTP, for stateful Web applications
----
DBD-SQLite-Amalgamation-3.5.7
http://search.cpan.org/~audreyt/DBD-SQLite-Amalgamation-3.5.7/
Single C-file based DBD::SQLite distribution
----
Finance-QIF-2.07
http://search.cpan.org/~mmcgillis/Finance-QIF-2.07/
Parse and create Quicken Interchange Format files
----
Games-Hack-Patch-i686-0.52
http://search.cpan.org/~pmarek/Games-Hack-Patch-i686-0.52/
How to patch code sequences on i686
----
Games-SGF-0.01
http://search.cpan.org/~whitcode/Games-SGF-0.01/
A general SGF parser
----
Google-Adwords-v1.8.1
http://search.cpan.org/~rohan/Google-Adwords-v1.8.1/
an interface which abstracts the Google Adwords SOAP API
----
Gtk2-GladeXML-OO-0.34
http://search.cpan.org/~strzelec/Gtk2-GladeXML-OO-0.34/
Object oriented interface to Glade.
----
IPC-Concurrency-0.4
http://search.cpan.org/~bbkr/IPC-Concurrency-0.4/
Concurrency guard for processes.
----
JavaScript-Minifier-1.05
http://search.cpan.org/~pmichaux/JavaScript-Minifier-1.05/
Perl extension for minifying JavaScript code
----
LEOCHARRE-Class2-1.02
http://search.cpan.org/~leocharre/LEOCHARRE-Class2-1.02/
----
LEOCHARRE-Class2-1.03
http://search.cpan.org/~leocharre/LEOCHARRE-Class2-1.03/
----
LWP-UserAgent-ProxyHopper-0.001
http://search.cpan.org/~zoffix/LWP-UserAgent-ProxyHopper-0.001/
LWP::UserAgent with proxi-hopping
----
LWP-UserAgent-ProxyHopper-0.002
http://search.cpan.org/~zoffix/LWP-UserAgent-ProxyHopper-0.002/
LWP::UserAgent with proxi-hopping
----
LWP-UserAgent-ProxyHopper-Base-0.001
http://search.cpan.org/~zoffix/LWP-UserAgent-ProxyHopper-Base-0.001/
base class for LWP::UserAgent based modules which want to proxy-hop their requests
----
Lyrics-Fetcher-LyricWiki-0.05
http://search.cpan.org/~bigpresh/Lyrics-Fetcher-LyricWiki-0.05/
Get song lyrics from www.LyricWiki.org
----
MIME-tools-5.426
http://search.cpan.org/~doneill/MIME-tools-5.426/
----
Metadata-DB-1.11
http://search.cpan.org/~leocharre/Metadata-DB-1.11/
----
Metadata-DB-Analizer-1.03
http://search.cpan.org/~leocharre/Metadata-DB-Analizer-1.03/
methods to analize database metadata table entries
----
Metadata-DB-Indexer-1.03
http://search.cpan.org/~leocharre/Metadata-DB-Indexer-1.03/
----
Metadata-DB-Search-1.05
http://search.cpan.org/~leocharre/Metadata-DB-Search-1.05/
search a metadata table
----
Module-Install-0.70
http://search.cpan.org/~adamk/Module-Install-0.70/
Standalone, extensible Perl module installer
----
OpenResty-0.1.7
http://search.cpan.org/~agent/OpenResty-0.1.7/
General-purpose web service platform for web applications
----
OpenResty-0.1.8
http://search.cpan.org/~agent/OpenResty-0.1.8/
General-purpose web service platform for web applications
----
PDE-v0.2.7
http://search.cpan.org/~yewenbin/PDE-v0.2.7/
Perl Development Environment in emacs
----
PDE-v0.2.8
http://search.cpan.org/~yewenbin/PDE-v0.2.8/
Perl Development Environment in emacs
----
PDE-v0.2.9
http://search.cpan.org/~yewenbin/PDE-v0.2.9/
Perl Development Environment in emacs
----
POE-Component-Client-FTP-0.18
http://search.cpan.org/~bingos/POE-Component-Client-FTP-0.18/
Implements an FTP client POE Component
----
Passwd-Samba-0.11
http://search.cpan.org/~strzelec/Passwd-Samba-0.11/
----
Passwd-Unix-0.32
http://search.cpan.org/~strzelec/Passwd-Unix-0.32/
----
PowerDNS-Backend-MySQL-0.04
http://search.cpan.org/~augie/PowerDNS-Backend-MySQL-0.04/
Provides an interface to manipulate PowerDNS data in the MySQL Backend.
----
RDF-Server-0.07
http://search.cpan.org/~jsmith/RDF-Server-0.07/
toolkit for building RDF servers
----
RDF-Server-0.08
http://search.cpan.org/~jsmith/RDF-Server-0.08/
toolkit for building RDF servers
----
RDF-Trine-0.105_02
http://search.cpan.org/~gwilliams/RDF-Trine-0.105_02/
An RDF Framework for Perl.
----
RPC-XML-Parser-XS-0.02
http://search.cpan.org/~mikage/RPC-XML-Parser-XS-0.02/
Fast XML-RPC parser written in C
----
Rinchi-CPlusPlus-Preprocessor-0.01
http://search.cpan.org/~bmames/Rinchi-CPlusPlus-Preprocessor-0.01/
A C++ to XML SAX preprocessor.
----
RiveScript-1.13
http://search.cpan.org/~kirsle/RiveScript-1.13/
Rendering Intelligence Very Easily
----
SMS-AQL-0.08
http://search.cpan.org/~bigpresh/SMS-AQL-0.08/
Perl extension to send SMS text messages via AQ's SMS service
----
SMS-Send-DeviceGsm-1.02
http://search.cpan.org/~bingos/SMS-Send-DeviceGsm-1.02/
An SMS::Send driver for Device::Gsm.
----
Software-License-0.000
http://search.cpan.org/~rjbs/Software-License-0.000/
packages that provide templated software licenses
----
Software-License-0.001
http://search.cpan.org/~rjbs/Software-License-0.001/
packages that provide templated software licenses
----
String-Splitter-0.1
http://search.cpan.org/~bbkr/String-Splitter-0.1/
Find all possible string splits and unique substrings.
----
String-Splitter-0.2
http://search.cpan.org/~bbkr/String-Splitter-0.2/
Find all possible string splits and unique substrings.
----
Sub-Lambda-0.02
http://search.cpan.org/~toyvo/Sub-Lambda-0.02/
syntactic sugar for lambdas in Perl
----
TM-1.31
http://search.cpan.org/~drrho/TM-1.31/
Topic Maps, Base Class
----
WWW-PAUSE-CleanUpHomeDir-0.001
http://search.cpan.org/~zoffix/WWW-PAUSE-CleanUpHomeDir-0.001/
the module to clean up old dists from your PAUSE home directory
----
XML-CompareML-0.2.3
http://search.cpan.org/~shlomif/XML-CompareML-0.2.3/
A processor for the CompareML markup language
----
XML-Compile-0.71
http://search.cpan.org/~markov/XML-Compile-0.71/
Compilation based XML processing
----
accessors-1.00
http://search.cpan.org/~spurkis/accessors-1.00/
create accessor methods in caller's package.
----
kephra-0.3.7_3
http://search.cpan.org/~lichtkind/kephra-0.3.7_3/
crossplatform, CPAN-installable GUI-Texteditor along Perl's Paradigms
----
parrot-0.6.0
http://search.cpan.org/~bschmal/parrot-0.6.0/
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/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Tue, 18 Mar 2008 23:49:29 GMT
From: Ron Eggler <test@example.com>
Subject: Re: opening file for appending doesn't work for me
Message-Id: <dyYDj.88319$FO1.84862@edtnps82>
Ron Eggler wrote:
> Hi,
>
> I would like to open a file for appending content and create it if it
> doesn't exist. I have been trying to do all I can but it just wouldn't
> open it. My code looks like:
>
> @files = </usr/share/NovaxTSP/logs/*>; #path where the log files
> are saved
> my $key_indicator="----Public key----"; #string that specifies
> that there is an ssh public key in the next lines and it will need to be
> appended to ~/.ssh/authorized_keys
> my $key_file="~/.ssh/authorized_keys"; #path the the authorized-keys file
>
> foreach $file (@files) { # read out the directory
> content
> print "parse file ".$file.":\n";
> file_parser($file);
> }
>
> sub file_parser
> {
> $file = $_[0]; # get 1st parameter
> (filename)
> open(INFO, $file); #opens file systemstats
> @lines = <INFO>; #assigns lines to array
> $num=0;
> foreach $line (@lines){ #go through each line in
> file
> $num++;
> print " ".$num ." - ". $line;
> if(rindex($line,$key_indicator)>-1){
> print "Dude, append the rest of the file to
> ~/.ssh/authorized_keys
> file\n"; #ah, there's an ssh key, the rest of the file will need to
> be appended to ~/.ssh/authorized_keys
> sysopen (KEY, ">>$key_file", 0644);
> print $lines[$num+1]."\n";
> print KEY $lines[$num+1];
> print $lines[$num+2]."\n";
> print KEY $lines[$num+2];
> close(KEY);
> }
> }
> }
>
> I appreciate any kind of help!
>
> Thank you so much!
I realized the problem was that my script wouldn't recognize "~" in the
path. I replaced it with the absolute home path and it worked just fine
with: open (KEY, ">>$key_file") || die "Cannot open file $key_file!\n";
Thanks! :)
--
chEErs roN
------------------------------
Date: Wed, 19 Mar 2008 01:45:45 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: opening file for appending doesn't work for me
Message-Id: <slrnfu0umu.8f9.tadmc@tadmc30.sbcglobal.net>
Ron Eggler <test@example.com> wrote:
> my $key_file="~/.ssh/authorized_keys"; #path the the authorized-keys file
tilde means "home directory" when programming in the shell.
tilde means "tilde character" in a Perl string...
> open(INFO, $file); #opens file systemstats
You should always, yes *always*, check the return value from open():
open(INFO, $file) or die "could not open '$file' $!";
> @lines = <INFO>; #assigns lines to array
> foreach $line (@lines){ #go through each line in file
No point in reading the whole thing into memory if you are only
going to process one line at a time anyway.
while ( my $line = <INFO> ) {
> $num++;
Now you can use the $. variable instead of maintaining the count yourself too.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Wed, 19 Mar 2008 05:24:48 -0700 (PDT)
From: Micha <michael.andrassy@gmail.com>
Subject: problem starting perl script from cron environment - ps: don't know which terminal to select
Message-Id: <15c8f4fd-5ae8-4646-b580-78c6eaabc7cc@s13g2000prd.googlegroups.com>
I have perl program which works just fine on the console, but started
in cron environment it prints "ps: don't know which terminal to
select" to stderr - btw I don't call ps explicitly at any point in my
scripts.
Now lets have a look at the details :
My script is written in perl, inside that script there is a call in
backquotes to an other perl script which starts too.
By printf-debugging I could find out that the "ps: don't know which
terminal to select" output occurs both in the parent and child script
before by first line of code. Does perl call ps before starting?? why
does it need a terminal? my script do not process stdin and stdout +
stderr are redirected into files. And for some reason this problem
occurs only when calling a perl script from an other perl script.
In interactive mode the script works just fine - I ran it from a ksh.
To execute it via cron I write a small ksh script, which reads the
environment from the .kshrc an the executes the per script sending
stdout and stderr to log-files.
Let me try to deconfuse it ;)
Cron -> ksh-Script -> perlA -> perlB -> perlC
-when calling perlA from ksh - ok, no message
- when calling perlB from perlA or perlC from perlB - there
is a stderr message "ps: don't know which terminal to select"
which must be caused before my first line of code in the child
script
Thanks in advance, Micha
------------------------------
Date: Wed, 19 Mar 2008 00:34:49 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Problem with loop control LAST exiting prematurely
Message-Id: <slrnfu0kcq.cea.hjp-usenet2@hrunkner.hjp.at>
On 2008-03-18 15:40, Rodion <hitodenashi@alexandria.cc> wrote:
> Jednom davno, ne znam vise kad, xhoster@gmail.com duboko zamisljen/a
> rece:
>
>> Rodion <hitodenashi@alexandria.cc> wrote:
>> > Jednom davno, ne znam vise kad, John W. Krahn duboko zamisljen/a rece:
>> > > Couldn't you just write that as:
>> > >
>> > > $found = 1 if exists $cb{$cbName}{$data};
>> >
>> > Well, I have to thank you for putting me on the right track!
>> >
>> > There was a problem with some numeric data having prefixed zeroes while
>> > some of the hash keys did not so there could be no match ( 0567 != 567).
Try to canonicalize the data.
>> > But I'm still confused why the LAST was triggered before a match was
>> > $found?
>>
>> I rather doubt that it was doing that. If you want to pursue the matter,
>> post a complete, runnable script to illustrate this. Otherwise I'll assume
>> you are misinterpreting something.
>
> Well, I'm most certanly misundrestanding something, but I'd like to know
> what, so I don't make the same mistake twice :/
>
> The following subrutine works correctly (and slowly) if the lines with
> LAST are commented out.
How does it not work correctly if these lines are not commented out?
Please post an example which demonstrates the problem.
> Code:
> sub checkCB{
> my $cbName=$_[0];
> my $data=$_[1];
> my ($k,$v);
> my $found;
> my $g=0;
> my $checked;
> my $test='text';
>
> print "looking for [$data] in [$cbName] control: ";
>
> #----numbers exception
> if ($data=~/^\d{1,30}$/){
> $data=int($data);
> $test='numbers';
> }
>
> CODECHECK: while ( ($k,$v) = each %{$cb{$cbName}}) {
> #print $g++."\n";
> switch ($test){
Don't use switch. It is rather buggy and introduces problems which are
hard to find.
> case 'numbers' {
> if ($data==$k){
> $found=1;
> #last CODECHECK if ($found==1);
$found is always 1 here (you just set it to one), so this is equivalent
to "last CODECHECK;". However, that seems to be what you want.
> }
> }
> case 'text' {
> if ($data eq $k){
> $found=1;
> #last CODECHECK if ($found==1);
Same here.
> }
> }
> }
> }
>
> return $found;
> }
> ---------
>
------------------------------
Date: Wed, 19 Mar 2008 01:45:46 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Problem with loop control LAST exiting prematurely
Message-Id: <slrnfu0ush.8f9.tadmc@tadmc30.sbcglobal.net>
Rodion <hitodenashi@alexandria.cc> wrote:
> Jednom davno, ne znam vise kad, xhoster@gmail.com duboko zamisljen/a
> rece:
>> If you want to pursue the matter,
>> post a complete, runnable script to illustrate this.
> Well, I'm most certanly misundrestanding something, but I'd like to know
> what, so I don't make the same mistake twice :/
Then simply post a complete, runnable program to illustrate the
problem you are having.
> The following subrutine
A snippet of subroutine is not a complete program that we can run.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Wed, 19 Mar 2008 09:37:20 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Problem with loop control LAST exiting prematurely
Message-Id: <k95Ej.90294$FO1.19251@edtnps82>
Andrew DeFaria wrote:
> Frank Seitz wrote:
>>> Why can't programmers tell Haloween from Christmas?
>>>
>>> Because OCT 31 == DEC 25
>> $ perldoc -f dec
>> No documentation for perl function `dec' found
> Some people no sense of humor!
Some people no verb!
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: Wed, 19 Mar 2008 05:04:12 -0700 (PDT)
From: Deepan Perl XML Parser <deepan.17@gmail.com>
Subject: XML Parsing in Perl
Message-Id: <2f4f8078-dc07-4923-a751-b8adecefb878@i7g2000prf.googlegroups.com>
Hi all,
This post is regarding XML parsing in perl.
I have written a handler for capturing Char named
characterData. when this handler is getting called up for parsing
""1667999478"" which is available in $data it should be able
to print "1667999478" replacing " with ", but it is only printing
".
Here is the code :
sub characterData {
my( $parseinst, $data ) = @_;
print "$data";
------------------>>> here i should get "1667999478" instead of "
}
Please help me.
Thanks,
Deepan
------------------------------
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 1373
***************************************