[17931] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 91 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 18 14:10:43 2001

Date: Thu, 18 Jan 2001 11:10:17 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979845017-v10-i91@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 18 Jan 2001     Volume: 10 Number: 91

Today's topics:
    Re: isInNet() function <Peter.Dintelmann@dresdner-bank.com>
    Re: isInNet() function (Garry Williams)
    Re: isInNet() function snval0@my-deja.com
    Re: isInNet() function (Garry Williams)
        List Current Processes in Win32 <Jerry_Geist@infinium.com>
    Re: overload not autogenerating as expected <bart.lateur@skynet.be>
    Re: overload not autogenerating as expected (Abigail)
        Perl Quotations <hazel.robinson@virgin.net>
        Perl script problem <ian@ianwaters.com>
    Re: Perl/IIS and open() jewoltman@my-deja.com
    Re: Perl/IIS and open() jewoltman@my-deja.com
        Problems splitting a string? <don@lclcan.com>
    Re: Problems splitting a string? <kstep@pepsdesign.com>
    Re: Problems splitting a string? <don@lclcan.com>
    Re: Problems splitting a string? <ren.maddox@tivoli.com>
    Re: Problems splitting a string? nobull@mail.com
        Randy et al. <a565a87@my-deja.com>
        Randy Kobes et al. <a565a87@my-deja.com>
        remove non word characters EXCEPT blank dts@netkonnect.net
    Re: Saving .htm file to disk from CGI script <lmoran@wtsg.com>
        Secure Space and Perl..help needed please (CyberPost)
    Re: Secure Space and Perl..help needed please (Abigail)
    Re: Win32::LookupAccountSID documentation? nobull@mail.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 18 Jan 2001 17:05:50 +0100
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: isInNet() function
Message-Id: <94749f$7rp2@intranews.bank.dresdner.net>

    Hi,

<snval0@my-deja.com> wrote in message news:94717q$7oh$1@nnrp1.deja.com...
> I would like to know if there is a function in Perl what can detect if
> an IP address belongs to a certain IP address range?

    write it yourself.

    What about (be careful - untested code)

        print isInNet( '0.0.0.0', '3.255.255.255', '3.2.3.4' );

        sub isInNet
        {   my ($start, $end, $ip) = @_;
            return convert($start) < convert($ip) && convert($ip) <
convert($end);

            sub convert {unpack( "L", join '',map chr,reverse
split(/\./,$_[0]) )}
        }

    isInNet takes the start address of your range, the end address and the
one
    to be tested as arguments.

    HTH.

        Peter Dintelmann





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

Date: Thu, 18 Jan 2001 16:30:30 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: isInNet() function
Message-Id: <GSE96.316$032.11145@eagle.america.net>

On Thu, 18 Jan 2001 15:14:10 GMT, snval0@my-deja.com
<snval0@my-deja.com> wrote:
>I would like to know if there is a function in Perl what can detect if
>an IP address belongs to a certain IP address range?
>In JavaScript it looks like this:
>
>if (isInNet(myIpAddress(), "123.123.123.0", "255.255.252.0"))
>{
><do something>
>}

Well, the first problem is that, if "123.123.123.0", "255.255.252.0"
is supposed to represent a network, it's nonsensical.  How can a
network address have one bits inside its host part?  

I didn't check CPAN, but it's trivial to code yourself.  Here's a
subroutine that will return true, if the first parameter is in the
network expressed by the second and third parameters, false, if not
and undef, if the parameters are not valid string forms of IP
addresses or nonsensical (like your example): 

  #!/usr/local/bin/perl
  use warnings;
  use strict;
  use Socket;

  sub is_in_net {
      my  ($addr, $net, $mask) = @_;
      for ($addr, $net, $mask) {
	  return undef unless $_ = inet_aton($_);
      }
      return undef unless ($net & $mask) eq $net;
      return(($addr & $mask) eq $net);
  }

  # Invalid parameters:
  print is_in_net("123.123.123.8", "123.123.123.0",
      "255.255.252.0"), "\n";

  # Legitimate tests: 
  print is_in_net("123.123.119.8", "123.123.120.0",
      "255.255.252.0"), "\n";
  print is_in_net("123.123.120.8", "123.123.120.0",
      "255.255.252.0"), "\n";
  print is_in_net("123.123.121.8", "123.123.120.0",
      "255.255.252.0"), "\n";
  print is_in_net("123.123.122.8", "123.123.120.0",
      "255.255.252.0"), "\n";
  print is_in_net("123.123.123.8", "123.123.120.0",
      "255.255.252.0"), "\n";
  print is_in_net("123.123.124.8", "123.123.120.0",
      "255.255.252.0"), "\n";

-- 
Garry Williams


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

Date: Thu, 18 Jan 2001 17:54:22 GMT
From: snval0@my-deja.com
Subject: Re: isInNet() function
Message-Id: <947ak8$h75$1@nnrp1.deja.com>

Guys,

Thanks for all your help.
It's working right now!
And yes I know that the IP address looked a bit strange, but I didn't
want to put the real one in :-)
Thanks again!

Fred.


In article <GSE96.316$032.11145@eagle.america.net>,
  garry@zvolve.com (Garry Williams) wrote:
> On Thu, 18 Jan 2001 15:14:10 GMT, snval0@my-deja.com
> <snval0@my-deja.com> wrote:
> >I would like to know if there is a function in Perl what can detect
if
> >an IP address belongs to a certain IP address range?
> >In JavaScript it looks like this:
> >
> >if (isInNet(myIpAddress(), "123.123.123.0", "255.255.252.0"))
> >{
> ><do something>
> >}
>
> Well, the first problem is that, if "123.123.123.0", "255.255.252.0"
> is supposed to represent a network, it's nonsensical.  How can a
> network address have one bits inside its host part?
>
> I didn't check CPAN, but it's trivial to code yourself.  Here's a
> subroutine that will return true, if the first parameter is in the
> network expressed by the second and third parameters, false, if not
> and undef, if the parameters are not valid string forms of IP
> addresses or nonsensical (like your example):
>
>   #!/usr/local/bin/perl
>   use warnings;
>   use strict;
>   use Socket;
>
>   sub is_in_net {
>       my  ($addr, $net, $mask) = @_;
>       for ($addr, $net, $mask) {
> 	  return undef unless $_ = inet_aton($_);
>       }
>       return undef unless ($net & $mask) eq $net;
>       return(($addr & $mask) eq $net);
>   }
>
>   # Invalid parameters:
>   print is_in_net("123.123.123.8", "123.123.123.0",
>       "255.255.252.0"), "\n";
>
>   # Legitimate tests:
>   print is_in_net("123.123.119.8", "123.123.120.0",
>       "255.255.252.0"), "\n";
>   print is_in_net("123.123.120.8", "123.123.120.0",
>       "255.255.252.0"), "\n";
>   print is_in_net("123.123.121.8", "123.123.120.0",
>       "255.255.252.0"), "\n";
>   print is_in_net("123.123.122.8", "123.123.120.0",
>       "255.255.252.0"), "\n";
>   print is_in_net("123.123.123.8", "123.123.120.0",
>       "255.255.252.0"), "\n";
>   print is_in_net("123.123.124.8", "123.123.120.0",
>       "255.255.252.0"), "\n";
>
> --
> Garry Williams
>


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 18 Jan 2001 18:05:15 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: isInNet() function
Message-Id: <vfG96.323$032.11756@eagle.america.net>

On Thu, 18 Jan 2001 17:05:50 +0100, Dr. Peter Dintelmann
<Peter.Dintelmann@dresdner-bank.com> wrote:
><snval0@my-deja.com> wrote in message news:94717q$7oh$1@nnrp1.deja.com...
>> I would like to know if there is a function in Perl what can detect if
>> an IP address belongs to a certain IP address range?
>
>    write it yourself.
>
>    What about (be careful - untested code)
>
>        print isInNet( '0.0.0.0', '3.255.255.255', '3.2.3.4' );
>
>        sub isInNet
>        {   my ($start, $end, $ip) = @_;
>            return convert($start) < convert($ip) && convert($ip) <
>convert($end);
>
>            sub convert {unpack( "L", join '',map chr,reverse
>split(/\./,$_[0]) )}
>        }

I think the OP meant for the parameters to be: 

  address to be tested
  network address
  network mask

where all of these are expressed in a dotted decimal string.  His
example was flawed in that the network address didn't make sense with
the given mask, but I think that's what he meant.  

You seem to be changing that profoundly.  Furthermore, your code to
convert a string form of an IP address into binary won't compile.  I
am confused about what you really intend.  Just use the Socket module
and its inet_aton() function.  It produces a 32-bit IP address data
element.  

-- 
Garry Williams


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

Date: Thu, 18 Jan 2001 12:01:59 -0500
From: "jg" <Jerry_Geist@infinium.com>
Subject: List Current Processes in Win32
Message-Id: <9477qg$71l$1@whqnews01.infinium.com>

Can someone point me in the direction of how to get the entire list of
processes which are showing in the Windows NT Task Manager into a list.
After I close a program, it sometimes leaves child tasks running and I need
to check and see whether it exists or not.

Thanks .




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

Date: Thu, 18 Jan 2001 17:20:00 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: overload not autogenerating as expected
Message-Id: <259e6tgrgfmc5fesvlrt63k858ick8kk4t@4ax.com>

Uri Guttman wrote:

>i am not an expert on overload but in rereading the docs it seems that
>only "" explicitly stringifies. since perl sees $x is overloaded, it
>looks for an eq method in your class. it does not have the brains to
>stringify first and just use internal eq. whereas it can convert an eq
>to a cmp call which you figured out.

At first sight,that doesn't make sense to me. I've always been told that

	$a eq $b

stringifies the arguments before doing the comparison on strings. An
overloaded eq doesn't feel right, unless... unless you wat to misuse the
"eq" operator for doing other tests, such as "is this the same object?"
or "is this an identical (but optionally a different) object?".

Since testing references using == actually compares addresses, i.e.
testing if it's the same object, so option B seems most appropriate as a
choice for 'eq'. So, after some thought, overloading 'eq' does seem
quite appropriate after all.

-- 
	Bart.


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

Date: 18 Jan 2001 18:48:28 GMT
From: abigail@foad.org (Abigail)
Subject: Re: overload not autogenerating as expected
Message-Id: <slrn96eejs.u7n.abigail@tsathoggua.rlyeh.net>

Bart Lateur (bart.lateur@skynet.be) wrote on MMDCXCVII September MCMXCIII
in <URL:news:259e6tgrgfmc5fesvlrt63k858ick8kk4t@4ax.com>:
,, Uri Guttman wrote:
,, 
,, >i am not an expert on overload but in rereading the docs it seems that
,, >only "" explicitly stringifies. since perl sees $x is overloaded, it
,, >looks for an eq method in your class. it does not have the brains to
,, >stringify first and just use internal eq. whereas it can convert an eq
,, >to a cmp call which you figured out.
,, 
,, At first sight,that doesn't make sense to me. I've always been told that
,, 
,, 	$a eq $b
,, 
,, stringifies the arguments before doing the comparison on strings. An
,, overloaded eq doesn't feel right, unless... unless you wat to misuse the
,, "eq" operator for doing other tests, such as "is this the same object?"
,, or "is this an identical (but optionally a different) object?".
,, 
,, Since testing references using == actually compares addresses, i.e.
,, testing if it's the same object, so option B seems most appropriate as a
,, choice for 'eq'. So, after some thought, overloading 'eq' does seem
,, quite appropriate after all.


Either I don't understand what you want to do, or I do, but then you
are properly better of overloading "".


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");


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

Date: Thu, 18 Jan 2001 18:50:46 -0000
From: "Hazel Robinson" <hazel.robinson@virgin.net>
Subject: Perl Quotations
Message-Id: <qZG96.8096$3N1.165494@news2-win.server.ntlworld.com>

Please could any one respond to me if they would be able to quote on Perl
programming or if you know of anyone who will quote for writing Perl/CGI  -
Don, I apologise for replying to your query when I was trying to get into
the newsgroup.

Thanks
Hazel




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

Date: Thu, 18 Jan 2001 17:25:11 -0000
From: "Ian Waters" <ian@ianwaters.com>
Subject: Perl script problem
Message-Id: <94788h$f0u$1@newsg2.svr.pol.co.uk>

I am writting a script for an online quiz.  I was told that the best way to
test the answers was using the following method

my %answers=(
    q1  =>'answer1',
    q2  =>'answer2',
);
use CGI qw/:standard/;
my $score=0;
foreach my $question (keys %answers) {
    if (param($question) eq $answers{$question}) {
    $score++;
    }
}
However, I do not have the CGI.pm module installed on my server and I cant
install it as I do not have telnet access.  Is there another way of testing
the answers in my web page by using the standard form parsing routine.  I
have tried using scalars and contional variables which works if there is
only one question in the form but as soon as I add more I get an internal
server error.




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

Date: Thu, 18 Jan 2001 17:57:56 GMT
From: jewoltman@my-deja.com
Subject: Re: Perl/IIS and open()
Message-Id: <947aqt$hat$1@nnrp1.deja.com>

Thanks all for your suggestions, but nothing
works.
Here is the exact code I'm using (to test with)

use CGI ':standard';
print header;
open (FILE, "test.html") or die eval
(print "Error<BR>$!");
for $line (<FILE>)
{
	print $line;
}

The file test.html is in the same directory as
the script.  It *should* work, right?  I'm new
perl and I'm probably doing something stupid
In article
<94679o$hig7@eccws12.dearborn.ford.com>,
  "Trevor Ward" <tward10@jaguar.com> wrote:
> Perl doesn't work the same as the Web browser.
It won't resolve Unix paths
> on a windows box. or at least thats my theory.
>
> However work relevant to your current path so
you have c:\web\site\cgi-bin
> as your current path
> and you data files are in c:\web\site\data all
you do is $filename =
> '../data/logs.txt';
>
> Well hope this helps
>
> John Woltman <jew208@psu.edu> wrote in message
> news:tPo96.125$cN.6302@bgtnsc07-
news.ops.worldnet.att.net...
> > I tried giving the CGI script the full path
name (d:/www/log/log.txt) and
> it
> > worked.  But I don't know the full path on
the production server.  I
> *know*
> > the path is correct because if I use the same
script to generate a link to
> > the log file then the link works.
> > like this:
> >     $filename = "/logs/log.txt";
> >     print "<a href=\"$filename\">link</a>";
# takes me to correct file
> >     open (HFILE, $filename);   #bombs.
> > This is the error code I get when I include
an "or die" for the open()
> > statement.
> >     error opening /logs/log.txt: No such file
or directory
> > The file *does* exist, but I don't know what
else the problem could be.
> > Could it be something else?
> > Thanks for your help so far.
> >   - John Woltman
> >
> > "Ron Grabowski" <ronnie@catlover.com> wrote
in message
> > news:3A6611E0.F13291F8@catlover.com...
> > > >     open(hFile, $filename);
> > >
> > > You are not checking for errors. Perhaps
you are in the wrong directory.
> > > Also try chdir
('c:/winnt/system32/logfiles/'); or something
similiar.
> > >
> > > open( HFILE, $filename) or die("error
opening $filename: $!");
> > >
> > > >
> > > >     for $line ( <hFile>)
> > > >     {
> > > >         print $line;
> > > >     }
> > >
> > > print <HFILE>;
> > >
> > > - Ron
> >
> >
>
>



Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 18 Jan 2001 18:03:49 GMT
From: jewoltman@my-deja.com
Subject: Re: Perl/IIS and open()
Message-Id: <947b5t$ho4$1@nnrp1.deja.com>

Thank you both for your posts, but the script is still not working.
Here's the script I'm using:


use CGI ':standard';
print header;
if ( open (FILE, "test.html") )
{
	for $line (<FILE>)
	{
		print $line;
	}
}
else
{
	print "Error: $!";
}

This file is in my cgi-bin directory, and so is "test.html", but it
does not work.  The error it gives me it says
"Error: NO such file or directory".  Am I doing something dumb?  I'm
new to perl, and thought this script would work.
Thanks again for the help,
  - John Woltman

In article <94679o$hig7@eccws12.dearborn.ford.com>,
  "Trevor Ward" <tward10@jaguar.com> wrote:
> Perl doesn't work the same as the Web browser. It won't resolve Unix
paths
> on a windows box. or at least thats my theory.
>
> However work relevant to your current path so you have
c:\web\site\cgi-bin
> as your current path
> and you data files are in c:\web\site\data all you do is $filename =
> '../data/logs.txt';
>
> Well hope this helps


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 18 Jan 2001 12:45:16 -0500
From: Don <don@lclcan.com>
Subject: Problems splitting a string?
Message-Id: <3A672BAC.8904363F@lclcan.com>

Hi,

I have a scaler variable that holds the following:

$text = "AACHEN              |GERMANY             |N|HAMBURG
|10|4|TRUCK|";

I wish to break it up into 7 variables so I have coded as such:

my ($port, $country, $suspended, $transPort, $transit, $tranship,
$disposition);
($port, $country, $suspended, $transPort, $transit, $tranship,
$disposition) = split(/|/, $text);

However, when I inspect the contents of the variables by printing each
on a seperate line, they contain:
A
A
C
H
E
N

Is there a problem with my code that uses split?

Thanks,
Don



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

Date: Thu, 18 Jan 2001 12:52:58 -0500
From: "Kurt Stephens" <kstep@pepsdesign.com>
Subject: Re: Problems splitting a string?
Message-Id: <947ag6$hmj$1@slb7.atl.mindspring.net>

"Don" <don@lclcan.com> wrote in message news:3A672BAC.8904363F@lclcan.com...
> Hi,
>
> I have a scaler variable that holds the following:
>
> $text = "AACHEN              |GERMANY             |N|HAMBURG
> |10|4|TRUCK|";
>
> I wish to break it up into 7 variables so I have coded as such:
>
> my ($port, $country, $suspended, $transPort, $transit, $tranship,
> $disposition);
> ($port, $country, $suspended, $transPort, $transit, $tranship,
> $disposition) = split(/|/, $text);
>
> However, when I inspect the contents of the variables by printing each
> on a seperate line, they contain:
> A
> A
> C
> H
> E
> N

The problem is in the regex used by split - /|/ means 'match a zero length
string or another zero length string'.  Splitting with a zero length string
returns a list consisting of each character of the input, which is what you
have.  Try escaping the '|' character:

my ($port, $country, $suspended, $transPort,
       $transit, $tranship, $disposition) = split(/\|/, $text);

HTH

Kurt Stephens





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

Date: Thu, 18 Jan 2001 13:02:34 -0500
From: Don <don@lclcan.com>
Subject: Re: Problems splitting a string?
Message-Id: <3A672FBA.265E6B43@lclcan.com>

Worked like a charm!

Thanks.

Kurt Stephens wrote:

> "Don" <don@lclcan.com> wrote in message news:3A672BAC.8904363F@lclcan.com...
> > Hi,
> >
> > I have a scaler variable that holds the following:
> >
> > $text = "AACHEN              |GERMANY             |N|HAMBURG
> > |10|4|TRUCK|";
> >
> > I wish to break it up into 7 variables so I have coded as such:
> >
> > my ($port, $country, $suspended, $transPort, $transit, $tranship,
> > $disposition);
> > ($port, $country, $suspended, $transPort, $transit, $tranship,
> > $disposition) = split(/|/, $text);
> >
> > However, when I inspect the contents of the variables by printing each
> > on a seperate line, they contain:
> > A
> > A
> > C
> > H
> > E
> > N
>
> The problem is in the regex used by split - /|/ means 'match a zero length
> string or another zero length string'.  Splitting with a zero length string
> returns a list consisting of each character of the input, which is what you
> have.  Try escaping the '|' character:
>
> my ($port, $country, $suspended, $transPort,
>        $transit, $tranship, $disposition) = split(/\|/, $text);
>
> HTH
>
> Kurt Stephens



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

Date: 18 Jan 2001 11:49:19 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Problems splitting a string?
Message-Id: <m3ely0rbs0.fsf@dhcp11-177.support.tivoli.com>

Don <don@lclcan.com> writes:

> $disposition) = split(/|/, $text);

The problem is that "|" is special in a regular expression -- it means
"OR".  So you are splitting on nothing or nothing, which always
matches, which means you split at every opportunity.

The fix is simply to escape the "|":

  split /\|/, $text;

-- 
Ren Maddox
ren@tivoli.com


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

Date: 18 Jan 2001 18:08:07 +0000
From: nobull@mail.com
Subject: Re: Problems splitting a string?
Message-Id: <u93degg2d4.fsf@wcl-l.bham.ac.uk>

Don <don@lclcan.com> writes:

> split(/|/, $text);

| is a Perl regular expression metacharacter.

To escape metacharacters in Perl regular expressions use \

split(/\|/, $text);

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 18 Jan 2001 18:13:15 GMT
From: Rob <a565a87@my-deja.com>
Subject: Randy et al.
Message-Id: <947bnh$i9f$1@nnrp1.deja.com>

Randy et al,

I succeeded--I think--in building the perl/Perl environment from the
latest source

release last week.  A resource that I relied upon was one of the
O'Reilly books, either

the Camel or the MacEachern.  After fiddling around enough with
MSVC60's nmake and

reading parts of those books I came to see that I might be feeding the
wrong arguments

to nmake.  (I was doing stuff like writing "nmake makefile" and "nmake -
f makefile"

when what I really should have been doing was writng two simple lines):

     nmake test
     nmake install

I _think_ that the results I've managed to achieve are correct.   One
of the documents

on the perl sites I've read have mentioned that the thing would build
and then it would

try to test and some of the tests would be skipped--all events that I
experienced over

the course of several minutes.  And it would be set up on the path that
I had

preselected in the makefile (which successfully happened).  So the
evidence shows that

I may have a functional perl/Perl setup.  I think.

I say "I think" because I don't know perl.  Yet.  I also use Windows NT
4 Workstation

while just about everyone else around here seems to be hacking UN*X.
Fine.  I'll

eventually get around to installing FreeBSD.  But the whole reason I
wanted to immerse

myself into learning Perl and Apache and mod_perl and Apache::ASP is
that I wanted an

alternative to IIS (which I also don't know).  I also really like the
Apache logo.  Who

knows--I may even eventually buy the books that I've been reading
standing up in the

bookstore.

First things first though.  The INSTALL.Win32 File reads like a
treasure map.  It's

ambiguous at best.  As a Windows user, I can read at least 10 different
meanings into a

statement like

     run 'perl Makefile.PL'
     run 'nmake install'

     "This will install the Perl side of mod_perl and setup files for
the library."

Which appears to be the very first order of business in the document.
As a perl

neophyte, I have to say that I don't know what the aforementioned pair
of lines

means--or the sentence that follows them.  After all:  I already
_installed_ "the Perl

side of mod_perl and setup files for the library," didn't I?  By virtue
of the

build/install process that I've outlined at the top of this post?
(That's what I mean

when I say that, with all of this perl/mod_perl/Apache integration, I
could

accidently--or ignorantly--be focusing on one objective using
information that really

applies to another.)  Really confusing for me as a beginner.  "...setup
files for"

which library?!  The mod_perl library?  The perl library?  The Apache
library?

I open the console.  I type "run 'perl Makefile.PL'" which obviously
doesn't work.  I

type "perl Makefile.PL" which doesn't work either.  Why?, I ask
myself.  Maybe it's

because I'm not in the perl directory path.  (Do I even need to be in
the perl

directory if I've built and installed perl correctly, as I "_think_" I
have.  Shouldn't

my "Path" have taken care of that?  Where does that "Path" information
get entered?  In

the Autoexec.bat file?  Or is there a different "Path" that the
documentation is

implying other than that for the Autoexec.bat?)

I give up.  I actually manually drill down into the C:\perl path that
my prior build a

week ago had automatically set up for me and I get to the point where I
can freely type

"perl."

Now I see that after I've typed "perl" that the cursor moves down one
line and blinks.

Should I have instead types "perl Makefile.PL"?  No--I don't think so.
Because if if I

do that then I draw an error message of some kind.  Okay (I say to
myself again), I'll

just type "Makefile.PL" on the next line where the cursor is cuurently
blinking.  That

achieves nothing that I can discern.  Then only way I can exit the
console is buy

pointing my mouse to the close button at the upper right of the console.

I need your help here.  What are the first and second orders of
business in the

INSTALL.Win32 File?  And is there a way that someone on this board can
guide me through

this?  Or answer a few of the questions I've asked above?

Whe this is all over, I may rewrite the documentation in a clear,
concise fashion that

would allow others in my predicament who follow in these footsteps to
save some

trouble.

Thank you all again--really, sincerely--for any information that you
can provide.

-Rob


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 18 Jan 2001 18:15:26 GMT
From: Rob <a565a87@my-deja.com>
Subject: Randy Kobes et al.
Message-Id: <947brk$ict$1@nnrp1.deja.com>

Randy et al,

I succeeded--I think--in building the perl/Perl environment from the
latest source release last week.  A resource that I relied upon was one
of the O'Reilly books, either the Camel or the MacEachern.  After
fiddling around enough with MSVC60's nmake and reading parts of those
books I came to see that I might be feeding the wrong arguments to
nmake.  (I was doing stuff like writing "nmake makefile" and "nmake -f
makefile" when what I really should have been doing was writng two
simple lines):

     nmake test
     nmake install

I _think_ that the results I've managed to achieve are correct.   One
of the documents on the perl sites I've read have mentioned that the
thing would build and then it would try to test and some of the tests
would be skipped--all events that I experienced over the course of
several minutes.  And it would be set up on the path that I had
preselected in the makefile (which successfully happened).  So the
evidence shows that I may have a functional perl/Perl setup.  I think.

I say "I think" because I don't know perl.  Yet.  I also use Windows NT
4 Workstation while just about everyone else around here seems to be
hacking UN*X.  Fine.  I'll eventually get around to installing
FreeBSD.  But the whole reason I wanted to immerse myself into learning
Perl and Apache and mod_perl and Apache::ASP is that I wanted an
alternative to IIS (which I also don't know).  I also really like the
Apache logo.  Who knows--I may even eventually buy the books that I've
been reading standing up in the bookstore.

First things first though.  The INSTALL.Win32 File reads like a
treasure map.  It's ambiguous at best.  As a Windows user, I can read
at least 10 different meanings into a statement like

     run 'perl Makefile.PL'
     run 'nmake install'

     "This will install the Perl side of mod_perl and setup files for
the library."

Which appears to be the very first order of business in the document.
As a perl neophyte, I have to say that I don't know what the
aforementioned pair of lines means--or the sentence that follows them.
After all:  I already _installed_ "the Perl side of mod_perl and setup
files for the library," didn't I?  By virtue of the build/install
process that I've outlined at the top of this post?  (That's what I
mean when I say that, with all of this perl/mod_perl/Apache
integration, I could accidently--or ignorantly--be focusing on one
objective using information that really applies to another.)  Really
confusing for me as a beginner.  "...setup files for" which library?!
The mod_perl library?  The perl library?  The Apache library?

I open the console.  I type "run 'perl Makefile.PL'" which obviously
doesn't work.  I type "perl Makefile.PL" which doesn't work either.
Why?, I ask myself.  Maybe it's because I'm not in the perl directory
path.  (Do I even need to be in the perl directory if I've built and
installed perl correctly, as I "_think_" I have.  Shouldn't my "Path"
have taken care of that?  Where does that "Path" information get
entered?  In the Autoexec.bat file?  Or is there a different "Path"
that the documentation is implying other than that for the
Autoexec.bat?)

I give up.  I actually manually drill down into the C:\perl path that
my prior build a week ago had automatically set up for me and I get to
the point where I can freely type "perl."

Now I see that after I've typed "perl" that the cursor moves down one
line and blinks.  Should I have instead types "perl Makefile.PL"?  No--
I don't think so.  Because if if I do that then I draw an error message
of some kind.  Okay (I say to myself again), I'll just
type "Makefile.PL" on the next line where the cursor is cuurently
blinking.  That achieves nothing that I can discern.  Then only way I
can exit the console is buy pointing my mouse to the close button at
the upper right of the console.

I need your help here.  What are the first and second orders of
business in the INSTALL.Win32 File?  And is there a way that someone on
this board can guide me through  this?  Or answer a few of the
questions I've asked above?

Whe this is all over, I may rewrite the documentation in a clear,
concise fashion that would allow others in my predicament who follow in
these footsteps to save some trouble.

Thank you all again--really, sincerely--for any information that you
can provide.

-Rob


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 18 Jan 2001 18:31:54 GMT
From: dts@netkonnect.net
Subject: remove non word characters EXCEPT blank
Message-Id: <947cqq$j6s$1@nnrp1.deja.com>

I am trying to come up with a simple way to remove non word characters
from a string, while still preserving blank spaces.  The following
works for removing all non-word characters including blanks;


$var1='this is(%#';
$var2=$var1;
$var2=~ s/[^a-zA-Z_0-9]//g;
print "var1 is $var1 and var2 is $var2";

is there s simple trick in Perl that would allow me to modify the \W to
exclude blanks?

tia

dan



Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 18 Jan 2001 13:29:17 -0500
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Saving .htm file to disk from CGI script
Message-Id: <8ade6to18ja2mri95uomtk8fv57gkr8lkp@4ax.com>

On Thu, 18 Jan 2001 15:53:02 GMT, dtbaker_dejanews@my-deja.com wrote
wonderful things about sparkplugs:

--SNIP--

>>
>> This is a red herring, according to the manual (perldoc -f open):
>>
>-------------
>
>not meant to be a red herring.... I seem to recall I've had it fail on
>win32 before with a space, so I'd recommend NO space as a general habit.
>


This is OT now but WINXX does not do well with spaces.  The simplest
operations can be fouled by a space in a name.  Shortcuts, printers,
drive mappings, shell scripts all suffer from spaces.  As such this is
excellent WINXX advice:

"...so I'd recommend NO space as a general habit."


>Dan
>
>
>Sent via Deja.com
>http://www.deja.com/


lmoran@wtsgSPAM.com
print "\x{263a}"


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

Date: 18 Jan 2001 17:35:37 GMT
From: cyberpost@aol.com (CyberPost)
Subject: Secure Space and Perl..help needed please
Message-Id: <20010118123537.26460.00000029@ng-fm1.aol.com>

I have just set up some secure web space with "secure-website.com". 

For simplicity : 
my current website is :  www.somewebspace.co.uk
my secure space url :   www.secure-website.com/somewebspace

Now I have some issure that need to be address and would appreciate some help :

<1> I have a appx 1,000 registration user files on my current web site which
I want to transfer to the secure space.... how do i do that.  Will a normal
perl script allow transfer of these files from my current website to my secure
space web site ?

<2> My current perl script on my web space  requires to check these
registration files whenever a user logs in.  How would I do this checking if
all these registration files were on the secure space ?

Any experts who have experience of this, I would thank for their help.

regards

TB

PS could you please email me the reply as well. thanks (CyberPost@aol.com)


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

Date: 18 Jan 2001 18:53:50 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Secure Space and Perl..help needed please
Message-Id: <slrn96eetu.u7n.abigail@tsathoggua.rlyeh.net>

CyberPost (cyberpost@aol.com) wrote on MMDCXCVII September MCMXCIII in
<URL:news:20010118123537.26460.00000029@ng-fm1.aol.com>:
@@ I have just set up some secure web space with "secure-website.com". 
@@ 
@@ For simplicity : 
@@ my current website is :  www.somewebspace.co.uk
@@ my secure space url :   www.secure-website.com/somewebspace
@@ 
@@ Now I have some issure that need to be address and would appreciate some help
@@ 
@@ <1> I have a appx 1,000 registration user files on my current web site which
@@ I want to transfer to the secure space.... how do i do that.  Will a normal
@@ perl script allow transfer of these files from my current website to my secur
@@ space web site ?

Why bother with Perl? NFS, scp, ftp, cpio, tar, uucp will all do the trick,
why bother writing a Perl program mimicing them?

@@ <2> My current perl script on my web space  requires to check these
@@ registration files whenever a user logs in.  How would I do this checking if
@@ all these registration files were on the secure space ?

Your Perl program would have to follow whatever protocol you set up
to access data in the "secure space". The trick is to do it in such
a way that you don't compromise your security. But that has nothing
to do with Perl, with a program written in Ada or sendmail macros, 
you'd face the same problems.

@@ Any experts who have experience of this, I would thank for their help.

None of this has any relevance to Perl.

@@ PS could you please email me the reply as well. thanks (CyberPost@aol.com)

No; if you can't be bothered to read the group, the answer can't be
important to you.



Abigail
-- 
BEGIN {$^H {q} = sub {$_ [1] =~ y/S-ZA-IK-O/q-tc-fe-m/d; $_ [1]}; $^H = 0x28100}
print "Just another PYTHON hacker\n";


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

Date: 18 Jan 2001 18:16:32 +0000
From: nobull@mail.com
Subject: Re: Win32::LookupAccountSID documentation?
Message-Id: <u9wvbsenen.fsf@wcl-l.bham.ac.uk>

nobull@mail.com writes:

> Does anyone have any documentation/examples on the use of this
> function.

To answer my own question - I've decided to ignore Win32::LookupAccountSID
and use Win32::Perms::ResolveAccount from Dave Roth's modules.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V10 Issue 91
*************************************


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