[7315] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 940 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 28 14:18:07 1997

Date: Thu, 28 Aug 97 11:00:19 -0700
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, 28 Aug 1997     Volume: 8 Number: 940

Today's topics:
     Address Book in Perl? (Juan Gonzalo Lopez R.)
     Re: Bizarre result with regex in -i -pe <rootbeer@teleport.com>
     Re: Bug in perl? Bug in my code? (Ronald L. Parker)
     Re: calling C program within perl CGI script <rootbeer@teleport.com>
     Re: Chomp and chop (brian d foy)
     Re: Filtering CR & CRLF from text input <cbarnett@idirect.com>
     Re: Help whit Serial I/O on PERL (Matthew H. Gerlach)
     Re: Need CPAM mirror site URL (M.J.T. Guy)
     Re: Net::FTP error <gbarr@ti.com>
     Re: Perl & Shadow Passwords authentitacion. <rootbeer@teleport.com>
     Re: Perl and document conversion to HTML ...SOLUTION? <ejones@rap.ucar.edu>
     perl cgi on NT bdrennin@usfg.com
     Re: Simple Search Script <rael@zx81.dnai.com>
     Re: Simple Search Script (brian d foy)
     Re: Sorting of Many Arrays <rootbeer@teleport.com>
     SSH and Perl jjune@midway.uchicago.edu
     Re: What's New in Perlland? (Clay Irving)
     Where is the FAQ?  Not at "www.perl.com"! <jdcurry@primenet.com>
     Re: Wrong status from system() in child process ? <rootbeer@teleport.com>
     Re: www.perl.com ? <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 28 Aug 1997 16:18:18 GMT
From: jglopez@pollux.javeriana.edu.co (Juan Gonzalo Lopez R.)
Subject: Address Book in Perl?
Message-Id: <5u48ca$il3@pollux.javeriana.edu.co>

Hey Boys Hello...


Does anyone knows how can I create a efficient address book?

Using AnyDBM_File, but still is inefficient, I need index (re-organize) a plain file at new register
process.

By now I have one working.

http://www.interimagen.com/cgi/email.cgi/forma.html

Thank you for your answers.  

-- 
---------------------------------------------------------------------------                          
                        Juan Gonzalo Lopez R.
                     Administracisn de Empresas
                 Pontificia Universidad Javeriana
---------------------------------------------------------------------------


------------------------------

Date: Thu, 28 Aug 1997 09:56:08 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Bizarre result with regex in -i -pe
Message-Id: <Pine.GSO.3.96.970828094701.8579l-100000@julie.teleport.com>

On 28 Aug 1997, Jonathan Feinberg wrote:

> I do a lot of one liners in my data-massaging efforts.  I have a
> tab-delimited file, in which some lines had data in the last field of
> each line that I wanted to remove: 
> 
> perl -i.bak -pe 's/[^\t]+$//'
> 
> Yes?  No.  This results in all of the newlines being stripped (leaving
> one rather long line in the file).

That's because the [^\t] will match the newline, since that's not a tab. 
(But if [^\t] didn't match it, then the $ would.) 

I think you might want something like this.

    s/[^\t\n]+(?=$)//

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 28 Aug 1997 17:19:39 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: Bug in perl? Bug in my code?
Message-Id: <3405b1c9.16882194@207.126.101.82>

[posted and emailed, as requested]

On Thu, 28 Aug 1997 10:36:16 -0400, Mark Buckaway <mark@uunet.ca>
wrote:

>$num=sprintf("%.02f",$num);
>printf("%d",$num*100);
>
>Say the number is 209.90 in $num after the "rounding". The second line
>occationally will print out: 20989. It would seem perl internally thinks
>$num is a float and goofs in the multiplication and integer conversion.

erm... 209.90 _is_ a float.  The 20990 that you get when you multiply
isn't _quite_ 20990, and casting it to an int truncates that .999999
off the end, leaving 20989.  Try

printf( '%.0f', $num*100 );

which will perform the multiplication and then round the result to a
whole number.

--
Ron Parker
Software Engineer
Farm Works Software       Come see us at http://www.farmworks.com
For PGP public key see http://www.farmworks.com/Ron_Parker_PGP_key.txt


------------------------------

Date: Thu, 28 Aug 1997 08:56:42 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Mark Grimshaw <M.Grimshaw@music.salford.ac.uk>
Subject: Re: calling C program within perl CGI script
Message-Id: <Pine.GSO.3.96.970828085328.8579W-100000@julie.teleport.com>

On Thu, 28 Aug 1997, Mark Grimshaw wrote:

> I'm having problems reading data returned by a C program that is called
> within my perl CGI script. 
> 
> I've tried using system calls, process ('filehandle' ) calls and
> backticks all without success. 

Maybe it's not returning anything. :-)

> As a test, my C program is the standard "hello world" program (hello.c)
> and when called within a perl script that is run from the command line
> on my UNIX system correctly prints out "hello world".  In this case, I
> call the hello C program using backticks -
> 
> print `./hello`;
> 
> When I try to do the same via CGI, I get nothing.

Is the current directory the same? Are the permissions on the C program
set to allow it to be world-executable? What's in $? after the backticks?

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to
solving such problems. It's available on the perl.com web pages. Hope
this helps!

   http://www.perl.com/perl/
   http://www.perl.com/perl/faq/
   http://www.perl.com/perl/faq/idiots-guide.html

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 28 Aug 1997 12:48:30 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Chomp and chop
Message-Id: <comdog-ya02408000R2808971248300001@news.walrus.com>

In article <Pine.SV4.3.94.970815161335.22551A-100000@aludra.usc.edu>, Nadim <nrana@aludra.usc.edu> wrote:

>Could anyone let me know the difference between chomp and chop? I am
>trying to use chomp in my script but it is not getting compiled. Why?

certainly the perlfunc man page or the Camel book can tell you :)

perhaps if you provided a snippet of the troubled code we could see
what was happening and why things aren't working as you expect them to :)

-- 
brian d foy                                  <comdog@computerdog.com>


------------------------------

Date: 27 Aug 97 16:09:30 GMT
From: "Carey Barnett" <cbarnett@idirect.com>
Subject: Re: Filtering CR & CRLF from text input
Message-Id: <01bcb30c$1f0daa60$425888cf@ns.idirect.com>

I'm new to Perl, but isn't this the 'chomp()' function EXACTLY!

Bart Lateur <bart.mediamind@tornado.be> wrote in article
<340c1c7a.10567789@news.tornado.be>...
> roger@ole-net.com (Roger Easlick) wrote:
> 
> >Can anyone tell me how to strip CRLFs from text input fields? I'm



------------------------------

Date: Thu, 28 Aug 1997 15:57:21 GMT
From: gerlach@netcom.com (Matthew H. Gerlach)
Subject: Re: Help whit Serial I/O on PERL
Message-Id: <gerlachEFMsBL.2KG@netcom.com>

In article <3403BCA8.23FFC799@lsi.net.mx> jzavala@lsi.net.mx writes:
>Hello,
>
>     Can anybody giveme an example of Serial I/O comunication in perl?
>     (linux).
>

If Comm.pl runs under Linux, then I suggest using it to "talk" to a
serial program like ckermit from columbia.edu.

Your script should start with the following lines:

require "Comm.pl";
&Comm'init("open_proc", "expect", "close_it");
use Kermit;


Here is my quick and dirty module wrapper around ckermit:

package Kermit;
 
 
#
#  This is the Kermit constructor, it requires two parameters,
#  the serial device name (i.e. /dev/ttya) and a filename which
#  is used to log the serial session.
#
sub new
{
    my $dev_name = shift;
    $dev_name = shift;
    my $log_file_name = shift;
    my ($kerm_cmd, $handle);
    my ($match, $err, $before, $after );
    my $self = {};
    bless $self;
 
 
    #print "Kermit::new $dev_name\n";
 
    $kerm_cmd =
        "ckermit -Y -l $dev_name -b 38400 -C \" " .
        "set terminal bytesize 8, " .
        "set command bytesize 8, " .
        "log session $log_file_name, " .
        "connect \" ";
 
    $handle = &Comm::open_proc($kerm_cmd) || die "failed to open_proc";
 
    sleep(2);
    $self->{'handle'} = $handle;
 
    ($match, $err, $before, $after ) =
        &Comm::expect($handle, 10, 'Session logged to [\s\S]{1,}, text\)');
 
    if ($match)
    {
        #print "got kermit banner\n";
        return($self);
    }
    else
    {
        print "failed to see kermit banner\n$before\n";
        &Comm::close_it($handle);
        return(0);
    }
 
}
#
#  This method is used to write a string out the serial connection.
#
sub Write
{
    my $self = shift;
    my $str  = shift;
    my $handle = $self->{'handle'};
 
    #print "Kermit2::Write: $str";
    print $handle "$str";
}
 
#
#  This function provides a non-blocking, timed read of the serial
#  device looking for a regular expression.  It has the same api
#  as Comm::expect.
#
sub Expect
{
    my $self = shift;
    my $timeout = shift;
    my $handle = $self->{'handle'};
 
    &Comm::expect($handle, $timeout, @_);
}
 
#
#  This is the destructor of serial connection.
#
#
sub delete
{
    my $self = shift;
 
    if (defined($self->{'handle'}))
    {
        &Comm::close_it($self->{'handle'});
 
    }
}
 
1;
__END__



------------------------------

Date: 28 Aug 1997 16:15:39 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Need CPAM mirror site URL
Message-Id: <5u487b$8sm$1@lyra.csx.cam.ac.uk>

Mick Ghazey <mick@DONTSMAM.ME> wrote:
>Can't connect to www.perl.com. Does anybody know a CPAN mirror site?

Yes, I know lots of them  :-).

If you have a modern Perl installed, you'll find a complete list in the
perlmodlib man page:

     The registered CPAN sites as of this writing include the
     following.  You should try to choose one close to you:

     + Africa

              South Africa    ftp://ftp.is.co.za/programming/perl/CPAN/


     + Asia

              Hong Kong       ftp://ftp.hkstar.com/pub/CPAN/
              Japan           ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
                              ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/
              South Korea     ftp://ftp.nuri.net/pub/CPAN/
              Taiwan          ftp://dongpo.math.ncu.edu.tw/perl/CPAN/
                              ftp://ftp.wownet.net/pub2/PERL/

     + Australasia

              Australia       ftp://ftp.netinfo.com.au/pub/perl/CPAN/
              New Zealand     ftp://ftp.tekotago.ac.nz/pub/perl/CPAN/

     + Europe

              Austria         ftp://ftp.tuwien.ac.at/pub/languages/perl/CPAN/
              Belgium         ftp://ftp.kulnet.kuleuven.ac.be/pub/mirror/CPAN/
              Czech Republic  ftp://sunsite.mff.cuni.cz/Languages/Perl/CPAN/
              Denmark         ftp://sunsite.auc.dk/pub/languages/perl/CPAN/
              Finland         ftp://ftp.funet.fi/pub/languages/perl/CPAN/
              France          ftp://ftp.ibp.fr/pub/perl/CPAN/
                              ftp://ftp.pasteur.fr/pub/computing/unix/perl/CPAN/              Germany         ftp://ftp.gmd.de/packages/CPAN/
                              ftp://ftp.leo.org/pub/comp/programming/languages/perl/CPAN/
                              ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/
                              ftp://ftp.rz.ruhr-uni-bochum.de/pub/CPAN/
                              ftp://ftp.uni-erlangen.de/pub/source/Perl/CPAN/
                              ftp://ftp.uni-hamburg.de/pub/soft/lang/perl/CPAN/
              Greece          ftp://ftp.ntua.gr/pub/lang/perl/
              Hungary         ftp://ftp.kfki.hu/pub/packages/perl/CPAN/
              Italy           ftp://cis.utovrm.it/CPAN/
              the Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
                              ftp://ftp.EU.net/packages/cpan/
              Norway          ftp://ftp.uit.no/pub/languages/perl/cpan/
              Poland          ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/
                              ftp://sunsite.icm.edu.pl/pub/CPAN/
              Portugal        ftp://ftp.ci.uminho.pt/pub/lang/perl/
                              ftp://ftp.telepac.pt/pub/CPAN/
              Russia          ftp://ftp.sai.msu.su/pub/lang/perl/CPAN/
              Slovenia        ftp://ftp.arnes.si/software/perl/CPAN/
              Spain           ftp://ftp.etse.urv.es/pub/mirror/perl/
                              ftp://ftp.rediris.es/mirror/CPAN/
              Sweden          ftp://ftp.sunet.se/pub/lang/perl/CPAN/
              UK              ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/
                              ftp://sunsite.doc.ic.ac.uk/packages/CPAN/
                              ftp://unix.hensa.ac.uk/mirrors/perl-CPAN/

     + North America

              Ontario         ftp://ftp.utilis.com/public/CPAN/
                              ftp://enterprise.ic.gc.ca/pub/perl/CPAN/
              Manitoba        ftp://theory.uwinnipeg.ca/pub/CPAN/
              California      ftp://ftp.digital.com/pub/plan/perl/CPAN/
                              ftp://ftp.cdrom.com/pub/perl/CPAN/
              Colorado        ftp://ftp.cs.colorado.edu/pub/perl/CPAN/
              Florida         ftp://ftp.cis.ufl.edu/pub/perl/CPAN/
              Illinois        ftp://uiarchive.uiuc.edu/pub/lang/perl/CPAN/
              Massachusetts   ftp://ftp.iguide.com/pub/mirrors/packages/perl/CPAN/
              New York        ftp://ftp.rge.com/pub/languages/perl/
              North Carolina  ftp://ftp.duke.edu/pub/perl/
              Oklahoma        ftp://ftp.ou.edu/mirrors/CPAN/
              Oregon          http://www.perl.org/CPAN/
                              ftp://ftp.orst.edu/pub/packages/CPAN/
              Pennsylvania    ftp://ftp.epix.net/pub/languages/perl/
              Texas           ftp://ftp.sedl.org/pub/mirrors/CPAN/
                              ftp://ftp.metronet.com/pub/perl/

     + South America

              Chile           ftp://sunsite.dcc.uchile.cl/pub/Lang/perl/CPAN/



Mike Guy


------------------------------

Date: Thu, 28 Aug 1997 12:38:52 -0500
From: Graham Barr <gbarr@ti.com>
To: John Ballem <jpb@ams.org>
Subject: Re: Net::FTP error
Message-Id: <3405B7AC.34BA584C@ti.com>

John Ballem wrote:
> 
> Does anyone know why this error crops up now and then.
> Its tough to reproduce, I'm not sure if the socket is shutting down on
> the otherend or what.
> 
>  Net::FTP: Unexpected EOF on command channel at
> /usr/local/lib/perl5/site_perl/Net/FTP.pm line 738

Your assumption is correct, that the server has closed the connection,
or the connection has been lost.

If you can reproduce the problem, adding Debug => 1 to
the Net::FTP constructor will output a protocol trace,
which may help to track why this is happening.

Graham.

-- 
The road to success is lined with many tempting parking spaces.


------------------------------

Date: Thu, 28 Aug 1997 10:17:45 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: John Osborne <osborne6@acm.cps.msu.edu>
Subject: Re: Perl & Shadow Passwords authentitacion.
Message-Id: <Pine.GSO.3.96.970828101442.8579q-100000@julie.teleport.com>

On 28 Aug 1997, John Osborne wrote:

> I've found that I can snag encrypted passwords from /etc/shadow using
> repeated calls to getpwent.  Give it a try, it might work on your system.

If you can do that from an unprivileged process, that pretty much negates
the usefulness of having shadow passwords, doesn't it? :-)

But if you're meaning that you can get these from a root-privileged
process, that's fine - but you shouldn't have to use _repeated_ calls to
getpwent to do so. (Unless you're trying to step through the list of users
on the system?) Either use getpwuid or getpwnam. Hope this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 28 Aug 1997 11:17:33 -0600
From: Eric Jones <ejones@rap.ucar.edu>
Subject: Re: Perl and document conversion to HTML ...SOLUTION?
Message-Id: <5u4bqs$o6l$1@ncar.ucar.edu>

I've gotten this to work using OLE automation. Use something like:


use OLE
$word=CreateObject OLE 'Word.Basic' \
 	or warn "Couldn't create new instance of App!!";
$word->FileOpen("myfile.doc");
$fmt = $word->ConverterLookup("HTML")
$word->FileSaveAs("myfile.htm",$fmt);
$word->Quit();


This works most of the time EXCEPT if the html converter encounters some
alert condition (characters in other languages for me) it throws up a
dialog box that requires manual intervention.

HOW DO I PREVENT THIS DIALOG BOX FROM APPEARING OR AT LEAST
AUTOMATICALLY SELECT ITS DEFAULT????? Sorry for shouting, this is
driving me batty. CVTDOC seems to have the same problem...no error
handling.

Thanks,

Eric


PS. To reply by mail remove *NOSPAM* from my address.


Jonathan Dodds wrote:
> 
> If this is a one time conversion use the Internet assistant for Word.
> 
> I'm not familiar with CVTDOC so I can't help you specifically with that.
> 
> The file format for Word documents is proprietary. Microsoft does not
> publish it. It also tends to change with each new version of Word.
> 
> Using perl to parse and convert Word documents implies reverse engineering
> the Word file format. Not an easy task.
> 
> I would suggest you stick to Microsoft supplied tools.
> 
> Mike Drons <Michael_Drons@ins.com> wrote in article
> <3401A209.310C@ins.com>...
> > I am need to upload a word document to IIS 3.0 and then have perl
> > convert that document to HTML.  Has anybody done this??  I have found an
> > ISASP filter (CVTDOC) on microsoft.com but I can't get it to work.
> > Please help me..
> >
> > Mike Drons
> > michael_drons@ins.com
> >
> >


------------------------------

Date: Thu, 28 Aug 1997 12:21:10 -0600
From: bdrennin@usfg.com
Subject: perl cgi on NT
Message-Id: <872788279.29848@dejanews.com>

perl 5.003 on NT:

I'm having trouble designing the following:

When a user submits a form,

1. A message displays on the user's browser stating something to the
   effect, "Results output to file abc.html".

2. A report is generated by a perl script, using the input from
   the form on the server.

I getting 1. is no problem, however, after the message displays, the
meteor shower continues to run until the report is finished being
generated. How can I do this without tying up the browser? thanks.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


------------------------------

Date: 28 Aug 1997 09:53:18 -0700
From: Rael Dornfest <rael@zx81.dnai.com>
Subject: Re: Simple Search Script
Message-Id: <87203e9rlt.fsf@zx81.dnai.com>


"Matthew Feinberg" <matt@monmouth.com> writes:

> Can anyone direct me to where I can find a simple search and replace
> script.
> for example I want to be able to replace a word or a string on multiple
> pages in a directory.

Perl allows you to do all this in one line (or more if you so wish ;-).

perl -p -i.bak -e "s/foo/bar/g;" file1 file2 file3

  replaces all (the 'g' after the final '/' means globally) occurances
  of 'foo' with 'bar' on each line of the files file1, file2, and file3
  while making backup copies ('-i.bak') named file1.bak, file2.bak, file3.bak

perl -p -i.bak -e "s/foo/bar/g;" *.html

  will obviously do the same to all files ending with the extension .html  


For example, if I have two files:

----- foo.1.txt -----
I am foo.1.txt.

----- foo.2.txt -----
I am foo.2.txt, yet another in the "foo" series.

and I run:

% perl -p -i.bak -e "s/foo/bar/g;" foo.*.txt

I am left with 4 files:

foo.1.txt.bak -- containing the original text of foo.1.txt
foo.2.txt.bak -- containing the original text of foo.2.txt

----- foo.1.txt -----
I am bar.1.txt.

----- foo.2.txt -----
I am bar.2.txt, yet another in the "bar" series.

For more info on such command-line shenanigans, see the perlrun
man page.

Rael

---------------------------------------------------------------------------
/Rael Dornfest/                                     <title>Webmaven</title>
                              %company = (DNAI => 'Direct Network Access');
print <<ADDRESS;
2039 Shattuck Avenue, Suite 206                           To: rael@dnai.com
Berkeley, CA 94704                                 atdt 888 321 3624 (DNAI)
ADDRESS                           <a href="http://www.dnai.com">Website</a>





------------------------------

Date: Thu, 28 Aug 1997 13:02:47 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Simple Search Script
Message-Id: <comdog-ya02408000R2808971302470001@news.walrus.com>

In article <01bcb3d0$0cc77920$05f7face@tech4.monmouth.com>, "Matthew Feinberg" <matt@monmouth.com> wrote:

>Can anyone direct me to where I can find a simple search and replace
>script.
>for example I want to be able to replace a word or a string on multiple
>pages in a directory.
>
>i.e.  ./replace filename wordtoreplace newword

from the command line

% perl -pi.old -e 's/wordtoreplace/newword/g' filename

the -p and -i combination replaces the file with the wordtoreplace
and saves the old file to "filename.old" (or whatever extension
you choose to use after -i).  the -e executes the script given on
the command line, and the "filename" is the name of the file to use
as input (this can also be a glob, such as *.txt).

see the perlrun man page for details :)

-- 
brian d foy                                  <comdog@computerdog.com>


------------------------------

Date: Thu, 28 Aug 1997 09:15:54 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Ravi Pina <rpina@bird.iagnet.net>
Subject: Re: Sorting of Many Arrays
Message-Id: <Pine.GSO.3.96.970828091333.8579d-100000@julie.teleport.com>

On Thu, 28 Aug 1997, Ravi Pina wrote:

> I have @a and @b and I'd like to be able to sort ALL of the values of
> the array to form a big array, and take that and sort the result, @c
> with another array, @d.  Can this be done, and if so, can it be done
> with any efficancy and quickness.  

Yes, if your sort definition is properly written to allow efficiency and
quickness.

    @c = sort however @a, @b;
    @d = sort however @c, @d;

Hope this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 28 Aug 1997 11:36:20 -0600
From: jjune@midway.uchicago.edu
To: joseph.june@ac.com
Subject: SSH and Perl
Message-Id: <872785193.26062@dejanews.com>

Hi!

I am currently trying to write a perl script that will utilize ssh and scp
to

	1)  Copy files to many different servers automatically;
	2)  Execute commands on many different servers automatically;

Basically I need to be able to execute the same command on multiple
servers... for example... I will need to scp a file (a tar file) to 30
different servers... and execute a command to untar the file on all 30
servers.

I think I can set up the ssh with RSA to ssh in and out of all the servers
without passwords... so i'm in the process of writing a perl script which
will basically read in the server ips and do a system call on them...

turning out to be MUCH more tricky then I had anticipated... has anyone
seen any script that does this?... Or better yet... can anyone offer any
pointers or advice on how to go about writing something like this?

thanks for your help!

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


------------------------------

Date: 28 Aug 1997 11:57:25 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: What's New in Perlland?
Message-Id: <5u4755$d0u@panix.com>

In <5u3v4o$k30@rigel.cyberpass.net> ahenry@rigel.cyberpass.net (Andrew Henry) writes:

>I'm looking for a source of news about Perl.

>Tom Christensen used to maintain a list at 
>http://www.perl.com/perl/admin/whats_new.html, but this 
>hasn't been updated in a while and in any case,
>http://www.perl.com seems to be down at the moment.

>The O'Reilly WWW site mentions that Songline Studios are 
>going to take over the running of http://www.perl.com in
>http://software.ora.com/news/press/pr8-19-97.html but
>it doesn't give any details about when this is going to
>happen.

>I realise that in the past a lot of the information on Perl
>has relied on the goodwill of people like Tom, and that
>real life can take over.  Personally, I would like this to
>be time for The Perl Institute to help out, but
>http://www.perl.org hasn't been updated since the end of
>May.  I do subscribe to The Perl Journal, but as a
>quarterly publication, its not ideal for up-to-date news.
>Are there any alternatives ?

Sure! Here's the best one: Hang tight. There is a lot of new and
exciting things happening at www.perl.com! If you absolutely have 
to have a dose of new stuff about Perl, check the Perl Reference
at http://www.panix.com/~clay/perl/ (this is also moving to the
new www.perl.com site).

-- 
Clay Irving <clay@panix.com>                   http://www.panix.com/~clay/


------------------------------

Date: 28 Aug 1997 09:25:00 -0700
From: John Desmond Curry <jdcurry@primenet.com>
Subject: Where is the FAQ?  Not at "www.perl.com"!
Message-Id: <5u48os$p6q@nntp02.primenet.com>

Thursday, August 28, 1997

Dear Perl gurus :

I am a newbie, so please have patience!  I have spent hours 
trying to find the Perl FAQ at the various places that previous 
messages on this newsgroup (comp.lang.perl.misc) have said that 
it is at, including "www.perl.com", but none of them exist.  So, 
where is it?

Be seeing you.

John Curry

mailto:jdcurry@primenet.com

http://www.primenet.com/~jdcurry/

"I propose we leave math to the machines and go play outside." -- Calvin


------------------------------

Date: Thu, 28 Aug 1997 10:11:35 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "Richard J. Marisa" <rjm2@cornell.edu>
Subject: Re: Wrong status from system() in child process ?
Message-Id: <Pine.GSO.3.96.970828101020.8579p-100000@julie.teleport.com>

On Thu, 28 Aug 1997, Richard J. Marisa wrote:

> I'm having trouble getting the return status from a system()
> call.  It works fine if I create a test script, but in my
> application $? is always -1 after the system call.  

Maybe that's the proper value. :-)  

> The only difference is that the application calls system from within a
> child (forked) process.  Is there anything strange about the status
> returned to child processes?

Every process except init is a child process. :-)

Can you post a small piece of code which doesn't do what you expect? A
dozen lines or so should be plenty. Thanks!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 28 Aug 1997 09:57:49 -0700
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: www.perl.com ?
Message-Id: <Pine.GSO.3.96.970828095634.8579m-100000@julie.teleport.com>

On Thu, 28 Aug 1997, Mick Ghazey wrote:

> Do you know the URL of a CPAN mirror site?

Yes, and there's one near you!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/


CPAN/SITES

Welcome to the CPAN, the Comprehensive Perl Archive Network.

This document describes the CPAN itself, the Network.

---

Network


The master CPAN site is at FUNET, the Finnish University NETwork
(Finland, Europe). Select the site nearest to you from the list below,
'Registered CPAN sites', to get the best response time and bandwidth.
NOTE: one way to select 'the nearest' is to use the
http://www.perl.com/CPAN
which tries to guess the nearest site for you based on your host's
Internet domain name.

The list of the registered CPAN sites follows.
Please note that the sorting order is alphabetical on fields:


	continent - country/state - ftp-url


and thus the North American servers happen to be listed between the
European and the South American sites.

Registered CPAN sites


  Africa

    South Africa    ftp://ftp.is.co.za/programming/perl/CPAN/

  Asia

    Hong Kong       ftp://ftp.hkstar.com/pub/CPAN/
    Japan           ftp://ftp.dti.ad.jp/pub/lang/CPAN/
                    ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
                    ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/
    Singapore       ftp://ftp.nus.edu.sg/pub/unix/perl/CPAN/
    South Korea     ftp://ftp.bora.net/pub/CPAN/
                    ftp://ftp.nuri.net/pub/CPAN/
    Taiwan          ftp://dongpo.math.ncu.edu.tw/perl/CPAN/
                    ftp://ftp.wownet.net/pub2/PERL/
    Thailand        ftp://ftp.riubon.ac.th/pub/mirrors/perl/CPAN/

  Australasia

    Australia       ftp://ftp.motd.com/pub/CPAN/
                    ftp://ftp.netinfo.com.au/pub/perl/CPAN/
    New Zealand     ftp://ftp.tekotago.ac.nz/pub/perl/CPAN/

  Central America

    Costa Rica      ftp://ftp.ucr.ac.cr/pub/Unix/CPAN/

  Europe

    Austria         ftp://ftp.tuwien.ac.at/pub/languages/perl/CPAN/
    Belgium         ftp://ftp.kulnet.kuleuven.ac.be/pub/mirror/CPAN/
    Czech Republic  ftp://ftp.fi.muni.cz/pub/perl/
                    ftp://sunsite.mff.cuni.cz/Languages/Perl/CPAN/
    Denmark         ftp://sunsite.auc.dk/pub/languages/perl/CPAN/
    Estonia         ftp://ftp.ut.ee/pub/languages/perl/CPAN/
    Finland         ftp://ftp.funet.fi/pub/languages/perl/CPAN/
    France          ftp://ftp.lip6.fr/pub/perl/CPAN/
                    ftp://ftp.oleane.net/pub/mirrors/CPAN/
                    ftp://ftp.pasteur.fr/pub/computing/unix/perl/CPAN/
    Germany         ftp://ftp.Germany.EU.net/pub/programming/perl/CPAN/
                    ftp://ftp.gmd.de/packages/CPAN/
                    ftp://ftp.uni-hamburg.de/pub/soft/lang/perl/CPAN/
    Greece          ftp://ftp.ntua.gr/pub/lang/perl/
    Hungary         ftp://ftp.kfki.hu/pub/packages/perl/CPAN/
    Ireland         ftp://sunsite.compapp.dcu.ie/pub/perl/
    Italy           ftp://cis.utovrm.it/CPAN/
    the Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
                    ftp://ftp.EU.net/packages/cpan/
    Norway          ftp://ftp.uit.no/pub/languages/perl/cpan/
    Poland          ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/
                    ftp://sunsite.icm.edu.pl/pub/CPAN/
    Portugal        ftp://ftp.ci.uminho.pt/pub/lang/perl/
                    ftp://ftp.telepac.pt/pub/CPAN/
    Romania         ftp://ftp.dntis.ro/pub/mirrors/perl-cpan/
                    ftp://ftp.dnttm.ro/pub/CPAN/
    Russia          ftp://ftp.sai.msu.su/pub/lang/perl/CPAN/
    Slovenia        ftp://ftp.arnes.si/software/perl/CPAN/
    Spain           ftp://ftp.etse.urv.es/pub/mirror/perl/
                    ftp://ftp.rediris.es/mirror/CPAN/
    Switzerland     ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
    UK              ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/
                    ftp://ftp.flirble.org/pub/languages/perl/CPAN/
                    ftp://sunsite.doc.ic.ac.uk/packages/CPAN/
                    ftp://unix.hensa.ac.uk/mirrors/perl-CPAN/

  North America

    California      ftp://ftp.cdrom.com/pub/perl/CPAN/
                    ftp://ftp.digital.com/pub/plan/perl/CPAN/
    Calisota        http://www.perl.org/CPAN/
    Colorado        ftp://ftp.cs.colorado.edu/pub/perl/CPAN/
    Florida         ftp://ftp.cis.ufl.edu/pub/perl/CPAN/
    Illinois        ftp://uiarchive.uiuc.edu/pub/lang/perl/CPAN/
    Manitoba        ftp://theory.uwinnipeg.ca/pub/CPAN/
    Massachusetts   ftp://ftp.ccs.neu.edu/net/mirrors/ftp.funet.fi/pub/languages/perl/CPAN/
                    ftp://ftp.iguide.com/pub/mirrors/packages/perl/CPAN/
    New York        ftp://ftp.rge.com/pub/languages/perl/
    North Carolina  ftp://ftp.duke.edu/pub/perl/
    Oklahoma        ftp://ftp.ou.edu/mirrors/CPAN/
    Ontario         ftp://enterprise.ic.gc.ca/pub/perl/CPAN/
                    ftp://ftp.utilis.com/public/CPAN/
    Oregon          ftp://ftp.orst.edu/pub/packages/CPAN/
    Pennsylvania    ftp://ftp.epix.net/pub/languages/perl/
    Texas           ftp://ftp.metronet.com/pub/perl/
                    ftp://ftp.sedl.org/pub/mirrors/CPAN/
                    ftp://ftp.sterling.com/CPAN/
    Washington      ftp://ftp.spu.edu/pub/CPAN/

  South America

    Brazil          ftp://cpan.if.usp.br/pub/mirror/CPAN/
    Chile           ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
                    ftp://sunsite.dcc.uchile.cl/pub/Lang/perl/CPAN/



Feedback

You can send email
to the CPAN administrators, cpan@perl.org.

How You Can Help

Inform

If you know of some Perl resources that seem not to be in the CPAN
(you did check the contents listings in indices/, didn't you?) please tell us.  We will grab it (if it is small and/or stable) or set up regular mirroring
(if it is not).

Contribute

If you have some modules/scripts/documentation yourself that you
would like to contribute to CPAN, please read the file modules/04pause
and let us know.

Register

If you have a reliable and well-connected ftp site where you can
keep CPAN (about 260 MB currently), more mirror sites are welcome.
Feel free to volunteer and contact the CPAN
administrators describing your mirroring setup, please see the top
of the file MIRRORED.BY Of course, first
check (see from the above list) whether you
area (network-connectivity-and-bandwidth-wise) is already well
covered. Redundancy and fault-tolerance are good things for ftp
archives like CPAN but virtues can be exaggerated. Mirroring
software is available
from the CPAN itself.

Private/Local Mirroring

If you want to set up a private/local mirror of CPAN but
do not want to advertise it you do not need to contact the CPAN
admistrators. You need to assess which of the public CPAN
sites would give the best ftp bandwidth for you (during the
nighttime, mind) and then contact the email address dst_contact
given in the MIRRORED.BY file to learn the best time of the
day to do your mirror. Mirroring software
is available from the
CPAN itself.

---






------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 940
*************************************

home help back first fref pref prev next nref lref last post