[13355] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 765 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 11 16:07:31 1999

Date: Sat, 11 Sep 1999 13:05:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 11 Sep 1999     Volume: 9 Number: 765

Today's topics:
        /etc/passwd <SternSZ@gmx.de>
    Re: /etc/passwd <ubu@easynet.ca>
    Re: /etc/passwd (Abigail)
    Re: /etc/passwd <rootbeer@redcat.com>
    Re: @INC (David Efflandt)
    Re: Accessing DB2/400 from perl on Linux <gellyfish@gellyfish.com>
        baffle about flock() please help! (Ryan Ngi)
    Re: baffle about flock() please help! <collin.starkweather@colorado.edu>
    Re: buying perl book (Help me) <gellyfish@gellyfish.com>
    Re: Design Advice needed on Sending Data to Client <gellyfish@gellyfish.com>
        Does Perl have a Y5.760K problem? <jeff@vpservices.com>
    Re: File IO Question <rootbeer@redcat.com>
    Re: File IO Question <gellyfish@gellyfish.com>
    Re: Find 'sendmail' with only ftp... <gellyfish@gellyfish.com>
    Re: Good databases for multi-variate timeseries data? (Abigail)
    Re: Help!  My perl cgi script truncates my download cou <rootbeer@redcat.com>
    Re: How do I load libraries from a non-default path ?? <gellyfish@gellyfish.com>
    Re: How to perform nslookup functions in perl? <tchrist@mox.perl.com>
    Re: Non-blocking I/O? <ehpoole@ingress.com>
        Object Cloning Help <asquith@macconnect.com>
    Re: passing variables in URL without ? <rootbeer@redcat.com>
    Re: Perl HTML Grabbing <ehpoole@ingress.com>
    Re: Perl ISAPI Not Working:  script product no output <ehpoole@ingress.com>
        Perl output to browser euan_woo9431@my-deja.com
        Pros/cons of using Perl vs. C to develop web site? (Jim)
    Re: Pros/cons of using Perl vs. C to develop web site? <collin.starkweather@colorado.edu>
    Re: Pros/cons of using Perl vs. C to develop web site? <jll@enterprise.newedgeconcept>
    Re: Question: How to send large (3+ MB) emails via Net: <ehpoole@ingress.com>
    Re: Removing a line from a text file <gellyfish@gellyfish.com>
    Re: UNCRAP project proposal (Randal L. Schwartz)
    Re: UNCRAP project proposal (Abigail)
    Re: Y2K bugs on the Internet (Lawrence Kirby)
    Re: Zipping <rootbeer@redcat.com>
    Re: Zipping <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 11 Sep 1999 19:00:04 +0200
From: Benjamin Schweizer <SternSZ@gmx.de>
Subject: /etc/passwd
Message-Id: <m3r9k5qt7v.fsf@anthrax.local.net>

Hello,

I´ve written a little user management in perl/html and need to check
passwords. Is there a method to encrypt a string like Linux´
/etc/passwd ist encrypted or even a complete method for checking
accounts?



regards
  -Benjamin

-- 
/* printf("Welcome to Windows 3.11"); */
/* printf("Welcome to Windows95"); */
printf("Welcome to Windows98");


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

Date: Sat, 11 Sep 1999 18:33:06 GMT
From: Ubu <ubu@easynet.ca>
Subject: Re: /etc/passwd
Message-Id: <7re791$gr2$1@nnrp1.deja.com>

In article <m3r9k5qt7v.fsf@anthrax.local.net>,
  Benjamin Schweizer <SternSZ@gmx.de> wrote:
> Hello,
>
> I´ve written a little user management in perl/html and need to check
> passwords. Is there a method to encrypt a string like Linux´
> /etc/passwd ist encrypted or even a complete method for checking
> accounts?
>
You can use perl's crypt function to encrypt a string and compare it to
what you have in your password file, but if this (as you seem to be
saying) a CGI program, you need to consider whether you want your web
server to have access to your password file. If for some reason you
decide you do, you can encrypt the plaintext password as follows
(assuming you've already gotten the encrypted password from the password
file):

if(crypt($plaintext, $encrypted) eq $encrypted)
{
  # Password matches
}

Hope this helps,

Barry


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 11 Sep 1999 14:06:36 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: /etc/passwd
Message-Id: <slrn7tla71.5ou.abigail@alexandra.delanet.com>

Benjamin Schweizer (SternSZ@gmx.de) wrote on MMCCII September MCMXCIII in
<URL:news:m3r9k5qt7v.fsf@anthrax.local.net>:
\\ 
\\ I´ve written a little user management in perl/html and need to check
\\ passwords. Is there a method to encrypt a string like Linux´
\\ /etc/passwd ist encrypted

What part of the manual about crypting passwords didn't you understand?

\\                           or even a complete method for checking
\\ accounts?


What is "a complete method for checking accounts"? Retina scans?



Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sat, 11 Sep 1999 12:51:54 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: /etc/passwd
Message-Id: <Pine.GSO.4.10.9909111250580.16999-100000@user2.teleport.com>

On 11 Sep 1999, Benjamin Schweizer wrote:

> Is there a method to encrypt a string like Linux=B4 /etc/passwd ist
> encrypted or even a complete method for checking accounts?

It sounds as if you want the crypt function from the perlfunc manpage. But
you may also want getpwuid, getpwnam, or the *pwent functions. Good luck!

--=20
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 11 Sep 1999 17:02:14 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: @INC
Message-Id: <slrn7tl2ol.1ku.efflandt@efflandt.xnet.com>

On Wed, 08 Sep 1999 18:32:57 GMT, missymanning@my-deja.com
<missymanning@my-deja.com> wrote:
>I am converting a script from unix to nt and having some
>problems...please help me.
>
>My script is trying to run and gives me this:
>
>[Wed Sep 8 14:13:36 1999] Record.pm: Can't locate Record.pm in @INC
>(@INC contains: C:/Perl/lib
>C:/Perl/site/lib .) at F:\Inetpub\wwwroot\staging\cgi-bin\doadmin.pl
>line 61. BEGIN
>failed--compilation aborted at
>F:\Inetpub\wwwroot\staging\cgi-bin\doadmin.pl line 61.
>
>I realize that it is not finding the file.  The file is located in the
>cgi-bin and my code calls it here:
>
>unshift(@INC, "/cgi-local/matrix1000");

You have to get it into @INC at precompile time and that will NOT do it.
And the path does not look right either, you need a full or relative
system path (not URL path).  Try this if cgi-local is a sub of cgi-bin:

use lib "./cgi-local/matrix1000";

However you should use a full path if you might move the doadmin.pl to a
different directory or current dir is uncertain.  For example:

use lib "F:/Inetpub/wwwroot/staging/cgi-bin/cgi-local/matrix1000";

It doesn't matter that the slashes are leaning the wrong way for NT, Perl
understands and it save having to escape them all.

-- 
David Efflandt   efflandt@xnet.com   http://www.xnet.com/~efflandt/
http://www.de-srv.com/   http://cgi-help.virtualave.net/
http://thunder.prohosting.com/~cv-elgin/


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

Date: 11 Sep 1999 20:16:26 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Accessing DB2/400 from perl on Linux
Message-Id: <7redaq$o5$1@gellyfish.btinternet.com>

In comp.lang.perl.misc Juan Riera <jriera@retemail.es> wrote:
> hello,
> Does anybody knows if is there any way of accessing DB2/400 data on an
> AS/400 server from a perl CGI script on a linux box? I have worked with
> DBI/DBD for MySQL.
> 

There may be some way of doing this but some service is going to have
to be provided on the AS/400 - you might be able to implement something
using the AS/400 port of Perl.  

/J\
-- 
Jonathan Stowe <jns@gellyfish.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: Sat, 11 Sep 1999 19:35:29 GMT
From: ryanngi@hotmail.com (Ryan Ngi)
Subject: baffle about flock() please help!
Message-Id: <37daabe6.29045007@news.inet.co.th>

i do this

open(FILE,"test.xxx");
flock(FILE,2);

sleep(3600);

flock(FILE,8);
close(FILE);

and then ,i use the command line like this
% cat test.xxx

ooh ... successful cat test.xxx ......... i think
it should access denied or something unsuccessful 'cuz it's lock....

did i do anything wrong?

i've read from many source but can't correct this ,please help.......!


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

Date: Sat, 11 Sep 1999 13:47:17 -0600
From: Collin Starkweather <collin.starkweather@colorado.edu>
To: Ryan Ngi <ryanngi@hotmail.com>
Subject: Re: baffle about flock() please help!
Message-Id: <37DAB1C5.ED971CA0@colorado.edu>

The first thing you should do is use Fcntl to make sure you've got your
constants right (though chances are LOCK_EX is 2 as you suppose) and the
second thing is test the lock with LOCK_NB:

use Fcntl qw(:flock);
open(FILE,"test.out");
print "Locking test.out . . .\n";
flock(FILE,LOCK_EX|LOCK_NB) || die "Couldn't lock test.out:  $!";
sleep(3600);
flock(FILE,LOCK_UN);
close(FILE);

This works just fine on my WinNT box:

From one prompt,

    g:\olsonco\perl>flock.pl
    Locking test.out . . .

From the other,

    G:\olsonco\perl>type test.out
    The process cannot access the file because
    another process has locked a portion of the file.

    G:\olsonco\perl>cat test.out
    cat: test.out: Input/output error

The nonblocking constant means if I try to lock it with another process
I get

    G:\olsonco\perl>flock.pl
    Locking test.out . . .
    Couldn't lock test.out:  Domain error at G:\olsonco\perl\flock.pl
line 4.

instead of just a hung process.

Hope this helps!

-Collin

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Collin Starkweather                                 (303) 492-4784
University of Colorado            collin.starkweather@colorado.edu
Department of Economics          http://ucsu.colorado.edu/~olsonco
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Ryan Ngi wrote:
> 
> i do this
> 
> open(FILE,"test.xxx");
> flock(FILE,2);
> 
> sleep(3600);
> 
> flock(FILE,8);
> close(FILE);
> 
> and then ,i use the command line like this
> % cat test.xxx
> 
> ooh ... successful cat test.xxx ......... i think
> it should access denied or something unsuccessful 'cuz it's lock....
> 
> did i do anything wrong?
> 
> i've read from many source but can't correct this ,please help.......!


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

Date: 11 Sep 1999 19:07:36 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: buying perl book (Help me)
Message-Id: <7re99o$md$1@gellyfish.btinternet.com>

On 10 Sep 1999 10:06:30 PST Neil wrote:
> sine2117@my-deja.com wrote:
>> Hello, anyone have a good tip of a nice perl book. like perl cookbook or
>> something ?
> 
> These are the standard introductory books:
> 
> "The Perl Cookbook" is an introductory learn-by-example book.

I for one would take issue with that descripton of the book : I quote from
the preface:

  "Its for people who know the basics but are wondering how to mix all
   those ingredients  together into a complete program."

Anyhow I would recommend seeing <http://reference.perl.com/query.cgi?books>.

/J\
-- 
Jonathan Stowe <jns@gellyfish.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: 11 Sep 1999 19:35:57 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Design Advice needed on Sending Data to Client
Message-Id: <7reaut$mh$1@gellyfish.btinternet.com>

[The useless alt.www.webmaster and the defunct comp.lang.perl removed]

In comp.lang.perl.misc Caitlyn Hay <caithay@hotmail.com> wrote:
> I'm new to internet programming.  I have to write a server program that
> interacts with a client program.  Basically, the client program will submit
> a criteria to the server via a http connection.  Based on this criteria, the
> server will generate some ASCII formated data, and return it (the ASCII
> data) back to the client.
> 

If you are setting out to use HTTP to do this then you want to look at the
appropriate RFC describing that protocol - RFC1945 describes HTTP 1.0 . 

There are other RFC regarding later work on the protocol but all of these
can be found via <http://www.rfc-editor.org>.

I would read the protocol specification and then make some code and then
when or if you have some problems with it then (of course after having
read the Perl documentation) please feel free to post a question here.

/J\
-- 
Jonathan Stowe <jns@gellyfish.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: 11 Sep 1999 16:46:17 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Does Perl have a Y5.760K problem?
Message-Id: <37DA865B.688B9C4A@vpservices.com>

I booted up ok this morning, but one can never be too paranoid.  The
FAQs are silent on this.  Does Perl have a Y5.760K problem?

-- 
Jeff
perl -e "print 'Happy New Year'"


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

Date: Sat, 11 Sep 1999 12:49:52 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: File IO Question
Message-Id: <Pine.GSO.4.10.9909111248210.16999-100000@user2.teleport.com>

On Sat, 11 Sep 1999, John J. Straumann wrote:

> Any idea what I am missing here?

If you can put together a small, self-contained test program which shows
your problem, we may be able to do something to help you. The program
should be no more than about a dozen lines of code, and should be written
so that -w and 'use strict' don't cause any complaints, if possible. Good
luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 11 Sep 1999 19:45:10 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: File IO Question
Message-Id: <7rebg6$np$1@gellyfish.btinternet.com>

On Sat, 11 Sep 1999 11:03:22 -0400 John J. Straumann wrote:
> Hey All:
> 
> I have a simple program that outputs some data to a file. 
> 
> When I tried this:
> 
> if ( open( outFile, ">>$dataFile" ) )           
> {
>   for ( $r=0; $r<25; $r++ )
>   {
>     print outFile ( "$input[ $r ]" );
>   }
>   close( outFile );
> }
> 
> it doesn't work, only prints the first data element and then nothing...
> 

<snip>

> Any idea what I am missing here?
> 

Using idiomatic Perl might help:

for ( @input )
  {
   print outFile $_ ;
  }

You might also consider using an ALL UPPERCASE FILEHANDLE.

/J\

-- 
Jonathan Stowe <jns@gellyfish.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: 11 Sep 1999 18:52:46 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Find 'sendmail' with only ftp...
Message-Id: <7re8du$m7$1@gellyfish.btinternet.com>

On 11 Sep 1999 12:47:29 +0200 Villy Kruse wrote:
> 
> Jonathan Stowe  <gellyfish@gellyfish.com> wrote:
> 
> 
>>*I* suspect that most systems that actually have a /usr/sbin and have 
>>sendmail installed there will have linked /usr/lib/sendmail as well.
> 
> 
> 
> And if you don't you can make one.
> 
> You have the same problem with:
> 
> #!/usr/local/bin/perl
> 
> versus
> 
> #!/usr/bin/perl
> 
> 
> Fix it once and for all with a symlink, until someone can authoritatively
> say which is the one and only correct form.
> 

A Recent Perl should have prompted you at configuration time whether you
wanted to do that.

/J\
-- 
Jonathan Stowe <jns@gellyfish.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: 11 Sep 1999 14:14:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Good databases for multi-variate timeseries data?
Message-Id: <slrn7tlalf.5ou.abigail@alexandra.delanet.com>

holmberg@NoSpam.net (holmberg@NoSpam.net) wrote on MMCCII September
MCMXCIII in <URL:news:37da3cf3.4624861@news.tiac.net>:
&& Hi,
&& 
&& Are there any good databases optimized for time-based data (like large
&& collections of time-stamped SNMP data)?  The inherent time-organization of su
&& data, and the typical need to process  blocks of data within given
&& time-boundaries (selected by other criteria as well) gives this kind of data
&& special properties.

Really? If times are stored as units since an epoch, what makes times
more special than oh, say, hairs on a persons body?

&& I've typically used simple time-sorted, flat-file organizations, since
&& this lends itself to very rapid streaming processing, but this creates its ow
&& management problems.  I'd be interested if there are any other good
&& alternatives, especially ones that can work with Perl and that have operation
&& that 'understand' the semantics of time, interval-data, etc.
&& 
&& In the past, I haven't found good solutions that scale to large, dynamically
&& growing databases, that are efficient,  but I haven't looked recently.

I don't think Sybase or Oracle will have problems anywhere near the point
you get into problems with your flat-files. Now, if you hit 10 million
rows, and are using a lowly Sparc 4 with 500 users, you might notice a
small hiccup. Of course, this has not much to do with Perl anymore.

Of course, there are many reason you would prefer Sybase or Oracle (or
any real database server) over flat-files that are much more important
than speed.


Abigail
-- 
sub A::TIESCALAR{bless\my$x=>A};package B;@q=qw/Hacker Another
Perl Just/;use overload'""'=>sub{pop @q};sub A::FETCH{bless\my
$y=>B}; tie my $shoe => 'A';print "$shoe $shoe $shoe $shoe\n";


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sat, 11 Sep 1999 12:42:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Help!  My perl cgi script truncates my download counter to zero length
Message-Id: <Pine.GSO.4.10.9909111230360.16999-100000@user2.teleport.com>

On Fri, 10 Sep 1999, Alan Borgolotto wrote:

> Do you know of any reason why an htm file, with permissions of
> rw-rw-rw-, can get truncated to zero length?

Yes; essentially any process on your system could be doing it. Maybe those
permissions should have fewer w's.

> #!/usr/bin/perl

I recommend using -w (at least during development) and 'use strict'
(always, on a program like this).

> print "Location: ../Godsbook.zip\n\n";
> 
> $file = "../downloads.htm";
> $mark = "wdp";
> 
> open(MAIN,"$file") || die $!;
> flock(MAIN,1);
> @main = <MAIN>;
> flock(MAIN,8);
> close(MAIN);

That unlock operation is a waste of time; closing the file releases the
lock every time. But now that you've released the lock, another process
could come along and start updating the file - you haven't gained what you
hoped to gain by using locking after all.

> open(MAIN,">$file") || die $!;

Now you've wiped out your file...

> flock(MAIN,2);

 ...and while you're waiting for the lock to be granted, your other process
is wondering where the file went.

> foreach $main_line (@main)
> 
>   if ($main_line =~ /<!--$mark--(.*)-->/) {
>      $count=$1+1;
>      print MAIN "<!--$mark--$count-->$count\n";
>   }
>   else {
>      print MAIN "$main_line";
>   }
> }
> flock(MAIN,8);
> close(MAIN);

And here, since you were writing the file, the lock is released before the
buffer is flushed (most likely truncating the file, in effect).

When updating a file using flock in Perl, unless you're enough of an
expert to make your own rules, do these steps in this order and you should
be fine.

    0. Note that there's no "release the lock" step on this list
    1. Open the file read/write ("+<myfile")
    2. Acquire the exclusive lock (LOCK_EX or 2)
    3. Do any needed reading, writing, or both
    4. Close the file quickly; someone's waiting for a turn

Good luck with it!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 11 Sep 1999 19:50:19 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How do I load libraries from a non-default path ??
Message-Id: <7rebpr$ns$1@gellyfish.btinternet.com>

On Fri, 10 Sep 1999 20:17:03 -0500 mike@yawp.com wrote:

<snip>

like :

use lib '/path/where/the/modules/are';

?

/J\
-- 
Jonathan Stowe <jns@gellyfish.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: 11 Sep 1999 13:37:37 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to perform nslookup functions in perl?
Message-Id: <37daaf81@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Jonathan Stowe <gellyfish@gellyfish.com> writes:
:backticks there (' ` - yep :) but I think I know why: is it your .vimrc that
:has map ` ^[[   ?

yep.  urk.

--tom
-- 
You have to admit that it's difficult to misplace the Perl sources.  :-)
		--Larry Wall in <1992Aug26.184221.29627@netlabs.com>


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

Date: Sat, 11 Sep 1999 13:46:55 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: Non-blocking I/O?
Message-Id: <37DA958F.560A504F@ingress.com>

Trond Kjernåsen wrote:
> 
> Hi,
> can anyone explain to me how I can set a file descriptor to non-blocking
> in ActivePerl under WindowsNT? I can't get the Fcntl module to work,
> which
> I've used successfully under Linux. The following error message is
> printed
> out:
> "Your vendor has not defined Fcntl macro F_SETFL, used at ..."

Which version of Perl are you using?

Fcntl.pm was largely undefined until the recent 5.005xx releases from
ActiveState.  Prior to the latest versions, many Fcntl values were missing
for NT, since then, however, most, if not all, values have been defined.

Upgrade your Perl ASAP ( http://www.activestate.com ) if you have any
version prior to 5.00502 or 5.00503.

-- 
Ethan H. Poole           ****   BUSINESS   ****
ehpoole@ingress.com      ==Interact2Day, Inc.==
(personal)               http://www.interact2day.com/


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

Date: Sat, 11 Sep 1999 13:42:17 -0500
From: "Asquith" <asquith@macconnect.com>
Subject: Object Cloning Help
Message-Id: <7re87i$2hj3@enews3.newsguy.com>

Need subroutine for deep duplication of arbitrarily complex Perl Objects.

I have a single hash object that looks similar to this:
$template = { -bunch_of_single_keys => scalars,
              -data => [ [    ],  [    ],   [   ]
                       ]
            };

$template is blessed hash in package A.
$template->{-data} is blessed array in package B.
each $template->{-data}->[0] is blessed array in package C.

I need to clone $template for an Undo feature in an application.  I have
finally discovered after extensive frustration that the following does not
seem to work. It clones $template, but the other deep anonymous structures
continue to point to their original references.

sub Clone {
   my $r = shift;
   bless ( { %{$r} }, ref($f) );
}

I hope that I have interpreted perl's behavior correctly.

Anyway, I need to make an exact duplication of $template that is truly
independent of the original.  I could use Data::Dumper or Storable and
perform a write and retrieve, but that is more overhead than I need.

Thanks for the help.......................


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

Date: Sat, 11 Sep 1999 12:44:21 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: passing variables in URL without ?
Message-Id: <Pine.GSO.4.10.9909111243370.16999-100000@user2.teleport.com>

On Sat, 11 Sep 1999 rajanishi@my-deja.com wrote:

> How can I get Apache to do the same thing 

It sounds as if you want to get Apache to do something. You should
probably check the docs, FAQs, and newsgroups about Apache for more
information. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sat, 11 Sep 1999 12:48:52 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: Perl HTML Grabbing
Message-Id: <37DA87F4.1F482463@ingress.com>

Oliver Christian Kjær wrote:
> 
> You have to use the LWP module in perl.

He/She does NOT *have* to use the LWP module.  They would be well advised
to use it, but they, as with anyone, are allowed to write their own module
(and in so doing, think and learn for themselves) or use another module if
they should find one.  

Just because we are unlikely to offer assistance if they go another route
does not mean anyone 'has' to use a certain module.

What's become of the "There's More Than One Way To Do It" in Perl motto
lately?

-- 
Ethan H. Poole           ****   BUSINESS   ****
ehpoole@ingress.com      ==Interact2Day, Inc.==
(personal)               http://www.interact2day.com/


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

Date: Sat, 11 Sep 1999 13:16:56 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: Perl ISAPI Not Working:  script product no output
Message-Id: <37DA8E88.979CD942@ingress.com>

Sushant Gargya wrote:
> 
> Hi everyone,
> Currently we use perl for cgi scripts, but due to inordinate amount of
> traffic, perl is taking too much of the server resources.
> I read up on Perl Resource Kit and decided to use PERL ISAPI.
> I think I have configured IIS 4.0 exactly what it suggests; however, I
> have not had any luck. All I did was to add a mapping
> within IIS 4.0 for the web-site in question. That is, I added a map to
> files ending in plx to c:\perl\5.005\bin\mswin32-x86-object\perlis.dll
> I then ran the script: (ie:
>     http://development/cgi/pathinfo.plx)
> The output sent to the browser was:
> 'C:\Inetpub\e-plastic\cgi\pathinfo.plx' script produced no output
> 
> Any ideas/suggestions?? Please respond directly to sushant@ntwrks.com
> Thanks

What version of Perl are you using?  Versions of the ISAPI Perl extenstion
prior to 5.005xx required all scripts to provide the "HTTP/1.0 200 OK\n"
HTTP header themselves.  In the current releases (any 5.005xx) this fault
has been corrected for non-NPH scripts.

I notice your path contains a reference to 5.005, but the pathing doesn't
look at all like my install of ActiveState's 5.005 Perl release.  Are you
using someone else's perl release or a self-compiled perl?  If so, you may
want to use the more widely used Perl release for Win32 platforms.

There are a few other issues with using the ISAPI Perl extension because
it does not provide an entirely true CGI interface, but many scripts will,
nonetheless, work fine.  One area to be careful of is using the process ID
($$), particularly in combination with time() to generate a unique
identifier in your script since every script executed will have the same
ID as the webserver.  You can fudge a litlle using Win32:GetTickCount() --
it isn't an absolute guarantee of uniqueness, but at least it will not
yield an unwanted result 100% of the time (it provides resolution of about
10ms on NT, 55ms on Win95).  If 100% uniqueness is a requirement you will
need to use some other tricks, or stick to perl.exe for those scripts.  It
would be nice if the ISAPI Perl could provide an emulated, but unique,
'process' id for the life of any given script call, but so far that does
not appear to be in the works so far as I know.

If you are using an older version of Perl, go to
http://www.activestate.com and download the latest version and upgrade
ASAP.

If all else fails, stick to an even simpler script at first (it is always
possible that Perl could not find CGI.pm):

#!/usr/bin/perl
# You'll need to change the above to point to the real perl.exe if using
Apache
# on NT... not sure what you do if using the perlis.dll for non-IIS
servers on
# NT.  Most windows webservers and Perl handlers only look at the options
# following 'perl' and not at the path itself.

# print "HTTP/1.0 200 OK\n"	# Uncomment if first attempt fails
print "Content-type: text/plain\n\n";
print "It works!\n";
exit (0);

-- 
Ethan H. Poole           ****   BUSINESS   ****
ehpoole@ingress.com      ==Interact2Day, Inc.==
(personal)               http://www.interact2day.com/


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

Date: Sat, 11 Sep 1999 18:10:51 GMT
From: euan_woo9431@my-deja.com
Subject: Perl output to browser
Message-Id: <7re5v5$g04$1@nnrp1.deja.com>

Hello,
  i'm trying to write some perl script for a web
site, I want to do it offline under windows NT.
When I put the path of my perl script in IE4 (i.e
c:\www\cgi-bin\test.pl) instead of the browser
displaying the output it starts up a MS-DOS
window and prints in that.

Can anyone help me?

cheers
   euan


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Sat, 11 Sep 1999 14:42:58 -0500
From: jkrogerDONCHA_SPAM_ME@earthlink.net (Jim)
Subject: Pros/cons of using Perl vs. C to develop web site?
Message-Id: <jkrogerDONCHA_SPAM_ME-1109991442580001@ip229.princeton.nj.pub-ip.psi.net>

I understand the advantages of speed for C and ease of coding in Perl.
Aside from these issues, does anyone have comments about the desireability
of using one versus the other?

Thanks
Jim



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

Date: Sat, 11 Sep 1999 13:33:35 -0600
From: Collin Starkweather <collin.starkweather@colorado.edu>
To: Jim <jkroger@earthlink.net>
Subject: Re: Pros/cons of using Perl vs. C to develop web site?
Message-Id: <37DAAE8F.EF93013A@colorado.edu>

There are virtually no cons to using Perl over C and a virtual plethora
of pros.

If you are running Unix/Apache/mod_perl (or, I believe, NT/MIIS/PerlEX
is comperable, but don't quote me), you don't have to worry about the
performance penalties.

And if you absolutely must have C code for a specific functionality,
you'd almost certainly still find it faster to wrap the C in Perl a la 

   http://www.perl.com/pub/doc/manual/html/pod/perlxs.html

or SWIG (in Advanced Perl Programming - buy a copy) and do the bulk of
your coding in Perl.

The bottom line is that what Perl does well it does very well, and Perl
does web programming well.

-Collin

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Collin Starkweather                                 (303) 492-4784
University of Colorado            collin.starkweather@colorado.edu
Department of Economics          http://ucsu.colorado.edu/~olsonco
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Jim wrote:
> 
> I understand the advantages of speed for C and ease of coding in Perl.
> Aside from these issues, does anyone have comments about the desireability
> of using one versus the other?
> 
> Thanks
> Jim


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

Date: 11 Sep 1999 22:38:11 +0200
From: Jean-Louis Leroy <jll@enterprise.newedgeconcept>
Subject: Re: Pros/cons of using Perl vs. C to develop web site?
Message-Id: <m3g10lfaks.fsf@enterprise.newedgeconcept>

jkrogerDONCHA_SPAM_ME@earthlink.net (Jim) writes:

> Aside from these issues, does anyone have comments about the desireability
> of using one versus the other?

Portability. I develop CGI on a Linux box, and deploy it on Solaris. I
recreate the final directory structure & content on my development
machine, and when I'm done I copy everything onto the server - et
voila! it works.

JL


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

Date: Sat, 11 Sep 1999 13:30:06 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: Question: How to send large (3+ MB) emails via Net::SMTP or other module
Message-Id: <37DA919E.EBA796EF@ingress.com>

eric_poulsen@my-deja.com wrote:
> 
> I have a remote machine reporting system that emails zipped files to
> clients & myself.  It works very well for smallish files (<1MB), but
> usually cannot send larger files.
> 
> The Net::SMTP module doesn't allow passing of a filehandle or filename
> (that I'm aware of, and this is confirmed from viewing the source), but
> instead requires a variable or reference.  Passing a filehandle
> reference does not work.
> 
> Has anyone out there had any success at sending large SMTP messages via
> (pure) perl?
> 
> I'm running 5.004 on NT boxes, so no access to those cool *NIX utilities
> like sendmail =P

If it is working for files smaller than 1MB but failing for larger files,
it sounds much more like a configuration issue with the SMTP servers.  The
SMTP server could very well be configured not to accept postings greater
than 1MB.  Further, assuming your SMTP server does accept unlimited
message sizes is no guarantee that the remote (recipient's) SMTP server
will do the same. Nowadays, many ISPs place restrictions on the size of
incomming messages as well as limit their users to much smaller storage
limits (which can also result in rejected emails) to prevent pack-rats and
the "I can't be bothered to ever read my email" individuals from consuming
large amounts of storage.

Otherwise, there is no particular reason why you should not be able to
send larger files through an open socket to an SMTP server so long as the
files have been properly encoded and the socket handle set to binary with
binmode() to prevent closing if an EOF character occurs within the data
stream.

-- 
Ethan H. Poole           ****   BUSINESS   ****
ehpoole@ingress.com      ==Interact2Day, Inc.==
(personal)               http://www.interact2day.com/


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

Date: 11 Sep 1999 20:02:30 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Removing a line from a text file
Message-Id: <7recgm$o2$1@gellyfish.btinternet.com>

On 10 Sep 1999 03:56:17 GMT Eric Bohlman wrote:
> Larry Rosler (lr@hpl.hp.com) wrote:
> : That is a reasonable analogy.  However, in most likelihood those who ask 
> : this question are using a different analogy: adding, deleting, or 
> : modifying lines using a text editor or a word processor.  There the 
> : mechanism is hidden.
> 
> Except that, especially if they're on a GUI system, they're aware that 
> they have to explicitly save the file they're editing, which ought to 
> suggest that the changes are actually done by rewriting the whole file.
> 
> I'm more inclined to think that it's a result of thinking of files as 
> array-like structures of physical records rather than as streams of 
> bytes.  As late as 20 years ago, I could understand why people would be 
> automatically inclined to think that way (22 years ago, *I* had a hard 
> time thinking of a file as anything other than an array of fixed-size 
> records), but I'm not sure why people think that now.
> 

On some systems *still used now* any file is presented as a set of records.
Not that I would have anything to do with them of course :)

/J\
-- 
Jonathan Stowe <jns@gellyfish.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: 11 Sep 1999 10:44:30 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: UNCRAP project proposal
Message-Id: <m1n1utl4w1.fsf@halfdome.holdit.com>

>>>>> "Uri" == Uri Guttman <uri@sysarch.com> writes:

Uri> the basic needs of the search engine is to search for some keywords in a
Uri> set of directory trees. it returns the file names of hits in a nice
Uri> htmlish way. here are some of the design rules:

You could certainly start with my search engine from WT, which
does much of what you ask already. See

	http://www.stonehenge.com/merlyn/WebTechniques/ 

for the details.  Look for col12.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 11 Sep 1999 14:02:09 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: UNCRAP project proposal
Message-Id: <slrn7tl9uk.5ou.abigail@alexandra.delanet.com>

lt lindley (ltl@rgsun40.viasystems.com) wrote on MMCCII September
MCMXCIII in <URL:news:7rds8n$lgc$1@rguxd.viasystems.com>:
{} Abigail <abigail@delanet.com> wrote:
{} 
{} :>Oh gosh, I could never do the second part. I just fail to understand
{} :>why people prefer endless method calls over
{} :>    print <<END_OF_HTML;
{} :>    ...
{} :>    END_OF_HTML
{} :>and just typing out what you want. CGI.pm's set of methods that output
{} :>html tags seems to me as useful as an English.pm module with a method
{} :>for every word, and using that instead of writing plain text. It's all
{} :>too much 'oh-golly-this-looks-like-I-am-doing-OOP' just for the sake of
{} :>looking like you're doing OOP.
{} 
{} Although I also write HTML directly (except tables where letting
{} CGI.pm take care of the details crosses my usefulness threshold), I'm

Tables are a one-liner:

qq{<table>@{[map{qq{<tr>@{[map{qq{<td>$_</td>}}@$_]}</tr>}}@table]}</table>};

given that @tables is a lol. Just remove the other qq{} if you're working
in a here document.

{} reconsidering for the future.  The XML train is gaining momentum.  If
{} I use standard routines (object oriented or not) to generate HTML,
{} then my programs will (may) still work when the definition of HTML
{} changes and somebody updates CGI.pm.

HTML was created to produce long lasting documents. Noone in their right
mind is going to make incompatible changes to HTML. In fact, one of the
reason we got HTML was the problem of having document formats that have
incompatible changes, so that old documents couldn't be read on new
versions of the software creating them.

{} Do you write HTML like this?
{} 	<p>
{} 	Some paragraph text
{} 	</p>
{} The closing tag is required in the XML'ified version of HTML.  

Then it isn't HTML. It shouldn't be called HTML. Anyone who calls that
HTML is as stupid as someone calling Windows NT the Microsoft'ified
version of Unix.

XML is just for wussies who are afraid of SGML. XML isn't a magic wand.
But it's being hyped more than Java.

{} I know that support for old style (current) HTML isn't going anywhere
{} soon and may never go away.  And besides, a program you write today
{} won't be around in 20 years anyway.  Right? So maybe this is just
{} a FUD thought and I should continue writing my HTML directly.

I don't know about my programs. But I do know it's very likely that HTML
will be around in 20 years.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sat, 11 Sep 99 18:04:12 GMT
From: fred@genesis.demon.co.uk (Lawrence Kirby)
Subject: Re: Y2K bugs on the Internet
Message-Id: <937073052snz@genesis.demon.co.uk>

In article <7r829q$492$1@nnrp1.deja.com>
           nikeighley@my-deja.com "Nick Keighley" writes:

>In article <7r313k$dcp$1@nnrp1.deja.com>,
>  finsol@ts.co.nz wrote:
>> I have decided to respond to the feedback I have received regarding
>> "Perl Y2K Bugs on the Internet" in one hit.  This feedback relates to
>> my article at URL:
>> http://www.y2kinfo.com/journal/features/0899_amon.html
>>
>> and the internet Y2K bugs collated at URL:
>> http://www.ts.co.nz/~finsol/y2k_examples.htm
><snip rambling artical>
>
>did you notice you didn't get one *single* favourable reply? Does this
>tell you something?

That everybody else has missed the point, of course.

-- 
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------



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

Date: Sat, 11 Sep 1999 12:47:17 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Zipping
Message-Id: <Pine.GSO.4.10.9909111245400.16999-100000@user2.teleport.com>

On Sat, 11 Sep 1999, Martin wrote:

> I'm wanting to output a zip file that's an archive of a number of
> other files (jpegs in this case). The problem is, that the jpegs are
> not all available at the same time. I'm looking for a way of starting
> to output the ZIP file and then add to that the jpegs as they become
> available without altering what has already been outputted.
> 
> e.g. I have jpeg1, jpeg2 and jpeg3. I want to make jpegs.zip
> 
> I want to be able to start making jpegs.zip and output the part of
> this that contains jpeg1, then wait a little until jpeg2 is available
> before adding this to what has already been outputted in the data
> stream and then add jpeg3 at the end.
> 
> Is this possible?

Whether it is or not, it's not a Perl question. The answer would be the
same if you were programming this in Cobol or ADA. Maybe you should search
for some documentation on the .zip file format. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 11 Sep 1999 19:41:12 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Zipping
Message-Id: <7reb8o$nm$1@gellyfish.btinternet.com>

On Sat, 11 Sep 1999 15:58:00 +0100 Martin wrote:
> Hi!
> 
> I'm wanting to output a zip file that's an archive of a number of other
> files (jpegs in this case). The problem is, that the jpegs are not all
> available at the same time. I'm looking for a way of starting to output
> the ZIP file and then add to that the jpegs as they become available
> without altering what has already been outputted.
> 
> e.g. I have jpeg1, jpeg2 and jpeg3. I want to make jpegs.zip
> 
> I want to be able to start making jpegs.zip and output the part of this
> that contains jpeg1, then wait a little until jpeg2 is available before
> adding this to what has already been outputted in the data stream and
> then add jpeg3 at the end.
> 
> Is this possible?
> 

I dunno but you almost certainly want to be using the module Compress::Zlib
which is available from CPAN <http://www.perl.com/CPAN>.

/J\
-- 
Jonathan Stowe <jns@gellyfish.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: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 765
*************************************


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