[8561] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2178 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 25 10:07:42 1998

Date: Wed, 25 Mar 98 07:00:46 -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           Wed, 25 Mar 1998     Volume: 8 Number: 2178

Today's topics:
    Re: - Limiting the length of a list on a page..... - <hex@voicenet.com>
        An easy question......? <cyberman@sonoma.edu>
    Re: Anybody experienced in File-Locking with Perl5? (Steffen Beyer)
    Re: books? scott@softbase.com
    Re: Calling all Newbies <gwynne@utkux.utk.edu>
    Re: Copy file command. (Hunter Johnson)
    Re: Copy file command. (Kevin Reid)
    Re: Copy file command. <barnett@houston.Geco-Prakla.slb.com>
    Re: crypt paranoia ? (Steffen Beyer)
    Re: Date::Manip  problem (Steffen Beyer)
    Re: Delete Files via Unlink on NT?? Help! <mark@imp.net>
    Re: Delete Files via Unlink on NT?? Help! <mark@imp.net>
    Re: Form Textarea and \n issue <webmaster@disconova.com>
    Re: Help sought with web programming security problem <wbrogden@bga.com>
    Re: Hmm...STDIN & inetd, what's up? (Jason Gloudon)
    Re: Interface to bp <pgdion@Nortel.ca>
    Re: Interpolating into a variable?  How to? <barnett@houston.Geco-Prakla.slb.com>
    Re: Is this wise way to do this? <webmaster@disconova.com>
    Re: Lazy question.. <camerond@mail.uca.edu>
    Re: Lazy question.. (Andy Lester)
    Re: LWP und Win32 ? (__Olivier__)
    Re: LWP und Win32 ? <jim.michael@gecm.com>
        Mimicking readdir (Stefaan A. Eeckels)
    Re: Netscape web server authentication problem <vallon@pearl.fi.bear.com>
    Re: Perl copy? (Jason Gloudon)
    Re: Perl Databases... <jdporter@min.net>
    Re: Perl on Win95 - CMD32 - File Length Restriction ? scott@softbase.com
    Re: Please help with ACGI vs. CGI in MacPerl (Chris Nandor)
    Re: Please help with ACGI vs. CGI in MacPerl (Chris Nandor)
    Re: Submitting to another CGI-Script <amar@iss-gmbh.de>
    Re: Using perl code as a config file syntax? (Or, can r <vallon@pearl.fi.bear.com>
    Re: Where to get Perl compiler for Win95 or Win NT? <merlyn@stonehenge.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 25 Mar 1998 12:43:03 GMT
From: Matt Knecht <hex@voicenet.com>
Subject: Re: - Limiting the length of a list on a page..... -
Message-Id: <rZ6S.1498$tR.3634280@news2.voicenet.com>

James <James@cydaps.nospam.co.uk> wrote:
> On Mon, 23 Mar 1998, Martin Vorlaender wrote:
>>James (James@cydaps.nospam.co.uk) wrote:
>>That's exactly what Randal Schwartz presents in his WebTechniques column
>>#2 at http://www.stonehenge.com/merlyn/col02.html
> Thanks for the URL, but when I tried it I got 404 file not found. I have
> managed to find col16.html and col22.html but no col02.html at the
> moment, any ideas??

Try using a shortened version of the URL such as:
http://www.stonehenge.com/merlyn and following the links on the page.
It shouldn't be difficult.

-- 
Matt Knecht <hex@voicenet.com>


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

Date: Wed, 25 Mar 1998 06:58:35 -0800
From: "David C. McCall" <cyberman@sonoma.edu>
Subject: An easy question......?
Message-Id: <35191B9B.A541D85F@sonoma.edu>

For PERL or CSH or SH,
What would be the easiest way to traverse down a filesystem and locate
occurances of foo, then replace a line in each foo like with sed -e
"s;blah;balh;".....

I know this must be simple but somehow I'm not getting the basics.....
thanks ahead of time....dmc




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

Date: 24 Mar 1998 13:04:35 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Anybody experienced in File-Locking with Perl5?
Message-Id: <6f8b13$o6l$1@en1.engelschall.com>

Tobias Bugala <TobiasBugala@swol.de> wrote:

> well I should lock a file so that only one process can access that file.

Maybe the following code snippet will help you:

(Each process that tries to access the common resource needs to pass this
code before actually accessing the resource!)

$self = $0;
$self =~ s!^.*/!!;

$lockfile = "/tmp/$self.lock";

# Wait for semaphore:

$wait = "true";

while ($wait)
{
    # Wait for semaphore to be released (if set):

    while (-f $lockfile) { sleep(5); }

    # When semaphore is gone, create our own:

    unless (open(LOCKFILE, ">>$lockfile"))
    {
        unlink($lockfile);
        die "$self: can't write semaphore '$lockfile': $!\n";
    }
    print LOCKFILE "$$\n";
    close(LOCKFILE);

    # Check wether semaphore is our's or was created
    # in the meantime by a concurrent process

    unless (open(LOCKFILE, "<$lockfile"))
    {
        unlink($lockfile);
        die "$self: can't read semaphore '$lockfile': $!\n";
    }
    chomp($_ = <LOCKFILE>);
    close(LOCKFILE);

    # Loop if semaphore isn't our's:

    $wait = ($_ != $$);
    if ($wait)
    {
        warn "Semaphore access conflict detected!\n";
        warn "Waiting for other process to terminate.\n";
    }
}

# Now access the resource which requires unique access:

# ... (your code here)

# Free the semaphore:

unlink($lockfile);

HTH.

Yours,
-- 
   Steffen Beyer <sb@sdm.de>
   Feel free to visit my web site at http://www.engelschall.com/u/sb/
   sponsored by the university of Zuerich (ETHZ) http://www.ethz.ch/


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

Date: 25 Mar 1998 13:43:52 GMT
From: scott@softbase.com
Subject: Re: books?
Message-Id: <6fb1mo$3oc$2@scully.new-era.net>

bob tokarsky (btokar@freespace.net) wrote:
> Can anyone recommend a good book for exploring PERL on a win95 system. 

Sure can. Go to www.skwc.com/essent/cyberreviews.html and
look for the Windows 95 Book FAQ.  I've tried to list
all the books that have anything to do with Perl on Windows.

>  I would like to learn Perl and CGI on my machine at home before i
> download my programs to the cgi-bin directory on my ISP.

This has nothing to do with Perl itself. I've never seen a single,
solitary book about getting Perl CGI scripts running under the Personal
Web Server or even IIS. (Anyone who would write this could
make a bundle of money, hint hint.)

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: Wed, 25 Mar 1998 08:57:47 -0500
From: "Bob Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: Calling all Newbies
Message-Id: <6fb2i3$gm0$1@gaia.ns.utk.edu>

May I also suggest working through Jon Orwant's Perl 5 Interactive Course.
Read it along with the other books, e.g., also read Mastering Regular
Expressions or Friedl's articles in The Perl Journal while working through
Chapter 2 of Orwant. Don't ask for help from clpm if you can't get an
exercise to work correctly. Instead, reread and rewrite until it works.
Asking for an answer may relieve stress, but it certainly doesn't contribute
to learning. Wrestling with the exercises and writing your own little
experimental programs will help you to internalize more.

Bob Gwynne

Birgitt Funk wrote in message <35172D70.DD83D6D3@order.booktraders.com>...
>Doug Evans wrote:
>
>
>>
>> I would like to propose, that we "Newbies" set up a mail list, designed
to
>> help each other. I am "all the way up" to p. 25, of Learning Perl on
Win32
>> systems-:), and have already run into a number of problems. By the way,
>> virtually every question that I have asked, on this newsgroup, was
>> answered, or led me to the answer, to my problem.
>>
>
>Why then ? You say yourself every question you had you got help with.
>What else can you ask for ?
>
>> Any takers?
>
>No way.
>
>I suggest you read to page 198 first, then you reread and then
>you read again...and then you read the index and then you read
>"Programming Perl" and then you read "Regular Expressions" and
>in between you read the FAQs. Great stuff, you know...
>
>Birgitt Funk




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

Date: 25 Mar 1998 14:07:26 GMT
From: jhunterj@lexis-nexis.com (Hunter Johnson)
Subject: Re: Copy file command.
Message-Id: <6fb32u$1ir@mailgate.lexis-nexis.com>

In article <35186C32.91198B45@golden.net>,  <tufgar@golden.net> wrote:

> Is there an actual command to copy or move files or do you have to
> write a small program?

There's a rename function, or you can make system function calls.

Hunter
--
J. Hunter Johnson        | "A little consistent wholesome modeling and
jhunterj@lexis-nexis.com |   costly servanthood are worth millions of
(937) 865-6800 x5385     |    true words harshly spoken."
Lexis-Nexis, Dayton, OH  |                               -- Ron Sider


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

Date: Wed, 25 Mar 1998 09:13:23 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Copy file command.
Message-Id: <1d6f0t3.1am5fle1ft8rr4N@slip166-72-108-57.ny.us.ibm.net>

<tufgar@golden.net> wrote:

> Hi,
>     Is there an actual command to copy or move files or do you have to
> write a small program?
> 
> Thanks in Advance.

File::Copy.

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


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

Date: Wed, 25 Mar 1998 08:11:43 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Copy file command.
Message-Id: <3519109F.BD415189@houston.Geco-Prakla.slb.com>

tufgar@golden.net wrote:
> 
> Hi,
>     Is there an actual command to copy or move files or do you have to
> write a small program?
> 
> Thanks in Advance.
The module File::Copy contains both a copy() and move() function.

I believe it to be part of the standard dist.  If not, you should be
able to get it from CPAN (http://www.perl.com/CPAN).

HTH.

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------


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

Date: 24 Mar 1998 21:14:59 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: crypt paranoia ?
Message-Id: <6f97oj$6rn$1@en1.engelschall.com>

*/chebs <chebs@elfin.org> wrote:

> I've been trying to use crypt on a win95 system and keep getting
> errors.

> I have been trying to use '$passwd = crypt($passwd,MW);'

> Perl keeps telling me I'm paranoid ?

No, it's telling you the U.S. government is paranoid and considers
the "crypt()" function a military weapon which may not legally be
exported. :-)    (No joke, alas!)

> 'The crypt() function is unimplemented due to excessive paranoia'

> I have looked through the docs but I can't find any mention of 
> having to configure anything special for win95 to use crypt

> Can anybody help? please

I think there's a "DES::Crypt" module on CPAN or so?

Check "The Perl 5 Module List" on http://www.perl.com/.

HTH.

Yours,
-- 
   Steffen Beyer <sb@sdm.de>
   Feel free to visit my web site at http://www.engelschall.com/u/sb/
   sponsored by the university of Zuerich (ETHZ) http://www.ethz.ch/


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

Date: 25 Mar 1998 06:57:25 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Date::Manip  problem
Message-Id: <6fa9sl$cq7$1@en1.engelschall.com>

David Walford <davewal@echo.engr.sgi.com> wrote:

> I am getting this error when I try and install and use Date::Manip

[...]

> I am building an online calendar, is there another library that you'd
> recommend to manipulate the dates?

Yes, definitely!

There is Date::DateCalc (which doesn't depend on any external modules),
available from CPAN (http://www.perl.com/CPAN/authors/id/STBEY/) or my
web site at http://www.engelschall.com/u/sb/download/.

Yours sincerely,
-- 
   Steffen Beyer <sb@sdm.de>
   Feel free to visit my web site at http://www.engelschall.com/u/sb/
   sponsored by the university of Zuerich (ETHZ) http://www.ethz.ch/


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

Date: Wed, 25 Mar 1998 08:38:24 -0500
From: "Mark Polakow" <mark@imp.net>
Subject: Re: Delete Files via Unlink on NT?? Help!
Message-Id: <6fb2fm$9s2$1@viper.america.net>

Thanks alot for your help Creede - you have definitely helped me understand
this more! I'm really tryin to get this perl stuff...
One more question for you if I may...

opendir(MYDIR, "$root$dir")
or die print "Unable to list the directory *$dir*, $!, check permissions.";
print "file" if ( -f "$root$dir/$file");
print "directory" if ( -d "$root$dir/$file " );
print "<a href=\"$baseurl/$dir/$file\">\n";
print  $file, "\n";

This code returns a directory listing marking files and directories but it
also returns those annoying dos dots (. and ..) in the listing (I am using
Perl on NT) and sees them as directories, they are actually navigation up a
level. Do you know of a piece of code I could use to exclude these in the
listing?

Thanks many times for all your help!




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

Date: Wed, 25 Mar 1998 08:36:54 -0500
From: "Mark Polakow" <mark@imp.net>
Subject: Re: Delete Files via Unlink on NT?? Help!
Message-Id: <6fb2cr$9ro$1@viper.america.net>

Thanks alot for your help Scott - you have definitely helped me understand
this more! I'm really tryin to get this perl stuff...
One more question for you if I may...

opendir(MYDIR, "$root$dir")
or die print "Unable to list the directory *$dir*, $!, check permissions.";
print "file" if ( -f "$root$dir/$file");
print "directory" if ( -d "$root$dir/$file " );
print "<a href=\"$baseurl/$dir/$file\">\n";
print  $file, "\n";

This code returns a directory listing marking files and directories but it
also returns those annoying dos dots (. and ..) in the listing (I am using
Perl on NT) and sees them as directories, they are actually navigation up a
level. Do you know of a piece of code I could use to exclude these in the
listing?

Thanks many times for all your help!




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

Date: Wed, 25 Mar 1998 13:52:19 -0800
From: Markku Uttula <webmaster@disconova.com>
Subject: Re: Form Textarea and \n issue
Message-Id: <35197C93.4240@disconova.com>

Geert Roovers wrote:
> therefore, there will be no newlines. It's a kind of psychology :o)

Unless the user for some reason or another chooses to press the
Enter-key. In this scenario, there are newlines. People don't care too
much about psychology or anything else for that matter when it comes to
ways they've used to be doing things :(
-- 
Markku Uttula             | "Jos haluu saada on pakko antaa!"
webmaster@disconova.com   | "Kukaan ei voi eldd vetdmdttd..."
http://www.disconova.com/ |                     - Mc Nikke T.


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

Date: Wed, 25 Mar 1998 08:03:39 -0500
From: William Brogden <wbrogden@bga.com>
Subject: Re: Help sought with web programming security problem
Message-Id: <351900AB.38B2@bga.com>

If the browser has received and displayed a gif file anybody can save
it.
Presumably a Java applet which checked where it was loaded from (and
possibly
did a dialog with the server) could display a synthesized "Seal of
Authenticity"
which did not have a corresponding GIF.

WBB


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

Date: Wed, 25 Mar 1998 14:18:51 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: Hmm...STDIN & inetd, what's up?
Message-Id: <slrn6hi4fp.i7a.jgloudon@manitoba.bbn.com>

Alan Curry <pacman@defiant.cqc.com> wrote:
>In article <6f8t47$bvd$1@blackice.winternet.com>,

<Very illuminating Information on telnet behaviour>

>Do you want to use \r\n in this protocol? If you do, then you need to use
>something other than chomp() to strip them off. If you don't, then you need
>to use something other than telnet as a test client.

If he wants to use \r\n in his protocol, which is a pretty standard thing
because it allows testing with telnet, he can still use chomp, he simply
has to tell chomp what to strip.

$/="\r\n"; # use English; $INPUT_RECORD_SEPARATOR = "\r\n";

while(<STDIN>){
chomp;
 .
 .
}

-- 
Jason Gloudon


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

Date: Wed, 25 Mar 1998 09:31:26 -0500
From: Paul-Guy Dion <pgdion@Nortel.ca>
Subject: Re: Interface to bp
Message-Id: <3519153E.14F5@Nortel.ca>

Jean-Baptiste CAZIER wrote:
> 
> Hi !
> 
> I have been using the bp library in Perl on my windoze95 machine and I
> am very happy with it.
> It works well but i must say that it lacks an interface.
> 
> Did anybody had the good idea to write one ?
> Or shall I spent the rest of my year to write one myself ?
> 
> Thanks
> 
> JB

Hi!

There is a user interface called Tk (for toolkit).
You can download it from:

ftp://ftp.iguide.com/pub/mirrors/packages/perl/CPAN/modules/by-module/

Next go under Tk and the version is there! Tk402.00x

The installation is quite easy usually so you should not have any
problems.


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

Date: Wed, 25 Mar 1998 08:09:20 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Interpolating into a variable?  How to?
Message-Id: <35191010.B88C023A@houston.Geco-Prakla.slb.com>

Keith G. Murphy wrote:
> 
> For example:
> 
> $planet = 'World';
> $greeting = <STDIN>; # $nice now is 'hello $planet/n'
> 
> How to do:
> 
> $greeting = interpolate($greeting);
> 
> and end up with 'Hello World'?
> 
> I've seen a solution involving sprintf, which seems to work fine.  Is
> there a simpler or more recommended way?  Haven't seen it in the docs.
How about the "." operator?

$greeting = $greeting . $planet;

or more compact
$greeting .= $planet;

HTH.

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------


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

Date: Wed, 25 Mar 1998 13:54:02 -0800
From: Markku Uttula <webmaster@disconova.com>
Subject: Re: Is this wise way to do this?
Message-Id: <35197CFA.3290@disconova.com>

Maybe you should check out 'Programming Perl' about ref() ?
-- 
Markku Uttula             | "Jos haluu saada on pakko antaa!"
webmaster@disconova.com   | "Kukaan ei voi eldd vetdmdttd..."
http://www.disconova.com/ |                     - Mc Nikke T.


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

Date: Wed, 25 Mar 1998 07:55:33 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: NIALL JAMES SELETZKY <njh4@aber.ac.uk>
Subject: Re: Lazy question..
Message-Id: <35190CD5.41CBD9A8@mail.uca.edu>

[cc'd to njs]

NIALL JAMES SELETZKY wrote:
> 
> Hi,
> 
> I need to knock up a quick Perl script for my final year dissertation. I don't want to learn Perl, as I prefer Java script, but for the scope of this project, Perl is neccesary.

Well, at least you're honest. But, if I send you a script, can I have
your degree? I wouldn't want to do all that work for nothing, just as
sure as you don't want to do all that work for something.

> My questions are can a file output routine exist in the same script, using the same data, with a routine that formats and sends emails?

Sure.

> Can anyone point me to a complete (simple) Perl file IO routine, that will receive name value pairs and format them into a logfile?

Undoubtedly, but, as the FAQ states, "Sure, but you probably can't
afford our contracting rates :-)", especially as a student. (perlfaq9)

> 
> Thanks in advance.

Anytime.

> Niall Seletzky.

Cameron
camerond@mail.uca.edu


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

Date: 25 Mar 1998 14:26:05 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: Lazy question..
Message-Id: <6fb45t$35u$1@usenet87.supernews.com>

: I need to knock up a quick Perl script

I suspect you misunderstand how one creates child processes.

xoxo,
Andy

--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: 25 Mar 1998 12:37:07 GMT
From: omueller@stud.ee.StoPx.ch (__Olivier__)
Subject: Re: LWP und Win32 ?
Message-Id: <slrn6hhu9k.djq.omueller@tardis-e3.ee.ethz.ch>

<genepool@netcom.com> ecrivait/schrieb/wrote:
>__Olivier__ (omueller@stud.ee.StoPx.ch) wrote:
>: This is maybe a stupid question, but is it possible to use LWP modules 
>: in a Perl script running under Windows ? 
>Not only is it possible, LWP comes as part of the Standard Win32 
>distribution. HTH.

Eh? Then could you please tell me where is for example
the UserAgent.pm file ? I also installed the last Win32
version of perl, but there are no LWP directory... 

I'll keep looking,
Olivier

-- 
Olivier Mueller    |  omueller@stud.ee.SToPx.ch 
EE Student @ ETHZ  |  http://www.stud.ee.ethz.ch/~omueller
 ...Please replace "SToPx" by "Ethz" in my email to reply...


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

Date: Wed, 25 Mar 1998 09:13:42 -0500
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: LWP und Win32 ?
Message-Id: <35191116.2A5A@gecm.com>

__Olivier__ wrote:
> 
> Eh? Then could you please tell me where is for example
> the UserAgent.pm file ? I also installed the last Win32
> version of perl, but there are no LWP directory...

My distribution is from:

http://www.perl.com/CPAN-local/ports/win32/Standard/x86/perl5.00402-bindist04-bc.zip

My LWP is under d:/Perl/lib/site/LWP and UserAgent.pm is located there. 

Cheers,

Jim


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

Date: 25 Mar 1998 13:59:34 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A. Eeckels)
Subject: Mimicking readdir
Message-Id: <6fb2k6$t03$1@justus.ecc.lu>

Hi,

I'm still busy writing my module to access an API
looking like the UNIX file system interface (this is
ultimately meant to run on NT ;-). I've duplicated the
readdir function, and came up with the following hack
to mimick readdir's behaviour (return a single entry
when called in a scalar context, return an array when
called in a list context.

(Obvious stuff deleted - this is an .xs file)

void
readdir(handle)
  int handle
CODE:
  SV* sv;

  if (GIMME == G_ARRAY)
  {
    POPs;
    while (S_READ(OpenDir[handle].handle,
    	(char *)&dirEntry, sizeof(dirEntry)) > 0) {
      if (dirEntry.name[0] != '\0') {
        sv = newSVpv(dirEntry.name, 0);
#ifdef INCOMPLETE_TAINTS
        SvTAINTED_on(sv);
#endif
        XPUSHs(sv_2mortal(sv));
      }
    } 
  } else {
    if (S_READ(OpenDir[handle].handle,
    	(char *)&dirEntry, sizeof(dirEntry)) > 0) {
      if (dirEntry.name[0] != '\0') {
        sv = newSVpv(dirEntry.name, 0);
#ifdef INCOMPLETE_TAINTS
        SvTAINTED_on(sv);
#endif
        XPUSHs(sv_2mortal(sv));
      }
      OpenDir[handle].pos = S_TELL(OpenDir[handle].handle);
    } else {
      S_SEEK(OpenDir[handle].handle, 0L, SEEK_SET);
    }
  }
  PUTBACK; NORMAL;
  return;


It works, but I realize this is a terrible hack - is there a
better way to do this? I'm really scared of the POPs to get
the standard XS return value off the perl stack.

Thanks for comments, hints and insight.

-- 
Stefaan
-- 

PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
  "Don't worry about people stealing your ideas.  If your ideas
   are any good, you'll have to ram them down people's throats."
                                                -- Howard Aiken


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

Date: 25 Mar 1998 07:25:01 -0500
From: Justin Vallon <vallon@pearl.fi.bear.com>
Subject: Re: Netscape web server authentication problem
Message-Id: <x6ek99jlzz6.fsf@pearl.fi.bear.com>

Try printing the keys and values of the hash that Netscape produces.
That may give you some indication of what a `correct' file looks like.

Then, try building a new hash file from scratch using the data you 
dumped from the `good' file, and try using it.

Then, figure out if you are crypt'ing things correctly.

 ...Though you might have done this already.

Lewis Chan <lewis@netvigator.com> writes:

> I've created an access control by using the Netscape web admin
> interface. It actually created a .pag file under the authdb directory
> and it works fine.
> 
> But I need to manipulate the authentication by some cron jobs. So I try
> to make such file using the following perl script with same id and
> password as I used in web admin.

-- 
-Justin
vallon@bear.com


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

Date: Wed, 25 Mar 1998 13:57:54 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: Perl copy?
Message-Id: <slrn6hi38g.i7a.jgloudon@manitoba.bbn.com>

Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>Only if you don't care to figure out what went wrong.  That module is
>broken in that it doesn't tell you what didn't work if there is an error.
>Doing a manual copy with sysread and syswrite per the documentation,
>or simply using system("cp") the way God and Dennis intended, is a
>more robust solution.  And no, I don't care about Windows.  It's its
>own punishment.

I take it the author is aware of their broken module design ?
The version I have installed attempts to preserve $! from the failed operation 
though alone doesn't is not really sufficient.

-- 
Jason Gloudon


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

Date: Wed, 25 Mar 1998 09:14:43 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Perl Databases...
Message-Id: <35191153.3159@min.net>

Bill Lewis wrote:
> 
> %info = $key => $value;

I don't know of *any* programming languages that allow an
assignment expression such as "x = foo" which *don't*
completely overwrite the previous value of x.

John Porter


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

Date: 25 Mar 1998 13:47:40 GMT
From: scott@softbase.com
Subject: Re: Perl on Win95 - CMD32 - File Length Restriction ?
Message-Id: <6fb1ts$3oc$3@scully.new-era.net>

James R. Matey (jmatey@sarnoff.com) wrote:

> Under Win95, it fails to process the tail end of a ~24 MB
> file.  I am processing the file line by line, so that there
> is no issue of running out of memory.  There is no error 
> message - the program simply behaves as if it had run into
> an EOF before it reaches the end of file.

Is this a *binary* file? You could be hitting a Control-Z that's
tripping up the stdio library Perl was recompiled with. Perl has
a function (that may be specific to Windows) to make sure the file
is being read in binary mode. 

I hit this same problem when I ported a UNIX library to Win32.
The first Ctrl-Z, and the thing exited like it had hit EOF!
I had to change all my fopen's to use binary mode.

If it's a text file, I don't know what to tell you. I've
processed web logs bigger than 24MB, I'm sure.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: Wed, 25 Mar 1998 08:43:03 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Please help with ACGI vs. CGI in MacPerl
Message-Id: <pudge-2503980843040001@ppp-6.ts-1.kin.idt.net>

In article <3516BDC6.157D@facstaff.wisc.edu>, Mark Gosink
<mmgosink@facstaff.wisc.edu> wrote:

# Hello netters:
#         I have been running into alot of trouble with a 32k limit to my
# output in a CGI application written in MacPerl to run on MacHTTP. I
# have heard that it is possible to get around this limit by using
# ACGI applications instead of CGI. Unfortunately, I know nothing about
# ACGI except that the A stands for asynchronous. If anyone could point
# me to a location where I could find out more on how to create ACGI
# applications I would appreciate it. (Do I need any additional plugins
# with MacPerl to create them?)
#         Alternatively, if someone knows of Mac server software that is
# free or inexpensive that would not have these limits please let me
# know.

Please see the draft chapter on CGI available for review at:

    http://www.ptf.com/macperl/ptf_book/draft.html

It should answer most of your questions.  As to free/inexpensive, Quid Pro
Quo and NetPresenz and MacHTTP are a few.

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: Wed, 25 Mar 1998 08:44:43 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Please help with ACGI vs. CGI in MacPerl
Message-Id: <pudge-2503980844440001@ppp-6.ts-1.kin.idt.net>

In article <alecler-2403980000130001@dialup-659.hip.cam.org>,
alecler@cam.org (Andre L.) wrote:

# So, if there is someone who's knowledgeable on MacPerl, is there or is
# there not a limit to the size of data structures (scalars, arrays,
# hashes...) in the Mac implementation of Perl? Is there a way to deal with
# this? I have seen nothing, in any doc, module or read-me file in the
# MacPerl 5.004 distribution, about this problem. 

In general, you are limited by available memory, just like Unix perl.  It
is complicated in MacPerl by the fact that the application cannot
dynamically allocate more memory as needed; if you give the app only 4MB
of RAM, that's all it gets.

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: Wed, 25 Mar 1998 14:14:00 +0100
From: Amar Subramanian <amar@iss-gmbh.de>
To: Webmaster <wv@earthling.net>
Subject: Re: Submitting to another CGI-Script
Message-Id: <35190318.6B30@iss-gmbh.de>

Hello Webmaster ;-),
> 
> 
> how can one Perl-Script submit FORM-Data to another
> CGI-Script (on another server)?
> E.g.: Submit Website-Data to multiple Searchengines.
> 
You can use a direct TCP/IP conneciton to another Web-Server and
implement the HTTP Protocol on your own. This is already done and
available as a package of modules and is called libwww and it is
very easy to handle. It must be on
every CPAN mirror, look out for it and get the recent version. 


regards amar


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

Date: 25 Mar 1998 07:01:27 -0500
From: Justin Vallon <vallon@pearl.fi.bear.com>
Subject: Re: Using perl code as a config file syntax? (Or, can require return more then one value?)
Message-Id: <x6elntzm12g.fsf@pearl.fi.bear.com>

Zenin <zenin@archive.rhps.org> writes:

> Martin Gregory <mgregory@asc.sps.mot.com> wrote:
> : Although a numbr of solutions to the question of 'how to do this with
> : require' have been suggested, there is indeed a "Better Way(TM)".  Use
> : a package:
> 
> 	I think you meen module, not package (packages exist in required
> 	files as well, infact they exist everywhere even if you don't ask
> 	for them).

What about defining a configuration interface, rather than worrying 
about what the global is named?  Then, use the config package in the
caller (main program) and the config file.

Caller:

    package Config;

    sub EnableVerbose { $Config::Opts{'verbose'} = 1; }
    sub AddIncludeDir { push @Config::Dirs, @_; }

    sub GetIncludeDirs { return @Config::Dirs; }
    sub GetVerbose { return $Config::Opts{'verbose'}; }

    sub Reset { undef @Config::Dirs; undef $Config::Opts; }
    sub Read { local ($file) = @_; Reset; require $file; }

Config file:

    Config::AddIncludeDir "/usr/include";
    Config::EnableVerbose;
    1;

Then:

    Config::Read 'config.file';
    local @dirs = Config::GetIncludeDirs;
    local $verbose = Config::GetVerbose;

That allows you to define the interface, then you can define whatever
you want for management of multiple config files, or even have a config
file writer:

    sub Write { print "Config::EnableVerbose" if Config::GetVerbose;
                print "Config::AddIncludeDir " . join ",", @Config::Dirs; };

It would also make the config file much more readable.  Consider the
above file vs:

push @Config::Dirs, "/usr/include";
$Config::Opts{'verbose'} = 1;
1;

-- 
-Justin
vallon@bear.com


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

Date: 25 Mar 1998 07:48:32 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: jgloudon@bbn.com
Subject: Re: Where to get Perl compiler for Win95 or Win NT?
Message-Id: <8cg1k6hlmn.fsf@gadget.cscaper.com>

>>>>> "Jason" == Jason Gloudon <jgloudon@manitoba.bbn.com> writes:

Jason> An official "compiler" for Perl has not been released for any platform.

Not so.

Jason> Perl is normally -interpreted-. That's lesson 1. 

Not so.  Not in the pure sense of "interpreter".

Perl is as compiled/interpreted as Java is.  If you call Java
compiled, you must call Perl compiled (I do).  If you call Perl
interpreted (referring to the fact that it only compiles down to a
virtual machine code, which then must be emulated), then you must also
call Java interpreted.

So, the first Perl "compiler" existed in Perl version 0, about 11
years ago, and no version of Perl ever shipped has been "interpreted".

QED  EIEIO.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 160 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@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: 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 2178
**************************************

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