[28829] in Perl-Users-Digest
Perl-Users Digest, Issue: 73 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 25 11:06:18 2007
Date: Thu, 25 Jan 2007 08:05:14 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 25 Jan 2007 Volume: 11 Number: 73
Today's topics:
Call another program using system <sonet.all@msa.hinet.net>
Re: Call another program using system <anedza@infotek-consulting.com>
Re: Call another program using system <bik.mido@tiscalinet.it>
Re: DBI call info <paul@probulletin.com>
Re: Is there a delete operator in Perl? <bugbear@trim_papermule.co.uk_trim>
Re: Is there a delete operator in Perl? <tzz@lifelogs.com>
Net::FTPSSL problem (or how to do FTP over SSL another <dsiomtw@gmail.com>
Re: Net::FTPSSL problem (or how to do FTP over SSL anot <sisyphus1@nomail.afraid.com>
new CPAN modules on Thu Jan 25 2007 (Randal Schwartz)
reverse-function with regex <pieter.online@gmail.com>
Re: reverse-function with regex <wahab-mail@gmx.de>
Re: reverse-function with regex <bik.mido@tiscalinet.it>
Re: reverse-function with regex anno4000@radom.zrz.tu-berlin.de
Re: reverse-function with regex <bik.mido@tiscalinet.it>
Re: reverse-function with regex <tzz@lifelogs.com>
Re: SNPP proxy <mark.clementsREMOVETHIS@wanadoo.fr>
Re: Statistics Extraction <josef.moellers@fujitsu-siemens.com>
Using perl modules <lhradowy@gmail.com>
Re: Using perl modules anno4000@radom.zrz.tu-berlin.de
weird perl script jcharth@hotmail.com
Re: weird perl script <anedza@infotek-consulting.com>
Re: weird perl script anno4000@radom.zrz.tu-berlin.de
Re: weird perl script <bik.mido@tiscalinet.it>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 25 Jan 2007 20:16:06 +0800
From: "sonet" <sonet.all@msa.hinet.net>
Subject: Call another program using system
Message-Id: <epa726$hjr$1@netnews.hinet.net>
I need to call a command_line(CM1.EXE) from another program(APP1.pl).
in APP.pl (PERL)
#!perl.exe
system('/path/CM1.EXE 1234>file.txt');
But the CM1.exe will show the console window.
How to avoid the CM1.exe show the console window?
------------------------------
Date: 25 Jan 2007 06:33:10 -0800
From: "Andy" <anedza@infotek-consulting.com>
Subject: Re: Call another program using system
Message-Id: <1169735590.385134.312790@a75g2000cwd.googlegroups.com>
Your command line program is a separete entity from your PERL program.
Unless your command line program accepts command line arguments when it
is called that allow it to be configured, there is nothing your PERL
program can do to suppress the window because the window is generated
by your command line interpreter and not PERL.
But, PERL does have a shell module (use Shell) that exposes some of the
type of functionality that is available in command line interpreters,
such as piping.
------------------------------
Date: Thu, 25 Jan 2007 17:01:50 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Call another program using system
Message-Id: <pjkhr2t8jlt35lqs0oatpqt54081e3mcks@4ax.com>
On 25 Jan 2007 06:33:10 -0800, "Andy" <anedza@infotek-consulting.com>
wrote:
>Your command line program is a separete entity from your PERL program.
I received your post but not the one you're replying to, as is likely
to happen on USENET. Thus I can hardly make sense of your answer
althugh I would like to. This is why it is generally recommended to
include some *relevant portion* of quoted context when replying.
*Please* (do a favour to us all and) do so!
Also, it seems to me that you're knowledgeable and helpful enough.
Yet, as someone else pointed out in another thread, your use of "PERL"
is a very well known gotcha. There's a faq entry:
perldoc -q 'difference between "perl" and "Perl"'
Also see e.g.:
http://perlmonks.org/index.pl?node_id=510594
for an interesting discussion about these matters.
>Unless your command line program accepts command line arguments when it
>is called that allow it to be configured, there is nothing your PERL
>program can do to suppress the window because the window is generated
>by your command line interpreter and not PERL.
I suppose (but can't be certain - see above) you're talking about
Windows. But then it's worth reminding of AS's wperl.exe coming with
ActivePerl. It starts a perl interpreter without starting a console as
well.
>But, PERL does have a shell module (use Shell) that exposes some of the
>type of functionality that is available in command line interpreters,
>such as piping.
It's also worth reminding about other Perl shells mentioned e.g. in
perldoc -q 'Perl shell'
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 25 Jan 2007 02:32:55 -0800
From: "Paul" <paul@probulletin.com>
Subject: Re: DBI call info
Message-Id: <1169721175.764880.264410@l53g2000cwa.googlegroups.com>
Use caller()
http://perldoc.perl.org/functions/caller.html
------------------------------
Date: Thu, 25 Jan 2007 10:09:36 +0000
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: Is there a delete operator in Perl?
Message-Id: <45b881e0$0$8716$ed2619ec@ptn-nntp-reader02.plus.net>
trashman.horlicks@btinternet.com wrote:
> Yes, I know theres one for hashes, but I was wondering if there was one
> for elements in a linked list?
Perl does not (intrinsically) have linked lists.
If you use arrays for this purpose, be aware that such operations
as you outline may be CPU intensive for large
lists.
BugBear
------------------------------
Date: Thu, 25 Jan 2007 10:43:35 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Is there a delete operator in Perl?
Message-Id: <g69zm87ru1k.fsf@dhcp-65-162.kendall.corp.akamai.com>
On 24 Jan 2007, trashman.horlicks@btinternet.com wrote:
> Yes, I know theres one for hashes, but I was wondering if there was
> one for elements in a linked list? I have such a list, and it is
> being read sequentially, with new items being placed either at the
> end, or the middle of the list. Now, I know how to do this in C++,
> but I was wondering if there was a way of deleting used/old list
> elements? And is there a way to add an array element to the middle
> of a list?
Look at perldoc -f splice to make modifications to a list in any
place.
push/pop and shift/unshift (again, use perldoc -f to look them up)
deal with adding and deleting elements at the beginning or end of a
list.
bugbear suggested these operations may be slow for large lists. I'd
say instead you should write your code to work correctly first, then
worry about optimizing for speed. You'd have to have really large
lists to notice slow performance.
Ted
------------------------------
Date: 24 Jan 2007 23:17:19 -0800
From: "DSIOMTW" <dsiomtw@gmail.com>
Subject: Net::FTPSSL problem (or how to do FTP over SSL another way?)
Message-Id: <1169709439.196982.199780@j27g2000cwj.googlegroups.com>
I'm trying to write a simple script to upload a file to an FTP server
using Net::FTPSSL. Everything works fine until I try to actually upload
the file. Based on the warnings and trace info it seems to have
something to do with using PASV mode. I'm able to connect and transfer
files just fine in PASV mode using my desktop FTP client, so I have no
idea what the problem might be. Here is the output when I run the
script. I get the same result whether I try to upload or download a
file. Any ideas? Is there any other easy way to do FTP over SSL in
Perl?
>>> USER *****
<<< 331 Password required for *****.
>>> PASS *****
<<< 230-Welcome to the ***** Secure FTP Server!
>>> CWD /*****/
<<< 230 User ***** logged in.
>>> TYPE A
<<< 250 CWD command successful now (/******)
>>> PBSZ 0
<<< 200 Type set to A
>>> PROT P
<<< 200 Great whatever you say
>>> PASV
<<< 200 Data channel will be encrypted
Use of uninitialized value in split at
/usr/lib/perl5/site_perl/5.8.5/Net/FTPSSL.pm line 141.
Use of uninitialized value in join or string at
/usr/lib/perl5/site_perl/5.8.5/Net/FTPSSL.pm line 143.
Use of uninitialized value in join or string at
/usr/lib/perl5/site_perl/5.8.5/Net/FTPSSL.pm line 143.
Use of uninitialized value in join or string at
/usr/lib/perl5/site_perl/5.8.5/Net/FTPSSL.pm line 143.
Use of uninitialized value in join or string at
/usr/lib/perl5/site_perl/5.8.5/Net/FTPSSL.pm line 143.
Use of uninitialized value in multiplication (*) at
/usr/lib/perl5/site_perl/5.8.5/Net/FTPSSL.pm line 144.
Use of uninitialized value in addition (+) at
/usr/lib/perl5/site_perl/5.8.5/Net/FTPSSL.pm line 144.
Use of uninitialized value in subroutine entry at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/Socket.pm line 373.
Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4
at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/Socket.pm line 373.
------------------------------
Date: Fri, 26 Jan 2007 02:46:47 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.com>
Subject: Re: Net::FTPSSL problem (or how to do FTP over SSL another way?)
Message-Id: <45b8d0eb$0$9774$afc38c87@news.optusnet.com.au>
"DSIOMTW" <dsiomtw@gmail.com> wrote in message
news:1169709439.196982.199780@j27g2000cwj.googlegroups.com...
.
.
> Here is the output when I run the script.
Can you show us the conversation that takes place when you use the "desktop
FTP client" ?
That might help us determine where things are going awry in the perl script.
.
.
> Is there any other easy way to do FTP over SSL in Perl?
For secure FTP, there's also Net::SFTP, which uses Net::SSH::Perl. This, of
course, means that the server has to be running SSH. However, I'm not
impressed with Net::SSH::Perl, so perhaps this is not a good suggestion.
I would prefer to FTP using Net::SSH2 (which needs the libssh2 library).
Again, there's a need for the server to be running SSH2, and, on top of
that, I have a nagging doubt that the libssh2 library is not being as
actively maintained as it ought.
I don't know much about Net::FTPSSL. (What is needed on the server side for
it to work ?)
Perhaps you're better off sticking with Net::FTPSSL - if you can just get
around the problem you're having. I see you sought help at
comp.lang.perl.modules (to no avail). If you don't get useful help here, try
contacting the author of Net::FTPSSL. He may be willing (and able) to help.
Otherwise my (non-expert) advice is to try Net::SSH2.
Cheers,
Rob
------------------------------
Date: Thu, 25 Jan 2007 05:42:09 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Jan 25 2007
Message-Id: <JCEt69.1Lpt@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.
Apache-FastForward-1.0
http://search.cpan.org/~jwach/Apache-FastForward-1.0/
----
Audio-SndFile-0.04
http://search.cpan.org/~jdiepen/Audio-SndFile-0.04/
Portable reading and writing of sound files
----
Catalyst-Plugin-DBIC-Schema-Profiler-0.04
http://search.cpan.org/~yamamoto/Catalyst-Plugin-DBIC-Schema-Profiler-0.04/
Profile time query took with DBIC::Schema in your Catalyst application.
----
Class-Simple-0.06
http://search.cpan.org/~sullivan/Class-Simple-0.06/
Simple Object-Oriented Base Class
----
Crypt-SSLeay-0.53_01
http://search.cpan.org/~dland/Crypt-SSLeay-0.53_01/
OpenSSL glue that provides LWP https support
----
DBM-Deep-0.99_04
http://search.cpan.org/~rkinyon/DBM-Deep-0.99_04/
A pure perl multi-level hash/array DBM that supports transactions
----
Data-Integer-0.001
http://search.cpan.org/~zefram/Data-Integer-0.001/
details of the native integer data type
----
Finance-Bank-HSBC-1.05
http://search.cpan.org/~mwilson/Finance-Bank-HSBC-1.05/
Extract HSBC online banking data.
----
FormValidator-Simple-0.20
http://search.cpan.org/~lyokato/FormValidator-Simple-0.20/
validation with simple chains of constraints
----
GD-Graph-Polar-0.07
http://search.cpan.org/~mrdvt/GD-Graph-Polar-0.07/
Make polar graph using GD package
----
GD-Graph-Polar-0.08
http://search.cpan.org/~mrdvt/GD-Graph-Polar-0.08/
Make polar graph using GD package
----
GPS-SpaceTrack-0.08
http://search.cpan.org/~mrdvt/GPS-SpaceTrack-0.08/
Package for calculating the position of GPS satellites
----
IPC-Locker-1.461
http://search.cpan.org/~wsnyder/IPC-Locker-1.461/
Distributed lock handler
----
Module-Build-Convert-0.47_01
http://search.cpan.org/~schubiger/Module-Build-Convert-0.47_01/
Makefile.PL to Build.PL converter
----
Net-Amazon-0.38
http://search.cpan.org/~boumenot/Net-Amazon-0.38/
Framework for accessing amazon.com via REST
----
PHP-Session-DBI-0.1
http://search.cpan.org/~burak/PHP-Session-DBI-0.1/
Interface to PHP DataBase Sessions
----
POE-Component-WWW-Shorten-1.05
http://search.cpan.org/~bingos/POE-Component-WWW-Shorten-1.05/
A non-blocking wrapper around WWW::Shorten.
----
POE-Filter-CSV-1.04
http://search.cpan.org/~bingos/POE-Filter-CSV-1.04/
A POE-based parser for CSV based files.
----
Parallel-Mpich-MPD-0.4.0
http://search.cpan.org/~alexmass/Parallel-Mpich-MPD-0.4.0/
Mpich MPD wrapper
----
Parallel-Mpich-MPD-0.5.0
http://search.cpan.org/~alexmass/Parallel-Mpich-MPD-0.5.0/
Mpich MPD wrapper
----
PerlIO-via-Logger-0.01
http://search.cpan.org/~akaplan/PerlIO-via-Logger-0.01/
PerlIO layer for prefixing current time to log output
----
PerlIO-via-Logger-0.02
http://search.cpan.org/~akaplan/PerlIO-via-Logger-0.02/
PerlIO layer for prefixing current time to log output
----
PerlSpeak-0.51
http://search.cpan.org/~jkamphaus/PerlSpeak-0.51/
Perl Module for text to speech with festival, cepstral and others.
----
Socialtext-Resting-0.11
http://search.cpan.org/~lukec/Socialtext-Resting-0.11/
module for accessing Socialtext REST APIs
----
Socialtext-Resting-Utils-0.06
http://search.cpan.org/~lukec/Socialtext-Resting-Utils-0.06/
Utilities for Socialtext REST APIs
----
Sub-ForceEval-2.00
http://search.cpan.org/~lembark/Sub-ForceEval-2.00/
eval subroutines, re-throw exceptions if there is an eval; otherwise cluck and return undef.
----
SyslogScan-Daemon-SpamDetector-0.51
http://search.cpan.org/~muir/SyslogScan-Daemon-SpamDetector-0.51/
Notice spammers in the log files
----
Text-ChaSen-1.04
http://search.cpan.org/~knok/Text-ChaSen-1.04/
ChaSen library module for perl
----
URI-Escape-JavaScript-0.02
http://search.cpan.org/~taniguchi/URI-Escape-JavaScript-0.02/
A perl implementation of JavaScript's escape() and unescape() functions
----
later-0.03
http://search.cpan.org/~erwan/later-0.03/
A pragma to postpone using a module
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: 25 Jan 2007 00:56:13 -0800
From: "Pieter Online" <pieter.online@gmail.com>
Subject: reverse-function with regex
Message-Id: <1169715373.779988.54200@k78g2000cwa.googlegroups.com>
Hello,
I'm trying to write a reverse-function with regex,
The following code gives: fedcba
$message = "abcdef";
$message =~ s/(.)(.)(.)(.)(.)(.)/$6$5$4$3$2$1/;
print $message;
But I like to use something like:
$message =~ s/(.){6}/$6$5$4$3$2$1/;
or even
$message =~ s/(.)*/$6$5$4$3$2$1/;
But that does not work, and all I can do is hope one of you can help me
out..
Thanks in advance,
Pieter
------------------------------
Date: Thu, 25 Jan 2007 10:21:48 +0100
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: reverse-function with regex
Message-Id: <ep9t5d$1ab$1@mlucom4.urz.uni-halle.de>
Pieter Online wrote:
> Hello,
>
> I'm trying to write a reverse-function with regex,
>
> The following code gives: fedcba
> $message = "abcdef";
> $message =~ s/(.)(.)(.)(.)(.)(.)/$6$5$4$3$2$1/;
> print $message;
>
> But I like to use something like:
> $message =~ s/(.){6}/$6$5$4$3$2$1/;
> or even
> $message =~ s/(.)*/$6$5$4$3$2$1/;
>
> But that does not work, and all I can do is hope one of you can help me
> out..
$message =~ s/(.*)/reverse $1/eg;
;-)
Regards
M.
------------------------------
Date: Thu, 25 Jan 2007 10:56:40 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: reverse-function with regex
Message-Id: <1kugr2hs95giabji4bm6pjr2clknbb7pat@4ax.com>
On 25 Jan 2007 00:56:13 -0800, "Pieter Online"
<pieter.online@gmail.com> wrote:
>I'm trying to write a reverse-function with regex,
BTW: why? What in reverse() does not satisfy you?
>But I like to use something like:
>$message =~ s/(.){6}/$6$5$4$3$2$1/;
>or even
>$message =~ s/(.)*/$6$5$4$3$2$1/;
>
>But that does not work, and all I can do is hope one of you can help me
>out..
Nope, neither of them works nor is supposed to work. And there is no
simple provision for a simple modification of the above to do so. You
can of course roll your own reverse sub using a single s/// in a
recursive fashion:
sub myownreverse {
local $_=shift;
my ($head, $tail) = /(.)(.*)/ or return $_;
myownreverse($tail) . $head;
}
BTW: I tried doing the same with a single s/// instead of a pattern
match, but it doesn't work:
#!/usr/bin/perl
use strict;
use warnings;
sub myownreverse {
my $s=shift;
$s =~ s/^(.)(.*)/myownreverse($2) . $1/e;
$s;
}
print myownreverse 'abcdef';
__END__
The latter yields
C:\temp>foo.pl
ffedcb
for me... (And I see no simple modification to correct it.)
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 25 Jan 2007 10:36:32 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: reverse-function with regex
Message-Id: <51rfhgF1jn9taU1@mid.dfncis.de>
Michele Dondi <bik.mido@tiscalinet.it> wrote in comp.lang.perl.misc:
> On 25 Jan 2007 00:56:13 -0800, "Pieter Online"
> <pieter.online@gmail.com> wrote:
>
> >I'm trying to write a reverse-function with regex,
[...]
> BTW: I tried doing the same with a single s/// instead of a pattern
> match, but it doesn't work:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> sub myownreverse {
> my $s=shift;
> $s =~ s/^(.)(.*)/myownreverse($2) . $1/e;
> $s;
> }
>
> print myownreverse 'abcdef';
>
> __END__
>
> The latter yields
>
> C:\temp>foo.pl
> ffedcb
>
> for me... (And I see no simple modification to correct it.)
That's because in the substitution part of s/// the call to
myownreverse() destroys the value of $1 which you are using
in the same expression. Save the initial value to fix it:
sub myownreverse {
local $1;
my $s=shift;
$s =~ s/^(.)(.+)/my $x = $1; myownreverse($2) . $x/e;
$s;
}
I have also changed the second capture from (.*) to (.+). If
(.*) is empty there is nothing to do.
Anno
------------------------------
Date: Thu, 25 Jan 2007 12:04:39 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: reverse-function with regex
Message-Id: <fk3hr29apslar02tte6a6f99k9b1lrc1v8@4ax.com>
On 25 Jan 2007 10:36:32 GMT, anno4000@radom.zrz.tu-berlin.de wrote:
>> for me... (And I see no simple modification to correct it.)
>
>That's because in the substitution part of s/// the call to
>myownreverse() destroys the value of $1 which you are using
>in the same expression. Save the initial value to fix it:
TY, BTW: I can't understand why the original code seemed to do the job
for all iterations but the first one...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 25 Jan 2007 10:48:21 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: reverse-function with regex
Message-Id: <g69veivrttm.fsf@dhcp-65-162.kendall.corp.akamai.com>
On 25 Jan 2007, pieter.online@gmail.com wrote:
> I'm trying to write a reverse-function with regex,
>
> The following code gives: fedcba
> $message = "abcdef";
> $message =~ s/(.)(.)(.)(.)(.)(.)/$6$5$4$3$2$1/;
> print $message;
>
> But I like to use something like:
> $message =~ s/(.){6}/$6$5$4$3$2$1/;
> or even
> $message =~ s/(.)*/$6$5$4$3$2$1/;
>
> But that does not work, and all I can do is hope one of you can help me
> out..
Regular expressions can't reverse arbitrary strings, it's not part of
their functionality. The only way is to do s/(.*)/reverse($1)/e which
of course is better written as $message = reverse $message;
Ted
------------------------------
Date: Thu, 25 Jan 2007 07:40:43 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: SNPP proxy
Message-Id: <45b850eb$0$27390$ba4acef3@news.orange.fr>
rmanohar@aol.com wrote:
> I am using Net::SNPP, port 444 is open on the firewall but I still can
> only resolve (DNS) intranet hosts and NOT internet hosts. The only way
> we currently access external hosts (web, telnet etc) is through a proxy
> server.
OK: so the proxy system can resolve DNS, at least. Can you not configure
a DNS forwarder on this system that you can use as a DNS server for
requests for external names?
Short of configuring DNS so that you can resolve external addresses, can
you get Net::SNPP to work if you feed it IP addresses rather than the
DNS names?
Mark
------------------------------
Date: Thu, 25 Jan 2007 09:13:43 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Statistics Extraction
Message-Id: <ep9ovd$b0r$1@nntp.fujitsu-siemens.com>
doni wrote:
> On Jan 24, 7:21 am, Josef Moellers
> <josef.moell...@fujitsu-siemens.com> wrote:
>=20
>=20
>>>> } elif (/^\s+(\d+)\s+(\S.*)/) {
>>>> next unless defined $stats;
>=20
>=20
> thanks, for your reply....
> Can I understand why we do "next unless defined $stats;" and why it
> will never be used.
I did that because the next line references $netstat{$stats}, which will =
fail if no line of the form "... statistics:" (to be precise: a line=20
starting with one or more non-blank characters followed by one or more=20
blank characters followed by the word "statistics" followed by a colon,=20
let's call that the "interface header line") were seen before.
It will (most likeley) never be used, becase the structure of the input=20
data is such that before any lines with the statistics data (i.e. any=20
line that starts with one or more blanks followed by one or more digits=20
followed by one or more blanks followed by at least a non-blank followed =
by an arbitrary amount of arbitrariy characters), an "interface header=20
line" is processed, so the first pattern will match once before the=20
second will.
>>>embedded hash. Perl knows what you mean
>>
>>> $netstat{ $stats }{ $2 } =3D $1
>>
>>>> }}</untested>
>>
>=20
> Can you let me know how can I find out the values in the HoH.
Didn't I write that "you'd find PHY's "tx buffer loads interrupted" in
$netstat{PHY}->{"tx buffer loads interrupted"}.", whereupon DJ Stunks=20
replied that "no arrow required"?
It is a common understanding in this group that we don't write code for=20
you, but we're willing to comment on any code that you post. Our=20
comments may very well contain code e.g. when we want to suggest a=20
different approach, as I did in my reply.
So, play around with the code that was posted and come back if you have=20
(unworking) code. Post that code and we're glad to suggest modifications.=
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: 25 Jan 2007 06:56:52 -0800
From: "LHradowy" <lhradowy@gmail.com>
Subject: Using perl modules
Message-Id: <1169737012.742059.187800@m58g2000cwm.googlegroups.com>
I am having difficulty using perl modules, I know once I start and
figure this out, it would make my life simplier.
My module is used for logging into a database.
#!/usr/bin/perl
use strict;
use warnings;
package login_acdb;
my $file = "/etc/accesscare/$ENV{'ORACLE_SID'}/voice/ac.login";
open LOGINID, "< $file" or die "Could not open $file: $!";
my $oraLoginId = <LOGINID>;
chomp $oraLoginId;
1;
The file looks like: oracle/oracle321
I have added it to my PERL5LIB environment so it is in the @INC path.
But now I am having problems with how to call it.
Here is where I call it in my script:
sub doSqlSelect {
my @buffer = qx { sqlplus -S $login_acdb::oraLoginId <<EOF;
set heading off
set pagesize 0
set feedback off
SELECT feature||','||description
FROM vt_feature
ORDER by 1;
EOF
};
Yes, I know it would be really easy to use the DBI, but I have tried to
no success to have 32 bit oracle, with 32 or 64 bit perl, on HP 11.00
RISC. Spent a week on that one.
DBI goes in nice, but DBD::ORACLE cacks out every time
------------------------------
Date: 25 Jan 2007 15:43:34 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Using perl modules
Message-Id: <51s1h6F1lk852U1@mid.dfncis.de>
LHradowy <lhradowy@gmail.com> wrote in comp.lang.perl.misc:
> I am having difficulty using perl modules, I know once I start and
> figure this out, it would make my life simplier.
>
> My module is used for logging into a database.
> #!/usr/bin/perl
A module normally doesn't need a shebang line.
> use strict;
> use warnings;
>
> package login_acdb;
Lower-case package names are reserved for pragmatic modules. Make
that Login_acdb or so.
> my $file = "/etc/accesscare/$ENV{'ORACLE_SID'}/voice/ac.login";
> open LOGINID, "< $file" or die "Could not open $file: $!";
> my $oraLoginId = <LOGINID>;
> chomp $oraLoginId;
> 1;
Well, that puts the data in an inaccessible place. The lexical
variable $oraLoginId is invisible from outside the file it is
declared in.
> The file looks like: oracle/oracle321
>
> I have added it to my PERL5LIB environment so it is in the @INC path.
>
> But now I am having problems with how to call it.
>
> Here is where I call it in my script:
> sub doSqlSelect {
> my @buffer = qx { sqlplus -S $login_acdb::oraLoginId <<EOF;
> set heading off
> set pagesize 0
> set feedback off
> SELECT feature||','||description
> FROM vt_feature
> ORDER by 1;
> EOF
> };
You are confusing the concepts of a module (which is invoked by
use() or require()) and a script that has to be called as a separate
executable.
To make it a module (untested):
package Login_acdb;
use strict; use warnings;
my $file = "/etc/accesscare/$ENV{'ORACLE_SID'}/voice/ac.login";
sub get_login {
open my $in, '<', $file or die "Could not open '$file': $!";
chomp( my $id = <$in>);
$id;
}
1;
Put that into Login_acdb.pm. Then in your main script do:
#!/usr/bin/perl
use strict; use warnings;
use Login_acdb;
my $oraLoginId = Login_acdb::get_login;
# use $oraLoginId to log in
Anno
>
> Yes, I know it would be really easy to use the DBI, but I have tried to
> no success to have 32 bit oracle, with 32 or 64 bit perl, on HP 11.00
> RISC. Spent a week on that one.
> DBI goes in nice, but DBD::ORACLE cacks out every time
>
------------------------------
Date: 25 Jan 2007 05:17:02 -0800
From: jcharth@hotmail.com
Subject: weird perl script
Message-Id: <1169731022.249477.141220@m58g2000cwm.googlegroups.com>
Hello I wrote a script that reads emails from a pop box, i notice that
it does not work at home, for some reason, i submit a form to the perl
script it hangs. THe process runs for a long time and no output to the
screen. But when i do the same thing from my firefox browser under
linux it works. any ideas what could cause this. THe script also runs
fine from console. I go the feeling it could be a java script in the
perl script but I doubt it.
------------------------------
Date: 25 Jan 2007 06:53:01 -0800
From: "Andy" <anedza@infotek-consulting.com>
Subject: Re: weird perl script
Message-Id: <1169736781.239587.51480@j27g2000cwj.googlegroups.com>
Its hard to tell what is going wrong without knowing about your email
server configurations and seeing your code.
Some PERL modules that furnish email functionality are actually
dependant upon other existing non-PERL email mediating facilities to be
present that are O/S resident. sendmail is an example of that - its
available only on UNIX and not windows platforms. sendmail is not
itself an email server; it only formats email headers and messages
which it forwards to an SMTP server. An email PERL module (such as
MAIL::xxxx) that relies on sendmail would only pass parameters (such as
recipient email address) to sendmail which would then format these into
the commands of the email protocol used to send or receive email.
Other PERL modules implement email protocols themselves and are able to
talk to directly to any email server that conforms to those protocols
(ie SMTP or POP3 or MAPI). These modules are not platform dependant
and should work on both windows and UNIX.
Another thing to consider is whether your authentication is passing the
security layer for your POP3 server. Because you experience a "hang",
its likely the email PERL modules you are using are searching for an
email mediator that isn't on the platform you are running on. If it
was an authentication problem, you would probably receive an
unauthorized message of some kind right away.
------------------------------
Date: 25 Jan 2007 15:02:47 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: weird perl script
Message-Id: <51rv4nF1m3f86U1@mid.dfncis.de>
Andy <anedza@infotek-consulting.com> wrote in comp.lang.perl.misc:
> Its hard to tell what is going wrong without knowing about your email
> server configurations and seeing your code.
>
> Some PERL modules that furnish email functionality are actually
Please.
The language is Perl. The executable is often called perl, unless
it's bleadperl, perl5.8.4 or so. There is no such thing as PERL.
Anno
------------------------------
Date: Thu, 25 Jan 2007 16:51:14 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: weird perl script
Message-Id: <68khr21h6iehmbrpfs4bath5stfn4d6llf@4ax.com>
On 25 Jan 2007 05:17:02 -0800, jcharth@hotmail.com wrote:
>Hello I wrote a script that reads emails from a pop box, i notice that
>it does not work at home, for some reason, i submit a form to the perl
>script it hangs. THe process runs for a long time and no output to the
A form? So it is a web based thing... why didn't you say so in the
first place?
>screen. But when i do the same thing from my firefox browser under
>linux it works. any ideas what could cause this. THe script also runs
>fine from console. I go the feeling it could be a java script in the
>perl script but I doubt it.
As others wrote, it's hard to say without seeing the actual script.
OTOH if you post the whole of it, it may be overwhelming for us to
look at it. The general recommendation is to trim it down to a bare
minimum that still exhibits the problem. Often in the process of doing
so one spots the problem in the first place. Incidentally, what is a
"java script in the perl script" supposed to be? I suppose you
dinamically render a page with perl. The rendered page contains some
Javascript code. Perl is not concerned with the latter any more...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
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 73
*************************************