[9154] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2772 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 31 06:07:18 1998

Date: Sun, 31 May 98 03:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 31 May 1998     Volume: 8 Number: 2772

Today's topics:
    Re: Best tool? (Tad McClellan)
    Re: Calling form fields with Variables? <rlogsdon@io.com>
    Re: chmod in perl? <rootbeer@teleport.com>
    Re: chmod in perl? (Jonathan Stowe)
    Re: chmod in perl? (Jeremy D. Zawodny)
    Re: chmod in perl? (Michael Dori)
    Re: Dereferencing SV** <jll@skynet.be>
    Re: Don't Know how to decrypt using PERL chris+usenet@netmonger.net
    Re: Don't Know how to decrypt using PERL chris+usenet@netmonger.net
    Re: Don't Know how to decrypt using PERL (Mark-Jason Dominus)
    Re: Don't Know how to decrypt using PERL chris+usenet@netmonger.net
    Re: Help with a Socket Problem <bowlin@sirius.com>
    Re: How do I tell if Perl is in foreground or backgound <rootbeer@teleport.com>
    Re: i need help...much!!!...anyone, please... (Sam Trenholme)
    Re: Internet Relay Chat (Jonathan Stowe)
    Re: Internet Relay Chat (Sam Trenholme)
    Re: Leap Year Script... (Paul Phillips)
    Re: Perl application security <rootbeer@teleport.com>
    Re: Perl application security <sdh1@anchor.hotmail.com>
        perl for windows 3.1? (michael tessman)
    Re: perl for windows 3.1? (Jonathan Stowe)
        Perl on Windows32 <herbert.weynand@fiscalnet.be>
    Re: Problems with select(). <rootbeer@teleport.com>
    Re: Problems with select(). (Tuomas Toivonen)
    Re: read and write (Chip Salzenberg)
    Re: seek advice on simple first program chris+usenet@netmonger.net
    Re: uploading files <bowlin@sirius.com>
        WIN32 <webmaster@celebindex.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 30 May 1998 18:56:10 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Best tool?
Message-Id: <qa6qk6.er2.ln@localhost>

stlam@yahoo.com wrote:


: 1) What is the best tool for PERL programmer?

A computer.

Perl's performance without a computer is abysmal...


: Is Perl Builder from www.solutionsoft.com is the best IDE for PERL?

No.


: 2) What is the best tool for Web developer?

An HTTP server installed on the above mentioned computer.


: Is Cold fusion is the best?

No.


: It seems that using cold fusion, I don't need to write code.

You say that like it is a Good Thing.

I disagree.


: but I know Perl.

Just use it then  ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 31 May 1998 04:18:24 -0500
From: REUBEN LOGSDON <rlogsdon@io.com>
To: Ray Rarey <rayr@accessus.net>
Subject: Re: Calling form fields with Variables?
Message-Id: <Pine.BSI.3.96.980531041730.12701A-100000@pentagon.io.com>

On Sat, 30 May 1998, Ray Rarey wrote:
[..]
> 30. The only problem is, when I have the number stored in the variable
> $num, and I try to call the form field using the command $response =
> "$FORM{'$num'}";
> the script actually looks for a field named $num, instead of the
> variable value. Is there any way to fix this?

yeah

$response = $FORM{$num};

no single quotes around $num.

Regards,
Reuben Logsdon



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

Date: Sun, 31 May 1998 03:17:15 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: chmod in perl?
Message-Id: <Pine.GSO.3.96.980530201605.19134M-100000@user2.teleport.com>

On 31 May 1998, Brad McCready wrote:

> i have a script that creates a new file, the file defaults to chmod 644,
> but i want to change it to 755, how do i do this in perl?

You could look for chmod in the perlfunc manpage. :-)  And, as a free
hint, I'll suggest that you may need to write 0755 to write an octal
literal. Hope this helps!

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



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

Date: Sun, 31 May 1998 03:27:11 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: chmod in perl?
Message-Id: <3570cbd5.59484598@news.btinternet.com>

On 31 May 98 02:39:13 GMT, Brad McCready wrote :

>hi guys i'm a self taught perl newbie.
>
>i have a script that creates a new file, the file defaults to chmod 644,
>but i want to change it to 755, how do i do this in perl?

Of course you can set your umask right.  But there is of course
(hey,surprise) a chmod builtin in perl.  Check perldoc -f chmod.

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: 30 May 1998 23:24:40 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: chmod in perl?
Message-Id: <m3u3676s1z.fsf@peach.z.org>

"Brad McCready" <bradmcc@comcen.com.au> writes:

> 
> hi guys i'm a self taught perl newbie.
> 
> i have a script that creates a new file, the file defaults to chmod 644,
> but i want to change it to 755, how do i do this in perl?
> 
> thanks for any assistance given.

Believe it or not, it's as easy as using Perl's chmod() function.

See your local perlfunc manpage for details.

Jeremy
-- 
Jeremy D. Zawodny                   Web Geek, Hacker, etc.
http://www.wcnet.org/~jzawodn/      jzawodn@wcnet.org

LOAD "LINUX",8,1


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

Date: Sun, 31 May 1998 03:18:27 GMT
From: michaeldore@hotmail.com (Michael Dori)
Subject: Re: chmod in perl?
Message-Id: <3572cb95.90701658@news.nacs.net>

On 31 May 98 02:39:13 GMT, "Brad McCready" <bradmcc@comcen.com.au>
wrote:

>hi guys i'm a self taught perl newbie.
>
>i have a script that creates a new file, the file defaults to chmod 644,
>but i want to change it to 755, how do i do this in perl?
>
>thanks for any assistance given.
>
>
>-------------------------
>brad mccready


The correct syntax for this is as follows:

chmod(MODE, FILES) and returns the number of files sucessfully
changed.

where MODE is similar to 0777, and file would be $file..
Mike Dori
michaeldore@hotmail.com


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

Date: Sun, 31 May 1998 10:54:09 +0200
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: Dereferencing SV**
Message-Id: <VA.00000065.0094b5a9@enterprise>

>  I am trying to write my first XS program but I find trouble in
> dereferencing SV** to SV*.  Can anyone tell me how to do that?

<?> Stick a star in front of your pointer-to-pointer:

    SV** pp = whatever();
    *pp;
    
Hmm...here's got to be something else to your question...aren't you 
rather trying to dereference a *scalar*, like in @$ra?

Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy/



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

Date: 31 May 1998 04:35:29 GMT
From: chris+usenet@netmonger.net
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6kqmmh$882$1@schenectady.netmonger.net>
Keywords: cupidity hangout soot transvestite

In article <6knd03$qj3$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
> In article <fl_aggie-2905981721540001@aggie.coaps.fsu.edu>,
> I R A Aggie <fl_aggie@thepentagon.com> wrote:
> >In which case, they have the on-line documentation for the library
> >question...again, the problem isn't the documentation so much as
> >people being unaware or too lazy of how to find the information...
> 
> Hello?  Hello?  Is this thing on?  
> 
> Ah, thanks.  No wonder.  Now where's the volume knob?
> 
> 
> 	AHEM.
> 
> 
> 
> 	THE ON-LINE DOCUMENTATION DOES NOT EXPLAIN THE PURPOSE OF THE SALT.
> 
> 
> 

That would seem to depend on the on-line documentation in question.

CRYPT(3)               FreeBSD Library Functions Manual               CRYPT(3)

[...]

     The crypt() function performs password encryption.  It is derived from
     the NBS Data Encryption Standard.  Additional code has been added to de-
     ter key search attempts.  The first argument to crypt is a NUL-terminated
     string (normally a password typed by a user).  The second is a character
     array, 9 bytes in length, consisting of an underscore (``_'') followed by
     4 bytes of iteration count and 4 bytes of salt.  Both the iteration count
     and the salt are encoded with 6 bits per character, least significant
     bits first.  The values 0 to 63 are encoded by the characters ``./0-9A-
     Za-z'', respectively.

     The salt is used to induce disorder in to the DES algorithm in one of
     16777216 possible ways (specifically, if bit i of the salt is set then
     bits i and i+24 are swapped in the DES ``E'' box output).  The key is di-
     vided into groups of 8 characters (a short final group is null-padded)
     and the low-order 7 bits of each character (56 bits per group) are used
     to form the DES key as follows: the first group of 56 bits becomes the
     initial DES key.  For each additional group, the XOR of the group bits
     and the encryption of the DES key with itself becomes the next DES key.
     Then the final DES key is used to perform count cumulative encryptions of
     a 64-bit constant.  The value returned is a NUL-terminated string, 20
     bytes in length, consisting of the setting followed by the encoded 64-bit
     encryption.

     For compatibility with historical versions of crypt(3),  the setting may
     consist of 2 bytes of salt, encoded as above, in which case an iteration
     count of 25 is used, fewer perturbations of DES are available, at most 8
     characters of key are used, and the returned value is a NUL-terminated
     string 13 bytes in length.

[...]

-- 
	    Christopher Masto <chris+usenet@netmonger.net>
	Director of Operations, NetMonger Communications, Inc.

		     "Behold the Power of Cheese"


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

Date: 31 May 1998 04:40:39 GMT
From: chris+usenet@netmonger.net
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6kqn07$882$2@schenectady.netmonger.net>

In article <8ck9733clv.fsf@gadget.cscaper.com>,
Randal Schwartz  <merlyn@stonehenge.com> wrote:
> >>>>> "Chris" == Chris Nandor <pudge@pobox.com> writes:
> 
> Chris> perl -le 'print crypt($ARGV[0], substr($ARGV[0], 0, 2))' mypassword
> Chris> myylAylKPNtmw
> 
> Waaaayy too much typing.  I've never seen a crypt() that didn't
> ignore everything after the first two chars given as a salt:
> 
> 	crypt($ARGV[0], $ARGV[0])
> 
> would have worked just fine.

And indeed it is an error to pass only the first two characters - some
systems use more than that.  Particularly when you have crypted and
plaintext passwords and you wish to check if they match; blindly
grabbing the first two characters of the crypted password to use as a
salt can lead to false negatives.

And of course, in a real program, it would not be a good idea to use
the beginning of the uncrypted password as the salt.
-- 
	    Christopher Masto <chris+usenet@netmonger.net>
	Director of Operations, NetMonger Communications, Inc.

		     "Behold the Power of Cheese"


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

Date: 31 May 1998 01:23:07 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6kqpfr$3n4$1@monet.op.net>
Keywords: cupidity hangout soot transvestite

In article <6kqmmh$882$1@schenectady.netmonger.net>,
 <chris+usenet@netmonger.net> wrote:
>In article <6knd03$qj3$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
>> 	THE ON-LINE DOCUMENTATION DOES NOT EXPLAIN THE PURPOSE OF THE SALT.
>> 
>> 
>> 
>
>That would seem to depend on the on-line documentation in question.
>
>CRYPT(3)               FreeBSD Library Functions Manual               CRYPT(3)
>
>[Much omitted]


That's nice, and yes, it does depend on the docmuentation in question,
but all that yabble yabble you quoted *still* doesn't explain what it
is for.  It says how it works, which is not the same.

Next contestant, please?


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

Date: 31 May 1998 07:10:54 GMT
From: chris+usenet@netmonger.net
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6kqvpu$d4c$1@schenectady.netmonger.net>
Keywords: cupidity hangout soot transvestite

In article <6kqpfr$3n4$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
> In article <6kqmmh$882$1@schenectady.netmonger.net>,
>  <chris+usenet@netmonger.net> wrote:
> >In article <6knd03$qj3$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
> >> 	THE ON-LINE DOCUMENTATION DOES NOT EXPLAIN THE PURPOSE OF THE SALT.
> >
> >That would seem to depend on the on-line documentation in question.
> >
> >CRYPT(3)               FreeBSD Library Functions Manual               CRYPT(3)
> >
> >[Much omitted]
> 
> 
> That's nice, and yes, it does depend on the docmuentation in question,
> but all that yabble yabble you quoted *still* doesn't explain what it
> is for.  It says how it works, which is not the same.
> 
> Next contestant, please?

Uh, how do you interpret "what's it for?" in a way that isn't explained
by one of the following:

  ...to deter key search attempts...

  The salt is used to induce disorder in to the DES algorithm...

  Or the technical description of how it works.

What else can one possibly say about it?  I think it would be very
nice to have a standard example of how to generate a good salt, and an
example of how to compare a password, but a lack of examples is a
different issue from explaining what the salt is used for.
-- 
	    Christopher Masto <chris+usenet@netmonger.net>
	Director of Operations, NetMonger Communications, Inc.

		     "Behold the Power of Cheese"


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

Date: Sat, 30 May 1998 23:15:12 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: dwright@thuntek.net
Subject: Re: Help with a Socket Problem
Message-Id: <3570F570.1F21BF94@sirius.com>

dwright@thuntek.net wrote:
> 
> Hi, I have a PERL script that creates a socket to port 80 on a server and
> runs a PERL script on that server.  The line I use to print to the socket is
> as follows:
> 
> print S "HEAD $url HTTP/1.0\n\n";
> 
> Where S is the socket and $url is the complete URL for the PERL script to be
> run.  Now, this has worked just fine but recently I am running into
> problems.  The script sends me an email indicating a bad response and lately
> I have been receiving the 403 forbidden response and further research seems
> to indicate that servers using the latest version of the Apache choke on this.
> 
> Can anyone tell me if there is a different way of doing this that will help.
> Thanks in advance...

You need to at least use a Host: hostname header line in your request.
This is the hostname where you want to get the file from.  The newer
Apache allows virtual hosts so this info must be included or the
WWW server won't know which page you are asking for.

print S "HEAD $path HTTP/1.0\nHost: $host\n\n";

should do the trick.

HTH -- Jim Bowlin


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

Date: Sun, 31 May 1998 03:15:52 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How do I tell if Perl is in foreground or backgound?
Message-Id: <Pine.GSO.3.96.980530201105.19134L-100000@user2.teleport.com>

On Sat, 30 May 1998, Robert Dorfman wrote:

> How can I tell if my script is running in foreground or background?

I'm not certain, but you may want the -t filetest, which tells you whether
a filehandle is open to a tty (roughly, something which will type to you,
as opposed to a file). Hope this helps! 

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



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

Date: Sun, 31 May 1998 04:17:31 GMT
From: set@netcom.com (Sam Trenholme)
Subject: Re: i need help...much!!!...anyone, please...
Message-Id: <setEtszx7.q7@netcom.com>

>Perl was not originally developed for CGI purposes, a casual glance at
>this newsgroup might indicate otherwise on occasion but this is purely
>cicumstantial.  Infact I'm not entirely sure whether CGI existed at
>all when Perl was fledged (infact I know but unsure of the exact
>chronology).  

The WWW, much less CGI, did not exist at the time Perl was first created 
in 1986.

- Sam

-- 
Unique Linux information: http://linux-rules.samiam.org/linux/linux_links.html
   I have the right to make public flames/spam I receive in response to this


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

Date: Sun, 31 May 1998 03:08:56 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Internet Relay Chat
Message-Id: <3570bf21.56233203@news.btinternet.com>

On Sun, 31 May 1998 01:50:31 GMT, Adam wrote :

<snip>

>
>(PS Sorry about the anti-spam measures)
>
>
Hmm.
>---
> Adam  <adam_trickett at bigfoot dot com>
>

 Just wondering why the necessity for the munged addresses *and* 

>ANTI-SPAM | UNsolicited e-mail will be charged a $10 proof-reading
>          | fee - by replying to this posting you are agreeing to
>STATEMENT | these terms and conditions.
> 

But this aint nothing to do with Perl ->

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: Sun, 31 May 1998 04:14:19 GMT
From: set@netcom.com (Sam Trenholme)
Subject: Re: Internet Relay Chat
Message-Id: <setEtszrv.I3@netcom.com>
Keywords: Internet Relay Chat IRC

>A colleague is looking to provide IRC for a client. The client does not like 
>the periodic update, nor manual refresh style chat. My colleague wishes to 
>provide this kind of "live" IRC on his virtual Linux/Apache system.

To get live IRC w/o refresh/manual update requires one to implement an IRC 
client in a language the enduser's web browser has, which has the ability 
to open up sockets (talk to machines on the internet).  Your best bet is 
to find a Java program that does this.

(I suspect that a dynamiclly updated animated gif would be too 
 bandwidth-consuming)

- Sam

-- 
Unique Linux information: http://linux-rules.samiam.org/linux/linux_links.html
   I have the right to make public flames/spam I receive in response to this


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

Date: 31 May 1998 02:54:59 GMT
From: paulp@go2net.com (Paul Phillips)
Subject: Re: Leap Year Script...
Message-Id: <6kqgq3$cim$1@sparky.wolfe.net>

In article <35703279.65947337@news.visi.com>,
Michael Armstrong <michaela@phosphor.com> wrote:
>Wouldn't it be easier to just subtract the day at the localtime(time)
>statement and cut out most of the rest of the code. Leaving you with: 
>
>#!/usr/perl
>
>($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time
>- 86400);

Exercise for the reader: what happens when you run this shortly
after midnight on the day following a day that daylight savings time
goes into effect? Or, shortly before midnight on the day daylight
savings time ends.

-- 
Paul Phillips      | Please keep your hands and feet inside the email
Cat Juggler        | at all times.
<paulp@go2net.com> | 
+1 206 447 1595    |--------* http://www.go2net.com/people/paulp/ *--------


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

Date: Sun, 31 May 1998 03:19:11 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl application security
Message-Id: <Pine.GSO.3.96.980530201814.19134N-100000@user2.teleport.com>

On Sat, 30 May 1998, Eric Tucker wrote:

> I would like to run an untrusted Perl script in a trusted environment
> without allowing the script to access various portions of the local
> machine such as the file system and TCP/UDP sockets.

It sounds as if you want the Safe module. I don't know whether it'll do
everything you need, but perhaps it's a start. Hope this helps! 

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



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

Date: Sun, 31 May 1998 00:10:47 -0400
From: "Scott" <sdh1@anchor.hotmail.com>
Subject: Re: Perl application security
Message-Id: <6kqlea$gjn$1@camel19.mindspring.com>

You can try running it in Tainted mode.  I believe that is perl -T.


Eric Tucker wrote in message <6kqg6q$fch$1@excalibur.flash.net>...
>I would like to run an untrusted Perl script in a trusted environment
>without allowing the script to access various portions of the local machine
>such as the file system and TCP/UDP sockets.  In other words:
>
>    I download script X that contains instructions to delete my root or
some
>other malicious instruction and execute it on my machine without causing
>damage.
>
>I'm running Perl 5 (ActiveState I386 build) on an NT4 box.  I can use
>another build if I need to, but I'm tied to NT4.  Any ideas?
>
>- Eric Tucker
>http://www.semperex.com/
>eric.tucker@semperex.com
>
>




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

Date: Sun, 31 May 1998 04:06:23 GMT
From: mtessman@erols.com (michael tessman)
Subject: perl for windows 3.1?
Message-Id: <3570d6ca.4471389@news.erols.com>

i'm very new to perl and am wondering if it is available somewhere for
win 3.1

thanks much...

mike tessman
mtessman@erols.com



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

Date: Sun, 31 May 1998 04:18:15 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: perl for windows 3.1?
Message-Id: <3570d8a6.62764939@news.btinternet.com>

On Sun, 31 May 1998 04:06:23 GMT, michael tessman wrote :

>i'm very new to perl and am wondering if it is available somewhere for
>win 3.1
>

I would hope so.  I've been using the djgpp thingymajig for a while
now.

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: Sun, 31 May 1998 11:36:13 +0200
From: "L. Weynand" <herbert.weynand@fiscalnet.be>
Subject: Perl on Windows32
Message-Id: <3571248D.510B@celebindex.com>

Hello !

I want to check my CGI Scripts offline... So I wanted to know how to do
that. It seems I have to use a Server program and a perl program.

Where can I download theses and what do I have to do ?

Can someone help me please ???

Emmanuel


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

Date: Sun, 31 May 1998 02:58:49 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Problems with select().
Message-Id: <Pine.GSO.3.96.980530194831.19134H-100000@user2.teleport.com>

On 30 May 1998, Tuomas Toivonen wrote:

> To my understanding process executing to script below would 'sleep' for
> 10 seconds if there was no 'activity' on STDIN. However, it returns
> immediately with $nfound == -1, $timeleft == 10. 

> $rin = $win = $ein = 0;

A proper bit vector should be a string; replace that zero with an empty
string for a good start.

> vec($rin, fileno(STDIN), 1) = 1;
> vec($win, fileno(STDIN), 1) = 1;

Of course, you shouldn't be writing to STDIN. Since select will wait until
writing to that filehandle wouldn't block, this makes it return at once.
You probably didn't want this second line at all. Or, if you did want it,
you probably wanted STDOUT or another output filehandle instead. 

> $ein = $rin | $win;
> 
> my ($nfound, $timeleft) = select($rin, $win, $ein, 10) 
>   or die "select: $!\n";
> 
> printf "nfound: %s\ntimeleft: %s\n", 
>   $nfound, 
>   $timeleft;

That's a very C-like way of printing! :-)  In Perl, printf is rarely used; 
this would be simpler as a regular print statement. 

Note that this will normally not wait for ten seconds or until a key is
pressed; it will wait for up to ten seconds or until some input is ready,
which is somewhat different. But if you wanted to read a single keypress,
I'm sure you would have used the answer from the FAQ. :-)

Hope this helps!

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



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

Date: 31 May 1998 05:19:04 GMT
From: toivotuo@fishpool.com (Tuomas Toivonen)
Subject: Re: Problems with select().
Message-Id: <slrn6n1q0m.ip1.toivotuo@gfanrend.fishpool.com>

On Sun, 31 May 1998 02:58:49 GMT, Tom Phoenix <rootbeer@teleport.com> wrote:
>On 30 May 1998, Tuomas Toivonen wrote:

>> To my understanding process executing to script below would 'sleep' for
>> 10 seconds if there was no 'activity' on STDIN. However, it returns
>> immediately with $nfound == -1, $timeleft == 10. 
>
>> $rin = $win = $ein = 0;
>
>A proper bit vector should be a string; replace that zero with an empty
>string for a good start.

Yes, $rin = $win = $ein = '' with more extensive error checking solved it.

Ie.

S == socket

my ($rin, $win, $ein);
$rin = $win = $ein = '';

vec($rin, fileno(S), 1) = 1;
vec($win, fileno(S), 1) = 1;
$ein = $rin | $win;

my ($n, $timeleft) = select($rin, $win, $ein, 10);
die "select: $!\n" if ($n < 0);

printf "n: %s\ntimeleft: %s\n", 
  $n, 
  $timeleft;

-- 
tuomas.toivonen@fishpool.com              fishpool creations ltd
http://www.fishpool.com/~toivotuo/        http://www.fishpool.com/


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

Date: Sun, 31 May 1998 01:06:58 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: read and write
Message-Id: <6kqaif$3ip$1@cyprus.atlantic.net>

According to ilya@math.ohio-state.edu (Ilya Zakharevich):
><chip@mail.atlantic.net>:
>> Isn't the current position beyond any file contents on the first
>> iteration?  Why act differently?
>
>I want
>  open FOO, 'foo' or die;
>  $/ = undef;
>  $contents = <FOO>;
>  close FOO or die;
>to make $contents into contents of 'foo'.  Currently it will not if
>'foo' is empty.

Use sysread.
-- 
Chip Salzenberg                - a.k.a. -               <chip@pobox.com>
"I brought the atom bomb.  I think it's a good time to use it."  //MST3K
           ->  Ask me about Perl training and consulting  <-
     Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: 31 May 1998 07:27:08 GMT
From: chris+usenet@netmonger.net
Subject: Re: seek advice on simple first program
Message-Id: <6kr0oc$d4c$2@schenectady.netmonger.net>

In article <6kp9eg$mj7@hplntx.hpl.hp.com>, Larry Rosler <lr@hpl.hp.com> wrote:
> [posted and emailed]
> 
> Dan Boorstein wrote in message <356FF68A.3C8234D0@negia.net>...
> >Andre L. wrote:
> ...
> >>    @content = <F>;
> >
> >     seek F,0,0;   # oops, forgot to rewind ( that'll be 25 cents :-)
> >
> >>    truncate(F, 0);
> 
> 
> Why???  Is it possible that truncating a file to 0 length leaves the
> file position indicator anywhere but at the beginning of the file?

Of course.  Stop being so non-unix centric!

<blink> :-) </blink>
-- 
	    Christopher Masto <chris+usenet@netmonger.net>
	Director of Operations, NetMonger Communications, Inc.

		     "Behold the Power of Cheese"


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

Date: Sat, 30 May 1998 23:22:08 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: Garrick Staples <webmaster@directnet.com>
Subject: Re: uploading files
Message-Id: <3570F710.D00EDBC7@sirius.com>

Garrick Staples wrote:
> 
> I have an application to use the nifty html file upload feature.
> However implementaion has been a bear.  I started this project by doing
> the form decoding myself, but that became problematic; I can't seem to
> find any documentation about the "multipart/form-data" enctype.  So then
> I looked at the "CGI::BasePlus" module, but can't seem to get that to
> work.
>         I guess my question is "Does anybody have any sample scripts that
> upload files?"  I don't care if I use the CGI module or not, I just want
> the mulitpart/form-data decoded.
>         Thanks in advance for that certain life saver out there.
> -Garrick

Use CGI.pm.  It comes with demo programs including file upload.
Be sure to use binmode() where needed.

-- Jim Bowlin


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

Date: Sun, 31 May 1998 11:38:47 +0200
From: "E. Zimmermann" <webmaster@celebindex.com>
Subject: WIN32
Message-Id: <35712527.22F0@celebindex.com>

Hello !

I want to check my CGI Scripts offline... So I wanted to know how to do
that. It seems I have to use a Server program and a perl program.

Where can I download theses and what do I have to do ?

Can someone help me please ???

Emmanuel

Sorry !

I sent another message with wrond mailproperties !


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

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

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