[10922] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4523 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 31 09:07:20 1998

Date: Thu, 31 Dec 98 06:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 31 Dec 1998     Volume: 8 Number: 4523

Today's topics:
        a better way? <tavi367@ibm.net>
    Re: Absolute Yuck <dgris@moiraine.dimensional.com>
    Re: Absolute Yuck bhoylma@uswest.com
    Re: Adding a path to the @INC variable <mpersico@erols.com>
        Changing Environment Variables in a shell <partha@mihy.mot.com>
    Re: Changing Environment Variables in a shell <Alex.Davies@tiuk.ti.com>
        command line arguments on NT jfreedman@securitydynamics.com
    Re: command line arguments on NT (Alastair)
        Copy a file in NT? <iblake@kodak.com>
    Re: Flock not working Can't figure out why! <support@counter.w-dt.com>
    Re: Flock not working Can't figure out why! <skilchen@swissonline.ch>
    Re: Getting error with "chomp" <trent@jps.net>
    Re: Getting error with "chomp" (Bart Lateur)
    Re: Homepage- Search Engine with ASP or PERL ? <matthew.sergeant@eml.ericsson.se>
    Re: Homepage- Search Engine with ASP or PERL ? (Clay Irving)
        Looking for script to do bulletin baord with yvan@intersolutions.com
    Re: Looking for script to do bulletin baord with (Alastair)
    Re: Looking for script to do bulletin baord with (Burt Lewis)
        Need Help: Beginners to Perl (Iskandar D)
    Re: Need Help: Beginners to Perl (Alastair)
    Re: Need sample TCP code <david@kasey.umkc.edu>
    Re: No UNIX command-line <nospam@nospam.com>
    Re: Perl Cookbook <mpersico@erols.com>
        Perl upgrade on sunos 4.1.3C <cadams@teleport.com>
        Problem with Net::SMTP under NT <beekmans@iae.nl>
    Re: Problems with HTTPD-Tools-0.55 Perl 5.005_2 (Randy Kobes)
    Re: Protecting my script from form data bhoylma@uswest.com
    Re: Question: Socket with perl/tk? <carvdawg@patriot.net>
    Re: random number problem <skilchen@swissonline.ch>
    Re: Retrospective on comp.lang.perl.moderated? jfreedman@securitydynamics.com
    Re: tutorial websites <trent@jps.net>
    Re: When hashing won't work... <uri@home.sysarch.com>
        wildcard <mox@videotron.ca>
    Re: wildcard (Bart Lateur)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 31 Dec 1998 00:49:04 -0600
From: <tavi367@ibm.net>
Subject: a better way?
Message-Id: <368b1e56.0@news1.ibm.net>

I have this little piece of code...

   $fileContents =~ s!(^.*<title>)([\w|\W]*)(<\/title>.*$)!$2!gis;
   $fileContents =~ s![\W\s]+! !gis;

It returns the text between <TITLE> and </TITLE>, and it works fine, if the
passed string contains both sub-strings.

How can I get this to give me an empty string if either of my 2 conditions
are not true (besides placing them in an IF conditional)?

Thanks for your help.

Walter

PS: Please cc my e-mail on any replies.





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

Date: 31 Dec 1998 00:45:48 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Absolute Yuck
Message-Id: <m3r9tgkb4j.fsf@moiraine.dimensional.com>

JTJ <elssa09@erase.callisto.si.usherb.ca> writes:

> This is silly ... I can do this, can't I?

No.

> I get this error message:
> Modification of a read-only value attempted at postcard.pl line 23.
> 
> 23:		$1 = @inputData;

You must assign $1 to another variable before you can modify it.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Thu, 31 Dec 1998 07:49:40 GMT
From: bhoylma@uswest.com
Subject: Re: Absolute Yuck
Message-Id: <76faak$7e4$1@nnrp1.dejanews.com>

In article <368AE152.5F89@erase.callisto.si.usherb.ca>,
  elssa09@erase.callisto.si.usherb.ca wrote:
> This is silly ... I can do this, can't I?
>
[...]
> Modification of a read-only value attempted at postcard.pl line 23.
>
> 23:		$1 = @inputData;
>

No, '$1' is a perl reserved variable.  Use another variable as the lvalue for
the above assignment statement.

--
  Bruce W. Hoylman (303-541-6557) -- bhoylma@uswest.com         ._ 0
   -     __0  "I intend to live forever...    /\/\    /\       /  //\.
-  - - _-\<,_  so far, so good."             /~/~~\/\/~~\     '  \>> |
 -  __(_)/_(_)_____________________________/\ /    \ \/\ \________\\ `_

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


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

Date: Thu, 31 Dec 1998 00:05:16 -0500
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Adding a path to the @INC variable
Message-Id: <368B060C.6749CA94@erols.com>

I am probably going to get flamed big-time here, but here it goes:

We are going to hardcode a non-standard path into our @INC before we
build perl.

Comments?

dave@mag-sol.com wrote:
> 
> In article <769e86$f8g$1@news.mel.aone.net.au>,
>   "douglas de vine" <douglasd@iig.com.au> wrote:
> > How do I add a path to the @INC variable which contains all the paths to
> > look for *pm files?
> 
> You can set a PERL5LIB environment variable, the contents of which will be
> prepended to @INC at runtime.
> 
> You can put a 'use lib /my/lib/directory' command in your Perl script.
> 
> You can manipulate @INC using any of the standard list functions like unshift
> or push.
> 
> hth,
> 
> Dave...
> 
> --
> Dave Cross
> Magnum Solutions Ltd: <http://www.mag-sol.com/>
> London Perl M[ou]ngers: <http://london.pm.org/>
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: Fri, 01 Jan 1999 14:59:43 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
Subject: Changing Environment Variables in a shell
Message-Id: <368C9587.DDFE742C@mihy.mot.com>

Hi,

I'm trying to change the environment variables of the shell using PERL.
Its a fact that the modifications are 'local' (PERLish) to the script
(and any child processes). Is there any way I can modify the Environment
variables (%ENV) of the current shell?

What I want to do is to set the environment variables (like PATH, etc.,)
dynamically as when required - this way we can have a script which can
take the s/w package name as argument and make the appropriate settings
to the environment.

Thanks



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

Date: Thu, 31 Dec 1998 12:05:59 +0000
From: Alex Davies <Alex.Davies@tiuk.ti.com>
To: rpsarathi@usa.net
Subject: Re: Changing Environment Variables in a shell
Message-Id: <368B68A7.768190EB@tiuk.ti.com>

Ramanujam Parthasarathi wrote:

> Hi,
>
> I'm trying to change the environment variables of the shell using PERL.
> Its a fact that the modifications are 'local' (PERLish) to the script
> (and any child processes). Is there any way I can modify the Environment
> variables (%ENV) of the current shell?
>

You can change the environent of the current shell (csh) by avoiding a
child
subprocess via alias :

alias  foobar  'eval `some_script`'

where some_script prints out the csh commands that you want eg.

#!/usr/local/bin/perl -w
print STDOUT  'set path = ( $path /some/other/bin )';

But this is a little clumsy...

>
> What I want to do is to set the environment variables (like PATH, etc.,)
> dynamically as when required - this way we can have a script which can
> take the s/w package name as argument and make the appropriate settings
> to the environment.

So how about a wrapper script, something like:

#!/usr/local/bin/perl -w

use FindBin qw($Script);

$ENV{'PATH'} .= ':/some/other/bin';

exec $Script, @ARGV;


  ... then you can have foobar and its related commands all being links
to this one script. If the "s/w package" you mention can be determined from

the cwd or an EV then this can be easily fitted into the wrapper...

HTH,
alex.
_________________________________________________________________________

Alex Davies, MOS Design,               Email:  Alex.Davies@tiuk.ti.com
Texas Instruments Limited,
800 Pavillion Drive,                   Tel (work):  01604 663450
Brackmills Industrial Estate,              (home):  01604 764961
Northampton, NN4 7YL.
U.K.


>
>
> Thanks



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

Date: Thu, 31 Dec 1998 12:53:19 GMT
From: jfreedman@securitydynamics.com
Subject: command line arguments on NT
Message-Id: <76fs3v$ke5$1@nnrp1.dejanews.com>

I am a perl newbie ( and a sort of NT newbie). I am running Perl 5 on NT 4.0
using MSK shell windows and straight MS-DOS command windows. I can not get
the command line arguments - getopts gives me nothing and when I printot
$#ARGV I get -1. I am doing something wrong but what?
  Jerry Freedman,Jr

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


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

Date: Thu, 31 Dec 1998 13:14:31 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: command line arguments on NT
Message-Id: <slrn78mu66.5l.alastair@calliope.demon.co.uk>

jfreedman@securitydynamics.com <jfreedman@securitydynamics.com> wrote:
>I am a perl newbie ( and a sort of NT newbie). I am running Perl 5 on NT 4.0
>using MSK shell windows and straight MS-DOS command windows. I can not get
>the command line arguments - getopts gives me nothing and when I printot
>$#ARGV I get -1. I am doing something wrong but what?
  Jerry Freedman,Jr

Show us the code that doesn't work and someone might be able to help.


-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 31 Dec 1998 13:47:00 GMT
From: "Ian Blake" <iblake@kodak.com>
Subject: Copy a file in NT?
Message-Id: <01be34c3$f9dbc7f0$3282dd96@ko-gipd-w8gnlg7>

What I think I'm trying to do is pretty simple, though I'm new to PERL.  I
have a file that I use every time my program runs, but every time a
different line gets appended to the file.  Right now what I do is use the
NT copy command in back quotes to make a copy of the file then use the new
file everytime.  The only other way I could think to make a copy of the
file is to read in each line then print it to a new file.  Is there a more
effiecient way of making a copy of the file without using NT commands. 
This program could get used on a Unix machine which has a different command
for copy.  Basically what I'm asking is, does PERL have a built in copy
command?  Thanks

Ian Blake
iblake@kodak.com


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

Date: Wed, 30 Dec 1998 23:40:40 -0600
From: Mike <support@counter.w-dt.com>
Subject: Re: Flock not working Can't figure out why!
Message-Id: <368B0E57.EB8CDE4A@counter.w-dt.com>

I tried that it still doesn't give any errors and it still deletes the
file every once in a while.

Jonathan Feinberg wrote:

> Mike <support@counter.w-dt.com> writes:
>
> > My flock isn't working in my program. It appears to work, doesn't
> > give any errors or anything
>
> > flock($handle,2);
>
> How could it possibly "give any errors" if you're not asking it for
> them?
>
>   flock($handle, LOCK_EX) || die "Can't lock: $!\n";
>
> --
> Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
> http://pobox.com/~jdf



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

Date: Thu, 31 Dec 1998 14:15:51 +0100
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Flock not working Can't figure out why!
Message-Id: <76fu23$coh1@news-sol.swissonline.ch>

Mike schrieb in Nachricht <368A7F6D.3875AEEF@counter.w-dt.com>...
>My flock isn't working in my program.
[...]

>$handle = "ADSTATS";
>open ($handle, "$adstats") || &erroropen;
>&lockshare;

Do you really want a shared lock? What happens to your counters if more
than one process is reading the file, before one of them updates the file?

[...]

>$handle = "ADSTATS";
>open ($handle, ">$adstats") || &erroropen;

This open destroys the file contents, before flock gets a chance to do its
job. The call to open is not blocked by flock'ing a file. So although if
some process holds a valid lock, it is still possible for another process
to call the above line.

A better way would be:
- open the file in read/write mode
- set an exclusive lock
- read/process the file contents
- set the file pointer back to the start
- truncate the file contents
- write out the newly computed file contents
- close the file


--
Samuel Kilchenmann
skilchen@swissonline.ch







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

Date: Wed, 30 Dec 1998 13:37:00 -0800
From: Trent <trent@jps.net>
Subject: Re: Getting error with "chomp"
Message-Id: <368A9CFC.10@jps.net>

I transferred a (working) script to another server running Perl 5, but
with a different OS, and gotten errors too.

I finally had to replace with chop.

Interesting...


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

Date: Thu, 31 Dec 1998 11:33:33 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Getting error with "chomp"
Message-Id: <368c60bc.6983329@news.skynet.be>

Trent wrote:

>I transferred a (working) script to another server running Perl 5, but
>with a different OS, and gotten errors too.
>
>I finally had to replace with chop.

No way.

I bet that it's running the wrong version of Perl. (Most servers support
both a Perl4 and a Perl5 port).

	Bart.


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

Date: Thu, 31 Dec 1998 11:02:14 +0000
From: Matt Sergeant <matthew.sergeant@eml.ericsson.se>
Subject: Re: Homepage- Search Engine with ASP or PERL ?
Message-Id: <368B59B6.79BED439@eml.ericsson.se>

Philip Class wrote:
> 
> Does someone have an example of a Search Engine, to browse through indexed
> pages on a Homepage (not to crawl through the whole WWW). ?
> There's a nice example of a Search Engine using Javascript on
> http://www.infohiway.com/javascript/search/wildcard.htm. But this might
> become too slow to index big Websites with many pages.
> 
> Is there a similar way of using ASP to automatically index a whole directory
> & subdirectories and use these keywords lateron in a search-field in the
> Website ?
> These keywords may be stored in an array (like in the Javascript example).
> Or would it be more efficient to use a cgi-PERL Script instead of ASP or
> Javascript ?

There's a search engine written in pure perl called ICE (or ICE2). I
can't remember the URL, but it does full text indexing and searches, and
is quite quick (quicker than a linear search of all files).

I use it on my personal workstation to search my perl documentation, and
Java docs.

If you can't find it on the web, mail me and I can send you the files, I
had to fix it up slightly to work on Win32.

-- 
<Matt/>

| Fastnet Software Ltd              |   Perl in Active Server Pages   |
| Perl Consultancy, Web Development |   Database Design   |    XML    |
| http://come.to/fastnet            |    Information Consolidation    |


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

Date: 31 Dec 1998 08:29:35 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Homepage- Search Engine with ASP or PERL ?
Message-Id: <76fu7v$1ka@panix.com>

In <368B59B6.79BED439@eml.ericsson.se> Matt Sergeant <matthew.sergeant@eml.ericsson.se> writes:
>Philip Class wrote:

>> Does someone have an example of a Search Engine, to browse through indexed
>> pages on a Homepage (not to crawl through the whole WWW). ?
>> There's a nice example of a Search Engine using Javascript on
>> http://www.infohiway.com/javascript/search/wildcard.htm. But this might
>> become too slow to index big Websites with many pages.

>> Is there a similar way of using ASP to automatically index a whole directory
>> & subdirectories and use these keywords lateron in a search-field in the
>> Website ?
>> These keywords may be stored in an array (like in the Javascript example).
>> Or would it be more efficient to use a cgi-PERL Script instead of ASP or
>> Javascript ?

>There's a search engine written in pure perl called ICE (or ICE2). I
>can't remember the URL, but it does full text indexing and searches, and
>is quite quick (quicker than a linear search of all files).

Perl Reference -> Search for ICE:

    ICE

    http://www.pi.informatik.tu-darmstadt.de/~neuss/ice/ice.html
    (USA Mirror: http://ice.cornell-iowa.edu/)

    ICE (current Version 1.5b3r1, September 1998) is an easy to install 
    software package for indexing World Wide Web archives. By installing 
    it as a CGI gateway under your Web server, users can perform searches
    on the Web servers document space. 

-- 
Clay Irving
clay@panix.com


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

Date: Thu, 31 Dec 1998 12:02:49 GMT
From: yvan@intersolutions.com
Subject: Looking for script to do bulletin baord with
Message-Id: <76fp59$iev$1@nnrp1.dejanews.com>

Does anyone here know where I might find a cgi/perl script that I can use to
do a bulletin board with, .. free or otherwise?  I'm looking for something
that allows people to upload and post images along with their messages.  Any
help would be much appreciated.

thanks,
-- yvan@intersolutions.com


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


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

Date: Thu, 31 Dec 1998 13:17:32 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Looking for script to do bulletin baord with
Message-Id: <slrn78mubr.5l.alastair@calliope.demon.co.uk>

yvan@intersolutions.com <yvan@intersolutions.com> wrote:
>Does anyone here know where I might find a cgi/perl script that I can use to
>do a bulletin board with, .. free or otherwise?  I'm looking for something
>that allows people to upload and post images along with their messages.  Any
>help would be much appreciated.

Since you're posting from Dejanews, did you think to search the archive?

http://www.dejanews.com/home_ps.shtml

Search the 'forum' : comp.lang.perl.misc
for : bulletin board

HTH.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 31 Dec 1998 13:25:04 GMT
From: burt@ici.net (Burt Lewis)
Subject: Re: Looking for script to do bulletin baord with
Message-Id: <76ftvg$oue$1@bashir.ici.net>

You should find something at:

http://www.cgi-resources.com/Programs_and_Scripts/Perl/

Burt Lewis



In article <76fp59$iev$1@nnrp1.dejanews.com>, yvan@intersolutions.com 
says...
>
>Does anyone here know where I might find a cgi/perl script that I can use 
to
>do a bulletin board with, .. free or otherwise?  I'm looking for something
>that allows people to upload and post images along with their messages.  
Any
>help would be much appreciated.
>
>thanks,
>-- yvan@intersolutions.com
>
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    



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

Date: Thu, 31 Dec 1998 12:55:31 GMT
From: thekrow@iname.com (Iskandar D)
Subject: Need Help: Beginners to Perl
Message-Id: <368b6d90.9322759@news.singnet.com.sg>

hi there,
             i'm keen to lean PERL.  the thing is that where do i
start and how?   i'm planning to install Linux on my system.  can it
run in Linux OS ?   thanks in advance.


cheers,
           iskandar d
           thekrow@iname.com


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

Date: Thu, 31 Dec 1998 13:13:35 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Need Help: Beginners to Perl
Message-Id: <slrn78mu4e.5l.alastair@calliope.demon.co.uk>

Iskandar D <thekrow@iname.com> wrote:
>hi there,
>             i'm keen to lean PERL.  the thing is that where do i
>start and how?   i'm planning to install Linux on my system.  can it
>run in Linux OS ?   thanks in advance.

Yes. It runs on most operating systems. See ;

http://www.perl.com

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Thu, 31 Dec 1998 08:27:52 +0000
From: David L Nicol <david@kasey.umkc.edu>
Subject: Re: Need sample TCP code
Message-Id: <368B3588.FD7E4994@kasey.umkc.edu>

David Harris wrote:
> 
> I would really appreciate some help on this one.  I'm trying to find some
> sample code to allow me to make an http request from within a PERL script
> and then process the results.  I imagine I need to open up a TCP connection
> on port 80 to the host.  I would appreciate it if someone could show me some
> sample code on how to do this.  Thanks.
> 
> Happy Holidays,
> David

lynx -source http://www.tipjar.com


______________________________________________________________________
 David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
      "... only defines a private destructor and has no friends"


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

Date: Wed, 30 Dec 1998 23:18:11 -0800
From: "David Christensen" <nospam@nospam.com>
Subject: Re: No UNIX command-line
Message-Id: <76f8s9$i2n$1@pollux.dnai.com>

FTMOM42:

As for chmod, MS file systems  don't have UNIX-style rwx
permissions.  Whether or not something is executable is based upon
filename extension (*.bat, *.com, *.exe).

To run a Perl program called "foo" on my Win98 and NT machines, I
type "perl foo" at the command prompt.  Of course, I installed
perl first...

Entering "perl foo" searches the path, finds the program
"perl.exe", and runs it with the command-line argument "foo".
"foo" is just a data file as far as MS is concerned.

Check out the FAQ posted to this news group for some really good
information (like where to get perl for Win32):

*** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Posted Twice
Weekly ***

David

--
PS  The above from/reply address is bogus to avoid spam.
    My username is dchrist, and my domain is dnai.com.

FTMOM42 wrote in message
<19981230030004.12580.00004088@ng-cr1.aol.com>...
>I have Win98 and I dont think I have UNIX.
>I have DOS, though.
>I need to run perl scripts but I cant use unix commands on DOS.
How do I run my
>scripts?
>My computer is a ItelPentiumII 64mb333mHz
>
>I need to run my programs.
> Are there any special commands for dos to run programs?
>I cant even set chmod on dos.




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

Date: Thu, 31 Dec 1998 00:12:17 -0500
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Perl Cookbook
Message-Id: <368B07B1.805BA8EC@erols.com>

Best damn book I ever bought for programming (Sorry Larry!. You're #2)
Certainly a lot more helpful for a learner than K&R! I take it home more
than once a week to read on the train as pleasure reading. I've even
adapted psgrep with some more switches and tweaked it for Solaris.
Thinking about providing hooks for any op system automagically. Also
will probably turn it into a module so I can use it in other perl
scripts. Will send these chagnes onto Tom when done so he can either 

publish them
fix them
bit-bucket them

He wrote it originally - his perogative.

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: Wed, 30 Dec 1998 22:27:03 -0800
From: Christopher Adams <cadams@teleport.com>
Subject: Perl upgrade on sunos 4.1.3C
Message-Id: <368B1937.58366AC9@teleport.com>

I had some problems upgrading Perl 5.000 to the latest version. I was
told that the operating system (SunOS 4.1.3C) should be upgraded if I
expect to be able to get a good Perl upgrade. During the upgrade, I get
to the "make install" and it has a problem with toke.c. I also
experienced problems with upgrading a new gcc compiler.

Has anyone experienced this with older versions of SunOS and is that the
likely problem.

--
Christopher Adams
cadams@teleport.com



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

Date: Thu, 31 Dec 1998 10:02:28 +0100
From: Marcel Beekmans <beekmans@iae.nl>
Subject: Problem with Net::SMTP under NT
Message-Id: <368B3DA4.F0D7C0F8@iae.nl>

The "Helo" part of the Net::SMTP module appears not to work under NT. It
in fact hangs up the complete IIS server. I need the "Helo" command to
make my application work, because the smtp-server of my provider is
configured in (they say a secure) way, that it needs this command. How
can I solve this problem?

Marcel Beekmans.



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

Date: 31 Dec 1998 06:12:29 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Problems with HTTPD-Tools-0.55 Perl 5.005_2
Message-Id: <slrn78m606.kd9.randy@theory.uwinnipeg.ca>

On Wed, 30 Dec 1998 16:36:56 -0500, Philip Green <pgreen@m2.msd.ray.com> wrote:
>This is a multi-part message in MIME format.

Hi,
   Most people prefer ordinary text messages ....

>I have Perl 5.005_2 on Solaris 7 and am unable to  get HTTPD-Tools-0.55
>working

[snip]

>m2# make test
>t/apache-groups.....Ambiguous call resolved as CORE::close(), 
	qualify as such or use & at lib/HTTPD/AdminBase.pm line 220.

This is a warning coming from perl 5.005_02 which you'll see
occasionally in some pre-5.005 modules - the author of the module will
probably fix it soon. It's most likely OK to ignore for now.

>Can't load MD5, skipping Message Digest Authentication tests
>Can't load MIME::Base64, skipping Basic Authentication tests
>Geez, we can't test much...

You need to install these 2 modules beforehand - if you're using the
CPAN shell (perl -MCPAN -e shell), simply do
	install MD5
	install MIME::Base64
Otherwise, grab them from your favourite CPAN site.

The fact that the rest of the tests passed OK probably means that,
once you install MD5 and MIME::Base64, you should have no problems
(ignoring the warnings of above).

-- 
		Best regards,
		Randy Kobes

Physics Department		Phone: 	   (204) 786-9399
University of Winnipeg		Fax: 	   (204) 774-4134
Winnipeg, Manitoba R3B 2E9	e-mail:	   randy@theory.uwinnipeg.ca
Canada				http://theory.uwinnipeg.ca/


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

Date: Thu, 31 Dec 1998 07:39:17 GMT
From: bhoylma@uswest.com
Subject: Re: Protecting my script from form data
Message-Id: <76f9n5$70c$1@nnrp1.dejanews.com>

In article <19981230103952.29088.00004147@ng102.aol.com>,
  groovy94@aol.com (Groovy94) wrote:
> >Lastly, it's probably safer to make sure that the string contains only
> >safe characters, rather than making sure it doesn't contain any unsafe
> >characters.
>
> Yes, but how do I make sure it contains only safe characters?
> Regards,
> Gil Hildebrand, Jr.
> Dynamic Scripts
>

I would advise you to visit Lincoln Stein's home page, and read his links on
web security.  Many of the concerns you have talked about are addressed in
some fashion.  He also has authored a few books on the subject:

http://stein.cshl.org/~lstein/

Examples of taint checking data (use the '-T' flag or have taint turned on, if
your server is Apache), safe 'sandboxes' for using user supplied data, etc.
abound in this very news group, but especially in the web related groups.
Hopefully you are asking these security questions there as well.

Trust no bit, especially if you have an unidentified audience such as that
found in an internet site.

Peace.

--
  Bruce W. Hoylman (303-541-6557) -- bhoylma@uswest.com         ._ 0
   -     __0  "I intend to live forever...    /\/\    /\       /  //\.
-  - - _-\<,_  so far, so good."             /~/~~\/\/~~\     '  \>> |
 -  __(_)/_(_)_____________________________/\ /    \ \/\ \________\\ `_

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


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

Date: Thu, 31 Dec 1998 05:41:40 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: Question: Socket with perl/tk?
Message-Id: <368B0E94.18C03458@patriot.net>

The "Advanced Perl Programming" book from OReilly and Assochas some
discussion that you may be interested in...

>
>
> 1. I am trying to make  client / server programs using perl/tk.
>     The server is made using C++.
>     The client will be made using perl/tk ( with GUI ).
>      But I need a bi-directional socket between these client / server
> programs.
>
> 2. The server C++ program will send a message at every 5 seconds to the
> client.
>     The client perl/tk program must receive this message and display on
> its GUI canvas.
>
> 3. But, anytime, if one of buttons on the client GUI program (perl/tk)
> is pushed, then
>     the corresponding message must be sent to the server and the server
> must receive this message.
>
> 4. So, I need a bidirectional socket with Non-blocking I/O.
>     I don't have any idea how to resolve this.
>
> Do you have any idea?
> Please, I need some grue's help.
>
> Heungmook Choi,
> Motorola.





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

Date: Thu, 31 Dec 1998 05:12:02 +0100
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: random number problem
Message-Id: <76etqu$bqm1@news-sol.swissonline.ch>

Justin schrieb in Nachricht <36896BD4.2DAE9A0@home.com>...
>i'm trying to get 10 random numbers between 0-50
>and i want all 10 random numbers to be different numbers
>so how do i make sure they are not same?

what about this one:
(i found it in a german book about algorithms named "Algorithmen
Arbeitsbuch" by Dietmar Herrmann, the original example is written in
pascal)

sub rand_k_perm {
  # get a random permutation of k numbers in the range 0 .. n
  my ($n, $k) = @_;
  my @range = 0..$n;
  my @result = ();

  for (my $i = 0; $i < $k; $i++) {
    my $r = int(rand($n - $i)) + $i;
    @range[$i, $r] = @range[$r, $i];
    push(@result, $range[$i]);
  }
  return @result;
}
print join(", ", rand_k_perm(50, 10);

is this similar to the "fisher_yates_shuffle" in perlfaq4?

--
Samuel Kilchenmann
skilchen@swissonline.ch





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

Date: Thu, 31 Dec 1998 13:01:20 GMT
From: jfreedman@securitydynamics.com
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <76fsj0$kqs$1@nnrp1.dejanews.com>

In article <769rs8$5dm$1@Mars.mcs.net>,
  les@MCS.COM (Leslie Mikesell) wrote:
> In article <1dkrrnt.nopl1dihi00wN@bos-ip-2-184.ziplink.net>,
> Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
> >> Yes, I thought the object of usenet was to exchange questions and
> >> answers easily.  I tried to answer a question and the answer bounced
> >> back to me instead of getting posted.  You can call that something
> >> other than a rejection if you like but the result is the same -
> >> the person who asked didn't get their answer.
> >
> >Did you actually bother to read the "bounce" message?
>
> Yes, I'd say "bothered" is the correct word.
>
> >> If the object of
> >> the other group is to make it difficult instead of easy, then I'm
> >> just too lazy to participate.
> >
> >Well, I guess that's your problem.  Registering for
> >comp.lang.perl.moderated is no more difficult than signing up for an
> >electronic mailing list.
>
> I know who I am.  Why should I attempt to prove it to someone else
> using an unreliable medium just so I could answer someone else's
> question?
>
>   Les Mikesell
>    les@mcs.com
>


I just tried to post to the moderated list and got the bounced message - what
a pile of ****. I have been using USENET since the mid 80s and this is the
first time I had to deal with something like that. Its a news group list, not
a securty check!!

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


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

Date: Wed, 30 Dec 1998 13:50:57 -0800
From: Trent <trent@jps.net>
Subject: Re: tutorial websites
Message-Id: <368AA041.787E@jps.net>

uunews@hotmail.com wrote:
> 
> Hi Folks,
>     I am looking for useful websites and mail servers on PERL.  Any help is
> appreciated.
> 
> Sincerely,
> Ali
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own


Hi, 

Go to Alta Vista and type:
+perl +tutorial
and you will get a BUNCH.

I really found Nick Silver's tutorial very helpful. (search for his
name)

If you need code examples type:
+perl +"usr/bin" 
and possibly the command etc., and you shall be very happy.


Trent


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

Date: 30 Dec 1998 23:40:43 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: When hashing won't work...
Message-Id: <x7lnjogbzo.fsf@home.sysarch.com>

>>>>> "MR" == Michael Rubenstein <miker3@ix.netcom.com> writes:

  MR> On 29 Dec 1998 09:10:38 -0500, Uri Guttman <uri@home.sysarch.com>
  MR> wrote:

  >>>>>>> "dhoward johnson's " == dave  <dave@mag-sol.com> writes:
  >> 
  >> dhoward johnson's > You need to escape @ characters in strings or Perl
  >> dhoward johnson's > will assume they denote an array which it will
  >> dhoward johnson's > attempt to interpolate.
  >> 
  >> dhoward johnson's > Something like this will work...
  >> 
  >> dhoward johnson's > $seen_email{'foo\@bar.com'} = 1;
  >> 
  >> sure it will work, but it is redundant. either single quotes OR a \ will
  >> suffice to quote the @.

  MR> The string 'foo\@bar.com' contains a backslash character.   Neither
  MR> "foo\@bar.com" nor 'foo@bar.com' do.

but the point was to get the string foo@bar.com as a hash key. that
means the \ is not wanted in the string. i should have been clearer that
i meant a \ will do in a "" string.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Thu, 31 Dec 1998 03:40:09 -0500
From: Benoit Lefebvre <mox@videotron.ca>
Subject: wildcard
Message-Id: <368B3868.B4415193@videotron.ca>

Hi, I am coding a kind of irc bot and I have a problem with wildcard
I have a file with all the infos about users, etc..
When a user msg the bot, eg: mox (user@test.net). I have that:
:mox!user@test.net. It's stored in $uhost
$uhost = ":mox!user@test.net";
The wildcard is in the config file.. eg:
$mask = "*!*@*.net";
It is possible to do something like:

if ($uhost =~ $mask) {
 op the user
}
else {
 unknown users
}


Thnx...



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

Date: Thu, 31 Dec 1998 09:45:31 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: wildcard
Message-Id: <368b466c.247821@news.skynet.be>

Benoit Lefebvre wrote:

>$uhost = ":mox!user@test.net";
>The wildcard is in the config file.. eg:
>$mask = "*!*@*.net";
>It is possible to do something like:
>
>if ($uhost =~ $mask) { ... } 

You must convert the $mask to a valid regexp pattern. That's not too
difficult:

	{
		# DOS compatible wildcards
		# replace "?" with ".", "*" with ".*", 
		# and make everything else safe
		my %wildcard = ( '?' => '.' , '*' => '.*' );
		($pattern=$mask) =~ s/(\W)/ $wildcard{$1} || "\\$1"/ge;
	}
	
Now, $pattern is a regexp pattern, which can be used like this:

	if ($uhost =~ /^$pattern$/) { ... } 

Note the begin- and end-anchors, otherwise, matching a substring would
be enough.

	Bart.


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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