[10773] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4374 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 7 15:07:14 1998

Date: Mon, 7 Dec 98 12:00:26 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 7 Dec 1998     Volume: 8 Number: 4374

Today's topics:
    Re: $ENV{'REMOTE_HOST'} Problem on NT <bryan@eai.com>
    Re: $ENV{'REMOTE_HOST'} Problem on NT <gellyfish@btinternet.com>
    Re: A usable Perl interpreter? <postmaster@castleamber.com>
    Re: A usable Perl interpreter? (Matthew Bafford)
    Re: ActivePerl perlscript and IIS brian.parks@stn.siemens.com
    Re: As I was A-Hacking the perl source (Rich)
        Case of the Vanishing Variable! (David Bolton)
        Checking before I post! <Richard@nugget.demon.co.uk>
        Code Bash: File Include (Sam Curren)
    Re: CRC check in Perl <postmaster@castleamber.com>
        Error Message (Youssef Masrour)
    Re: Fastest way to search through an array? <tchrist@mox.perl.com>
    Re: function for copying files <bryan@eai.com>
        Generating a Reference Number <mikej@1185design.com>
        Help clearing hash index from memory <pcion@cybersource.com>
    Re: help, have to figure perl out in 4 days!! <harrisr@ugsolutions.com>
    Re: How to open a background process in Perl and CGI/Pe <wtang@flash.net>
    Re: https and GET <gellyfish@btinternet.com>
    Re: I hate to ask, but i'm stuck on my logic :-( (Matthew Bafford)
    Re: I hate to ask, but i'm stuck on my logic :-( (Andrew M. Langmead)
    Re: I hate to ask, but i'm stuck on my logic :-( <daniel.vesma@thewebtree.com>
    Re: Is it possible to run a web server on Win95? (Shane Owenby)
    Re: Need help getting dir list in V4 <harrisr@ugsolutions.com>
    Re: new..  where do I go? <gellyfish@btinternet.com>
        Perl examples <pep_mico@hp.com>
    Re: Perl examples (Matthew Bafford)
    Re: Perl script on apache <gellyfish@btinternet.com>
        Perl script to send a page (DOS/Windows) wagnerj@mercyhealth.com
    Re: Perl script to send a page (DOS/Windows) <tripp.lilley@perspex.com>
        perl zip <omahonym@indigo.ie>
    Re: PERL-FTP <gellyfish@btinternet.com>
    Re: Perlscript timeout <gellyfish@btinternet.com>
    Re: POSIX not found (Bart Lateur)
        Question: Perl IRC Bot <rweaver@raex.com>
    Re: usage of $_ within nested loops <tchrist@mox.perl.com>
    Re: usage of $_ within nested loops <merlyn@stonehenge.com>
        Which modules to use <monkey@chisp.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 07 Dec 1998 13:21:21 -0600
From: Bryan Hart <bryan@eai.com>
Subject: Re: $ENV{'REMOTE_HOST'} Problem on NT
Message-Id: <366C2AB1.446B@eai.com>

Bill wrote:
> 
> Does anybody know why, when I run $ENV{'REMOTE_HOST'}, do I always come up
> with an IP address instead of user123.blah.com or whatever?
> 

This is provided by the webserver, so you're at it's mercy.  If the
webserver is configured to return resolved hostnames, that's what you
get.  If name resolution isn't available (or enabled) then you will get
IP addresses.

Bryan
-- 
------------------------------------------------------------
|  Bryan Hart                 |  Phone: (515) 296-5979     |
|  Network Products Engineer  |  Fax: (515) 296-7025       |
|  Engineering Animation Inc. |  Email: bryan@eai.com      |            
|                             |  WWW: http://www.eai.com/ 
|                         
------------------------------------------------------------


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

Date: 7 Dec 1998 18:30:48 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: $ENV{'REMOTE_HOST'} Problem on NT
Message-Id: <74h6so$co$1@gellyfish.btinternet.com>

On Mon, 07 Dec 1998 17:43:59 GMT Bill <cdxpl@yahoo.com> wrote:
> Does anybody know why, when I run $ENV{'REMOTE_HOST'}, do I always come up
> with an IP address instead of user123.blah.com or whatever?
> 
> I'm running the perl script on a Windows NT IIS 4.0 server with the latest
> service pack 4 plus the latest built perl from Active State.
> 

This is the way the IIS <ahem> works - you need to be asking in a group such
as comp.infosystems.www.servers.ms-windows.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 7 Dec 1998 18:20:23 GMT
From: "John Bokma" <postmaster@castleamber.com>
Subject: Re: A usable Perl interpreter?
Message-Id: <01be220d$ed852dc0$02521e0a@tschai>



N H <nhoop@centuryinter.net> wrote in article
<366fa3a8.14021325@news.ot.centuryinter.net>...
> Yeah, I'm new to perl and just about had it. I downloaded the latest
> version, but winzip doesn't like *.gz files. Then I got advise to
download
> another file, but that needs to be compiled - with WHAT?  AGGGH.
> 
> Is there anywhere I can just get a perl interpreter that winzip
understands
> that will work when unzipped? 

http://www.activestate.com/

John


-- 
------------------------------------------------------------------
C A S T L E  A M B E R      Software Development (Java/Perl/C/CGI)
http://www.castleamber.com/ john@castleamber.com
http://www.caiw.nl/~jbokma/
http://www.binaries.org/    Guide to Program Binaries and Pictures



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

Date: Mon, 7 Dec 1998 13:46:14 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: A usable Perl interpreter?
Message-Id: <MPG.10d5ec7ec8d8f5b2989750@news.scescape.net>

In article <366fa3a8.14021325@news.ot.centuryinter.net>, 
nhoop@centuryinter.net says...
=> Yeah, I'm new to perl and just about had it. I downloaded the latest
=> version, but winzip doesn't like *.gz files. Then I got advise to download
=> another file, but that needs to be compiled - with WHAT?  AGGGH.
=> 
=> Is there anywhere I can just get a perl interpreter that winzip understands
=> that will work when unzipped?  

www.activestate.com

=> (please e-mail nhoop@centuryinter.net)

Personal consultation costs...

=> Thanks,

HTH!

=> Nat

--Matthew


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

Date: Mon, 07 Dec 1998 18:56:22 GMT
From: brian.parks@stn.siemens.com
Subject: Re: ActivePerl perlscript and IIS
Message-Id: <74h8cl$12n$1@nnrp1.dejanews.com>

In article <366BAA08.F5BF687@teamamiga.org_NOSPAM>,
  matt@teamamiga.org wrote:
> brian.parks@stn.siemens.com wrote:
> >
> > I just installed ActivePerl (build 507) and want to write some ASP pages
using
> > PerlScript rather than VBScript.
> > ActivePerl installed OK, and I can run standard perl cgi scripts, but I'm
> > having problems with the following perlscript (ASP):
>
> [snip]
>
> > My browser returns the following error message:
> > ---------------------------------------------------------------------------
> > $Response->writeblock(0); $Response->write("Hello World"); error '80004005'
> >
> > Can't call method "writeblock" on an undefined value.
>
> You have an installation problem. Try re-installing ActivePerl. If that
> doesn't work, reinstall IIS.
>
> --
> <Matt email="matt@teamamiga.org" />
>
> | Fastnet Software Ltd              |   Perl in Active Server Pages   |
> | Perl Consultancy, Web Development |   Database Design   |    XML    |
> | http://come.to/fastnet            |    Information Consolidation    |
>

Re-installing ActivePerl did the trick, for some reason.  The first
installation went smoothly . . . I wonder why I had to re-install ??
Thanks.
-brian

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 7 Dec 1998 19:41:29 GMT
From: richm@ucesucks.mulveyr.roc.servtech.com (Rich)
Subject: Re: As I was A-Hacking the perl source
Message-Id: <slrn76obp4.gk.richm@ll.aa2ys.ampr.org>

On Mon, 07 Dec 1998 16:55:39 GMT, kmitev@my-dejanews.com <kmitev@my-dejanews.com> wrote:
>I noticed that there were 492 functions that weren't called from anywhere.
>
>Curious, wot ?
>

   Does that include calls via function pointers?

- Rich

--
Rich Mulvey                                         
My return address is my last name, 
   followed by my first initial, @mulveyr.roc.servtech.com        
http://mulveyr.roc.servtech.com
Amateur Radio: aa2ys@wb2wxq.#wny.ny.usa


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

Date: 7 Dec 1998 18:22:21 GMT
From: DBolton@IdeaPlace.org (David Bolton)
Subject: Case of the Vanishing Variable!
Message-Id: <DBolton-0712981224060001@199.199.170.135>

Hopefully this'll be an easy one.  (I'm new at this.)

I passed data to a perl cgi via PATH_INFO.  In the recieving program I...
   a) parsed it out: $tchr=$ENV{'PATH_INFO'};
   b) used it: <P>Hello $tchr


But!  When I call MAILCMD and send $tchr as data in an email, the
information is gone.  All other variable data are present, and when I
changed $tchr="Bob" the string "Bob" makes it just fine to the email.

Being the newbie that I am, I even tried...
   $temp=$ENV{'PATH_INFO'};
   $tchr=$temp;
But it didnt' work.

How do I grab on to the PATH_INFO data and make it permanent within a
variable?  (This must be one of those pass-by-reference deals I never was
too good at.)

 ___________________________________________________________________
|  David Bolton                 |                                   |
|  dbolton@ideaplace.org        |                                   |
|                               | "With every mistake               |
|  Virginia, Minnesota          |      we must surely be learning." |
|                               |   --George Harrison               |
|___________________________________________________________________|


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

Date: Mon, 7 Dec 1998 18:23:17 +0000
From: Richard <Richard@nugget.demon.co.uk>
Subject: Checking before I post!
Message-Id: <VbysuDAV0Bb2Ewqz@nugget.demon.co.uk>

Hi,

I've just completed my largest cgi script attempt so far. It's not large
by most peoples standards but I'm pretty pleased with it as it does
exactly what I want.

I realise that this group is not for cgi issues but I would be grateful
if I could post the code here for constructive criticism on the coding.
This would help me get it right first time next time and hopefully help
others new to Perl lurking here. So if I post it will I be flamed?

I would stress that the whole of the cgi has been written with extensive
use of the online documentation at http://www.perl.com and I consider
this a great resource.

Many thanks

Richard 
-- 
Richard Eyles                           | General techie anorak
Principle Pharmacist Computer Services  | DOS Win95 AIX HP-Unix (just)
Queen Alexandra Hospital, Portsmouth    | TCPIP IPX Novell


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

Date: Mon, 7 Dec 1998 11:38:43 -0800
From: samc@empirewest.com (Sam Curren)
Subject: Code Bash: File Include
Message-Id: <MPG.10d5ce9a542391609896b0@news.sonic.net>

Here is a subroutine I wrote to include other files in output, mostly for 
preformatted html, but also for non-cgi purposes. Rip it to shreds, that 
I might learn better coding practices. Thanks!

calling method:

ifile("include.txt");

subroutine:

sub ifile {
  foreach $file (@_) {
    unless(open IFILE, $file) { print("Can't open $file: $!\n"); return; 
}    
    while($line = <IFILE>) { print $line; }
    close IFILE;
  }
}


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

Date: 7 Dec 1998 18:27:03 GMT
From: "John Bokma" <postmaster@castleamber.com>
Subject: Re: CRC check in Perl
Message-Id: <01be220e$dbb03f80$02521e0a@tschai>



Paul Falbe <paul@cassens.com> wrote in article
<17584.913045143@cassens.com>...
> Has any one implemented a CRC check function in Perl?  I have the
following
> C function which does the check.

[snip]

Check out the %number option in unpack. (p237 of Programming Perl)
(number = number-bit checksum)
The example in the book:

undef $/;
$checksum = unpack("%32C*", <>) % 32767;

(Works like System V sum).

John


-- 
------------------------------------------------------------------
C A S T L E  A M B E R      Software Development (Java/Perl/C/CGI)
http://www.castleamber.com/ john@castleamber.com
http://www.caiw.nl/~jbokma/
http://www.binaries.org/    Guide to Program Binaries and Pictures



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

Date: 7 Dec 1998 18:59:35 GMT
From: ab535@FreeNet.Carleton.CA (Youssef Masrour)
Subject: Error Message
Message-Id: <74h8in$l1l@freenet-news.carleton.ca>


I've written a rather simple program (below) to convert
from a GDBM to SDBM database. At some point the program
dies and displays the following message:
 ------------------------------
sdbm store returned -1, errno 22, key
"http://www.fastball.com/auto/minors/amer/nashville/
boxes/1997/amernas0703box.html"
---------------------------------------------

So my question is does anyone know what error number 22 is?
Or where I can find more documentation on SDBM?

Cheers,
Youssef


convert.pl
-----------------------------
#!/usr/local/bin/perl

use strict;  
use GDBM_File;  
use SDBM_File;  
use Fcntl; 


my $dbfileIn  = 'test.gdbm';
my $dbfileOut = 'test.sdbm';

tie (my %hashIn , "GDBM_File", $dbfileIn,   &GDBM_WRCREAT,   0666);
tie (my %hashOut, "SDBM_File", $dbfileOut,  O_RDWR | O_CREAT, 0666);


while (my ($key, $value) = each %hashIn) {
    $hashOut{"$key"} = $value;
}
untie %hashIn;
untie %hashOut;

--
  Youssef Masrour 


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

Date: 4 Dec 1998 18:36:53 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Fastest way to search through an array?
Message-Id: <749a45$q7q$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, jhill22@csc.com writes stuff.

The lesson is that arrays aren't for searching; hashes are.

--tom
-- 
"Lazy people never bother to actually read the manual.  Instead they
  (like kids) pick something with big, colorful buttons."
    --Eugene Tyurin <gene@insti.physics.sunysb.edu> 


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

Date: Mon, 07 Dec 1998 13:18:00 -0600
From: Bryan Hart <bryan@eai.com>
Subject: Re: function for copying files
Message-Id: <366C29E8.2781@eai.com>

Check out File::Copy in the standard Perl libs...

Bryan

Michael Tacelosky wrote:
> 
> I've read the chapter on File and Directory manipulation, and can't seem to
> find the simple command to copy a file from one directory to another, or
> from one name to another.
> 
> The rename() function is close, but I don't want to delete the original.
> 
> This seems so simple -- can anyone point me in the right direction?
> 
> TIA,
> 
> Tac
> 
> PS I'm using perl5 under NT, but I'm hoping that the copy function is not
> OS-specific.
> 
> Smokescreen Action Network
> http://www.smokescreen.org
> e-mail: tac@smokescreen.org
> "Raise Tobacco Taxes. Provide Smokefree Environments. No immunity."

-- 
------------------------------------------------------------
|  Bryan Hart                 |  Phone: (515) 296-5979     |
|  Network Products Engineer  |  Fax: (515) 296-7025       |
|  Engineering Animation Inc. |  Email: bryan@eai.com      |            
|                             |  WWW: http://www.eai.com/ 
|                         
------------------------------------------------------------


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

Date: Mon, 07 Dec 1998 11:59:28 -0800
From: mikej <mikej@1185design.com>
Subject: Generating a Reference Number
Message-Id: <366C339E.1EED6E26@1185design.com>

Hi All,

I have a form that calls a Perl script and I want it to generate a
"reference number" as an ID for people to use later on if they want to
change something on their entry. An example would be something you would
see on sites where you buy a product and the thank you page gives you a
transaction reference number. Anyone know a quick and easy way in Perl
to generate a unique number based on each form submission? Thanks!

-Mike

mikej@1185design.com



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

Date: Mon, 07 Dec 1998 10:13:48 -0800
From: Pete Cion <pcion@cybersource.com>
Subject: Help clearing hash index from memory
Message-Id: <366C1ADC.73FDBAAB@cybersource.com>

Hello -

I am working with a rather large associative array (about 100,000
name/value pairs) that I need to keep in memory.  The problem isn't the
array itself, but that once the array is undef'd, the memory is not
released.  I assume that this memory is for the index to the associative
array rather than for the array itself.

Any thoughts as to how to clear the index out of memory once the array
itself has been undef'd?

Thanks,

Pete Cion
Mgr. for Payment Systems
CyberSource
pcion@cybersource.com



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

Date: Sun, 06 Dec 1998 09:06:28 -0500
From: Randy Harris <harrisr@ugsolutions.com>
Subject: Re: help, have to figure perl out in 4 days!!
Message-Id: <366A8F64.7C51E89D@ugsolutions.com>

There is an incredible amount of on line resources for perl.  There are two
excellent tutorials that might help "jump start" you.

http://agora.leeds.ac.uk/nik/
http://www.netcat.co.uk/rob/perl/win32perltut.html

Good Luck -


Robert III Lockhart wrote:

> or atleast enough of the Perl language to make a program that takes a
> scrambled word and compares it with  a word list and prints them both.
> It is not a hard concept, basically I can do it in my sleep in C but the
> OS class just went to Perl and I'm lost.
> I get the concept of using a sub * { thing to make a function, but how
> to start a perl file, and play around with several simple learning
> programs that play with file manipulation, I am having a hard time
> finding examples of code, and a version of perl that will run on a
> windows98 version, although I do have a drive that is not yet converted
> to FAT32 that I just tried to install perl from using a CD ROM version I
> got with a book entitled"Perl by Example", and some of the information
> in the Readme files, makes me think I just wasted my time..., not to
> mention 40 bucks.
> if anyone can give me some quick advice, or sample of code that would
> benefit me with this program, then thank you very much,
> Rob Lockhart
> D.W.E@worldnet.att.net



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

Date: 7 Dec 1998 19:05:21 GMT
From: "William Tang" <wtang@flash.net>
Subject: Re: How to open a background process in Perl and CGI/Perl?
Message-Id: <01be2213$509f6920$5d68b9a3@wtang-sgl.sugar-land.geco-prakla.slb.com>

This will work on perl script, but not on perl CGI application, I also
tried the setsid() function, it does not work either.

William

Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote in article
<slrn76nv83.4n7.sholden@pgrad.cs.usyd.edu.au>...
> 
> If you really just want to do a C->perl translation then have a look at
> the POSIX module which allows you to do :
> 
> use POSIX;
> 
> if(($childpid=fork())==0) {
>     exit 1 unless defined setpgid($$,$$);
>     executethebackgroundcommandhere();
>     exit(1);
> } else { parentprocesshere(); }
> exit(0);
> 
> sub executethebackgroundcommandhere {};
> sub parentprocesshere {};
> 
> Of course that's very C-like perl but I guess that's OK...
> I'd do it different myself - but it's 3am and I can't be bothered.
> 
> perlfaq8 :  How do I fork a daemon process?
> 
> might explain a more correct way of doing it (the above leaves stdin,
stdout,
> etc open).
> 
> -- 
> Sam
> 
> You can blame it all on the internet. I do...
> 	--Larry Wall
> 


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

Date: 7 Dec 1998 19:33:41 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: https and GET
Message-Id: <74hail$f6$1@gellyfish.btinternet.com>

On Mon, 07 Dec 1998 15:21:33 GMT Barry Eimer <beimer@uu.net> wrote:
> 
> Can someone please show me a way to GET a document from an SSL server?
> The problem that I am having is that something in the server is
> causing erratic GET failures and I want to examine the headers,
> however LWP does not support SSL. 
> 

You might check out :

Net::SSLeay
LWP::SecoreSocket or
Crypt::SSLeay

from CPAN. 

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Mon, 7 Dec 1998 13:45:59 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: I hate to ask, but i'm stuck on my logic :-(
Message-Id: <MPG.10d5ec74515406ea98974e@news.scescape.net>

In article <366c12e6.0@news.thefree.net>, daniel.vesma@thewebtree.com 
says...
=> Hi,

[snip]

=> The script should output something like
=> 
=> Person1 talks about subject 1
=> Person2 talks about subject 1
=> Person2 talks about subject 2
=> Person1 talks about subject 2
=> 
=> But It doesn't. It just shows
=> 
=> Person 1 talks about subject 1
=> Person 2 talks about subject 2

Umm, you do kinda tell it to do that.

=> Both files are bellow. Thanks for any help. This is kinda urgent.

URGENT!?  Urgent as in 'my instructor wants it in tomorrow', or urgent as 
in 'I just gotta know what person x is talking about!'?

usenet is anything but fast, if you wanted an immediate answer, you 
should have hired someone...

=> 
=> SCRIPT
=> *********
=> open(ChatRoomFile, 'chat.txt') or die("can't find it");
=>
=> $current = 1;
=>     while(<ChatRoomFile>)
=>       {
=> 
=>              ($ID, $N, $Name, $email, $subject, $Message) = split(/\|/, $_);
=> 
=>                  if($ID == $current)
=>                    {
=> 
=>                       print "\n$Name talks about $subject";
=> 
=>                    }
=>                       $current++;
=>       }
=> 
=> chat.txt
=> ********
=> 1|1|Person 1|daniel.vesma@thewebtree.com|subject 1|subject 1. Lets talk.

Loop one of the while loop.    $current == 1, $ID == 1
Printed

=> 2|1|Person 2|jeff@thewebtree.com|subject 2|subject 2. Lets talk.

Loop two of the while loop.    $current == 2, $ID == 2
Printed

=> 1|2|Person 2|jeff@thewebtree.com|subject 1|subject 1. Reply.

Loop three of the while loop.  $current == 3, $ID == 1
Not printed.

=> 2|2|Person 1|daniel.vesma@thewebtree.com|subject 2|subject 2. Reply.

Loop four of the while loop.   $current == 4, $ID == 2
Not printed.

---

Soo, in short, it's doing exactly what you asked.


Hope This Helps!

=> Daniel Vesma

--Matthew


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

Date: Mon, 7 Dec 1998 19:32:41 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: I hate to ask, but i'm stuck on my logic :-(
Message-Id: <F3M0yH.153@world.std.com>

"Daniel Vesma" <daniel.vesma@thewebtree.com> writes:


>Person1 talks about subject 1
>Person2 talks about subject 1
>Person2 talks about subject 2
>Person1 talks about subject 2

You have $current incrementing each time through the loops, and you
are specifying that the print statment should execute each time
current equals the ID number (which change each time through the loop.

So since you have ID's and the $current iterators that run like this,
you will have a match on the lines that say "T" (for true)

ID      1   2   1   2
current 1   2   3   4
---------------------
match   T   T   F   F

Perl isn't going to go back and wedge onto STDOUT the third line
because it found and ID that matched in a previous loop iteration.

Unfortunatly, I'm at a bit of a loss on what to suggest, because I'm
not sure what you intend to do to get the desired order.  Do you want
to print together all of the lines that the ID's match? (If so, why
not just match the subject lines?) 

Assuming that is what you are trying to do, how large will the file
become (small enough to fit the entire file into memory?) If so, then
you might want to build a hash of hashes keyed by ID number.

while(<ChatRoomFile>) {
   ($ID, $N, $Name, $email, $subject, $Message) = split(/\|/, $_);
   $threads{$ID} =  { N => $N, Name => $Name, 
           email => $email, subject => $subject, Message => $Message };
}

for my $thread (sort { $a <=> $b } keys %threads) {
  for my $message (@$thread) {
    print "\n$message->{Name} talks about $message->{subject}"
  }
}

If the file is too big to keep in memory, you might want to look into
using DBM files, or creating a separate index file for the text giving
the offsets in the datafile which has the appropriate lines.
-- 
Andrew Langmead


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

Date: Mon, 7 Dec 1998 19:33:58 -0000
From: "Daniel Vesma" <daniel.vesma@thewebtree.com>
Subject: Re: I hate to ask, but i'm stuck on my logic :-(
Message-Id: <366c2dac.0@news.thefree.net>

>URGENT!?  Urgent as in 'my instructor wants it in tomorrow', or urgent as
>in 'I just gotta know what person x is talking about!'?
>
>usenet is anything but fast, if you wanted an immediate answer, you
>should have hired someone...


Urgent as in, this site needs to be done before xmas, this is the missing
link.

>Soo, in short, it's doing exactly what you asked.


You right. Damn, damn, damn.

Daniel Vesma
www.thewebtree.com
www.thewebtree.com/daniel-vesma




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

Date: Mon, 07 Dec 1998 19:51:11 GMT
From: shaneo@nospam.raleigh.ibm.com (Shane Owenby)
Subject: Re: Is it possible to run a web server on Win95?
Message-Id: <366e3112.522229015@rtpnews.raleigh.ibm.com>

First this message should be directed to
comp.infosystems.www.servers.ms-windows
but anyway....

On Mon, 23 Nov 1998 09:37:19 -0800, "PCM"
<pulsecode@mailandnews.dot.com> wrote:

>Kris wrote in message <3654E41F.BA773505@fit2print.com>...
>>I have Apache 1.3.3 and Perl 5.0, and I'm wondering if its worth my time
>>trying to figure out how to configure them to run on Win95 (4.00.950b,
>>96 megs RAM, Pentium 166).  Looking through the documentations it seems
You can run Apache on NT, and 95,98 although the proxy doesn't load
on 95...but why would you want to run a proxy on 9X anyway....

you can get the binary dist from:
http://www.apache.org/dist/
the file apache_1_3_3.exe        

It runs quite nice, and the Un*x docs explain most of what you need
for NT or 9X.

Shane


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

Date: Sun, 06 Dec 1998 10:34:07 -0500
From: Randy Harris <harrisr@ugsolutions.com>
Subject: Re: Need help getting dir list in V4
Message-Id: <366AA3EF.BFEA306B@ugsolutions.com>

Yet more explanation:

I am able to make it work using backticks:
  @dirs = `ls -p1 $datadir | grep "/"` ;
  chop ( @dirs ) ;
  chop ( @dirs ) ;

I sure would like to understand why I can't make it work with -d.


Randy Harris wrote:

> Further explanation:
>
> opendir (DIRECT, $datadir)  ||  die "Could not access the data
> directory!";
>     @dirs = grep ( -d , readdir DIRECT ) ;
> closedir DIRECT;
> print "@dirs" ;
>
> On NT returns list of all dirs (including . and .. ).  On Unix only
> returns . and ..
>
> I've tried dozens of different approaches, I'm stuck.
>
> Randy Harris wrote:
>
> > I need to read in a list of subdirectories.
> >
> > This sub works nicely in Perl 5:
> >
> > sub GetDataDirList {
> >  opendir (DIRECT, $datadir)  ||  die "Could not access the data
> > directory!";
> >       # get all dirs (-d), avoid . and .. -
> >     @dirs = grep ( -d && !/^\./, readdir DIRECT ) ;
> >  closedir DIRECT;
> > }
> >
> > I can't come up with syntax to make it work in Perl 4 (HP-UX).
> > Any suggestions appreciated (even untested).



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

Date: 7 Dec 1998 19:01:54 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: new..  where do I go?
Message-Id: <74h8n2$cu$1@gellyfish.btinternet.com>

On Mon, 07 Dec 1998 17:04:04 GMT Me <luvbeingmama@home.com> wrote:
> Hi there!
> I am totally new to this perl programming and am trying the Perl Builder
> program.  I am looking for places where I can find "dummy" help and would
> like to request either...
> 1- a newsgroup where questions on programming (or help for it) would be
> appropriate...
> 2- or where I could find dummy help.  :o)
> 

Generally this group is an appropriate placec to questions about Perl
programming however it is assumed that you have made some effort to
familiarise yourself with the docs and faqs that come with the Perl
distribution and also should have taken other steps to answer your question
such as searching DejaNews for previous articles in this group - if it is
suspected that you havent done thes things then you will be pointed toward
the relevant resource with varying degrees of friendliness <or not>.

Likewise if you have a question that would properly be asked in another
group such as CGI or web server matters then the only responses you
should expect are ones pointing you to the correct NG.

The definitive source of Perl information is http://www.perl.com/ which is
always a good place to start if you are seeking some information.

Have Fun

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Mon, 07 Dec 1998 19:13:32 +0100
From: Pep Mico <pep_mico@hp.com>
Subject: Perl examples
Message-Id: <366C1ACB.4F2750E8@hp.com>

Where can I found Perl Examples? I only found sites that only contais
CGI scripts and I'm interested to found other examples, more helpful for
a system admin.

Thaks in advance
pep_mico@hp.com




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

Date: Mon, 7 Dec 1998 13:46:02 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Perl examples
Message-Id: <MPG.10d5ec759dfe067498974f@news.scescape.net>

In article <366C1ACB.4F2750E8@hp.com>, pep_mico@hp.com says...
=> Where can I found Perl Examples? I only found sites that only contais
=> CGI scripts and I'm interested to found other examples, more helpful for
=> a system admin.

Let's see...

http://www.perl.com
http://www.perl.com/CPAN/modules/index.html
http://dir.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/
http://search.yahoo.com/bin/search?p=perl

=> Thaks in advance

HTH!

=> pep_mico

--Matthew


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

Date: 7 Dec 1998 19:28:59 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Perl script on apache
Message-Id: <74ha9r$du$1@gellyfish.btinternet.com>

On Mon, 07 Dec 1998 14:26:26 GMT rmaglich@my-dejanews.com wrote:
> I am trying to get a perl script to run on apache.  I know the script is
> being accessed and is doing some of it's work but the html in the script is
> not being displayed back to the client.  Does anyone know if there are any
> setting in the configuration that should be checked?  Any help would be
> appreciated.
> 

Without seeing the code its a little difficult to say anything really.

What happens when you run the program from the command line ?

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Mon, 07 Dec 1998 18:26:52 GMT
From: wagnerj@mercyhealth.com
Subject: Perl script to send a page (DOS/Windows)
Message-Id: <74h6l7$vel$1@nnrp1.dejanews.com>

I'd like to write a script that will send a certain number (say "555") to a
numeric pager every 15 minutes or thereabouts(don't ask why - it's a long
story).  Anyway, getting the looping part down is relatively easy.  What I'm
having problems doing is opening the COM port the modem is attached to and
having it send the DTMF tones.  Any thoughts?

Thanks in advance,
Joe Wagner
Muskegon, MI

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 07 Dec 1998 14:17:23 -0500
From: Tripp Lilley <tripp.lilley@perspex.com>
Subject: Re: Perl script to send a page (DOS/Windows)
Message-Id: <366C29C3.3231DF65@perspex.com>

wagnerj@mercyhealth.com wrote:

> I'd like to write a script that will send a certain number (say "555") to a
> numeric pager every 15 minutes or thereabouts(don't ask why - it's a long
> story).  Anyway, getting the looping part down is relatively easy.  What I'm
> having problems doing is opening the COM port the modem is attached to and
> having it send the DTMF tones.  Any thoughts?

You don't explicitly mention your platform, so I'll assume Win32 (since only
ex-DOS users call serial ports 'COM' ports ;-)). In which case, to answer
your specific question, you'll want to check out Win32::SerialPort (at CPAN:
/modules/by-module/Win32/Win32-SerialPort-0.13.tar.gz )

However, to answer your general question, which I infer to be "what's the best
way to send a page from Perl", I refer you to RFC 1861, describing the
"Simple Network Paging Protocol". If your paging provider does not have an
SNPP gateway already, I urge you to put the screws to them. If they whine,
tell them it's an open standard, and that there's sample SNPP -> IXO/TAP
gateway software out there.

ftp://ftp.isi.edu/in-notes/rfc1861.txt

http://www.hylafax.org/HylaFAQ/Q46.html

If they do support SNPP, then your work is done! Use Net::SNPP and you're
off. If they don't support SNPP, then your best bet is to ask them for the info
you need to dial directly in to their IXO/TAP port and push the pages directly
into their network. Then you can build your own SNPP gateway :-)




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

Date: Mon, 7 Dec 1998 18:41:23 -0000
From: "Mary O Mahony" <omahonym@indigo.ie>
Subject: perl zip
Message-Id: <74h7ge$eug$1@news.indigo.ie>

Could anyone please send me an up to date copy of perl in the zip format?





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

Date: 7 Dec 1998 19:06:12 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: PERL-FTP
Message-Id: <74h8v4$dn$1@gellyfish.btinternet.com>

On Mon, 07 Dec 1998 17:42:01 +0100 David Van den Brande <brandeda@se.bel.alcatel.be> wrote:
> 
<snip>

> In short: I need (an) ftp command(s) to get the latest modified file in
> a directory and
> copy it to a file (on my machine) witch is the concatenation of a string
> variable with the original filename.
> 

You should examine the possibility of using Net::FTP from the libnet suite
(available from CPAN) - this allows you to specify both remote and local
names for the transferred file.


/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 7 Dec 1998 19:26:52 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Perlscript timeout
Message-Id: <74ha5s$dr$1@gellyfish.btinternet.com>

On Mon, 07 Dec 1998 15:05:55 +0100 Ernst Christensen <e.christensen@netjob.dk> wrote:
> Hi
> I am using NT and IIS. How can I set the timeout of my perlscripts to fx
> 5 seconds. the reason is that sometimes i make a script width an
> infinite loop, that is running for ever
> 

On Unix you would be able to use alarm() but this is generally not an option
on NT - I would start asking myself why there is an infinite loop in your
program instead.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Mon, 07 Dec 1998 18:41:56 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: POSIX not found
Message-Id: <366c213b.2033323@news.skynet.be>

Bbirthisel wrote:

> Win95 is not POSIX
>compatible so it wouldn't work if you had it.

>What are you trying to accomplish with Posix.pm? TIMTOWTDI
>(and on Win95 you are frequently stuck with second, third, ... choices).

Ah. So Win95 is too stupid to know about floor().

	Bart.


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

Date: Mon, 7 Dec 1998 13:47:11 -0500
From: Ralph <rweaver@raex.com>
Subject: Question: Perl IRC Bot
Message-Id: <Pine.GSO.3.96.981207134603.17037C-100000@vectura.raex.com>

Does anyone know of a decent bot written in perl or how hard it would be
to extend an existing bots C/C++ code to use perl as an extensible part of
the bot? (so you can write scripts inside the bot).  Thanks for info in
advance.

Ralph



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

Date: 4 Dec 1998 18:30:14 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: usage of $_ within nested loops
Message-Id: <7499nm$q7q$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Randal Schwartz <merlyn@stonehenge.com> writes:
:foreach does (if that's the variable you're using to walk through the
:list).  grep does.  map does.  The others use the outer $_.

You mean, "other".

:Yup.  $_ got clobbered.

That's what "no underscore" is for. 

--tom
-- 
Can you sum up plan 9 in layman's terms? It does everything 
    Unix does only less reliably    --Ken Thompson


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

Date: Mon, 07 Dec 1998 19:20:11 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: usage of $_ within nested loops
Message-Id: <8c3e6r69pe.fsf@gadget.cscaper.com>

>>>>> "Tom" == Tom Christiansen <tchrist@mox.perl.com> writes:
Tom>     Randal Schwartz <merlyn@stonehenge.com> writes:
Tom> :foreach does (if that's the variable you're using to walk through the
Tom> :list).  grep does.  map does.  The others use the outer $_.

Tom> You mean, "other".

Uh, no, I meant what I typed.  "outer".  As in "not something
internal to the construct".  I make typos (sometimes a lot :-)
but that wasn't one of them.

print "Just another Perl hacker,"

-- 
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@teleport.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: 7 Dec 1998 18:16:12 GMT
From: "John Hankey" <monkey@chisp.net>
Subject: Which modules to use
Message-Id: <01be220d$a644d280$231faecf@loglady.owlscreech.com>

Which are the best Perl modules for

(1) Multi Threading

(2) Reading in HTML pages

I've looked at CSPAN and  know that there are several modules available,
but I was wondering what people have found to be the most useful.

	Thank you,

		John


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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