[30163] in Perl-Users-Digest
Perl-Users Digest, Issue: 1406 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 30 11:09:46 2008
Date: Sun, 30 Mar 2008 08: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 Sun, 30 Mar 2008 Volume: 11 Number: 1406
Today's topics:
Re: BEGIN, INIT etc... <nospam-abuse@ilyaz.org>
Re: BEGIN, INIT etc... <hjp-usenet2@hjp.at>
How to find this pattern by regular expression? <ahmad.abdulghany@gmail.com>
Re: Memory issues <jm@nospam.fr>
Re: Memory issues <hjp-usenet2@hjp.at>
Re: Memory issues <hjp-usenet2@hjp.at>
Re: Memory issues <hjp-usenet2@hjp.at>
Re: Memory issues <hjp-usenet2@hjp.at>
Re: Memory issues <joost@zeekat.nl>
Re: Memory issues <joost@zeekat.nl>
new CPAN modules on Sun Mar 30 2008 (Randal Schwartz)
Re: NIC Configurations <rkb@i.frys.com>
Re: NIC Configurations <XXjbhuntxx@white-star.com>
Re: ssh ssh <hjp-usenet2@hjp.at>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 30 Mar 2008 07:43:40 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: BEGIN, INIT etc...
Message-Id: <fsngbc$sqe$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Ben Morrow
<ben@morrow.me.uk>], who wrote in article <dhs2c5-lk6.ln1@osiris.mauzo.dyndns.org>:
> > do not forget to never use exec()"?
>
> I am confused. How is one (on a fork/exec-based system, or perl's
> emulation of such under Win32) supposed to avoid calling exec when
> necessary?
The situations when it is *necessary* to call exec() do exist. But
they are extremely rare. fork() is useful slightly more often; but
again, these situations are in no way frequent.
[The introduction of fork()/exec() mess is one of the major weaknesses
of *nix. Fortunately, Perl API makes it practically never needed.]
Yours,
Ilya
------------------------------
Date: Sun, 30 Mar 2008 15:20:38 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: BEGIN, INIT etc...
Message-Id: <slrnfuv4t7.sd3.hjp-usenet2@hrunkner.hjp.at>
On 2008-03-27 18:36, pgodfrin <pgodfrin@gmail.com> wrote:
> So how prevalent is Perl in the commercial world? Do people actually
> have full-time jobs writing perl modules?
Yes.
> Do people use perl to write software like Microsoft Office
I doubt it.
> or Quest Software's Toad? Or perhaps BMC Patrol or CA Univision?
These three are probably closer. (In fact I've been considering to write
"something like Toad" in Perl - it could save me a lot of time, but
unfortunately I first need to find the time to write it).
I doubt you'll find much "shrink-wrapped" software written in perl -
companies which sell shrink-wrapped software don't like to give away
their source code (the customer might see how grotty it is :-)).
> What is it mostly used for?
Lots of "backoffice" stuff: Converting data, producing reports, printing
bills. Anything which has to gather and mangle lots of data from files
or databases.
Tools: Everything you need "in-house" to make some job easier and which
you can't buy off the shelf.
Web-Applications: From small cgi scripts to really large applications.
Analysis: From Server-Logs to the human genome.
hp
------------------------------
Date: Sun, 30 Mar 2008 07:56:25 -0700 (PDT)
From: Ahmad <ahmad.abdulghany@gmail.com>
Subject: How to find this pattern by regular expression?
Message-Id: <30933b35-9453-4494-a0b8-5fbd5ffef3c6@s50g2000hsb.googlegroups.com>
Hi,
I want to find the pattern: PATTERN that can contain lower case or
upper case characters, digits, and special characters like : _ ; ( )
& .
A sample context is:
-- Start here (this line is not in context)
PATTERN {
@ a line containing anything(comment line)
@ multiple comment lines can exist
// Another type of comments
/* Third type of comments
and it's a multiline comment
*/
x1=a AND b
y1= x1 OUTSIDE layer100
copy y1
//Comments can exist anywhere in the text (between the braces)
// this is the closing brace }
-- End here (this line is not in context)
I need when apply regular expression on the above sample context, it
return the word PATTERN.
Any guidance about the most efficient RE to perform that?
Thanks and best regards,
Ahmad
------------------------------
Date: Sun, 30 Mar 2008 11:28:52 +0200
From: jm <jm@nospam.fr>
Subject: Re: Memory issues
Message-Id: <47ef5d54$0$21150$7a628cd7@news.club-internet.fr>
Joost Diepenmaat a écrit :
> jm <jm@nospam.fr> writes:
>
>> Modifying a little bit again the script, and checking execution with
>> ltrace, I observed malloc is called 1871 times when free is just called
>> 922 times.
>> Isn't it an issue?
>
> Please keep in mind that perl's memory allocation strategy in general is
> optimized for longer running programs, not for one-off scripts (which
> makes sense, since one-off scripts don't usually need the performance
> gains).
I did not read this, nor in the documentation, nor in the faq.
Might be a faqmemory might be helpful?
> This means that for instance subroutines will get memory
> allocated on the assumption that they'll be called again, and will take
> about as much memory the next time.
But when a same routine is called several times, with different kind and
size of data, some times it consume lot of memory, and some other time
less memory.
If your code contains hundred of functions and twenty of them consume
200 Mbytes (in a similar way as aa in my example), then a 2 Gbytes
computer will not be enough to run it.
> This is NOT a memory leak per se, but it does mean that if you have a
> subroutine that takes 100Mb to complete, your program will take that
> memory and probably not give it back until the program ends.
I understand this. But I'd like to have the opposite feature.
Or at least one perl function to release the memory used by a function
(or a package).
> IOW, if you
> have a long-running program that only means you need 100Mb for it to
> run, it does NOT mean it takes a 100Mb for each call.
Yes, it is what I observed.
But this mean it is not possible to free the memory consumed by one
function, when you know you need memory in another one function.
> In your test case, don't assume that just because the regular expression
> replacements don't in theory *need* to use any additional RAM, they
> won't. Especially not if you're using UTF-8 encoded strings (which you
> are). Perl algorithms tend to exchange RAM for speed in most cases
> anyway, and replacing a match with a new string of exactly the same
> length in bytes in a unicode string is a pretty uncommon use-case, so
> it's likely not optimized.
I do not think the issue is here.
> Anyway, I've not seen a serious memory leak in perl itself in ages, and
> I run perl processes that use up to 8 Gb of RAM and run for months
> without issues.
This mean you have a 8 Gbytes RAM memory computer.
But if memory was used by perl in a better way, might be the same
programs might work on a 512 MBytes RAM computer.
------------------------------
Date: Sun, 30 Mar 2008 14:37:41 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Memory issues
Message-Id: <slrnfuv2cl.sd3.hjp-usenet2@hrunkner.hjp.at>
On 2008-03-29 13:55, jm <jm@nospam.fr> wrote:
> Joost Diepenmaat a écrit :
>> jm <jm@nospam.fr> writes:
>>
>>> Based on the fact that perl contains many memory leaks,
>>
>> It doesn't.
>
> I wrote a sample of code to illustrate the issue.
[...]
> Calling function aa (one or several times) makes a memory leak (or
> memory empreint) of 150 Mbytes.
> I mean that once I called this function I do not know how to free those
> 150 mega bytes, but if I call this same function again I will not loose
> more memory.
Then it's not a memory leak. A memory leak is when memory which has been
allocated cannot be (re)used. But in your case it can be reused (and is,
if you call the function again).
Perl is certainly wasteful with memory - The data structures have a lot
of overhead, and it often doesn't free memory because it might need it
again later - but AFAIK perl itself doesn't leak. (Perl programs often
leak - the garbage collector cannot detect cycles, for example, so
the programmer has to remember to do that).
hp
------------------------------
Date: Sun, 30 Mar 2008 14:40:44 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Memory issues
Message-Id: <slrnfuv2ic.sd3.hjp-usenet2@hrunkner.hjp.at>
On 2008-03-30 00:13, Joost Diepenmaat <joost@zeekat.nl> wrote:
> jm <jm@nospam.fr> writes:
>> Modifying a little bit again the script, and checking execution with
>> ltrace, I observed malloc is called 1871 times when free is just called
>> 922 times.
>> Isn't it an issue?
>
> Please keep in mind that perl's memory allocation strategy in general is
> optimized for longer running programs, not for one-off scripts (which
> makes sense, since one-off scripts don't usually need the performance
> gains).
Or maybe it is optimized for one-off scripts? One-off scripts rarely
need to worry about hogging memory and it is certainly faster to let the
OS free all the memory at once than to call free a gazillion times.
hp
------------------------------
Date: Sun, 30 Mar 2008 14:55:00 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Memory issues
Message-Id: <slrnfuv3d4.sd3.hjp-usenet2@hrunkner.hjp.at>
On 2008-03-30 09:28, jm <jm@nospam.fr> wrote:
> Joost Diepenmaat a écrit :
>> jm <jm@nospam.fr> writes:
>>> Modifying a little bit again the script, and checking execution with
>>> ltrace, I observed malloc is called 1871 times when free is just called
>>> 922 times.
>>> Isn't it an issue?
[...]
>> IOW, if you
>> have a long-running program that only means you need 100Mb for it to
>> run, it does NOT mean it takes a 100Mb for each call.
>
> Yes, it is what I observed.
>
> But this mean it is not possible to free the memory consumed by one
> function, when you know you need memory in another one function.
You can. Perl keeps around the lexical variables, but not any objects
they point to. So avoid large scalar, hash or array variables in subs
and use references instead. For example, compare the behaviour of
#!/usr/bin/perl
use warnings;
use strict;
print a(@ARGV), "\n";
exit 0;
sub a {
print "entering a @_\n";
my ($n) = @_;
my $s1 = "a" x $n;
my $s2 = "b" x $n;
my $rc = length($s1 . $s2);
print "leaving a @_\n";
return $rc;
}
and
#!/usr/bin/perl
use warnings;
use strict;
print a(@ARGV), "\n";
exit 0;
sub a {
print "entering a @_\n";
my ($n) = @_;
my $s;
$s->[1] = "a" x $n;
$s->[2] = "b" x $n;
my $rc = length($s->[1] . $s->[2]);
print "leaving a @_\n";
return $rc;
}
(And of course "length($s->[1] . $s->[2])" is (intentionally) stupid -
replace it with "length($s->[1]) + length($s->[2])")
>> Anyway, I've not seen a serious memory leak in perl itself in ages, and
>> I run perl processes that use up to 8 Gb of RAM and run for months
>> without issues.
>
> This mean you have a 8 Gbytes RAM memory computer.
>
> But if memory was used by perl in a better way, might be the same
> programs might work on a 512 MBytes RAM computer.
Yes. But memory allocated to lexicals is usually the least of your
worries in this case. The overhead of typical perl data structures is
much worse. (Just this month I reduced the memory consumption of a
program from about 3 GB (which meant that it crashed sometimes, since
that's the limit on 32bit linux) to less than one GB by replacing an
anonymous array with a string (which I always had to unpack and repack
to access and manipulate the data within, which is ugly, but not really
slower than accessing the array).
hp
------------------------------
Date: Sun, 30 Mar 2008 15:02:27 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Memory issues
Message-Id: <slrnfuv3r3.sd3.hjp-usenet2@hrunkner.hjp.at>
On 2008-03-29 23:52, smallpond <smallpond@juno.com> wrote:
> I don't know much about the perl garbage collector,
> but memory is not freed immediately when the ref
> count goes to 0.
This is wrong. When the ref count goes to zero, perl immediately calls
free.
free may decide to keep the memory around for a subsequent malloc call,
but that doesn't have anything to do with perl - only with your system's
malloc/free implementation (if you use the system's malloc, which is the
default on most platforms, I think).
> When I run your program and watch with top, VM goes to 200 MB and
> stays there for the whole run. That seems to be some upper bound
> where the garbage collector is running.
Perl doesn't have a garbage collector which runs periodically.
hp
------------------------------
Date: Sun, 30 Mar 2008 15:10:42 +0200
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: Memory issues
Message-Id: <87ve34pdbh.fsf@zeekat.nl>
"Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
> Or maybe it is optimized for one-off scripts? One-off scripts rarely
> need to worry about hogging memory and it is certainly faster to let the
> OS free all the memory at once than to call free a gazillion times.
True enough. In any case, as others mentioned, the perl interpreter is
pretty wasteful with memory in most cases where it could trade off
between speed and memory efficiency.
--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
------------------------------
Date: Sun, 30 Mar 2008 15:17:00 +0200
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: Memory issues
Message-Id: <87r6dspd0z.fsf@zeekat.nl>
jm <jm@nospam.fr> writes:
>> Anyway, I've not seen a serious memory leak in perl itself in ages, and
>> I run perl processes that use up to 8 Gb of RAM and run for months
>> without issues.
>
> This mean you have a 8 Gbytes RAM memory computer.
16 Gb, actually.
> But if memory was used by perl in a better way, might be the same
> programs might work on a 512 MBytes RAM computer.
No, because the data structures stored in the program really takes up
that much memory (though memory usage could concievably be reduced, if
we really needed to, but that's not a top priority for us). The tradeoff
here was also: speed vs memory use, and speed really was the top
priority (which also means significant pieces of the program are
actually written in C++).
The point being, these programs handle LOTS of data and run for months
without leaking - their memory use is about as stable as you'd expect. A
real leak is where repeated operation will continually increase the
amount of memory needed, which isn't what your test case is doing, and
as I said, it's not something I've seen (in the perl interpreter) in
quite a while.
--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
------------------------------
Date: Sun, 30 Mar 2008 04:42:17 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Mar 30 2008
Message-Id: <JyJ12H.1upD@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.
App-Starter-0.07
http://search.cpan.org/~tomyhero/App-Starter-0.07/
App Starter
----
App-Starter-0.08
http://search.cpan.org/~tomyhero/App-Starter-0.08/
App Starter
----
Bundle-Text-SenseClusters-1.00
http://search.cpan.org/~tpederse/Bundle-Text-SenseClusters-1.00/
Bundle to install SenseClusters and all of its dependent CPAN modules
----
Calendar-List-0.20
http://search.cpan.org/~barbie/Calendar-List-0.20/
A module for creating date lists
----
Config-AutoConf-0.08
http://search.cpan.org/~ambs/Config-AutoConf-0.08/
A module to implement some of AutoConf macros in pure perl.
----
Data-Form-Elements-0.61
http://search.cpan.org/~plural/Data-Form-Elements-0.61/
----
Data-FormValidator-Constraints-Words-0.03
http://search.cpan.org/~barbie/Data-FormValidator-Constraints-Words-0.03/
Data constraints for word inputs.
----
Devel-Backtrace-0.08
http://search.cpan.org/~pepe/Devel-Backtrace-0.08/
Object-oriented backtrace
----
Emacs-Run-0.04
http://search.cpan.org/~doom/Emacs-Run-0.04/
utilities to assist in using emacs from perl via the shell
----
Finance-Bank-LloydsTSB-1.31
http://search.cpan.org/~aspiers/Finance-Bank-LloydsTSB-1.31/
Check your bank accounts from Perl
----
GRID-Machine-0.089
http://search.cpan.org/~casiano/GRID-Machine-0.089/
Remote Procedure Calls over a SSH link
----
Goo-Canvas-0.05
http://search.cpan.org/~yewenbin/Goo-Canvas-0.05/
Perl interface to the GooCanvas
----
Lyrics-Fetcher-Lyrics007-0.06
http://search.cpan.org/~jamesr/Lyrics-Fetcher-Lyrics007-0.06/
Attempts to fetch lyrics from www.lyrics007.com
----
MIME-Charset-1.003
http://search.cpan.org/~nezumi/MIME-Charset-1.003/
Charset Informations for MIME
----
MIME-EncWords-1.008
http://search.cpan.org/~nezumi/MIME-EncWords-1.008/
deal with RFC 2047 encoded words (improved)
----
Net-Interface-Wireless-FreeBSD-1.0.0
http://search.cpan.org/~vvelox/Net-Interface-Wireless-FreeBSD-1.0.0/
Get information for wireless interfactes.
----
Net-UploadMirror-0.10
http://search.cpan.org/~knorr/Net-UploadMirror-0.10/
Perl extension for mirroring a local directory via FTP to the remote location
----
POE-Component-IRC-Plugin-OutputToPastebin-0.001
http://search.cpan.org/~zoffix/POE-Component-IRC-Plugin-OutputToPastebin-0.001/
easily pastebin output from your bot
----
POE-Component-IRC-Plugin-PAUSE-RecentUploads-0.05
http://search.cpan.org/~zoffix/POE-Component-IRC-Plugin-PAUSE-RecentUploads-0.05/
PoCo::IRC plugin for reporting recent uploads to "/pause.perl.org" in http::
----
POE-Component-ResourcePool-0.02
http://search.cpan.org/~nuffin/POE-Component-ResourcePool-0.02/
Asynchronous generic resource management for POE based apps.
----
POE-Component-WWW-Pastebin-Bot-Pastebot-Create-0.002
http://search.cpan.org/~zoffix/POE-Component-WWW-Pastebin-Bot-Pastebot-Create-0.002/
non-blocking POE wrapper around WWW::Pastebin::Bot::Pastebot::Create
----
PPM-0.01_01
http://search.cpan.org/~rkobes/PPM-0.01_01/
Perl Package Manager: locate, install, upgrade software packages.
----
Parse-Marpa-0.205_007
http://search.cpan.org/~jkegl/Parse-Marpa-0.205_007/
(Alpha) Earley's algorithm with LR(0) precomputation
----
PerlMagick-6.40
http://search.cpan.org/~jcristy/PerlMagick-6.40/
----
Rinchi-Fortran-Preprocessor-0.02
http://search.cpan.org/~bmames/Rinchi-Fortran-Preprocessor-0.02/
An Fortran to XML preprocessor extension for preprocessing Fortran files producing XML SAX parser events for the tokens scanned.
----
SOAP-Lite-0.71.01
http://search.cpan.org/~mkutter/SOAP-Lite-0.71.01/
Perl's Web Services Toolkit
----
SVG-Parser-1.02
http://search.cpan.org/~peterw/SVG-Parser-1.02/
XML Parser for SVG documents
----
TM-1.36
http://search.cpan.org/~drrho/TM-1.36/
Topic Maps, Base Class
----
TaskForest-1.05
http://search.cpan.org/~enoor/TaskForest-1.05/
Simple, powerful task scheduler
----
Template-Multipass-0.03
http://search.cpan.org/~nuffin/Template-Multipass-0.03/
Add a meta template pass to TT
----
Test-A8N-0.01
http://search.cpan.org/~nachbaur/Test-A8N-0.01/
Storytest Automation Runner
----
Test-CPAN-Meta-0.10
http://search.cpan.org/~barbie/Test-CPAN-Meta-0.10/
Validation of the META.yml file in a CPAN distribution.
----
Test-YAML-Meta-0.09
http://search.cpan.org/~barbie/Test-YAML-Meta-0.09/
Validation of the META.yml file in a distribution.
----
Tk-GraphViz-1.00
http://search.cpan.org/~jgs/Tk-GraphViz-1.00/
Render an interactive GraphViz graph
----
VS-Chart-0.04
http://search.cpan.org/~claesjac/VS-Chart-0.04/
Simple module to create beautifully looking charts
----
WWW-Curl-4.00
http://search.cpan.org/~szbalint/WWW-Curl-4.00/
Perl extension interface for libcurl
----
WWW-Ofoto-1.28
http://search.cpan.org/~mgrimes/WWW-Ofoto-1.28/
A module to interact with the Ofoto (now Kodakgallery) website
----
X11-Aosd-0.03
http://search.cpan.org/~jred/X11-Aosd-0.03/
libaosd binding for Cairo powered on screen display
----
XML-QOFQSF-0.04
http://search.cpan.org/~codehelp/XML-QOFQSF-0.04/
convert personal data to and from QSF XML files
----
cpan_bot-0.09
http://search.cpan.org/~zoffix/cpan_bot-0.09/
an IRC CPAN Info bot
----
libapreq-1.33
http://search.cpan.org/~geoff/libapreq-1.33/
Apache Request C Library
----
pcsc-perl-1.4.7
http://search.cpan.org/~whom/pcsc-perl-1.4.7/
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: Sat, 29 Mar 2008 21:10:32 -0700 (PDT)
From: Ron Bergin <rkb@i.frys.com>
Subject: Re: NIC Configurations
Message-Id: <0cee7074-36e1-4417-8fe1-ceefcdbfc824@i7g2000prf.googlegroups.com>
On Mar 29, 7:16 pm, Cosmic Cruizer <XXjbhun...@white-star.com> wrote:
> From a Windows box, I need to remotely look at the NICs of about 60 Windows
> servers I have administrative accounts on.
>
> I was going to try and use IO::Interface, but I cannot get the module
> installed. I cannot find the PPD for IO-Interface-1.04 so I can use ppm.
>
> Does anybody have a Perl solution for getting the NIC configurations on
> remote Window servers? Is IO-Interface my best option?
>
> Thanks,
>
> Coz.
Have you looked into trying one of these modules?
Win32::IPConfig
http://search.cpan.org/~jmacfarla/Win32-IPConfig-0.09/lib/Win32/IPConfig.pm
Win32::IPConfig::Adapter
http://search.cpan.org/~jmacfarla/Win32-IPConfig-0.09/lib/Win32/IPConfig/Adapter.pm
Net::Address::Ethernet
http://search.cpan.org/~mthurn/Net-Address-Ethernet-1.111/lib/Net/Address/Ethernet.pm
------------------------------
Date: Sun, 30 Mar 2008 14:07:13 GMT
From: Cosmic Cruizer <XXjbhuntxx@white-star.com>
Subject: Re: NIC Configurations
Message-Id: <Xns9A714863FAE75ccruizermydejacom@207.115.33.102>
Ron Bergin <rkb@i.frys.com> wrote in
news:0cee7074-36e1-4417-8fe1-ceefcdbfc824@i7g2000prf.googlegroups.com:
> On Mar 29, 7:16 pm, Cosmic Cruizer <XXjbhun...@white-star.com> wrote:
>> From a Windows box, I need to remotely look at the NICs of about 60
>> Windows servers I have administrative accounts on.
>>
>> I was going to try and use IO::Interface, but I cannot get the
>> module installed. I cannot find the PPD for IO-Interface-1.04 so I
>> can use ppm.
>>
>> Does anybody have a Perl solution for getting the NIC configurations
>> on remote Window servers? Is IO-Interface my best option?
>>
>> Thanks,
>>
>> Coz.
>
> Have you looked into trying one of these modules?
>
> Win32::IPConfig
> http://search.cpan.org/~jmacfarla/Win32-IPConfig-0.09/lib/Win32/IPConfi
> g.pm
>
> Win32::IPConfig::Adapter
> http://search.cpan.org/~jmacfarla/Win32-IPConfig-0.09/lib/Win32/IPConfi
> g/Adapter.pm
>
> Net::Address::Ethernet
> http://search.cpan.org/~mthurn/Net-Address-Ethernet-1.111/lib/Net/Addre
> ss/Ethernet.pm
>
Thanks Ron. It looks like Win32::IPConfig will do what I need.
------------------------------
Date: Sun, 30 Mar 2008 16:27:31 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: ssh ssh
Message-Id: <slrnfuv8qm.sd3.hjp-usenet2@hrunkner.hjp.at>
On 2008-03-27 18:47, jammer <jameslockie@mail.com> wrote:
> Here is my next attempt:
>
> #!/bin/perl
>
> use strict;
>
> my $inputFile = 'hostlist3.txt';
>
> open my $HOSTLIST, '<', $inputFile
> or die "can't open hostlist: $!";
>
> $/ = ''; # this will read a paragraph at a time
> $\ = "\n"; # avoids needing to print it all the time
>
> while (<$HOSTLIST>) {
> my @hostList = split /\n/;
>
> my $adminHost = shift( @hostList ); # first line
>
> print 'adminHost=' . $adminHost;
>
> my $otherHosts = join ' ', map "ssh $_ uname -a", @hostList;
That doesn't look right.
> my $cmd = "ssh ccn\@$adminHost $otherHosts";
>
> print "executing '$cmd'";
> print `$cmd`;
> }
>
> The problem is that I can't seem to run more than one command from
> ssh.
> I don't really want to open and ssh connection for each otherHosts.
>
> What if hostlist3.txt is:
> host1.domain
> host2
> host3
>
> host4.domain
> ...
>
> I need 'ssh host1.domain ssh host2 uname -a ssh host3 uname -a'.
No, you don't.
ssh host2 uname -a ssh host3 uname -a
is not the command you want to execute on host1.domain. Maybe you want
to execute
ssh host2 uname -a; ssh host3 uname -a
hp
------------------------------
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 1406
***************************************