[13369] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 779 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 13 14:07:18 1999

Date: Mon, 13 Sep 1999 11:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 13 Sep 1999     Volume: 9 Number: 779

Today's topics:
        $sth->rows function in DBI-Oracle <tsui@cbmi.upmc.edu>
    Re: /etc/passwd <AgitatorsBand@yahoo.com>
        a challenge... <srooij@wins.uva.nl>
    Re: ATTN: Who would like to write a perl IDE for linux <jerrad@networkengines.com>
    Re: Calls from HTML <jerrad@networkengines.com>
    Re: Can't get list to sort... (Kragen Sitaker)
    Re: Can't get list to sort... <dove@synopsys.com>
    Re: Can't get list to sort... <dove@synopsys.com>
    Re: Can't get list to sort... (Larry Rosler)
    Re: CGI cannot open relative path <AgitatorsBand@yahoo.com>
    Re: Desperately searching for perl lint <aqumsieh@matrox.com>
        division in list context <occitan@esperanto.org>
    Re: division in list context <tchrist@mox.perl.com>
    Re: division in list context <srooij@wins.uva.nl>
    Re: File IO Question <sariq@texas.net>
    Re: foreach oddity <r28629@email.sps.mot.com>
    Re: Good way to learn PERL mikedel@ix.netcom.com
    Re: How can two Perl programs exchange data directly? (Michel Dalle)
        How to know an ip address of visitor who are behind pro jteens@my-deja.com
    Re: How to know an ip address of visitor who are behind <dove@synopsys.com>
    Re: How to know an ip address of visitor who are behind <flavell@mail.cern.ch>
    Re: how to mkdir on NT with Perl <Nicholas.Dragotas@Motorola.com>
    Re: Is anyone capable of explaining this?? (Larry Rosler)
    Re: multiple perl's (Kragen Sitaker)
    Re: perl -w strangeness <aqumsieh@matrox.com>
    Re: Perl output to browser <jerrad@networkengines.com>
    Re: perl regex's (Larry Rosler)
    Re: regexp with variables containing unknown data <sariq@texas.net>
    Re: Returning from calling subroutine <aqumsieh@matrox.com>
    Re: shebang question for Win32 Perl/Apache <jerrad@networkengines.com>
    Re: Statistics for comp.lang.perl.misc (Kragen Sitaker)
    Re: Statistics for comp.lang.perl.misc (Kragen Sitaker)
    Re: Trouble installing DBM mSQL on Solaris. <dove@synopsys.com>
    Re: UNCRAP project proposal <jerrad@networkengines.com>
    Re: use cgi/perl to hide access to subdirectory (Michel Dalle)
    Re: way to print all variables ? <aqumsieh@matrox.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Mon, 13 Sep 1999 13:42:00 -0400
From: tsui <tsui@cbmi.upmc.edu>
Subject: $sth->rows function in DBI-Oracle
Message-Id: <37DD3768.4D801D6@cbmi.upmc.edu>

Hi there,

  I found that the sth->rows in the DBI for oracle doesn't return the
right number of fetched rows.  any suggestion?

Oracle: 7.3.3
Perl: 5.004, patch 03
OS: Solaris 2.5

Rich


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

Date: Mon, 13 Sep 1999 17:19:00 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: /etc/passwd
Message-Id: <8maD3.386$n82.64213@news.shore.net>

Ubu <ubu@easynet.ca> wrote:
: In article <slrn7tla71.5ou.abigail@alexandra.delanet.com>,
:   abigail@delanet.com wrote:
:>
:> What part of the manual about crypting passwords didn't you
: understand?
:>
:> What is "a complete method for checking accounts"? Retina scans?
:>
: OK, I ordinarily try to stay away from potential flame wars, but I have
: to ask, just who is this 'Abigail' and what is she so angry about? 

She gets upset when people who know less than she does about Perl (or
Unix, or anything else she knows a lot about) post here. Just don't let it
bother you; occasionally she posts some useful information but it's
usually at the "strictly guru" level.

--Art

-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Mon, 13 Sep 1999 19:20:12 +0200
From: Steven de Rooij <srooij@wins.uva.nl>
Subject: a challenge...
Message-Id: <37DD324C.A984C7A9@wins.uva.nl>

Hello everyone,

 ...for those of you who like to show off by writing amazingly cool short
programs:

I propose to you three challenges. For each one of them, a separate
winner will be announced. The contest will close tomorrow at 18:00 GMT.

These are your assignments:

--------------------------------------------------------------------
1. Write the shortest possible Perl program that finds anagrams in a
word list. Anagrams are two or more words built of the same letters,
like tapestries-striptease or underflow-wonderful etcetera.
My Perl program is 75 characters long (counting newlines as a single
character to be fair to DOS/Windows users).

2. Find the shortest possible Unix command that finds all palindromes
in a wordlist. A palindrome is a word that stays the same when read
backwards, like rotator or boob. Hint: your solution may, but need
not, start by invoking the Perl interpreter.
My solution is a command of 39 characters.

3. Write the shortest possible Unix command that find words in a
wordlist that occur both forwards and backwards, like repaid-diaper,
stressed-dessert etc. It's possible in 33 characters but I'm not
convinced my solution is 100% Posix compatible.
--------------------------------------------------------------------

If you want your program to be evaluated, send it to me by email, and
I'll try to be a fair judge.
You may of course post solutions to the newsgroup right away, but don't
spoil everybody's fun - if your program is any good I will list it in
the challenge results tomorrow anyway.
Don't forget to mention your full name (or alias) when you mail me.

I can be reached at srooij@wins.uva.nl

Good luck!

Steven de Rooij


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

Date: Mon, 13 Sep 1999 13:18:51 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: Re: ATTN: Who would like to write a perl IDE for linux
Message-Id: <37DD31FB.2BF14859@networkengines.com>

I think "intellisense" is that M$ BS that parses things as you type it.
so that would you are only half-done with a line, and realize you need to change somehting else elsewhere first the "IDE" (read Idiot's Development Environment, I Drool Everywhere, etc.) hiccups and tsks tsks you


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

Date: Mon, 13 Sep 1999 13:19:38 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: Re: Calls from HTML
Message-Id: <37DD322A.4DB765A1@networkengines.com>

Or ASP (blechh)


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

Date: Mon, 13 Sep 1999 17:14:05 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Can't get list to sort...
Message-Id: <xhaD3.8216$N77.641542@typ11.nn.bcandid.com>

In article <37DD1D6D.9183BB87@wfu.edu>,
Brant Yandell  <yandellb@interpath.com> wrote:
>The listbox is populating fine.  I need to get "$field[1]" sorted
>alphabetically but have had no luck.  I have omitted my sort string here
>for fear of your laughter... :-)  Can anyone give me a sort statement? 

There are some examples of sort in the FAQ.  Also, I posted yesterday
to help someone with a very similar problem.

If you read the FAQ question or my post and do not understand it, post
again explaining which parts you don't understand.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Mon, 13 Sep 1999 10:35:40 -0700
From: David Amann <dove@synopsys.com>
Subject: Re: Can't get list to sort...
Message-Id: <37DD35EC.768C3CE1@synopsys.com>

Hi Brant,

>   Can anyone give me a sort statement?

Try this:

    @sorted_field = sort alpha @field;
    sub alpha { $a cmp $b };

Hope this helps;
-=dav

>
> Brant Yandell



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

Date: Mon, 13 Sep 1999 10:35:28 -0700
From: David Amann <dove@synopsys.com>
Subject: Re: Can't get list to sort...
Message-Id: <37DD35E0.A8382829@synopsys.com>

Hi Brant,

>   Can anyone give me a sort statement?

Try this:

    @sorted_field = sort alpha @field;
    sub alpha { $a cmp $b };

Hope this helps;
-=dav

>
> Brant Yandell



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

Date: Mon, 13 Sep 1999 10:43:37 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Can't get list to sort...
Message-Id: <MPG.1246d7a0fe9ecc5c989f4c@nntp.hpl.hp.com>

In article <37DD1D6D.9183BB87@wfu.edu> on Mon, 13 Sep 1999 11:51:09 -
0400, Brant Yandell <yandellb@wfu.edu> says...
 ...
> The listbox is populating fine.  I need to get "$field[1]" sorted
> alphabetically but have had no luck.  I have omitted my sort string here
> for fear of your laughter... :-)  Can anyone give me a sort statement? 
> I fear I may launch my laptop out the window.

Launch it my way, then.  But it will be a long trajectory.

This is a rather trivial problem, which is discussed in the Perl 'sort' 
manpage and in the FAQ -- perlfaq4: "How do I sort an array by 
(anything)?"  If you have read them and still can't do the sort, please 
post the effort without fear of laughter, and someone will help.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 13 Sep 1999 17:24:52 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: CGI cannot open relative path
Message-Id: <EraD3.388$n82.64213@news.shore.net>

JduPayrat <jdupayrat@webraska.com> wrote:
: Since I upgraded from perl 5.003 to 5.005, my cgi scripts can't open files
: given with a relative path. My scripts are run by perl ISAPI on Winnt.

: If it's a security thing, is there a way to disable it ? I really need to
: find a answer because a lot of scripts
: use relative path. Making all path absolute would be a lack of time and
: wouldn't be a good programming solution.

I can't answer re: what's different in 003 vs 005, but I find that calling
files by an absolute path is almost always a good idea in CGI scripts. Or,
could you "chdir" to the proper directory first? Then, presumably, all
your "relative" paths would be relative to the correct directory.

Hope this helps,

--Art


-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Mon, 13 Sep 1999 11:20:44 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Desperately searching for perl lint
Message-Id: <x3ybtb6g7n8.fsf@tigre.matrox.com>


kaih=7OhjWm7Xw-B@khms.westfalen.de (Kai Henningsen) writes:

> Not that I can see. It explains what -w is for, it doesn't explain why my  
> variables should be seen as different.
> 
> I can't see that it's any less common or dangerous a mistake.

My view is the following.

1) It is not dangerous if you declare a variable via my(), but don't
   use it anywhere in your program. The reason is that it is probably
   a variable that you once needed, but discarded later and forgot to
   remove its declaration from your program.

2) If you declare a variable via my(), but then misspell its name in
   your program, you are effectively creating a new global variable
   (unless your variables have VERY similar names, and a typo in one
   name can become another valid variable name). This is a dangerous
   situation (since your vars will not contain the correct info), and
   should be warned against.

Conclusion:
You can not create a new my() variable by misspelling the name of
another variable. Misspelled var names will create GLOBAL vars which
is a dangerous thing.

--Ala



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

Date: Mon, 13 Sep 1999 16:58:34 GMT
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: division in list context
Message-Id: <7rjaf0$t6r$1@nnrp1.deja.com>

Hi!

It would often be useful (and disruptive only in the weirdest of cases)
if

($div, $rem) = $a / $b;

were equivalent to

$div = int $a / $b; $rem = $a % $b;

best regards - Daniel


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 13 Sep 1999 11:21:53 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: division in list context
Message-Id: <37dd32b1@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Daniel Pfeiffer <occitan@esperanto.org> writes:
:It would often be useful (and disruptive only in the weirdest of cases)
:if
:
:($div, $rem) = $a / $b;
:
:were equivalent to
:
:$div = int $a / $b; $rem = $a % $b;

Are you sure that's the right definition?  What if $a is 7.6 and $b is 3?
Then $div is 2 but $rem is 1.  This means that $div * $a + $rem != $a.
This seems wrong.

Also, I think that would be more disruptive than you think:

    %h = (
	K1 => $x/$y,
	K2 => $fred,
    );

Better to have

    ($div, $rem) = divmod($a, $b);

or I suppose, 

    ($div, $rem) = $a divmod $b;

But we really don't have much in the way of perlop(1)-style
operators that return lists right now.

--tom
-- 
Sockets are the X windows of IO interfaces.  --Rob Pike


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

Date: Mon, 13 Sep 1999 19:56:18 +0200
From: Steven de Rooij <srooij@wins.uva.nl>
Subject: Re: division in list context
Message-Id: <37DD3AC2.55B77D3D@wins.uva.nl>

Hi,

> Better to have
> 
>     ($div, $rem) = divmod($a, $b);
> 
> or I suppose,
> 
>     ($div, $rem) = $a divmod $b;

why not introduce a /% operator, so that you can say:

      ($div, $rem) = $a /% $b;

I'd also like to be able to say this:

      ($angle, $dist) = topolar($x, $y);
and   ($x, $y) = tocarthesian($angle, $dist);

Having complained about that, why are the list functions max and sum
missing?
I'd like to call them like this:

my $highest = max {abs($a) > abs($b)} @array;
my $tot_chars = sum {length} @array;

This probably has been discussed for a millennium. I feel that the
answers to these questions (assuming there are any), should be in the
FAQs.


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

Date: Mon, 13 Sep 1999 12:14:46 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: File IO Question
Message-Id: <37DD3106.5233B5B2@texas.net>

"John J. Straumann" wrote:
> 
> When I tried this:
> 
> if ( open( outFile, ">>$dataFile" ) )
> {
>   for ( $r=0; $r<25; $r++ )
>   {
>     print outFile ( "$input[ $r ]" );
>   }
>   close( outFile );
> }
> 
> it doesn't work, only prints the first data element and then nothing...

That code will print the first 25 elements of @input...all on the same
line.  Is that your intention?

- Tom


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

Date: Fri, 10 Sep 1999 21:44:08 -0500
From: TK Soh <r28629@email.sps.mot.com>
To: David Bradley <debr@hpesdebr.fc.hp.com>
Subject: Re: foreach oddity
Message-Id: <37D9C1F8.CACE39FF@email.sps.mot.com>

[posted to clpm and copy cc'ed]

David Bradley wrote:
[snip]
> Questions:
> ----------
> 1) Is this a documented feature?

the last time I was told, it's a documented bug - 5.005_01

> 2) Can this be easily fixed?

get the later release (I know 5.005_3 is good), hope this is easy
enough.

-TK


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

Date: Mon, 13 Sep 1999 17:28:56 GMT
From: mikedel@ix.netcom.com
Subject: Re: Good way to learn PERL
Message-Id: <7rjc7k$ukg$1@nnrp1.deja.com>

Here are two books that are absolutely esential to learning perl:

This is the  constumate tutorial for learning the in, outs, and
flexibility of perl:

http://www.amazon.com/exec/obidos/ASIN/1565922840/productlink
Learning Perl (2nd Edition)

This book is the Perl reference manual for all the stuff perl does:
http://www.amazon.com/exec/obidos/ASIN/1565921496/productlink
Programming Perl (2nd Edition)

This has some good refernce for creating perl - CGI scripts.
http://www.amazon.com/exec/obidos/ASIN/0471168963/productlink
The Cgi/Perl Cookbook

These links will take you to amazon so you can read the reviews.

I hope this helps!


In article <7r98j0$er$1@f1.andara.com>,
  "Jim Carison" <matthew357@hotmail.com> wrote:
> Hello. I am fairly new to PERL and CGI. Although I understand enough
to make
> small scripts that do a little bit of stuff, I am interested in
making my
> skills good enough to use on the commercial level. If you can give me
any
> information as to how I can learn PERL much better without a lot of
upfront
> costs (like IT schools) but things like webpages or good books.
>
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 09 Sep 1999 15:26:42 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: How can two Perl programs exchange data directly?
Message-Id: <7r8jqg$4sn$1@news.mch.sbs.de>

In article <01bef951$16e62000$75a551d4@unbekanb>, "Thorsten" <thorsten_kuske@gmx.net> wrote:
>Hello, 
>
>I am a Perl newcomer and I tried hard to find out how to exchange data
>directly between two Perl programs running, but I did not get along with
>this. So it would be really great if you could help me!
>
>Thank you very much,
>        Thorsten Kuske

Have you looked at 'perlipc' in the documentation yet ? It talks about the 
different options for Inter-Process Communication (mostly Unix-oriented).

If you're working on Windows NT, also have a look at "Programming"
in the ActivePerl FAQ, where they talk about named pipes and sockets
(among other stuff).

BTW, this seems an ambituous topic for a "newcomer". :)
Maybe if you re-think the way you want to handle different tasks, you
might avoid this altogether ? Or try having only unidirectional IPC, if
possible...

Have fun,

Michel.


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

Date: Mon, 13 Sep 1999 17:11:25 GMT
From: jteens@my-deja.com
Subject: How to know an ip address of visitor who are behind proxy server?
Message-Id: <7rjb6v$toi$1@nnrp1.deja.com>

Hello there,
I wanna know IP address of visitor who visit my web site so I write
simple perl script
to get an ip address of my visitor by use server environment variable
below.
$ENV{'REMOTE_HOST'}
$ENV{'REMOTE_ADDR'}
Anyway, I can't get visitor IP address if they are using proxy server,
$ENV variable
above get only ip of proxy server. How can I get an ip address of
visitor if they are behind
proxy server? Any help would be mostly appreciated.
Thanks,
Paul


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 13 Sep 1999 10:50:05 -0700
From: David Amann <dove@synopsys.com>
Subject: Re: How to know an ip address of visitor who are behind proxy server?
Message-Id: <37DD394D.37FF6EB9@synopsys.com>

Hi Paul,

>  I can't get visitor IP address if they are using proxy server,
> $ENV variable above get only ip of proxy server. How can I get an ip
> address of visitor if they are behind proxy server?

Unfortunately, you can't.  The proxy server doesn't send the IP address of
the client to your web server, so your web server can't put it in any $ENV
variable.  You might want to use Cookies or structured URLs or HTTP
authentication.

Good luck,
-=dav






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

Date: Mon, 13 Sep 1999 19:38:11 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How to know an ip address of visitor who are behind proxy server?
Message-Id: <Pine.HPP.3.95a.990913193427.13201E-100000@hpplus03.cern.ch>

On Mon, 13 Sep 1999 jteens@my-deja.com wrote:

> Anyway, I can't get visitor IP address if they are using proxy server,

That's correct, in general.

> How can I get an ip address of visitor if they are behind proxy
> server? 

See above. You can't.

Sometimes their proxy will tell you, in an extra header
(x-forwarded-for: , maybe).  It might or might not be the truth. 

You could ask the user.  They might answer.  It might or might not be
the truth. 

It could be an address in one of the private-use ranges, and therefore
of no use to you even if you got an accurate answer.

Why do you think you need it?




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

Date: Mon, 13 Sep 1999 12:00:12 -0400
From: "Nicholas Dragotas" <Nicholas.Dragotas@Motorola.com>
Subject: Re: how to mkdir on NT with Perl
Message-Id: <7rj72c$rsc$1@schbbs.mot.com>

Randy,

There is a command called (you guessed it) "mkdir".  Out of curriosity
though.  Did you check on a PERL reference?  You should have a PERL book or
reference handy.

Regards,

Nicholas

Randy wrote in message <37d8ac10.92012574@news.dowco.com>...
>Hi,
>I would like to know if there is a way i could create or edit
>directories in NT with Perl?
>
>thank you!




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

Date: Mon, 13 Sep 1999 10:36:16 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Is anyone capable of explaining this??
Message-Id: <MPG.1246d5ea66424cec989f4b@nntp.hpl.hp.com>

In article <7rj7jv$qt8$1@nnrp1.deja.com> on Mon, 13 Sep 1999 16:09:47 
GMT, Amonotod <amonotod@netscape.net> says...
> In article <7rj0dr$l70$1@nnrp1.deja.com>,
>   ladlad@my-deja.com wrote:
> > I have a file. I need to read it (to find a regular expression) and
> > after few calculations write back to the file.
> >
> > Here  is a part.
> >
> > open(search,"+<searchEC.htm");  #open searchEc.htm file both for

> open (SEARCH,">>searchEC.htm"); #open for r/w/append access

Huh?

> open (SEARCH,">searchEC.htm"); #open for r/w access

Huh?

> open (SEARCH,"searchEC.htm"); #open for read access

Well, you got that one right.  But so did the code that you were trying 
to correct.

 ...

> Check the FAQs, this is detailed...

And you got that one right too, though perhaps a more explicit pointer 
would be in order. perlfaq5: "How do I change one line in a file/delete 
a line in a file/insert a line in the middle of a file/append to the 
beginning of a file?"

I assume your posting this response twice was just a transient glitch of 
some sort.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 13 Sep 1999 17:39:18 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: multiple perl's
Message-Id: <aFaD3.8249$N77.644385@typ11.nn.bcandid.com>

In article <37DD2947.DE25D9E1@networkengines.com>,
jerrad pierce  <jerrad@networkengines.com> wrote:
>is there a way for one perl process to access the values of variables in
>another perl process? (they're both running under the same effective and
>real UID's)

That is, can Perl do shared memory?  Not really.  (You can do shmsegs
and so forth, but you can't put variables in shared memory.)

You have to communicate explicitly.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Mon, 13 Sep 1999 11:59:52 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: perl -w strangeness
Message-Id: <x3y906ag5tz.fsf@tigre.matrox.com>


"John Cokos" <jcokos@ccs.net> writes:

> I'm getting strange errors when running perl -w on a program:
> 
> Error:
> Use of uninitialized value at test.cgi line 119.

Checkout perldiag for a desciption of all of Perl's diagnostic
messages.

> Line 119:
>     $global{'action'}="$PROG_URL";
> 
> First line in program:
>     use vars qw (%global,%users,$misc,$sth,$rc,@rows);
> 
> Why would that line cause an error, when clearly, it was defined.
> 
> I've replace "use vars qw" with "my" to try and localize, but the same
> error shows.

Of course. The problem is not with the %global hash. It is with
$PROG_URL. Double quotes interpolate variables. So Perl is trying to
assign to $global{'action'} a value equal to the string value of
$PROG_URL. It seems to me that you don't have a variable called
$PROG_URL and you simply want the literal string '$PROG_URL' in which
case you would use single quotes:

	$global{'action'} = '$PROG_URL';

HTH,
--Ala



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

Date: Mon, 13 Sep 1999 13:25:57 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: Re: Perl output to browser
Message-Id: <37DD33A5.4B34B385@networkengines.com>

Ahh yes the joys of integrating everything.
You're entering a local file path.

Therefore windoze is executing the file, not your web server
(do you even have one installed?)
You should be accessing this something like:
http://localhost/cgi-bin/test.pl)

Don't suppose you bothered to try it in another (read real) web browser did you? :-P


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

Date: Mon, 13 Sep 1999 10:30:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: perl regex's
Message-Id: <MPG.1246d4aad440f20b989f4a@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7rit6b$1npo$1@pike.uhc.com> on Mon, 13 Sep 1999 09:12:03 -
0400, Peter Icaza <picaza@chsi.com> says...
> hi,
> im going nutz trying to figure out what seems to be a simple reg ex problem.
> can you help? please reply via clpm and picaza@chsi.com

Sure, why not? At least you didn't munge the reply address.

> description of problem:
>  match the first occurence of a word, (upper case), on the line.  the word
> may be preceded by 0 or more ('s.  followed by one space, other stuff, a
> space and a newline,(\n for illistration purposes)
> 
> data:
> ((((ABC  == '9'  || \n
> DEF  == '2' ) && \n
> GHI   == 1 ) && \n
> JKLM  == '6'  && \n
> NOPQR   include file/name  && \n
> ST   include 'otherfile.name' )) \n

If all you want to do is match (capture) the first upper-case word in a 
string, then a very simple regex will do it.

    /([A-Z]+)/

This is subject to locale issues, as some pedant will be sure to point 
out if I don't.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 13 Sep 1999 12:27:07 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: regexp with variables containing unknown data
Message-Id: <37DD33EB.1233E2D6@texas.net>

Brad Barnett wrote:
> 

<snipped quotemeta reference>

> Many thanks, oh god of perl ;)  Heh, even more thanks for perldoc, which
> I never even knew existed ;)

Then before you write *even one* more line of Perl code, read:

perldoc perldoc
perldoc perltoc

and go from there.

*Always* do your best to find an answer in the documentation before
posting a question here.  There are numerous advantages.

- Tom


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

Date: Mon, 13 Sep 1999 11:27:43 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Returning from calling subroutine
Message-Id: <x3yaeqqg7bk.fsf@tigre.matrox.com>


Collin Starkweather <collin.starkweather@colorado.edu> writes:

> I need to define a subroutine which will not just return, but cause its
> calling subroutine to return as well if an unexpected event occurs
> (e.g., a Tk fileevent).
> 
> For example,
> 
> sub calling { 
>    &called( 'return' );
>    print "Too bad:  I didn't return prematurely.\n" 
> }
> 
> sub called {
>    if (shift eq 'return') {
>       # somehow cause &calling to return as well
>    }
> }
> 
> Any tips would be greatly appreciated.

A Quick and Dirty way:

sub calling {
	return if called('return');
	print "Too bad .. bla bla\n";
}

sub called {
	if (shift eq 'return') {
		# bla bla
		return 1;
	}
	# more bla 
	return 0;
}

--Ala



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

Date: Mon, 13 Sep 1999 13:14:15 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: Re: shebang question for Win32 Perl/Apache
Message-Id: <37DD30E7.62CA8626@networkengines.com>

if you associate .pl files with you're perl.exe then you can simply invoke them by name
> windoze.pl

all the interpreter cares is that the string perl is somewhere on the the first line


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

Date: Mon, 13 Sep 1999 17:24:55 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <HraD3.8227$N77.642841@typ11.nn.bcandid.com>

In article <7rj8ga$f70$1@info2.uah.edu>, Greg Bacon  <gbacon@cs.uah.edu> wrote:
>   69   107.0 ( 51.4/ 43.7/ 23.2)  Jonathan Stowe <gellyfish@gellyfish.com>
>   46    89.8 ( 32.9/ 47.5/ 31.8)  kragen@dnaco.net (Kragen Sitaker)
>   43    57.9 ( 26.6/ 27.6/ 16.6)  moseley@best.com (Bill Moseley)
>   42    74.3 ( 39.7/ 29.7/ 20.5)  Tom Phoenix <rootbeer@redcat.com>
>   35    55.1 ( 21.7/ 29.4/ 17.4)  lr@hpl.hp.com (Larry Rosler)
>   35    79.3 ( 40.6/ 23.3/ 21.8)  abigail@delanet.com

Unbelievable.  I posted more than anybody except Jonathan Stowe!  Maybe
I need to get a life.  :)

> 107.0 ( 51.4/ 43.7/ 23.2)     69  Jonathan Stowe <gellyfish@gellyfish.com>
>  89.8 ( 32.9/ 47.5/ 31.8)     46  kragen@dnaco.net (Kragen Sitaker)
>  79.3 ( 40.6/ 23.3/ 21.8)     35  abigail@delanet.com
>  74.3 ( 39.7/ 29.7/ 20.5)     42  Tom Phoenix <rootbeer@redcat.com>

 . . . by volume, too.

But what I'd like to know is this: what is my OCR?  I can see it is
between 0.756 and 0.520, because I'm in neither the top ten nor the
bottom ten.

>These [top 10] threads accounted for 11.6% of all articles.

Hmm, that's alarmingly low.  Death of clpm predicted.  Film at 11.6.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Mon, 13 Sep 1999 17:42:06 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <OHaD3.8253$N77.641977@typ11.nn.bcandid.com>

In article <HraD3.8227$N77.642841@typ11.nn.bcandid.com>,
Kragen Sitaker <kragen@dnaco.net> wrote:
>But what I'd like to know is this: what is my OCR?  I can see it is
>between 0.756 and 0.520, because I'm in neither the top ten nor the
>bottom ten.

0.669 -- I'm in both the top *and* bottom ten for new posters.  :)
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Mon, 13 Sep 1999 10:42:28 -0700
From: David Amann <dove@synopsys.com>
Subject: Re: Trouble installing DBM mSQL on Solaris.
Message-Id: <37DD3784.372D9317@synopsys.com>

Hi Mark,

Mark wrote:

> Trying to install DBI/mSQL on solaris. I unpack the tar file & change
> directory to
> Msql-Mysql-modules-1.2206
>
> make Makefile.PL and immediately get the following message:
>

I think you want to type the following:

% perl Makefile.PL
% make
% make test
% make install

If you want to install your DBI module in a special directory, try

% perl Makefile.PL LIB=/my/module/directory

Hope this helps,
-=dav




>
> Mark Winder.
>
> mark.winder@virgin.net.



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

Date: Mon, 13 Sep 1999 13:48:34 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: Re: UNCRAP project proposal
Message-Id: <37DD38F2.9F17AA5C@networkengines.com>

>this is a good idea for the second version or an related one. one of the
>problems we seem to see is stupid isp who don't allow new modules. cgi
>and file::find are standard core. that one isn't. also running cron jobs
>is not a service many web sites will allow. so building the index is
>problematical. maybe a remote cron could hit a local cgi which does the
>build? :-)
Just because's it's a module doesn't mean it has to be in the lib directory.
put it in the same directory as the program itself and 'use' it.

You could arrange it so that the script tracks when it is called in a file (or just stat's the database)
If the date is yesterday or older, rebuild the database.


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

Date: Thu, 09 Sep 1999 16:01:54 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: use cgi/perl to hide access to subdirectory
Message-Id: <7r8lsf$4sn$2@news.mch.sbs.de>

In article <37d7384d@derwent.nt.tas.gov.au>, "Andrew" <andrewl@fire.tas.gov.au> wrote:
>I want to have a html page that calls cgi and within the cgi, I simply want
>to run another html page which is thereby hidden from the user. Can it be
>done and how?
>

Yes, it can be done (although the part where your HTML page 'calls' a CGI
might require some webserver reconfiguration - use SSI, or redirection, or 
a default CGI page, or ... depending on your webserver).

How can it be done ? By asking in the right newsgroups :

1. for your webserver configuration : comp.infosystems.www.servers.*
2. for your CGI question : comp.infosystems.www.authoring.cgi
3. for coding problems in Perl : comp.lang.perl.*

Have fun,

Michel.


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

Date: Mon, 13 Sep 1999 12:06:28 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: way to print all variables ?
Message-Id: <x3y7llug5j5.fsf@tigre.matrox.com>


ryanngi@hotmail.com (Ryan Ngi) writes:

> is there any way to print all variable of the language
> include
> %SIG,and special variable,%ENV...every variable

Yes.

% perl -wle 'print join(q/ and /, (keys %main::))'
@ and stdin and STDIN and " and stdout and STDOUT and $ and _<perlmain.c and _<universal.c and ENV and IO:: and _<-e and UNIVERSAL:: and / and ARGV and 0 and stderr and STDERR and DynaLoader:: and  and main:: and DB:: and INC and _


--Ala



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

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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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