[13923] in Perl-Users-Digest

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

No subject found in mail header

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 10 17:48:04 1999

Date: Mon, 8 Nov 1999 13:23:25 -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: <942096204-v9-i1319@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 8 Nov 1999     Volume: 9 Number: 1319

Today's topics:
    Re: Why doesn't thhis work? (Kragen Sitaker)
    Re: Why doesn't thhis work? (Abigail)
    Re: Why doesn't thhis work? (Bart Lateur)
    Re: Why doesn't thhis work? (Kragen Sitaker)
    Re: Why doesn't thhis work? (Abigail)
        Win32 UNC path names <jhudgins@vuent.com>
    Re: Win32 UNC path names <vincent.murphy@cybertrust.gte.com>
        Win32::Process::Create -- Arg #5 <vtc@us.ibm.com>
    Re: Win32::Process::Create -- Arg #5 (Michel Dalle)
    Re: Win32::Process::Create -- Arg #5 <bwalton@rochester.rr.com>
        Works on 5.005 but not 5.004? <hiller@email.com>
    Re: Works on 5.005 but not 5.004? <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 06 Nov 1999 22:33:20 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Why doesn't thhis work?
Message-Id: <Q02V3.48919$23.1864176@typ11.nn.bcandid.com>

In article <382295F4.F571FF70@post.tele.dk>,
Kim Frederiksen  <kimf@post.tele.dk> wrote:
>Hope someone can help me, this doesn't work, and I don't know why. It's
>supposed to detect the country from the remote_host:
> 
>$rhost=""; 

What did you set it to "" for?  

>$rhost=$ENV{'REMOTE_HOST'};

What is this value?  Perhaps your web server is not doing reverse
lookups by default.

>foreach $host (@ALLOW_HOSTS)
>{
>     if ( $rhost =~ /$host$/)

You might want to /\Q$host\E$/ instead.

>        tam tam tam;

I assume that's Dansk for 'blah blah blah'.

By the way, your authorization scheme is not likely to work well; it
can easily be circumvented, and it is likely to fail to properly
authorize people who *should* be allowed.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 6 Nov 1999 22:24:10 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Why doesn't thhis work?
Message-Id: <slrn829vu8.2i1.abigail@alexandra.delanet.com>

Kragen Sitaker (kragen@dnaco.net) wrote on MMCCLVIII September MCMXCIII
in <URL:news:Q02V3.48919$23.1864176@typ11.nn.bcandid.com>:
-- In article <382295F4.F571FF70@post.tele.dk>,
-- Kim Frederiksen  <kimf@post.tele.dk> wrote:
--
-- >foreach $host (@ALLOW_HOSTS)
-- >{
-- >     if ( $rhost =~ /$host$/)
--
-- You might want to /\Q$host\E$/ instead.

No, you might want to do:

        if (0 <= index $rhost, $host) { ... }

Or, if you want to test for equality:

        if ($rhost eq $host) { ... }

And all this can be combined with the foreach:

        if (grep {$rhost eq $_} @ALLOW_HOSTS) { ... }



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


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


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

Date: Sun, 07 Nov 1999 18:20:38 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Why doesn't thhis work?
Message-Id: <3825c270.448517@news.skynet.be>

Kim Frederiksen wrote:

>Hope someone can help me, this doesn't work, and I don't know why. It's
>supposed to detect the country from the remote_host:
>
>@ALLOW_HOSTS = ('.dk', '.se', '.no');
>
>foreach $host (@ALLOW_HOSTS) {
>     if ( $rhost =~ /$host$/)

One word: "quotemeta". 

The dot is a special character for regexes. You can indicate you want
the "regex" to match literally, by specifying '\Q':

  @ALLOW_HOSTS = ('.dk', '.se', '.no');
  
  foreach $host (@ALLOW_HOSTS) {
      if ( $rhost =~ /\Q$host\E$/) {

-- 
	Bart.


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

Date: Sun, 07 Nov 1999 19:55:34 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Why doesn't thhis work?
Message-Id: <WOkV3.53870$23.2013470@typ11.nn.bcandid.com>

In article <slrn829vu8.2i1.abigail@alexandra.delanet.com>,
Abigail <abigail@delanet.com> wrote:
>Kragen Sitaker (kragen@dnaco.net) wrote on MMCCLVIII September MCMXCIII
>in <URL:news:Q02V3.48919$23.1864176@typ11.nn.bcandid.com>:
>-- In article <382295F4.F571FF70@post.tele.dk>,
>-- Kim Frederiksen  <kimf@post.tele.dk> wrote:
>--
>-- >foreach $host (@ALLOW_HOSTS)
>-- >{
>-- >     if ( $rhost =~ /$host$/)
>--
>-- You might want to /\Q$host\E$/ instead.
>
>No, you might want to do:
>
>        if (0 <= index $rhost, $host) { ... }

This will return a false positive for $host == '.dk' and $rhost ==
'mud.dkmud.com', unless I have misunderstood.

>Or, if you want to test for equality:
>
>        if ($rhost eq $host) { ... }

That will return a false negative for .dk and auc.dk.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 7 Nov 1999 21:36:59 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Why doesn't thhis work?
Message-Id: <slrn82chhn.lh6.abigail@alexandra.delanet.com>

Kragen Sitaker (kragen@dnaco.net) wrote on MMCCLIX September MCMXCIII in
<URL:news:WOkV3.53870$23.2013470@typ11.nn.bcandid.com>:
^^ In article <slrn829vu8.2i1.abigail@alexandra.delanet.com>,
^^ Abigail <abigail@delanet.com> wrote:
^^ >Kragen Sitaker (kragen@dnaco.net) wrote on MMCCLVIII September MCMXCIII
^^ >in <URL:news:Q02V3.48919$23.1864176@typ11.nn.bcandid.com>:
^^ >-- In article <382295F4.F571FF70@post.tele.dk>,
^^ >-- Kim Frederiksen  <kimf@post.tele.dk> wrote:
^^ >--
^^ >-- >foreach $host (@ALLOW_HOSTS)
^^ >-- >{
^^ >-- >     if ( $rhost =~ /$host$/)
^^ >--
^^ >-- You might want to /\Q$host\E$/ instead.
^^ >
^^ >No, you might want to do:
^^ >
^^ >        if (0 <= index $rhost, $host) { ... }
^^ 
^^ This will return a false positive for $host == '.dk' and $rhost ==
^^ 'mud.dkmud.com', unless I have misunderstood.

Ah, I didn't notice the $.

In that case, it's even easier:

    if ($host eq substr $rhost => -length $host) { ... }



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


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


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

Date: Fri, 05 Nov 1999 13:21:55 -0800
From: Jonathan Hudgins <jhudgins@vuent.com>
Subject: Win32 UNC path names
Message-Id: <38234A73.C73E4834@vuent.com>

How can I access a UNC path name through perl in WinNT?
I am mostly simply trying to get a ls (or dir) of a UNC directory
( ie \\server\share\directory ).

Thanks,

Jonathan
-- 
"Whoever watches the wind will not plant,
whoever looks at the clouds will not reap."

********************************************************
* Jonathan Hudgins             **  Adaptive Media      *
* (408) 616-1119               **  477 Potrero Ave     *
* jhudgins@adaptivemedia.com   **  Sunnyvale, CA 94086 *
********************************************************


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

Date: Sat, 06 Nov 1999 01:32:37 GMT
From: Vincent Murphy <vincent.murphy@cybertrust.gte.com>
Subject: Re: Win32 UNC path names
Message-Id: <xjg3dukieve.fsf@gamora.ndhm.gtegsc.com>

>>>>> "Jonathan" == Jonathan Hudgins <jhudgins@vuent.com> writes:

    Jonathan> How can I access a UNC path name through perl in WinNT?
    Jonathan> I am mostly simply trying to get a ls (or dir) of a UNC directory
    Jonathan> ( ie \\server\share\directory ).

my $dir = "//server/share/directory";
# you could also say "\\\\server\\share\\directory" but that's too many
# backslashes for me

opendir( DIR, $dir ) || die "can't open $dir: $!\n";
my @list = readdir(DIR);

see "perldoc -f opendir" for more details.

--Vinny


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

Date: Sun, 07 Nov 1999 14:28:09 -0500
From: Tom Cockerline <vtc@us.ibm.com>
Subject: Win32::Process::Create -- Arg #5
Message-Id: <3825D2C9.B4209757@us.ibm.com>


--------------F524A7F7DEEBC2506B641670
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The fifth argument for the Create method of Win32::Process is documented
thusly in perldoc:
$cflags         flags for creation (see exported vars below)
Unfortunately, there don't seem to be any "exported vars below".

The example in the doc uses NORMAL_PRIORITY_CLASS for this arg. There's
an example in the gecko book that uses DETACHED_PROCESS which seems to
cause the process to run background.

What other options are there for this arg and/or where are they
documented?

TIA!

--------------F524A7F7DEEBC2506B641670
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
The fifth argument for the Create method of Win32::Process is documented
thusly in perldoc:
<br><i>$cflags&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; flags for
creation (see exported vars below)</i>
<br>Unfortunately, there don't seem to be any "exported vars below".
<p>The example in the doc uses NORMAL_PRIORITY_CLASS for this arg. There's
an example in the gecko book that uses DETACHED_PROCESS which seems to
cause the process to run background.
<p>What other options are there for this arg and/or where are they documented?
<p>TIA!</html>

--------------F524A7F7DEEBC2506B641670--



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

Date: Sun, 07 Nov 1999 23:41:13 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Win32::Process::Create -- Arg #5
Message-Id: <8052o1$nc5$2@nickel.uunet.be>

In article <3825D2C9.B4209757@us.ibm.com>, Tom Cockerline <vtc@us.ibm.com> wrote:

>The fifth argument for the Create method of Win32::Process is documented
>thusly in perldoc:
>$cflags         flags for creation (see exported vars below)
>Unfortunately, there don't seem to be any "exported vars below".
>
>The example in the doc uses NORMAL_PRIORITY_CLASS for this arg. There's
>an example in the gecko book that uses DETACHED_PROCESS which seems to
>cause the process to run background.
>
>What other options are there for this arg and/or where are they
>documented?

Have you looked :

1) in the module itself - check in your Perl\site\lib\Win32 directory
for a file called 'Process.pm'

2) in the Win32 API - if you don't have that, search MSDN at Microsoft
for 'CreateProcess' - http://search.microsoft.com/us/dev/

HTH,

Michel.


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

Date: Sun, 07 Nov 1999 19:14:25 -0500
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Win32::Process::Create -- Arg #5
Message-Id: <382615E1.E60D80E9@rochester.rr.com>

Tom Cockerline wrote:
> 
> The fifth argument for the Create method of Win32::Process is
> documented thusly in perldoc:
> $cflags         flags for creation (see exported vars below)
> Unfortunately, there don't seem to be any "exported vars below".
> 
> The example in the doc uses NORMAL_PRIORITY_CLASS for this arg.
> There's an example in the gecko book that uses DETACHED_PROCESS which
> seems to cause the process to run background.
> 
> What other options are there for this arg and/or where are they
> documented?
 ...
Take a look at the source code for the Win32::Process module, in
file Process.pm in the Win32 directory.  Just search for Process.pm.
Right near the start is a list of symbols exported by the module.
You'll probably have to know something about Windows if you want
to know what they all mean.
-- 
Bob Walton


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

Date: Sat, 06 Nov 1999 17:06:29 GMT
From: Jordan Hiller <hiller@email.com>
Subject: Works on 5.005 but not 5.004?
Message-Id: <3824608D.10A14653@email.com>

The following line of Perl code works fine in ActiveState Perl for Win32
5.005_03, but gives a syntax error on a Linux machine with perl 5.004_04.

df_increment($_) for (split /,/, $questions[$i]{scorecode});

Is there an obvious problem that would cause an incompatibility?

Thanks in advance, 
Jordan Hiller (hiller@email.com)

Online Quiz and Testing Solutions
http://online-tests.hypermart.net


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

Date: 6 Nov 1999 18:37:49 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Works on 5.005 but not 5.004?
Message-Id: <801sht$bau$1@gellyfish.btinternet.com>

On Sat, 06 Nov 1999 17:06:29 GMT Jordan Hiller wrote:
> The following line of Perl code works fine in ActiveState Perl for Win32
> 5.005_03, but gives a syntax error on a Linux machine with perl 5.004_04.
> 
> df_increment($_) for (split /,/, $questions[$i]{scorecode});
> 
> Is there an obvious problem that would cause an incompatibility?
> 

I believe that the use of 'for' and 'foreach' as statement modifiers was
introduced in 5.005 and is therefore not going to work in 5.004 - a yes
from Changes:

[   620] By: TimBunce                              on 1998/03/02  21:25:27
        Log: Title:  "STMT foreach LIST;", #F002
             From:  Chip Salzenberg
             Files:  pod/perlsyn.pod perly.c perly.c.diff perly.y t/cmd/mod.t toke.c
             vms/perly_c.vms
     Branch: maint-5.004/perl
       ! perly.c perly.c.diff perly.y pod/perlsyn.pod t/cmd/mod.t
           ! toke.c vms/perly_c.vms
 
/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

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


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