[23844] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6047 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 29 22:41:59 2004

Date: Thu, 29 Jan 2004 19:36:20 -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, 29 Jan 2004     Volume: 10 Number: 6047

Today's topics:
        SSH and run an interactive program on another machine (John Call)
    Re: SSH and run an interactive program on another machi <kuujinbo@hotmail.com>
    Re: SSH and run an interactive program on another machi <kuujinbo@hotmail.com>
    Re: stat file behaviour ( and just a bit more ) <groups@donstefani.com>
    Re: stat file behaviour ( and just a bit more ) <go@away.spam.invalid>
    Re: stat file behaviour ( and just a bit more ) <go@away.spam.invalid>
    Re: stat file behaviour ( and just a bit more ) <groups@donstefani.com>
        stat file behaviour (mike)
    Re: stat file behaviour (Walter Roberson)
    Re: stat file behaviour <raisin@delete-this-trash.mts.net>
        Statistics for comp.lang.perl.misc <gbacon@hiwaay.net>
        stop a die(); <aolblowz@yahoo.com>
    Re: stop a die(); <tassilo.parseval@rwth-aachen.de>
    Re: stop a die(); <bik.mido@tiscalinet.it>
    Re: stop a die(); (Anno Siegel)
    Re: stop a die(); <aolblowz@yahoo.com>
    Re: stop a die(); <bik.mido@tiscalinet.it>
    Re: stop a die(); <bik.mido@tiscalinet.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 27 Jan 2004 18:50:12 -0800
From: jcall@gilmerschools.com (John Call)
Subject: SSH and run an interactive program on another machine
Message-Id: <8ebb64a.0401271850.56445feb@posting.google.com>

I am trying to run a program on machine B from machine A. I need to
SSH from A to B, run the program which will ask for a password
interactively, give it the password and then disconnect.

I came across Except but cannot see how to ssh and then inside the ssh
I initiate run the program.

I have written some code with Net::SSH::Perl that connects and runs
the program but it asks for the password at my command line and won't
accept it from the program.

Code:
-----------------------------
use Net::SSH::Perl;

require '/storage/mu/etc_defaults.pl';

$cmd = $radius_restart_cmd;

my %params = (
                protocol => 2,
);

my $ssh = Net::SSH::Perl->new($radius_host, %params);
$ssh->login('root', $radius_su);
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
my($stdout, $stderr, $exit) = $ssh->cmd('admin');
$ssh->debug($msg);

print "\n\n'$stdout' '$stderr' '$exit'\n\n";

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

Thanks ahead of time for any ideas.

I know I should pass the password as plain text but this is just a
test and I'll clean that up later.

John Call


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

Date: Wed, 28 Jan 2004 21:49:34 +0900
From: ko <kuujinbo@hotmail.com>
Subject: Re: SSH and run an interactive program on another machine
Message-Id: <bv8bes$cvr$1@pin3.tky.plala.or.jp>

John Call wrote:
> I am trying to run a program on machine B from machine A. I need to
> SSH from A to B, run the program which will ask for a password
> interactively, give it the password and then disconnect.
> 
> I came across Except but cannot see how to ssh and then inside the ssh
> I initiate run the program.
> 
> I have written some code with Net::SSH::Perl that connects and runs
> the program but it asks for the password at my command line and won't
> accept it from the program.
> 
> Code:
> -----------------------------
> use Net::SSH::Perl;
> 
> require '/storage/mu/etc_defaults.pl';
> 
> $cmd = $radius_restart_cmd;
> 
> my %params = (
>                 protocol => 2,
> );
> 
> my $ssh = Net::SSH::Perl->new($radius_host, %params);
> $ssh->login('root', $radius_su);
> my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
---------------------------------------------^^^
 From the documentation:

($out, $err, $exit) = $ssh->cmd($cmd, [ $stdin ])

"Runs the command $cmd on the remote server and returns the stdout, 
stderr, and exit status of that command."

So try this:

my($stdout, $stderr, $exit) = $ssh->cmd($cmd, 'admin');

> my($stdout, $stderr, $exit) = $ssh->cmd('admin');

Then you can get rid of the line above. Basically, you called cmd() 
twice and clobbered the return values from the first call. You also 
would have seen some important messages if warnings were enabled...

[snip]

HTH- keith


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

Date: Wed, 28 Jan 2004 21:56:25 +0900
From: ko <kuujinbo@hotmail.com>
Subject: Re: SSH and run an interactive program on another machine
Message-Id: <bv8brn$djh$1@pin3.tky.plala.or.jp>

ko wrote:

>  From the documentation:
> 
> ($out, $err, $exit) = $ssh->cmd($cmd, [ $stdin ])
> 
> "Runs the command $cmd on the remote server and returns the stdout, 
> stderr, and exit status of that command."

the line below that is the most important part...wrong cut and paste:

"If $stdin is provided, it's supplied to the remote command $cmd on 
standard input."

[snip]


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

Date: Thu, 29 Jan 2004 14:32:40 GMT
From: Don Stefani <groups@donstefani.com>
Subject: Re: stat file behaviour ( and just a bit more )
Message-Id: <40191AE0.1040609@donstefani.com>

mike wrote:
> hi
> 
> i have a directory testdir with a single file called test.txt 
> i tried to stat the file like this

The next rookie steps up to the help booth and humbly inquires...

This seemed like a very simple thing to do, and after a bit of checking, 
I found that it was.
But I'm posting to ask:

1/ Can it be done with less code? ( 99.999% of the time it can )

2/ My file test for 'only if -f or NOT -d' is not working.
I've tried the test in different place in the script, the last one I'll 
show just happens to be the last place I tried it.
The things I've tried I found in 'Learning Perl' and 'google groups'.

A good hint is always appreciated.

Thanks,

Don

##############################

#!/usr/bin/perl -w
use strict;

my ($name, $size);
my $dir = '/usr/local/';

opendir(DIRLIST,$dir) || die "Cannot opendir $dir: $!";

foreach $name (sort readdir(DIRLIST))
{
     if (! -d $name) # also tried (-f $name) and got no returned files
         $size = (stat($dir.$name))[7];
         print "$name : $size\n" if $name =~ /^[^.]+/;
     }
}
closedir(DIRLIST);



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

Date: Thu, 29 Jan 2004 20:16:35 GMT
From: LaDainian Tomlinson <go@away.spam.invalid>
Subject: Re: stat file behaviour ( and just a bit more )
Message-Id: <Xns947F9B62F906bclennoxeosncsuedu@24.25.9.41>

On 29 Jan 2004, "Don Stefani" <groups@donstefani.com> wrote in
comp.lang.perl.misc: 

> This seemed like a very simple thing to do, and after a bit of
> checking, I found that it was.
> But I'm posting to ask:
> 
> 1/ Can it be done with less code? ( 99.999% of the time it can )

Sure can, with a slight loss in clarity and one more of those fancy
-X functions. 

> 2/ My file test for 'only if -f or NOT -d' is not working.
> I've tried the test in different place in the script, the last one
> I'll show just happens to be the last place I tried it.
> The things I've tried I found in 'Learning Perl' and 'google
> groups'. 

I'm surprised you didn't find an answer on Google.  It's a fairly
common mistake (in fact, it's the same mistake as made by the OP). 

> #!/usr/bin/perl -w
> use strict;
> 
> my ($name, $size);

Declare your variables in the smallest scope in which they are used.  
Both $name and $size are only used inside the for loop, so declare
them there. 

> my $dir = '/usr/local/';
> 
> opendir(DIRLIST,$dir) || die "Cannot opendir $dir: $!";
> 
> foreach $name (sort readdir(DIRLIST))
> {
>      if (! -d $name) # also tried (-f $name) and got no returned
>                      # files 

You got it right on the next line!  You needed to append the
directory name up front. 

>          $size = (stat($dir.$name))[7];
>          print "$name : $size\n" if $name =~ /^[^.]+/;
>      }
> }
> closedir(DIRLIST);

A few lines shorter:


my $dir = '/usr/local/bin';  #nothing in /usr/local for me

 ...

for (map "$dir/$_" => sort readdir DIRLIST){
	print((split '/')[-1] . ': ' . -s) if (-f && ! /^\./);
}


Brandan L.
-- 
bclennox AT eos DOT ncsu DOT edu


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

Date: Thu, 29 Jan 2004 20:27:26 GMT
From: LaDainian Tomlinson <go@away.spam.invalid>
Subject: Re: stat file behaviour ( and just a bit more )
Message-Id: <Xns947F9D3922840bclennoxeosncsuedu@24.25.9.41>

On 29 Jan 2004, "LaDainian Tomlinson" <go@away.spam.invalid> wrote in 
comp.lang.perl.misc:

<snip>

> for (map "$dir/$_" => sort readdir DIRLIST){
>      print((split '/')[-1] . ': ' . -s) if (-f && ! /^\./);
> }

Of course, this makes sure that your path doesn't start with a dot, and 
that's not so helpful.  It isn't testing the filename.  It looks like 
you need the full path in two places and the filename in two places, so 
you can't really save any effort by aliasing.

Brandan L.
-- 
bclennox AT eos DOT ncsu DOT edu


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

Date: Thu, 29 Jan 2004 22:27:00 GMT
From: Don Stefani <groups@donstefani.com>
Subject: Re: stat file behaviour ( and just a bit more )
Message-Id: <UMfSb.17778$Wl.10876@newssvr27.news.prodigy.com>

LaDainian Tomlinson wrote:

> On 29 Jan 2004, "Don Stefani" <groups@donstefani.com> wrote in
> comp.lang.perl.misc: 
> 
> 

> I'm surprised you didn't find an answer on Google.  It's a fairly
> common mistake (in fact, it's the same mistake as made by the OP). 

I thought I had fixed them all, thanks for seeing that.
I should have waited before posting I probably would have found it.

> 
>>#!/usr/bin/perl -w
>>use strict;
>>
>>my ($name, $size);
> 
> 
> Declare your variables in the smallest scope in which they are used.  
> Both $name and $size are only used inside the for loop, so declare
> them there. 

Thanks for the tip
I guess at this point it's short enough, If I make it too slick I won't know what I wrote
in a coule of weeks!

Thanks again,,
Don



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

Date: 28 Jan 2004 20:34:39 -0800
From: s99999999s2003@yahoo.com (mike)
Subject: stat file behaviour
Message-Id: <dfd17ef4.0401282034.85e54f2@posting.google.com>

hi

i have a directory testdir with a single file called test.txt 
i tried to stat the file like this

opendir(DIR, "$dir" ) or die "Cannot open directory $dir\n";
my @list  = readdir(DIR) or die "Unable to enter directory $dir\n";
foreach ( @list)
{
        local $name = $_;
        next if ( "$name" eq "." );
        next if ( "$name" eq "..") ;
        my $size = (stat($name))[7];
        print "size is $size\n";
}

the output shows:  size is 

the size is not shown. Even if i change the stat statement to 
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) = stat($name);

the result is still the same..
what is wrong with the code? I am using  5.005_03 
thanks


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

Date: 29 Jan 2004 04:46:45 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: stat file behaviour
Message-Id: <bva37l$k8k$1@canopus.cc.umanitoba.ca>

In article <dfd17ef4.0401282034.85e54f2@posting.google.com>,
mike <s99999999s2003@yahoo.com> wrote:
:i have a directory testdir with a single file called test.txt 
:i tried to stat the file like this

use strict;
use warnings;

:opendir(DIR, "$dir" ) or die "Cannot open directory $dir\n";
:my @list  = readdir(DIR) or die "Unable to enter directory $dir\n";
:foreach ( @list)
:{
:        local $name = $_;

Probably 'my' would be better than 'local' there.

:        next if ( "$name" eq "." );

Useless use of double quotes.

         next if ( $name eq '.' );

:        next if ( "$name" eq "..") ;

Again useless use of double quotes.

:        my $size = (stat($name))[7];
:        print "size is $size\n";
:}

:the output shows:  size is 

:the size is not shown.

You aren't chdir'ing into the directory, and you then stat the file
by only its name instead of its path. Try stat'ing on  "$dir/$name"
-- 
   Beware of bugs in the above code; I have only proved it correct,
   not tried it.                             -- Donald Knuth


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

Date: Thu, 29 Jan 2004 08:32:38 -0600
From: Web Surfer <raisin@delete-this-trash.mts.net>
Subject: Re: stat file behaviour
Message-Id: <MPG.1a82d57b95bb4bc0989795@news.mts.net>

[This followup was posted to comp.lang.perl.misc]

In article <dfd17ef4.0401282034.85e54f2@posting.google.com>, 
s99999999s2003@yahoo.com says...
> hi
> 
> i have a directory testdir with a single file called test.txt 
> i tried to stat the file like this
> 
> opendir(DIR, "$dir" ) or die "Cannot open directory $dir\n";
> my @list  = readdir(DIR) or die "Unable to enter directory $dir\n";
> foreach ( @list)
> {
>         local $name = $_;
>         next if ( "$name" eq "." );
>         next if ( "$name" eq "..") ;

>         my $size = (stat($name))[7];

# Note : You need to specify the path to the file
          my $size = (stat("$dir/$name"))[7];

>         print "size is $size\n";
> }
> 
> the output shows:  size is 
> 
> the size is not shown. Even if i change the stat statement to 
> ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
> $atime,$mtime,$ctime,$blksize,$blocks) = stat($name);
> 
> the result is still the same..
> what is wrong with the code? I am using  5.005_03 
> thanks
> 


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

Date: Mon, 26 Jan 2004 19:56:58 -0000
From: Greg Bacon <gbacon@hiwaay.net>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <101as8arnpu9tc3@corp.supernews.com>

Following is a summary of articles spanning a 7 day period,
beginning at 19 Jan 2004 20:02:33 GMT and ending at
27 Jan 2004 14:47:56 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 2004 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Excluded Posters
================

perlfaq-suggestions\@(?:.*\.)?perl\.com
faq\@(?:.*\.)?denver\.pm\.org
comdog\@panix\.com

Totals
======

Posters:  225
Articles: 951 (420 with cutlined signatures)
Threads:  159
Volume generated: 1884.5 kb
    - headers:    890.4 kb (15,890 lines)
    - bodies:     934.2 kb (29,160 lines)
    - original:   570.3 kb (19,307 lines)
    - signatures: 59.0 kb (1,364 lines)

Original Content Rating: 0.611

Averages
========

Posts per poster: 4.2
    median: 2 posts
    mode:   1 post - 88 posters
    s:      8.1 posts
Posts per thread: 6.0
    median: 5 posts
    mode:   1 and 3 posts - 21 threads
    s:      6.0 posts
Message size: 2029.2 bytes
    - header:     958.8 bytes (16.7 lines)
    - body:       1005.9 bytes (30.7 lines)
    - original:   614.1 bytes (20.3 lines)
    - signature:  63.5 bytes (1.4 lines)

Top 20 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   59   147.1 ( 73.5/ 65.7/ 52.9)  tadmc@augustmail.com
   50    99.4 ( 44.6/ 43.2/ 19.0)  Ben Morrow <usenet@morrow.me.uk>
   38    77.3 ( 32.7/ 40.5/ 29.0)  Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca>
   36    59.7 ( 31.3/ 28.3/ 15.8)  "Robin" <robin@csf.edu>
   30    62.0 ( 35.4/ 26.5/ 21.4)  "edgrsprj" <edgrsprj@ix.netcom.com>
   27    47.7 ( 25.7/ 22.0/ 11.5)  "gnari" <gnari@simnet.is>
   27    53.7 ( 25.5/ 22.0/  8.8)  Uri Guttman <uri@stemsystems.com>
   27    44.3 ( 20.0/ 24.2/ 10.4)  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
   25    37.7 ( 22.6/ 13.4/  5.3)  Gunnar Hjalmarsson <noreply@gunnar.cc>
   23    42.8 ( 24.3/ 18.4/ 10.1)  "Matt Garrish" <matthew.garrish@sympatico.ca>
   16    33.8 ( 14.4/ 17.1/ 10.5)  Tore Aursand <tore@aursand.no>
   16    27.8 ( 13.4/ 13.3/ 10.0)  Michele Dondi <bik.mido@tiscalinet.it>
   16    35.0 ( 18.9/ 15.0/  8.1)  "A. Sinan Unur" <1usa@llenroc.ude>
   15    40.7 ( 13.5/ 23.8/ 10.1)  tassilo.parseval@post.rwth-aachen.de
   15    25.0 ( 15.7/  8.8/  4.4)  Joe Smith <Joe.Smith@inwap.com>
   14    35.1 ( 16.3/ 15.5/  7.5)  jwillmore@adelphia.net
   13    21.0 ( 10.0/ 11.0/  5.5)  Paul Lalli <ittyspam@yahoo.com>
   13    21.1 (  6.6/ 14.5/ 10.7)  Mark Jason Dominus <mjd@plover.com>
   10    21.0 (  8.6/ 11.7/  5.3)  Brian McCauley <nobull@mail.com>
    8    16.5 (  6.1/ 10.4/  3.4)  Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca>

These posters accounted for 50.3% of all articles.

Top 20 Posters by Number of Followups
=====================================

             (kb)   (kb)  (kb)  (kb)
Followups  Volume (  hdr/ body/ orig)  Address
---------  --------------------------  -------

       57   147.1 ( 73.5/ 65.7/ 52.9)  tadmc@augustmail.com
       50    99.4 ( 44.6/ 43.2/ 19.0)  Ben Morrow <usenet@morrow.me.uk>
       38    77.3 ( 32.7/ 40.5/ 29.0)  Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca>
       31    59.7 ( 31.3/ 28.3/ 15.8)  "Robin" <robin@csf.edu>
       27    47.7 ( 25.7/ 22.0/ 11.5)  "gnari" <gnari@simnet.is>
       27    44.3 ( 20.0/ 24.2/ 10.4)  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
       27    53.7 ( 25.5/ 22.0/  8.8)  Uri Guttman <uri@stemsystems.com>
       25    37.7 ( 22.6/ 13.4/  5.3)  Gunnar Hjalmarsson <noreply@gunnar.cc>
       23    62.0 ( 35.4/ 26.5/ 21.4)  "edgrsprj" <edgrsprj@ix.netcom.com>
       23    42.8 ( 24.3/ 18.4/ 10.1)  "Matt Garrish" <matthew.garrish@sympatico.ca>
       16    33.8 ( 14.4/ 17.1/ 10.5)  Tore Aursand <tore@aursand.no>
       16    35.0 ( 18.9/ 15.0/  8.1)  "A. Sinan Unur" <1usa@llenroc.ude>
       15    25.0 ( 15.7/  8.8/  4.4)  Joe Smith <Joe.Smith@inwap.com>
       15    40.7 ( 13.5/ 23.8/ 10.1)  tassilo.parseval@post.rwth-aachen.de
       14    27.8 ( 13.4/ 13.3/ 10.0)  Michele Dondi <bik.mido@tiscalinet.it>
       14    35.1 ( 16.3/ 15.5/  7.5)  jwillmore@adelphia.net
       13    21.0 ( 10.0/ 11.0/  5.5)  Paul Lalli <ittyspam@yahoo.com>
       12    21.1 (  6.6/ 14.5/ 10.7)  Mark Jason Dominus <mjd@plover.com>
       10    21.0 (  8.6/ 11.7/  5.3)  Brian McCauley <nobull@mail.com>
        8    16.5 (  6.1/ 10.4/  3.4)  Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca>

These posters accounted for 55.5% of all followups.

Top 20 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

 147.1 ( 73.5/ 65.7/ 52.9)     59  tadmc@augustmail.com
  99.4 ( 44.6/ 43.2/ 19.0)     50  Ben Morrow <usenet@morrow.me.uk>
  77.3 ( 32.7/ 40.5/ 29.0)     38  Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca>
  62.0 ( 35.4/ 26.5/ 21.4)     30  "edgrsprj" <edgrsprj@ix.netcom.com>
  59.7 ( 31.3/ 28.3/ 15.8)     36  "Robin" <robin@csf.edu>
  53.7 ( 25.5/ 22.0/  8.8)     27  Uri Guttman <uri@stemsystems.com>
  47.7 ( 25.7/ 22.0/ 11.5)     27  "gnari" <gnari@simnet.is>
  44.3 ( 20.0/ 24.2/ 10.4)     27  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
  42.8 ( 24.3/ 18.4/ 10.1)     23  "Matt Garrish" <matthew.garrish@sympatico.ca>
  40.7 ( 13.5/ 23.8/ 10.1)     15  tassilo.parseval@post.rwth-aachen.de
  37.7 ( 22.6/ 13.4/  5.3)     25  Gunnar Hjalmarsson <noreply@gunnar.cc>
  35.1 ( 16.3/ 15.5/  7.5)     14  jwillmore@adelphia.net
  35.0 ( 18.9/ 15.0/  8.1)     16  "A. Sinan Unur" <1usa@llenroc.ude>
  33.8 ( 14.4/ 17.1/ 10.5)     16  Tore Aursand <tore@aursand.no>
  28.0 ( 10.2/ 17.8/ 13.1)      7  Chris <ceo@nospan.on.net>
  27.8 ( 13.4/ 13.3/ 10.0)     16  Michele Dondi <bik.mido@tiscalinet.it>
  25.3 (  6.1/ 19.2/ 12.9)      7  zentara <zentara@highstream.net>
  25.0 ( 15.7/  8.8/  4.4)     15  Joe Smith <Joe.Smith@inwap.com>
  21.1 (  6.6/ 14.5/ 10.7)     13  Mark Jason Dominus <mjd@plover.com>
  21.0 (  8.6/ 11.7/  5.3)     10  Brian McCauley <nobull@mail.com>

These posters accounted for 51.2% of the total volume.

Top 19 Posters by Volume of Original Content (min. ten posts)
=============================================================

        (kb)
Posts   orig  Address
-----  -----  -------

   59   52.9  tadmc@augustmail.com
   38   29.0  Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca>
   30   21.4  "edgrsprj" <edgrsprj@ix.netcom.com>
   50   19.0  Ben Morrow <usenet@morrow.me.uk>
   36   15.8  "Robin" <robin@csf.edu>
   27   11.5  "gnari" <gnari@simnet.is>
   13   10.7  Mark Jason Dominus <mjd@plover.com>
   16   10.5  Tore Aursand <tore@aursand.no>
   27   10.4  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
   15   10.1  tassilo.parseval@post.rwth-aachen.de
   23   10.1  "Matt Garrish" <matthew.garrish@sympatico.ca>
   16   10.0  Michele Dondi <bik.mido@tiscalinet.it>
   27    8.8  Uri Guttman <uri@stemsystems.com>
   16    8.1  "A. Sinan Unur" <1usa@llenroc.ude>
   14    7.5  jwillmore@adelphia.net
   13    5.5  Paul Lalli <ittyspam@yahoo.com>
   25    5.3  Gunnar Hjalmarsson <noreply@gunnar.cc>
   10    5.3  Brian McCauley <nobull@mail.com>
   15    4.4  Joe Smith <Joe.Smith@inwap.com>

These posters accounted for 44.9% of the original volume.

Top 19 Posters by OCR (minimum of ten posts)
============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.808  ( 21.4 / 26.5)     30  "edgrsprj" <edgrsprj@ix.netcom.com>
0.806  ( 52.9 / 65.7)     59  tadmc@augustmail.com
0.754  ( 10.0 / 13.3)     16  Michele Dondi <bik.mido@tiscalinet.it>
0.737  ( 10.7 / 14.5)     13  Mark Jason Dominus <mjd@plover.com>
0.715  ( 29.0 / 40.5)     38  Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca>
0.616  ( 10.5 / 17.1)     16  Tore Aursand <tore@aursand.no>
0.558  ( 15.8 / 28.3)     36  "Robin" <robin@csf.edu>
0.547  ( 10.1 / 18.4)     23  "Matt Garrish" <matthew.garrish@sympatico.ca>
0.539  (  8.1 / 15.0)     16  "A. Sinan Unur" <1usa@llenroc.ude>
0.525  ( 11.5 / 22.0)     27  "gnari" <gnari@simnet.is>
0.497  (  4.4 /  8.8)     15  Joe Smith <Joe.Smith@inwap.com>
0.494  (  5.5 / 11.0)     13  Paul Lalli <ittyspam@yahoo.com>
0.482  (  7.5 / 15.5)     14  jwillmore@adelphia.net
0.450  (  5.3 / 11.7)     10  Brian McCauley <nobull@mail.com>
0.439  ( 19.0 / 43.2)     50  Ben Morrow <usenet@morrow.me.uk>
0.427  ( 10.4 / 24.2)     27  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
0.427  ( 10.1 / 23.8)     15  tassilo.parseval@post.rwth-aachen.de
0.400  (  8.8 / 22.0)     27  Uri Guttman <uri@stemsystems.com>
0.395  (  5.3 / 13.4)     25  Gunnar Hjalmarsson <noreply@gunnar.cc>

Bottom 19 Posters by OCR (minimum of ten posts)
===============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.808  ( 21.4 / 26.5)     30  "edgrsprj" <edgrsprj@ix.netcom.com>
0.806  ( 52.9 / 65.7)     59  tadmc@augustmail.com
0.754  ( 10.0 / 13.3)     16  Michele Dondi <bik.mido@tiscalinet.it>
0.737  ( 10.7 / 14.5)     13  Mark Jason Dominus <mjd@plover.com>
0.715  ( 29.0 / 40.5)     38  Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca>
0.616  ( 10.5 / 17.1)     16  Tore Aursand <tore@aursand.no>
0.558  ( 15.8 / 28.3)     36  "Robin" <robin@csf.edu>
0.547  ( 10.1 / 18.4)     23  "Matt Garrish" <matthew.garrish@sympatico.ca>
0.539  (  8.1 / 15.0)     16  "A. Sinan Unur" <1usa@llenroc.ude>
0.525  ( 11.5 / 22.0)     27  "gnari" <gnari@simnet.is>
0.497  (  4.4 /  8.8)     15  Joe Smith <Joe.Smith@inwap.com>
0.494  (  5.5 / 11.0)     13  Paul Lalli <ittyspam@yahoo.com>
0.482  (  7.5 / 15.5)     14  jwillmore@adelphia.net
0.450  (  5.3 / 11.7)     10  Brian McCauley <nobull@mail.com>
0.439  ( 19.0 / 43.2)     50  Ben Morrow <usenet@morrow.me.uk>
0.427  ( 10.4 / 24.2)     27  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
0.427  ( 10.1 / 23.8)     15  tassilo.parseval@post.rwth-aachen.de
0.400  (  8.8 / 22.0)     27  Uri Guttman <uri@stemsystems.com>
0.395  (  5.3 / 13.4)     25  Gunnar Hjalmarsson <noreply@gunnar.cc>

19 posters (8%) had at least ten posts.

Top 20 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   41  bbs problem
   34  How well a PHP or Perl programmer paid comparing to Java
   24  Perl speed test questions   Jan. 21, 2004
   23  Language detection module..
   20  Script that blocks certain IP's
   17  bbs admin problem
   17  bbs problem + using cgi
   16  Interpolation of qr-regexes containing backreferences
   16  pattern matching and grabing value sub
   16  Call Tree utility
   15  10 lines revisited
   14  problem with 'or' statement
   13  perl bug File::Basename and Perl's nature
   13  Newbie... bubble sort in a more elegant fashion?
   13  perl journals
   13  Simple opendir(), directory does not exist problem
   12  SQL insert/update duplicate entries
   12  perl one-liner to rename files
   12  Perl Programmers, America Needs Your Help!  We Need Secure Voting  Machines
   11  HELP: from XML to mySQL

These threads accounted for 37.0% of all articles.

Top 20 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  79.2 ( 39.5/ 38.3/ 26.1)     34  How well a PHP or Perl programmer paid comparing to Java
  69.6 ( 38.6/ 28.5/ 16.5)     41  bbs problem
  49.4 ( 28.4/ 19.9/ 11.9)     24  Perl speed test questions   Jan. 21, 2004
  41.7 ( 11.2/ 29.9/ 20.4)     12  Perl Programmers, America Needs Your Help!  We Need Secure Voting  Machines
  39.2 ( 20.6/ 17.9/  8.6)     23  Language detection module..
  39.1 ( 11.7/ 25.3/ 13.0)     16  Call Tree utility
  38.1 ( 21.5/ 16.2/  9.9)     20  Script that blocks certain IP's
  35.4 (  6.6/ 27.6/ 10.0)      6  Lisp2Perl - Lisp to perl compiler
  34.4 (  2.1/ 32.3/ 32.3)      2  Posting Guidelines for comp.lang.perl.misc ($Revision: 1.5 $)
  34.2 ( 14.9/ 18.6/ 11.1)     16  Interpolation of qr-regexes containing backreferences
  34.0 ( 12.4/ 20.9/ 15.2)     13  perl bug File::Basename and Perl's nature
  32.0 ( 16.7/ 14.4/  9.9)     17  bbs problem + using cgi
  31.8 ( 16.6/ 13.8/  9.3)     17  bbs admin problem
  30.8 ( 16.3/ 14.0/  7.3)     16  pattern matching and grabing value sub
  29.8 ( 12.7/ 15.5/  9.2)     13  Newbie... bubble sort in a more elegant fashion?
  28.8 ( 10.8/ 17.4/ 10.1)     12  SQL insert/update duplicate entries
  26.1 ( 14.2/ 10.4/  6.8)     15  10 lines revisited
  25.5 ( 11.6/ 13.2/  7.2)     11  HELP: from XML to mySQL
  24.7 ( 12.3/ 10.5/  6.7)     13  Simple opendir(), directory does not exist problem
  23.5 ( 10.4/ 11.8/  7.4)     10  How to use select (select(2)) in Perl?

These threads accounted for 39.6% of the total volume.

Top 20 Threads by OCR (minimum of ten posts)
============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.728  ( 15.2/  20.9)     13  perl bug File::Basename and Perl's nature
0.692  (  9.9/  14.4)     17  bbs problem + using cgi
0.682  ( 26.1/  38.3)     34  How well a PHP or Perl programmer paid comparing to Java
0.680  ( 20.4/  29.9)     12  Perl Programmers, America Needs Your Help!  We Need Secure Voting  Machines
0.672  (  9.3/  13.8)     17  bbs admin problem
0.647  (  6.8/  10.4)     15  10 lines revisited
0.633  (  5.5/   8.6)     10  dynamic scalar-naming problem
0.633  (  6.7/  10.5)     13  Simple opendir(), directory does not exist problem
0.622  (  7.4/  11.8)     10  How to use select (select(2)) in Perl?
0.609  (  9.9/  16.2)     20  Script that blocks certain IP's
0.598  ( 11.9/  19.9)     24  Perl speed test questions   Jan. 21, 2004
0.597  (  9.2/  15.5)     13  Newbie... bubble sort in a more elegant fashion?
0.596  ( 11.1/  18.6)     16  Interpolation of qr-regexes containing backreferences
0.581  ( 10.1/  17.4)     12  SQL insert/update duplicate entries
0.578  ( 16.5/  28.5)     41  bbs problem
0.573  (  3.5/   6.0)     14  problem with 'or' statement
0.548  (  4.0/   7.3)     10  Several Perl questions  (Newbie)
0.545  (  7.2/  13.2)     11  HELP: from XML to mySQL
0.521  (  7.3/  14.0)     16  pattern matching and grabing value sub
0.520  (  3.9/   7.4)     13  perl journals

Bottom 20 Threads by OCR (minimum of ten posts)
===============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.647  (  6.8 / 10.4)     15  10 lines revisited
0.633  (  5.5 /  8.6)     10  dynamic scalar-naming problem
0.633  (  6.7 / 10.5)     13  Simple opendir(), directory does not exist problem
0.622  (  7.4 / 11.8)     10  How to use select (select(2)) in Perl?
0.609  (  9.9 / 16.2)     20  Script that blocks certain IP's
0.598  ( 11.9 / 19.9)     24  Perl speed test questions   Jan. 21, 2004
0.597  (  9.2 / 15.5)     13  Newbie... bubble sort in a more elegant fashion?
0.596  ( 11.1 / 18.6)     16  Interpolation of qr-regexes containing backreferences
0.581  ( 10.1 / 17.4)     12  SQL insert/update duplicate entries
0.578  ( 16.5 / 28.5)     41  bbs problem
0.573  (  3.5 /  6.0)     14  problem with 'or' statement
0.548  (  4.0 /  7.3)     10  Several Perl questions  (Newbie)
0.545  (  7.2 / 13.2)     11  HELP: from XML to mySQL
0.521  (  7.3 / 14.0)     16  pattern matching and grabing value sub
0.520  (  3.9 /  7.4)     13  perl journals
0.513  ( 13.0 / 25.3)     16  Call Tree utility
0.480  (  4.3 /  8.9)     12  perl one-liner to rename files
0.479  (  8.6 / 17.9)     23  Language detection module..
0.461  (  4.3 /  9.4)     10  passing changing amounts of variables to subroutine
0.451  (  3.1 /  6.9)     10  $$$ Im at a loss for words THIS WORKS $$$

25 threads (15%) had at least ten posts.

Top 8 Targets for Crossposts
============================

Articles  Newsgroup
--------  ---------

      40  comp.lang.php
      16  comp.lang.lisp
      16  comp.lang.scheme
      10  comp.lang.python
      10  comp.lang.ruby
       8  comp.lang.perl.modules
       5  comp.lang.perl
       3  comp.lang.javascript

Top 20 Crossposters
===================

Articles  Address
--------  -------

      11  Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca>
       8  Xah Lee <xah@xahlee.org>
       8  Michele Dondi <bik.mido@tiscalinet.it>
       6  "Matt Garrish" <matthew.garrish@sympatico.ca>
       5  Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca>
       5  Charlton Wilbur <cwilbur@mithril.chromatico.net>
       5  Jochen Buennagel <zang.NOSPAM@buennagel.com>
       5  G Klinedinst <g_klinedinst@hotmail.com>
       4  Thomas F. Burdick <tfb@famine.OCF.Berkeley.EDU>
       4  Joe Mason <joe@notcharles.ca>
       4  "gnari" <gnari@simnet.is>
       4  Michele Simionato <michele.simionato@poste.it>
       4  Lothar Scholz <llothar@web.de>
       3  jwillmore@adelphia.net
       2  "Ravi Krishna" <rkdba@sympatico.ca>
       2  Chris <ceo@nospan.on.net>
       2  Marcin 'Qrczak' Kowalczyk <qrczak@knm.org.pl>
       2  =?ISO-8859-1?Q?Jens_Axel_S=F8gaard?= <usenet@jasoegaard.dk>
       2  "John W. Kennedy" <jwkenne@attglobal.net>
       2  Shannon Jacobs <shanen@my-deja.com>


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

Date: Wed, 28 Jan 2004 02:17:44 -0500
From: lucas <aolblowz@yahoo.com>
Subject: stop a die();
Message-Id: <Vv6dnQAsGs2F_4rdRVn-hg@golden.net>

Is there a way to stop a die(); statement?
So far I've found: $SIG{__DIE__} = sub { };
However, that I can't figure out anything to stop a die();
-- 
lucas
-------------------------
Perl Coder since 2001
shift || die;
-------------------------


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

Date: 28 Jan 2004 07:42:32 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: stop a die();
Message-Id: <bv7p58$rv$1@nets3.rz.RWTH-Aachen.DE>

Also sprach lucas:

> Is there a way to stop a die(); statement?
> So far I've found: $SIG{__DIE__} = sub { };
> However, that I can't figure out anything to stop a die();

Wrap the code that could potentially die() into a BLOCK-eval:

    eval { die };
    print "alive\n";
    print $@ if $@;   
    __END__
    alive
    Died at - line 1.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Thu, 29 Jan 2004 16:10:47 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: stop a die();
Message-Id: <4a7i10h0b655hqmuphrrt1qjbslvqf84pi@4ax.com>

On Wed, 28 Jan 2004 02:17:44 -0500, lucas <aolblowz@yahoo.com> wrote:

>Is there a way to stop a die(); statement?
>So far I've found: $SIG{__DIE__} = sub { };
>However, that I can't figure out anything to stop a die();

You have already been given a good answer. But, I beg your pardon, to
me the expression "to stop a die()" is ambiguous. You can "stop" a die
by exiting the call before it is completed:

  #!/usr/bin/perl -l
  
  use strict;
  use warnings;
  
  no warnings 'uninitialized';
  open my $fh, "<\000" or die $ARGV[0] && goto HEHE;
  
  HEHE: print 'done!'
    
  __END__

  # ./die.pl
  Died at ./die.pl line 7.
  # ./die.pl 0
  0 at ./die.pl line 7.
  # ./die.pl 1
  done!

Please note that I'm by no means a goto() fanatic, I'd say quite the
contrary indeed, and I do not want to encourage its use! That may well
have been a return() in a sub or a next or last in a cycle, the key
point being that, to me, "to stop" is related to something that has
already started and can well be stopped, as the example shows...


HTH,
Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

Date: 28 Jan 2004 15:54:17 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: stop a die();
Message-Id: <bv8lv9$hsg$1@mamenchi.zrz.TU-Berlin.DE>

Michele Dondi  <bik.mido@tiscalinet.it> wrote in comp.lang.perl.misc:
> On Wed, 28 Jan 2004 02:17:44 -0500, lucas <aolblowz@yahoo.com> wrote:
> 
> >Is there a way to stop a die(); statement?
> >So far I've found: $SIG{__DIE__} = sub { };
> >However, that I can't figure out anything to stop a die();

[...]

>                                                   You can "stop" a die
> by exiting the call before it is completed:

[...]

>   open my $fh, "<\000" or die $ARGV[0] && goto HEHE;
>   
>   HEHE: print 'done!'


Are you saying that when "goto" happens, "die" has already started
executing?  That is not so.  Perl evaluates the arguments before the
call to die.

Anno


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

Date: Wed, 28 Jan 2004 12:40:04 -0500
From: lucas <aolblowz@yahoo.com>
Subject: Re: stop a die();
Message-Id: <4bWdnb_e8rxpbordRVn-jw@golden.net>

Thanks for both your answers.  I think I have enough to fix my problem.
;)
-- 
lucas
-------------------------
Perl Coder since 2001
shift || die;
-------------------------


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

Date: Thu, 29 Jan 2004 21:17:25 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: stop a die();
Message-Id: <9hqi10h3qqfkibajqdqm0g4gh5coudbbf9@4ax.com>

On Thu, 29 Jan 2004 16:10:47 +0100, I wrote:

>  #!/usr/bin/perl -l
>  
>  use strict;
>  use warnings;
>  
>  no warnings 'uninitialized';
>  open my $fh, "<\000" or die $ARGV[0] && goto HEHE;
>  
>  HEHE: print 'done!'
>    
>  __END__
[snip]
>Please note that I'm by no means a goto() fanatic, I'd say quite the
>contrary indeed, and I do not want to encourage its use! That may well

BTW: basically I used it by virtue of the cardinal virtue called
'lazyness', but my lazyness was not long-sighted for I could have
shown a better example with no more effort:

  #!/usr/bin/perl -l
    
  use strict;
  use warnings;
  
  {
      no warnings 'uninitialized';
      open my $fh, "\000" or die shift && last;
  }
  
  print 'done!';
  
  __END__


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

Date: Fri, 30 Jan 2004 20:52:02 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: stop a die();
Message-Id: <19cl10demrd3bdo6sm7qht9hdpl2ttvdp9@4ax.com>

On 28 Jan 2004 15:54:17 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:

>>   open my $fh, "<\000" or die $ARGV[0] && goto HEHE;
>>   
>>   HEHE: print 'done!'
>
>
>Are you saying that when "goto" happens, "die" has already started
>executing?  That is not so.  Perl evaluates the arguments before the
>call to die.

D'Oh!

Yes... that is what I was saying! But of course it is not so: it's
obvious that the trick works exactly because the arguments are
evaluated before the actual call.

But you may interpret my words in the sense that since the arguments
are being put "into" the func and follow it, the mentioned trick
conveys the *psycological* feeling that it works by *stopping* a call
that has already *started*, doesn't it? And now, isn't this a pretty
feeble excuse/justification?!?
;-)


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

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 V10 Issue 6047
***************************************


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