[6866] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 491 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 17 01:04:29 1997

Date: Fri, 16 May 97 22:00:26 -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           Fri, 16 May 1997     Volume: 8 Number: 491

Today's topics:
     Re: "email me when the URL changes" script? <aas@bergen.sn.no>
     Re: $filename = ($event->file =~ /([^.]+)/, $1); <dbenhur@egames.com>
     Anyone heard of www.pl ? (Tony Moran)
     Re: ARGV and WinNT Perl <merlyn@stonehenge.com>
     Calling c code...help amhardin@erols.com
     Re: Decoding CyberSitter in 1 line - but how long a lin (Bek Oberin)
     Re: Does Perl have the case statement or do I have to u <jhi@alpha.hut.fi>
     Executing simultaneous commands? <Dianne@spamfree.com>
     Re: I need a programmers assistance... (Abigail)
     Re: Is there a port for NT <petri.backstrom@icl.fi>
     Re: MacPerl & Applescript (John Moreno)
     Opening Javascript style windows with perl <mrchristopher@inorbit.com>
     Output cut off <compman@pb.net>
     Re: Output cut off (Tad McClellan)
     Perl and PGP interface (Yvon D. Roustan)
     Re: PERL script autoresponder problems...please take a  <billc@tibinc.com>
     perlipc and multi-threading problem swarren@pdc.com
     POP V3 implementation in Perl..Has anybody implemented  (Harichandran Sukerathavan)
     Problems running .cmd and .exe from Perl for OS/2 <craig@indelible-blue.com>
     Re: Problems running .cmd and .exe from Perl for OS/2 (Ilya Zakharevich)
     Re: Q: Perl/Cgi under Windows NT <petri.backstrom@icl.fi>
     Re: Reading past CTRL-Z in file <petri.backstrom@icl.fi>
     Re: Selecting files to open <rootbeer@teleport.com>
     Sorting a hash on output - newbie (Bruce McGuire)
     Re: Sorting a hash on output - newbie (David Alan Black)
     Re: Sorting a hash on output - newbie (Tad McClellan)
     Re: standard packages (Abigail)
     stat/test and _ and efficiency (John F. Whitehead)
     Re: Tatum O'Neil (Abigail)
     Re: Tatum O'Neil (Tad McClellan)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 17 May 1997 00:50:11 +0200
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: "email me when the URL changes" script?
Message-Id: <h911fav6k.fsf@bergen.sn.no>

Tom Phoenix <rootbeer@teleport.com> writes:

> I can't recommend such a script, but if I wrote one (using cron to run it
> periodically, using LWP to send the web request, and then calling sendmail
> to send off the notice), then I'd be glad to recommend it. :-)  And it
> should be fairly easy to write and should all fit as one screenful of
> text, more or less.

This is such a script:

--------------------------------------------------------------------
#!/local/bin/perl -w

use strict;
use vars qw($RECEIVER %urls @mess);

$RECEIVER = 'mailto:yourself@somewhere.edu';

use Fcntl;
use AnyDBM_File;
use MD5;
use LWP;

tie %urls, 'AnyDBM_File', 'urls', O_CREAT|O_RDWR, 0644 or
    die "Can't open urls: $!";

# If arguments, add them as URLs to check in the database
for (@ARGV) { $urls{$_} = "NEW"; }

my $ua = LWP::UserAgent->new;

my $url;
for $url (keys %urls) {
   print "Checking $url...\n";
   my $res = $ua->request(HTTP::Request->new(GET => $url));
   if ($res->is_success) {
	my $hash = "MD5:" . MD5->hexhash($res->content);
	if ($hash ne $urls{$url}) {
           push(@mess, "$url changed");	
	   $urls{$url} = $hash;
        } else {
	   print "  unchanged\n";
        }
   } elsif ($res->code >= 500) {  # local failure, better luck next time
        print "  ", $res->code, " ", $res->message, "\n";
	my $count = $urls{$url};
	$count = 5 unless $count =~ /^\d+$/;
	if ($count > 0) {
	    print "  will still try $count more times\n";
	    $urls{$url} = $count - 1;
            next;
        }
	print "  giving up\n";
	push(@mess, "$url: Giving up: " . $res->message);
        delete $urls{$url};	
   } else {
	print "  bad\n";
	push(@mess, "$url: " . $res->code . " " . $res->message);
	delete $urls{$url};
   }
}

if (@mess) {
    my $req = HTTP::Request->new(POST => $RECEIVER);
    $req->header(Subject => 'URL Notification service');
    $req->content(join("\n", @mess, ""));
    $ua->request($req)->is_success or die "Can't POST to $RECEIVER";
}

-- 
Gisle Aas <aas@sn.no>


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

Date: Fri, 16 May 1997 16:51:18 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: kendall shaw <kshaw@plight.lbin.com>
Subject: Re: $filename = ($event->file =~ /([^.]+)/, $1);
Message-Id: <337CF2F6.2F61@egames.com>

[mail&post]
kendall shaw wrote:
> What is the more concise way of doing this?

($filename) = $event->file =~ /([^.]+)/;

putting the m// operator in a list context returns a list
of the (...) matched patterns.

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"The Earth is degenerating today. Bribery and corruption
 abound. Children no longer obey their parents, every man 
 wants to write a book, and it is evident that the end of
 the world is fast approaching." -- Assyrian tablet, c. 2800 BC



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

Date: 16 May 1997 22:53:14 GMT
From: tmoran@iol.ie (Tony Moran)
Subject: Anyone heard of www.pl ?
Message-Id: <5liogq$onk$1@nuacht.iol.ie>

Hi, I've installed MOMspider on a machine, all went fine, installed all 
the extensions and modules that are required, but when I the spider, it
tells me that www.pl is missing !?  I've done web-searches, CPAN searches,
the lot..but no clues..  anyone where i can find this script/lib/module ?


Thanks,  Tony.

-- 










=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| He who will not reason, is a bigot; he who cannot is a fool;            |
| and he who dares not is a slave.                                        |
|                                                     -= TonY =-          |
|     <tmoran@iol.ie>        Dublin, Ireland                              |
++*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-++


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

Date: 16 May 1997 19:35:49 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: tashbrk@ix.netcom.com
Subject: Re: ARGV and WinNT Perl
Message-Id: <8czptuomey.fsf@gadget.cscaper.com>

>>>>> "Thomas" == Thomas Ashbrook <tashbrk@ix.netcom.com> writes:

Thomas> @ARGV[0]

No.  The first element of @ARGV is $ARGV[0].  What you have written is
a *list* consisting of just the first element of @ARGV, and is
probably not going to work the way you want it to work.  From the
overheads that I teach from for my 4-day intro to perl course:

	@b = qw(fred barney dino);
	$a[0] = @b;		# scalar context, gets length (3)
	($a[0]) = @b;		# list context, get elements, keeps "fred"
	@a[0] = @b;		# ditto
	$a[0] = <STDIN>;	# read one line, stuff into $a[0]
	@a[0] = <STDIN>;	# read *ALL* lines, stuff first into $a[0],
				# and *DISCARD* rest!

Quite a difference eh?  I usually tell my classes "if you are using @
and [] together in this class, you will almost certainly NOT get what
you want.  That's going down the wrong tunnel.  There's no cheese at
the end of that tunnel." :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 472 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 17 May 1997 03:31:20 GMT
From: amhardin@erols.com
Subject: Calling c code...help
Message-Id: <5lj8q8$gbu$1@bilbo.reference.com>

I am trying to call c code from a perl script - Im running on
LINUX and have used GNU C for my C code...this WAS working at
one point and Im not sure why it is not anylonger. The c code
seems to be working fine (when i execute it from the command
line in LINUX, I get the expected results (an ID). But for
some reason when I try to run it  from the perl script it
doesn't even seem to be calling the c code - (it comes back
quickly and no id was returned) ... heres the calling code
from perl....any advice would be appreciated...


 $pid = open PROG, "search.exe @zip5 @zip4 @filename |";
                                  (search accepts 3 variables)
 unless (defined $pid) {
       die "open not completed";
       }

 print $pid;    (just put this in for debugging - i get a value)
 @idnumb = <PROG>;
 close(PROG);

 print @idnumb;


Thanks in advance..
Annie


--

Posted using Reference.COM                         http://www.reference.com
Browse, Search and Post         Usenet and Mailing list Archive and Catalog.

InReference, Inc. accepts no responsibility for the content of this posting.


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

Date: 17 May 1997 03:20:27 GMT
From: gossamer@glasswings.com.au (Bek Oberin)
Subject: Re: Decoding CyberSitter in 1 line - but how long a line?
Message-Id: <slrn5nq958.coq.gossamer@amarok.glasswings.com.au>

In article <8c2079t41m.fsf@gadget.cscaper.com>, Randal Schwartz wrote:
>    perl -lne '$_^="\224"x y///c;print/([ -~]{5,})/g'

Okay, I'm not so great at this stuf, but with much use of the 
camel book I've figured out what a few bits of it do:

"perl -lne"   Loop through whatever's on stdin, aplying
    the following code to every line, after politely chop()'ing
    the newline.

"^="  bitwise XOR of $_ and ... what?  is it just the \224 or
    everything up to the next ;?  and what's the x for?

"y///c"  seems to to a tr of the complement of "" (ie everything)
    and "" ... doesn't this leave us with nothing in $_?

"print ..." prints all the sections of $_ which consist of 5
    or more spaces, -'s and ~'s in a row?

will somebody take pity on me?


gossamer




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

Date: 17 May 1997 01:23:20 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Does Perl have the case statement or do I have to use if statements?
Message-Id: <oeen2pvys2v.fsf@alpha.hut.fi>


serenite@concentric.net (David Dougal) writes:

> Does Perl have the case statement?  I can't find any information about
> case in Perl.

No, it has not.

Yes, it has, several different.  None of them is called 'case'.  Or 'switch'.

It also has a nice FAQ which you should have read before sending this
question to the USENET news because you have found the answer to that
one particular and many other questions.

Also it has a manual page called 'perlsyn' which discusses the very
same issue.

-- 
$jhi++; # http://www.iki.fi/~jhi/


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

Date: Fri, 16 May 1997 18:15:08 -0400
From: Dianne <Dianne@spamfree.com>
Subject: Executing simultaneous commands?
Message-Id: <337CDC6C.22D4@spamfree.com>

I was wondering if it is possible to execute a subroutine or a command
line program and move on to the next line in the script without waiting
for the subroutine/command to finish.  I am not having much luck.  Any
suggestions?

Diana


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

Date: Sat, 17 May 1997 00:05:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: I need a programmers assistance...
Message-Id: <EAAtLr.1oG@nonexistent.com>

On Fri, 16 May 1997 15:51:17 -0600, winnt@winnt.icss.com wrote in
comp.lang.perl.misc URL: news:863815431.6607@dejanews.com:
++ Here's my problem,
++ 
++ I have a file on my server './jobs.txt'
++ and here's what I want to do.  I want to
++ write a subroutine to open the file,
++ add the numbers in the file which has this
++ form in the text file,
++ 7
++ 8
++ 9
++ 15
++ ,add all the numbers line by line and
++ print out the total. All that I've been
++ able to do so far is print out the file
++ using the source listed below.


perl -nwe 'BEGIN {$i = 0;} chomp; $i += $_; END {print $i, "\n";}'



Abigail (Doesn't that look very awkish?)


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

Date: Thu, 15 May 1997 20:04:18 +0200
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: Is there a port for NT
Message-Id: <337B5022.10E8@icl.fi>

John Speight wrote:
> 
> Could anyone out there tell me if there is a port of Perl to Windows NT?
> If so who sells it is there one from Gnu?

Someone else just asked this (and others before that, and before that,
and...; in other words, see what http://www.dejanews.com can do for 
you ;-).

Also, bookmark these (the first one is the kit, the second one has what 
you need to know in addition, and the other pointers will also lead you 
to useful information):

Perl for Win32:

  http://www.activeware.com

Perl for Win32 Frequently Asked Questions (FAQ):

  http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html

The Perl Language Home Page:

  http://www.perl.com/perl/

Perl FAQ:

  http://www.perl.com/perl/faq/index.html

Perl Reference:

  http://www.panix.com/~clay/perl/

Comprehensive Perl Archive Network (CPAN):

  http://www.perl.com/CPAN/

regards,
 ...petri.backstrom@icl.fi
    ICL Data Oy
    Finland


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

Date: Fri, 16 May 1997 20:33:47 -0400
From: phenix@interpath.com (John Moreno)
Subject: Re: MacPerl & Applescript
Message-Id: <199705162033476034053@roxboro-168.interpath.net>

Chris Nandor <pudge@pobox.com> wrote:

] In article <199705152326581462334@roxboro-168.interpath.net>,
] phenix@interpath.com (John Moreno) wrote:
] 
] #$args = "Internet Using Freeppp";
] #
] #MacPerl::DoAppleScript qq{
] #        tell application "Script Editor"
] #          choose file with prompt $args
] #        end tell
] #}
] 
] Whoops.  You are sending the following command to Script Editor:
] 
]    choose file with prompt Internet Using Freeppp
] 
] But Script Editor doesn't know what Internet or using or Freeppp is.
] 
]           choose file with prompt "$args"
]                                   ^     ^
] Hope this helps,

Thank you very much. It did indeed.  

Now as soon as I can get MacPerl to create a file...

-- 
John Moreno


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

Date: Sat, 17 May 1997 09:56:50 +0900
From: christopher <mrchristopher@inorbit.com>
Subject: Opening Javascript style windows with perl
Message-Id: <337D0252.1C63@inorbit.com>

This might appear to be a javascript question, but is more likely a perl
question (albeit rather cgi in form, apologies..)

When printing to the browser I know I can print to a new window using
Window-target, could someone direct me to or tell me what the perl
syntax is for sending the window attributes to the browser too (ie size,
toolbars etc etc) ?

I would be most grateful.

Christopher
Tokyo, May97

http://www.wonderlandinorbit.com


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

Date: Fri, 16 May 1997 19:31:28 -0400
From: "Ryan Huebsch" <compman@pb.net>
Subject: Output cut off
Message-Id: <5liqp4$o8d@ns2.pb.net>

Hi, I wrote a script to output a graphic file as follows :


	open(mediaFile,$mfile);# || &documentFileError;
	print "Content-type: image/"."gif"."\n\n";
	while(<mediaFile>)
	{
		print $_;
	}
	close(mediaFile);
}

on my Windows NT Server running Perl 4.00 and Perl 5.003 (both don't work)
the output is not complete. It stops at 13K... Is there any reason for
this?  The exact same script was placed on a Solaris 2.3 system and worked
perfectly.

Ryan Huebsch
compman@pb.net




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

Date: Fri, 16 May 1997 21:53:04 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Output cut off
Message-Id: <gi6jl5.dk2.ln@localhost>

Ryan Huebsch (compman@pb.net) wrote:
: Hi, I wrote a script to output a graphic file as follows :


: 	open(mediaFile,$mfile);# || &documentFileError;
: 	print "Content-type: image/"."gif"."\n\n";
: 	while(<mediaFile>)
: 	{
: 		print $_;
: 	}
: 	close(mediaFile);
: }

: on my Windows NT Server running Perl 4.00 and Perl 5.003 (both don't work)
: the output is not complete. It stops at 13K... Is there any reason for
: this?  The exact same script was placed on a Solaris 2.3 system and worked
: perfectly.


'cause Solaris is Unix. 

Unix works good. 

Bill's stuff, somewhat less good  ;-)



from the perlfunc man page:

------------------------
=item binmode FILEHANDLE

Arranges for the file to be read or written in "binary" mode in operating
systems that distinguish between binary and text files.  Files that are
not in binary mode have CR LF sequences translated to LF on input and LF
translated to CR LF on output.  Binmode has no effect under Unix; in DOS
and similarly archaic systems, it may be imperative--otherwise your
DOS-damaged C library may mangle your file.  The key distinction between
systems that need binmode and those that don't is their text file
formats.  Systems like Unix and Plan9 that delimit lines with a single
character, and that encode that character in C as '\n', do not need
C<binmode>.  The rest need it.  If FILEHANDLE is an expression, the value
is taken as the name of the filehandle.
------------------------



--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 16 May 1997 22:48:00 GMT
From: roustan@wwa.com (Yvon D. Roustan)
Subject: Perl and PGP interface
Message-Id: <5lio70$sd5$1@kirin.wwa.com>
Keywords: Perl PGP pgp email encryption

I am an amateur programmer in Perl5 and I would appreciate any help you
can give me. 

I created a Perl5 script program that generates a local unencrypted
message in a variable I call '$message'. I then use a subroutine that 
employs UNIX 'sendmail' within the Perl script to email the unencrypted 
$message.

I am trying to create a subroutine to encrypt the '$message' generated by a 
perl5 script using PGP (PRETTY GOOD PRIVACY). I would like to encrypt 
'$message' before emailing it, so that it is protected during transit.

I can manually encrypt a file using Perl and PGP so long as the message 
resides as a file in my public directory. For example if the message is a
file named 'message'in my public directory, the following program I called 
'encrypt.cgi' will generate another file encrypted by PGP called 
'message.asc' which I then can email manually:

Program
__________________________

#!/usr/bin/perl
# encrypt.cgi
   $filename = "message"; # I must type the file 'message' manually
   # in my public directory
   open(OUT, "| pgp -eat '$filename' userID");
   close(OUT)
__________________________

After editing and saving a test file under the name 'message' in my
directory this program, when run from the UNIX command line with perl or 
perl5, (with the command: perl encrypt.cgi), generates an encrypted file 
in the same directory with the name 'message.asc' containing the encrypted 
contents of the 'message' file. I can then easily email the encrypted file 
'message.asc'.

I does not work, however, when I try modifying this program into a 
subroutine to be executed from the main Perl script this way:

&EncryptOrder($message); # to call the subroutine
______________________________________

The actual subroutine being:

sub EncryptOrder {
    local($message) = @_;
    $filename = "$message"; # note this is a variable, not a file in the 
    # directory as in the program.
    open(OUT, "| pgp -eat '$filename' userID";
    print(OUT);
    close(OUT);
}
_______________________

I tried also, without any success, writting the output to a variable I 
call $CryptFile and then emailing the $CryptFile, as follows:

sub EncrypOrder {
$filename = "$message";
open(OUT, "| pgp -eat '$filename' userID > $CryptFile"; # to write t
o $CryptFile
    print(OUT);
    close(OUT);
    return($CryptFile);
}
_______________________

It does not work. However, from the command line this program generates the
same file 'message.asc'. The encrypted file is not written to $CryptFile but
contains the remarks generated by PGP, without the encryption. It does not
work at all from the Perl script.

Has someone had this problem before and can you offer any ideas or 
suggestions. Thank you for your attention.
Regards,
Yvon D. Roustan
roustan@wwa.com



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

Date: Fri, 16 May 1997 20:29:32 -0400
From: Bill Cowan <billc@tibinc.com>
To: "K. Hawkins" <c9@pyramid.net>
Subject: Re: PERL script autoresponder problems...please take a look.
Message-Id: <337CFBEC.61D3@tibinc.com>

K. Hawkins wrote:
> 
> I've put together a script that basically reads in form fields and
> then depending on what fields are there & their content, will send out
> various mail responses to 1,2, or 3 individuals at the same time.
> The script seems to run fine...no errors..the page redirects
> fine...but no email goes thru. I know the address I'm using to locate
> the mail program on my system is correct as I am using it in another
> (working) script. Here's an example with one of my subroutines...is
> the problem in my "IF" statement? or should I post the entire script?
> 
> Thanks...
> 
> Kevin
> 
> sub per_mail {
> if ($remote_mail eq '1' && $FORM{'username'} && $FORM{'perad' eq '1'})
                                                       ^^^^^^^^^^^^^^^^
I doubt you wanted to do the equality test as an expression used to for
the hash key for $FORM{...}.  Perhaps, ... $FORM{'perad'} eq '1' ... 

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: 16 May 1997 15:47:28 -0700
From: swarren@pdc.com
Subject: perlipc and multi-threading problem
Message-Id: <5lio60$fbq@drn.zippo.com>

I am trying to get this multi-threaded control program to work
and having no luck.

I used snippets from the perlipc man page and was able to get it
to nearly work, but when the last child thread exits, it never
calls the &REAPER signal handler, for some reason.

Here is the code:

#!/usr/local/bin/perl
 
use POSIX ":sys_wait_h";
sub REAPER {
    my $waitedpid;
    while ($waitedpid = waitpid(-1,WNOHANG)) {
        $Kid_Status{$waitedpid} = $?;
    }
    $SIG{CHLD} = \&REAPER;  # still loathe sysV
}
$SIG{CHLD} = \&REAPER;
 
sub spawn {
    my $pid;
    if (!defined($pid = fork)) {
        printf(STDERR "cannot fork: $!\n");
        return;
    } elsif ($pid) {
        printf(STDERR "begat $pid\n");
        push(pidList,$pid);             # Using this for kill list
        $Kid_Status{$pid}=-1;           # Seed the status with -1
        return; # I'm the parent
    }
 
    # else I'm the child -- go spawn
    sleep($Thread+1);                   # Space the child exits so I
                                        # can distinguish them
    printf(STDERR "I'm child #%s.\n",$Thread);
    exit($Thread);
}
 
sub PRINTSTAT {
    my $pid;
    foreach $pid (keys(Kid_Status)) {
        printf(STDERR "Kid_Status{%s}=%s; Kill(0)=%s.\n",$pid,$Kid_Status{$pid},kill(0,$pid));
    }
    printf("\n");
 
    return(kill(0,@pidList)); # Using this because %Kid_Status was not
}                             # getting fully exercised by &REAPER
 
for ( $Thread = 0;$Thread <= 3;$Thread++)
{
    printf(STDERR "Forking thread #%s: ",$Thread);    
    &spawn;
}
 
printf(STDERR "\n");
 
while(&PRINTSTAT){    # Why does it sleep forever on the last loop?
    sleep;        
}


Here is the output that I get under both SunOS and Solaris:

pdctx1:/home/swarren> ./forker.pl
Forking thread #0: begat 6302
Forking thread #1: begat 6303
Forking thread #2: begat 6304
Forking thread #3: begat 6305
 
Kid_Status{6302}=-1; Kill(0)=1.
Kid_Status{6303}=-1; Kill(0)=1.
Kid_Status{6304}=-1; Kill(0)=1.
Kid_Status{6305}=-1; Kill(0)=1.
 
I'm child #0.
Kid_Status{6302}=0; Kill(0)=0.
Kid_Status{6303}=-1; Kill(0)=1.
Kid_Status{6304}=-1; Kill(0)=1.
Kid_Status{6305}=-1; Kill(0)=1.
 
I'm child #1.
Kid_Status{6302}=0; Kill(0)=0.
Kid_Status{6303}=256; Kill(0)=0.
Kid_Status{6304}=-1; Kill(0)=1.
Kid_Status{6305}=-1; Kill(0)=1.
 
I'm child #2.
Kid_Status{6302}=0; Kill(0)=0.
Kid_Status{6303}=256; Kill(0)=0.
Kid_Status{6304}=512; Kill(0)=0.
Kid_Status{6305}=-1; Kill(0)=1.
 
I'm child #3.

(Wait forever after this)

Any help is sincerely appreciated.

Steve Warren                           E-mail: swarren@pdc.com     _.  
Central Regional SE Manager            Phone: 972-446-2644       ._||__
PDC Services                           Fax: 972-245-9320          v\ *|
1445 MacArthur Dr, Suite 116           Pager: 214-249-8651          V  
Carrollton, TX  75007                  http://www.pdc.com


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

Date: Sat, 17 May 1997 01:28:50 GMT
From: hcs@pc.jaring.my (Harichandran Sukerathavan)
Subject: POP V3 implementation in Perl..Has anybody implemented it?
Message-Id: <337d0898.921118@news.jaring.my>

Hey,

I'm looking for a perl implementation of the POPV3 protocol....can
somebody let me know if anybody has done it. I'm planning to implement
a mail reader via browser, where the mail is retrieved using the POP
protocol. 

Thank you.

--hari
Harichandran Sukerathavan
hcs@pc.jaring.my


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

Date: Fri, 16 May 1997 18:11:55 -0400
From: "craig@indelible-blue.com" <craig@indelible-blue.com>
Subject: Problems running .cmd and .exe from Perl for OS/2
Message-Id: <337CDBAB.719D@indelible-blue.com>

I am running Perl 5.0.3 for OS/2.  I am trying to launch REXX scripts
and .exe's.  After reading through the docs, I tried using the system(),
open(foo,"...") and `` commands.  All of these are either crashing or
returning nothing.

If anyone can let me know how to kick off a REXX script and capture the
output, I would appreciate it.

Craig


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

Date: 17 May 1997 04:48:19 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Problems running .cmd and .exe from Perl for OS/2
Message-Id: <5ljdaj$dnr$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to craig@indelible-blue.com
<craig@indelible-blue.com>],
who wrote in article <337CDBAB.719D@indelible-blue.com>:
> I am running Perl 5.0.3 for OS/2.  I am trying to launch REXX scripts
> and .exe's.  After reading through the docs, I tried using the system(),
> open(foo,"...") and `` commands.  All of these are either crashing or
> returning nothing.
> 
> If anyone can let me know how to kick off a REXX script and capture the
> output, I would appreciate it.

If you expect to get help, ask for it properly.  Just crying "it does
not work" will not solicite you anything.

Ilya


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

Date: Sat, 17 May 1997 02:59:17 +0200
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: Q: Perl/Cgi under Windows NT
Message-Id: <337D02E5.1DD7@icl.fi>

Per Marstein wrote:
> 
> I've installed a web server on a NT.
> 
> Unix uses the environment variable $QUERY_STRING to get the input from
> the client.
> 
> How to get the same information with a perl cgi-script ?

You do it the same way, unless you have a really weird web server
on your Windows NT system.

In any case, no matter what your platform is, if you do CGI
in Perl, use CGI.pm:

    http://www-genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.htm

and as far as Windows NT and Perl for Win32 is concerned, 
bookmark also:

    http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html

regards,
 ...petri.backstrom@icl.fi
    ICL Data Oy
    Finland


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

Date: Thu, 15 May 1997 20:10:53 +0200
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: Reading past CTRL-Z in file
Message-Id: <337B51AD.8A4@icl.fi>

Look up binmode in the Perl docs.

regards,
 ...petri.backstrom@icl.fi
    ICL Data Oy
    Finland

Doug Lockhart wrote:
> 
> I am using Perl 5.003 Build 306 on Windows NT 4.0.
> The file I am trying to process contains text mixed with binary
> data and sometimes there is a CTRL-Z embedded in the binary data.
> I am trying to extract the text part of the data but my script
> only reads the file up to the CTRL-Z.  I apologize if this is a
> dumb question but I am just a beginner at using Perl.
> 
> Here is a simple script called script.pl that encounters the problem:
>         while (<>) {
>                 S/p/xxx/;
>         } continue {
>                 print;
>         }
> 
> and I invoke it as "script.pl text"
> 
> Any advice is appreciated.  Thanks.
> 
> Reply to lockhart@netcom.ca


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

Date: Fri, 16 May 1997 20:25:51 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Reverend Joshua Berezin <josh@inetarena.com>
Subject: Re: Selecting files to open
Message-Id: <Pine.GSO.3.96.970516200817.16343H-100000@kelly.teleport.com>

On 15 May 1997, Reverend Joshua Berezin wrote:

> I have a bunch of log files named foo.1996.01 foo.1996.02 ...
> foo.1996.12 foo.1997.01 ... 

> I only want to open the files of months between the start date and end
> date.

I think this will get you started.

sub filename_list {
    # Given a starting month and year, and an ending month and
    # year, returns a list of filenames for that range. The
    # list returned may be empty. The filenames may refer to
    # files which don't exist (yet).

    my($start_mon, $start_year, $end_mon, $end_year) = @_;
    my($year, $mon, @filanames);

    @filenames = ();
    for ($start_mon, $end_mon) { 
        $_ = 1 if $_ < 1 or $_ > 12;
        $_ = sprintf "%02d", $_;
    }
    $year = $start_year;
    $mon = $start_mon;

    # Sanity checks, just in case
    die "Too many years between $end_year and $start_year"
        if $end_year - $start_year > 10;	# Sanity check
    die "Year $start_year is too far in the past"
        if $start_year < 1980;			# Sanity check

    # Build the list of filenames
    while ("$year$mon" <= "$end_year$end_mon") {	# Yes!
        push @filenames, "foo.$year.$mon";
        $mon = $mon + 1;
        if ($mon > 12) {
            $year = $year + 1;
            $mon = 1;
        }
        $mon = sprintf "%02d", $_;
    }
}

Hope this helps!    

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 17 May 1997 00:36:57 GMT
From: bmcguire@business.uvic.ca (Bruce McGuire)
Subject: Sorting a hash on output - newbie
Message-Id: <5liuj9$24s8@uvaix3e1.comp.UVic.CA>

Hello.

I am trying to sort a hash (names and counters) by the value of the key.

ie I would like output such as:
Alpha	034
Alphas	433
Beta	001
Deltas	991

etc.

I have looked in "The Camel Book", and on the www.perl.com site, but I can't
get this right.

I would appreciate any help you could give.

Bruce McGuire.



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

Date: 17 May 1997 02:02:49 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: Sorting a hash on output - newbie
Message-Id: <5lj3k9$7bf@pirate.shu.edu>

Hello -

bmcguire@business.uvic.ca (Bruce McGuire) writes:

>Hello.

>I am trying to sort a hash (names and counters) by the value of the key.

>ie I would like output such as:
>Alpha	034
>Alphas	433
>Beta	001
>Deltas	991

>etc.

Check Mike Stok's comments on this subject (posted today) in
the thread "Sorting Associative by Values?"

David Black
dblack@icarus.shu.edu


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

Date: Fri, 16 May 1997 22:13:33 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Sorting a hash on output - newbie
Message-Id: <to7jl5.um2.ln@localhost>

Bruce McGuire (bmcguire@business.uvic.ca) wrote:
: Hello.

: I am trying to sort a hash (names and counters) by the value of the key.
                 ^^^^^^^^^^^
                 ^^^^^^^^^^^

I think if you search for the phrase above in the FAQ for
this newsgroup (that I'm sure you checked before posting, because
that is what good 'net citizens do. Guess you missed it somehow)
you would find this in part 4:

"How do I sort a hash (optionally by value instead of key)?"
          ^^^^^^^^^^^

Sounds to me like you might find something helpful there...


: I have looked in "The Camel Book", and on the www.perl.com site, but I can't
: get this right.


Thank you. You tried to do the right thing, those are very good
sources of information.

But, there are two sources of information that are much too valuable
to not have lying around on your very own hard drive:

1)
The man pages included with the perl distribution, if you have
perl installed, you should already have these installed somewhere.
Find out where.

2)
The FAQ for *ANY* newsgroup (if one exists) should be consulted before
posting to that newsgroup. c.l.p.m does indeed have such a FAQ
(available from www.perl.com). 

If you had the Perl FAQs handy, you could have had this
question answered in 20 *seconds*!


: I would appreciate any help you could give.

Well, somebody probably appreciates you doing your part to
ensure that the 'F' in FAQ remains accurate ;-)


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Sat, 17 May 1997 00:09:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: standard packages
Message-Id: <EAAtr7.22x@nonexistent.com>

On Fri, 16 May 1997 19:01:19 GMT, Jim Shi wrote in comp.lang.perl.misc
URL: news:5lid7t$gn5@hideout.emanon.net:
++ 
++ 
++ Hi, where can I find info on how to use Perl standard packages
++ such as Getopt::Std etc? Thanks


man Getopt::Std, or if the man pages aren't installed perldoc Getopt::Std.



Abigail


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

Date: 16 May 1997 20:10:48 -0400
From: jfw@wral-tv.wral-tv.com (John F. Whitehead)
Subject: stat/test and _ and efficiency
Message-Id: <x77mgz9cvr.fsf@wral-tv.wral-tv.com>

Is there a way to use _ to refer to the same file in different
subroutines?

For example, once you do a stat($file), it is more efficient in the future
to refer to stat(_), (-e _), etc.  But how do you know what the _ refers
to once you're in other subroutines?

So right now I might have something like:

if (-e $file) {                             # line 1
    $foo = &is_dir($file);                  # line 2
}

if (-x _) {                                 # line 5
    print "executable\n";
}

sub is_dir {

	my ($file) = @_;                    # line 11

        print "file is $file\n";

	(-d _) ? return 1 : return 0;       # line 13

}

The problems with the above are that

1) if &is_dir is called from somewhere else, line 13's _ may not really
refer to $file if there was no test performed first

2) &is_dir could, unknowing to the caller, change _, making line 5
refer to the wrong file

So is there a way around this that will allow only one disk access?
Like, test whether _ still refers to $file?

Thanks!  I couldn't find anything on this...  there is only one sentence
in Camel about _.  Btw, I'm using Perl version 5.003.

-- 
John F. Whitehead
(formerly of WRAL OnLine)
New address: jfw@well.com


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

Date: Sat, 17 May 1997 00:13:46 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Tatum O'Neil
Message-Id: <EAAtyy.2CB@nonexistent.com>

On Fri, 16 May 1997 16:06:55 -0500, Paul T. McNally wrote in
comp.lang.perl.misc URL: news:337CCC6E.3380@radiks.net:
++ Does anyone know when the actress and Oscar winner Tatum O'Neil
++ was born? I'm thinking she was born close to 3-6-62, but I knew more
++ when I had this bitty crush about the time Bad News Bears came out.
++ I need to know for it may become a vital part of my home page!!
++ Very important!


Djee, you can have some sympathy for those single digit IQ's who
think any question about CGI belongs in a group about Perl.

But posting a questions about an Oscar winner in a Perl group
just because you might want to add it to your home page? I didn't
know people with a negative IQ were allowed to touch keyboards.



Abigail


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

Date: Fri, 16 May 1997 22:25:36 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Tatum O'Neil
Message-Id: <gf8jl5.1s2.ln@localhost>

Paul T. McNally (paulmc@radiks.net) wrote:
: Does anyone know when the actress and Oscar winner Tatum O'Neil
: was born? I'm thinking she was born close to 3-6-62, but I knew more
: when I had this bitty crush about the time Bad News Bears came out.
: I need to know for it may become a vital part of my home page!!
: Very important!


 ___    _    ____    _    ___   
/   \__/ \__/    \__/ \__/   \  "Hey Rocky!  Watch me pull
|          _|@ @ __          |  some intelligence out of
 \________/ |    | \________/   the InterNet!"
         __/    _/              "But that trick never works."
        /) (o _/                "This time for sure."
        \____/                  


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

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 491
*************************************

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