[8909] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2527 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 7 10:07:36 1998

Date: Thu, 7 May 98 07:02:32 -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           Thu, 7 May 1998     Volume: 8 Number: 2527

Today's topics:
    Re: How to send email (was Re: Ever Wonder Why Not Ever <quednauf@nortel.co.uk>
    Re: How to send email (was Re: Ever Wonder Why Not Ever <tchrist@mox.perl.com>
    Re: How to send email (was Re: Ever Wonder Why Not Ever <jgoldberg@dial-but-dont-spam.pipex.com>
    Re: HTTP server written in perl? <captain@pirate.de.nospam-delete-this>
        Inputting Passwords without echoing them to the screen  <freetly@us.ibm.com>
    Re: Inputting Passwords without echoing them to the scr (Hakan Hjelmstrom)
    Re: print($b=1,$b=2) <cnwetzel@linguistik.uni-erlangen.de>
    Re: Problem installing Perl 5.004_04 on Solaris 2.5.1 (Matthew H. Gerlach)
    Re: Problem with xemacs and perl syntax hilitghtning <qdtcall@esb.ericsson.se>
        require "file.sub": which script called it? <quednauf@nortel.co.uk>
    Re: stat function <mark@tmsnet.co.uk>
        Truncate() not documented correctly? <sguelich-@-asq.org>
    Re: What is wrong with this? <etoxkar@eto.ericsson.se>
        Win32 - access to comms ports moodfarm@hotmail.com
    Re: Win32 reading in passwords <notebench@rchland.ibm.com>
    Re: win32::registry (queryvalue) <nils-martin.fredriksen@capgemini.no>
    Re: Win95 Perl scripts DONT WORK on UNIX <barnett@houston.Geco-Prakla.slb.com>
    Re: Win95 Perl scripts DONT WORK on UNIX <perlguy@inlink.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 07 May 1998 12:36:21 +0100
From: "Frank L. Quednau" <quednauf@nortel.co.uk>
Subject: Re: How to send email (was Re: Ever Wonder Why Not Everyone Uses Modules?)
Message-Id: <35519CB4.D2C8AA0E@nortel.co.uk>

>

I think I missed the thread there a bit, but it just insoires me to ask: Are
there any good pages on security in Perl, how to avoid security holes, etc.?



--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________





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

Date: 7 May 1998 12:18:35 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to send email (was Re: Ever Wonder Why Not Everyone Uses Modules?)
Message-Id: <6is8qr$r3m$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    "Frank L. Quednau" <quednauf@nortel.co.uk> writes:
:I think I missed the thread there a bit, but it just insoires me to ask: Are
:there any good pages on security in Perl, how to avoid security holes, etc.?

% man perlsec
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
clueless> $SOCK_STREAM = 2  
    Huh?  use Socket or die!
	    --Tom Christiansen <tchrist@mox.perl.com>


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

Date: Thu, 7 May 1998 14:56:12 +0100
From: "Jeremy Goldberg" <jgoldberg@dial-but-dont-spam.pipex.com>
Subject: Re: How to send email (was Re: Ever Wonder Why Not Everyone Uses Modules?)
Message-Id: <6iseim$dhc$1@plug.news.pipex.net>

>I think I missed the thread there a bit, but it just insoires me to ask:
Are
>there any good pages on security in Perl, how to avoid security holes,
etc.?


Look for "Fravia's page of reverse engineering" - there's a good little
section there about CGI security problems.




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

Date: Thu, 07 May 1998 14:39:39 +0200
From: Mark Seuffert <captain@pirate.de.nospam-delete-this>
Subject: Re: HTTP server written in perl?
Message-Id: <3551AB8B.222A@pirate.de.nospam-delete-this>

> Mcoe NT <root@mail.mcoe.k12.ca.us> Said this:
> >Has anyone seen a HTTP server written only in perl?

yep and I use it, go to CPAN and search for "mhttp"

-- 

/Mark (EMailadresse ab ".nospam" lvschen)
http://home.pages.de/~irc ~html ~unix


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

Date: Thu, 30 Apr 1998 12:02:11 -0500
From: Neil Freetly <freetly@us.ibm.com>
Subject: Inputting Passwords without echoing them to the screen - Win32 Perl
Message-Id: <3548AE92.B3CE0A60@us.ibm.com>

I need to somehow write a perl win32 program which allow the users to
type in their password, but not have their password displayed on the
screen.  Any ideas on how can do this in Perl?

Neil




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

Date: Thu, 07 May 1998 13:56:33 GMT
From: hawk@algonet.se (Hakan Hjelmstrom)
Subject: Re: Inputting Passwords without echoing them to the screen - Win32 Perl
Message-Id: <3554bcd9.4708901@news.algonet.se>

On Thu, 30 Apr 1998 12:02:11 -0500, Neil Freetly wrote:
> I need to somehow write a perl win32 program which allow the users to
> type in their password, but not have their password displayed on the
> screen.  Any ideas on how can do this in Perl?

I didn't follow it that well, but there's a *very* recent thread on
the subject from May 1st named "Win32 reading in passwords" in this
group.

Hekan Hjelmstrvm
hawk@algonet.se


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

Date: Thu, 07 May 1998 15:10:58 +0200
From: Christian Wetzel <cnwetzel@linguistik.uni-erlangen.de>
Subject: Re: print($b=1,$b=2)
Message-Id: <3551B2E2.3658@linguistik.uni-erlangen.de>

Horst Fickenscher wrote:

> A list constructor gathers values, not references to variables.
> You can see this with the following code:
> 
> $b = 2;
> @ar = ($b, "foo");
> $b = 3;
> print("@ar\n");

@ar is (2,'foo'), because at the time of it's creation,
$b was 2, and it was passed by value.

> Furthermore the value of an asignment is defined to be the value
> of it's right side.

Right. And let me add another statement: Before any
assignment is made, the whole right side is evaluated
(including evaluation of further assignments from left
to right).

> But why then does the value of $b = 2 change when it is followed
> by $b = 3 ?
> 
> @ar = ($b = 2, $b = 3); # This is not the scalar comma operator!!!
> print("@ar\n");

As I wrote in an earlier response, perl's evaluation order is: 
1) set $b=2                     
2) set $b=3                     
3) create an array ($b,$b)      
4) assign it to @ar             

Your assumption was that the list was created incrementally.
But that's not the case. And therefore I avoid doing any
assignments on the right side of an assignment or a print
statement.

   Christian


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

Date: Thu, 7 May 1998 13:39:20 GMT
From: gerlach@netcom.com (Matthew H. Gerlach)
Subject: Re: Problem installing Perl 5.004_04 on Solaris 2.5.1
Message-Id: <gerlachEsL9xK.1Hw@netcom.com>

In article <6iqs21$fp1$6@comdyn.comdyn.com.au> mgjv@comdyn.com.au (Martien Verbruggen) writes:
>In article <35504FCD.B7C4BE7A@pobox.com>,
>	Michael Peck <mpeck@pobox.com> writes:
>> I have freshly installed Solaris 2.5.1 on a Sun Sparc 5.  I have also
>> installed all of the compilers and tools I can think of prior to
>> installing Perl.  When I try to make perl I get the following error
>> messages:
>> 

I just did the same thing with no problem.  I used gcc.2.7.2.1 that I
got precompiled from http://smc.vnet.net/solaris_2.5.html

When I configed, I just used the defaults it prompted me with.

Matthew



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

Date: 07 May 1998 13:06:47 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: Problem with xemacs and perl syntax hilitghtning
Message-Id: <isaf8ucpbr.fsf@godzilla.kiere.ericsson.se>

gerd4000@hermes.zrz.TU-Berlin.DE (Gerd Schering) writes:

> Could someone give me a hint?

M-x list-faces-display
-- 
		    Calle Dybedahl, UNIX Sysadmin
       qdtcall@esavionics.se  http://www.lysator.liu.se/~calle/


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

Date: Thu, 07 May 1998 14:02:12 +0100
From: "Frank L. Quednau" <quednauf@nortel.co.uk>
Subject: require "file.sub": which script called it?
Message-Id: <3551B0D3.5271E490@nortel.co.uk>

Hello all,
If I include the following statement in my script:

require "docfiling_.sub";

How can I figure out within that subroutines file from which
script it has been called?
Thanks for any advice

--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________





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

Date: Thu, 07 May 1998 11:18:35 GMT
From: "Mark Austin" <mark@tmsnet.co.uk>
Subject: Re: stat function
Message-Id: <35519764.0@tmsserv4.tmsnet.co.uk>

Here is the code i'm using

while ($FileName = readdir(dir))
 {


  if ($FileName cmp "." && $FileName cmp "..")
  {
   print "<tr>\n";
   print "<td>\n";
   print "<a href=\"/modelsdownload/",$FileName,"\"","
target=DISPLAY",">","[",$FileName,"]","</a>","\n";
   print "</td>\n";


($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,
$blocks) = stat($FileName);

   print "<td>\n";
   print $size," bytes";
   print "</td>\n";

   print "<td>\n";
   $ConSpeed ="28.8";
   print DisplayDownloadTime();

   print " Seconds";
   print "</td>\n";

   print "<td>\n";
   $ConSpeed ="56";
   print DisplayDownloadTime();

   print " Seconds";
   print "</td>\n";

   print "</tr>\n";
  }
	}
Martien Verbruggen wrote in message <6ir298$gfq$2@comdyn.comdyn.com.au>...
>In article <354efd29.0@tmsserv4.tmsnet.co.uk>,
> "Mark Austin" <mark@tmsnet.co.uk> writes:
>> I've written a routine to get the file size of each file within a
specific
>> directory.
>>
>> however, it only works on particular files.  There doesn't seem to be a
>> pattern either.  I'm using NT as a platform.
>
>Odd. It should work at all times or never. What is the code you use?
>Maybe you are just missing a pattern which is there?
>
>Martien
>--
>Martien Verbruggen                  |
>Webmaster www.tradingpost.com.au    | That's not a lie, it's a
terminological
>Commercial Dynamics Pty. Ltd.       | inexactitude.
>NSW, Australia                      |




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

Date: Thu, 07 May 1998 13:41:24 +0000
From: Scott Guelich <sguelich-@-asq.org>
Subject: Truncate() not documented correctly?
Message-Id: <3551BA04.AA7B941E@-asq.org>

Hi all. I ran across a problem with truncate and I'd reallly appreciate
it if someone could validate this for me... or let me know if I'm just
going insane. This message is a little long, but I know I'll get a
simple answer based on the docs unless I explain this fully:

I've been trying to find better ways to handle file locking so I was
looking through the included pods and found the following suggestion for
file locking a web page counter:

use Fcntl;
sysopen(FH, "numfile", O_RDWR|O_CREAT, 0644)
    or die "can't open numfile: $!";
flock(FH, 2)
    or die "can't flock numfile: $!";
$num = <FH> || 0;
seek(FH, 0, 0)
    or die "can't rewind numfile: $!";
truncate(FH, 0)
    or die "can't truncate numfile: $!";
(print FH $num+1, "\n")
    or die "can't write numfile: $!";
# DO NOT UNLOCK THIS UNTIL YOU CLOSE    
close FH
    or die "can't close numfile: $!";

Now just to cover myself, a web page counter isn't what I'm using this
for, but I figured this code would still be useful. Problem is, as soon
as I toss a 'use strict' in there (and add 'my' to $num, etc.), Perl
starts complaining about a plain word after truncate. It won't recognize
FH as a file handle.

Fine, so I pull out the mighty Camel book and double-check. Should it
just be a file name? Nope, truncate is supposed to take a file handle.
Okay, I go to the Advanced Perl book and read that open, close, etc.
cause Perl to interpret FH as *FH. Sure enough, flock, seek, and close
all work just as well with *FH instead of FH. Perhaps truncate doesn't
automatically make this assumption, so I try *FH with truncate. Now it
compiles but dies on that line.

Finally, I just use the filename: 'truncate("numfile", 0) ...'. It works
just fine... but this is with strict refs on! Using a filename on any
one of the other file functions would have given me a compiler error.

So, I've concluded that truncate doesn't work as documented... it
requires a filename but will accept a file handle so long as strict refs
is not on. This is the reverse of all the other file functions I know.
Can anyone verify this?  Thanks in advance... oh, and please remove the
dashes from the email address to email me (anti-spam).

Scott Guelich
sguelich-@-asq.org


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

Date: Thu, 07 May 1998 14:31:07 +0200
From: Kjell Arne Rekaa <etoxkar@eto.ericsson.se>
Subject: Re: What is wrong with this?
Message-Id: <3551A98B.4C71EE0C@eto.ericsson.se>

Ian Sergeant wrote:
> 
>........(code removed)
> $secretword = "llama"; # the secret word
> print "What is you name?";
> $name = <STDIN>;
> chomp $name

	You're missing the semicolon on the statement above!

> if ($name eq "Randal")  {
>     print "Hello, Randal!  How good of you to be here!\n";
> } else {
>     print "Hello, $name!\n"; # ordindary greeting
> .... (code removed)

-- 
Kjell Arne Rekaa

    Though I'll admit readability suffers slightly... 
                    --Larry Wall in <2969@jato.Jpl.Nasa.Gov>


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

Date: Thu, 07 May 1998 08:09:06 -0600
From: moodfarm@hotmail.com
Subject: Win32 - access to comms ports
Message-Id: <6isbpi$j1i$1@nnrp1.dejanews.com>

Can anybody help me with this, it would be simple if I was allowed to use a
unix box I know, so does anybody know an equivilent of

open( FRED, "/dev/cua1") ;

so that I can do some very simple serial comms on a windows box

many thanks

kpm.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Mon, 04 May 1998 12:20:57 -0500
From: NoteBench <notebench@rchland.ibm.com>
Subject: Re: Win32 reading in passwords
Message-Id: <354DF8F9.86558F7C@rchland.ibm.com>

Thanks Win32::Console() did the trick.  Here is a copy of the code for those
who are interested.

use Win32::Console;
$IN = new Win32::Console(STD_INPUT_HANDLE);

print "Enter Password : ";
$IN->Mode(ENABLE_LINE_INPUT);

$password = "";
$pass = "h";
while ($pass ne " " && $pass ne "\r") {
  $pass = $IN->InputChar(1);
  $password .= $pass;
}
print "\nYour Password is : $password\n";


Igor Krivokon wrote:

> scott@softbase.com wrote in message <6icd7m$rsv$1@mainsrv.main.nc.us>...
> >Neil Freetly (nfreetly@ibm.net) wrote:
> >> How can I accept input from the keyboard without displaying it to the
> >> screen?
> >
> >> For instance, I want to prompt for a password in my WIN32 Perl program,
> >> but I don't want to echo to the screen what the user types in.  Any
> >> Ideas?
> >
> Portable solution: Term::ReadKey
> Win32 - specific: Win32::Console
>
> Regards,
>
> Igor Krivokon
> <igor.k@usa.net>





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

Date: Thu, 7 May 1998 15:27:57 +0200
From: "Nils Martin Fredriksen" <nils-martin.fredriksen@capgemini.no>
Subject: Re: win32::registry (queryvalue)
Message-Id: <6iscrk$j1m$1@news.capgemini.se>


Preston L. Bannister wrote in message ...
>In article <35445216.0@d2o26.telia.com>, "Andreas Olsson" <seo@sorona.se>
wrote:
>>I wonder why the function QueryValue doesn't work under WinNT4.
>>[Snip, snip]
>
>QueryValue() is for Win3.1 compability and can only query "(Default)"
>values, you want to use QueryValueEx().


Please excuse my ingnorance, but where do I find QueryValueEx()?

Nils M. Fredriksen




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

Date: Thu, 07 May 1998 07:51:32 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: edepot <phlin@ix.netcom.com>
Subject: Re: Win95 Perl scripts DONT WORK on UNIX
Message-Id: <3551AE54.30B04EA8@houston.Geco-Prakla.slb.com>

[cc to cited author]

On a day, not unlike other days, edepot scribed merrily:
<snip>
> My question is, HOW DO YOU STRIP THE
> "^M" character? 
Why not just do an ASCII mode transfer????  FTP will automagically
handle the newline character translation process for you.

<snip>
> Thanks.
Cheers,
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: Thu, 7 May 1998 12:58:45 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Win95 Perl scripts DONT WORK on UNIX
Message-Id: <3551B005.24E32D90@inlink.com>

> > The reason is that Windows (or DOS) puts a
> > character "^M" after a line, and UNIX perl
> > does NOT understand this character.

Perl DOES understand this character, it just shouldn't be there so it
generates an error!

:-)

Brent


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

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

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