[13368] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 778 Volume: 9

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

Date: Mon, 13 Sep 1999 10:05:07 -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: 778

Today's topics:
        CGI cannot open relative path <jdupayrat@webraska.com>
    Re: Deleting spaces in a string (Larry Rosler)
        Exact matching? <dcr@shell.one.net>
    Re: File IO Question (Larry Rosler)
    Re: Help : DBD::ODBC ? (Dan Wilga)
    Re: How to echo "% f"? <glenn.kauffman@worldnet.att.net>
    Re: Is anyone capable of explaining this?? <amonotod@netscape.net>
    Re: Is anyone capable of explaining this?? <amonotod@netscape.net>
    Re: MSQL.pm Please Help <glenn.kauffman@worldnet.att.net>
        multiple perl's <jerrad@networkengines.com>
        New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: perl -w strangeness <jcokos@ccs.net>
    Re: Perl / C Memory (Kai Henningsen)
    Re: Question about split <srooij@wins.uva.nl>
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: UNCRAP project proposal (Chris Nandor)
        Variable matching patterns (Michael Friendly)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Mon, 13 Sep 1999 18:10:31 +0100
From: "JduPayrat" <jdupayrat@webraska.com>
Subject: CGI cannot open relative path
Message-Id: <7rj7gb$fnh$1@minus.oleane.net>

Hello,

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.

Thanks.




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

Date: Mon, 13 Sep 1999 09:25:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Deleting spaces in a string
Message-Id: <MPG.1246c559d2e50cfe989f49@nntp.hpl.hp.com>

In article <Pine.GSO.4.10.9909130908200.19013-100000@crusoe.crusoe.net> 
on Mon, 13 Sep 1999 09:14:51 -0400, Jeff Pinyan <jeffp@crusoe.net> 
says...
> On Sep 13, Nick Condon blah blah blah:
> 
> > Jeff Pinyan wrote:
> > 
> > > Such a popular question, it's in the FAQ.
> > 
> > I know that this group is full of people who *love* to jump down people's throats
> > with "it's in the the FAQ", but you could at least read what he actually posted.
> 
> Ok, here is my take on the whole "It's in the FAQ" thing.

<SNIP of worthwhile presentation of the 'throw a fish' metaphor>

But you have missed the point -- it isn't in the FAQ!  Or if it is, 
please say where.

The question was how to strip all spaces from a string, not just the 
leading and trailing spaces.  That is probably too simple to warrant 
being in the FAQ.  (Nevertheless, only one answer included The Best Way 
To Do It, using the tr() operator.)

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


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

Date: 13 Sep 1999 12:58:00 -0400
From: Dan Rinnert <dcr@shell.one.net>
Subject: Exact matching?
Message-Id: <37dd2d18_3@news1.one.net>




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

Date: Mon, 13 Sep 1999 09:04:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: File IO Question
Message-Id: <MPG.1246c057109bae84989f48@nntp.hpl.hp.com>

[Posted and a courtesy copy sent. Order reversed again.]

In article <7rj4g1$to$3@bgtnsc03.worldnet.att.net> on Mon, 13 Sep 1999 
11:14:07 -0400, Glenn Kauffman <glenn.kauffman@worldnet.att.net> says...
> John J. Straumann <jstraumann@worldnet.att.net> wrote in message
> news:37DA6F3A.4E4CA917@worldnet.att.net...
> I have a simple program that outputs some data to a file.
> 
> 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...

 ...

> I had the same problem. So, I started to use
> 
>  foreach $cnt ($start,$end)
> 
> and the problem went away.

Exacly how many iterations do you think that will generate?  No doubt 
you meant this:

   foreach $cnt ($start .. $end)

Which is OK if $end >= $start.
 
> and the problem went away.

After so many wrong answers in such a short time, maybe you should 
consider doing the same thing.

At the very least, you should learn not to post conjectures and untested 
code.  It is wearying to have to do so much damage control after you.  
None of us likes being the guy with the bucket who walks after the 
elephants in the circus parade.

-- 
(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:01:33 -0400
From: dwilgaREMOVE@mtholyoke.edu (Dan Wilga)
Subject: Re: Help : DBD::ODBC ?
Message-Id: <dwilgaREMOVE-1309991201330001@wilga.mtholyoke.edu>

In article <7rissb$6to$1@srv4-poa.nutecnet.com.br>, "Alexandre"
<alrope@zaz.com.br> wrote:

> Please Programmers,
> 
>    I installed the DBD-ODBC in my system, and when a run a simple programm
> appear the message:
> 
> " Install_driver(ODBC) failed: DBD::ODBC object version 0.21 does not match
> bootstrap parameter
>   0 at C:\Perl\5.005\lib/MSWin32-x86-object/DynaLoader.pm line 187."

Recompile and reinstall DBD::ODBC from scratch. Don't rely on a
pre-compiled binary.

Dan Wilga          dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply  **


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

Date: Mon, 13 Sep 1999 11:55:45 -0400
From: "Glenn Kauffman" <glenn.kauffman@worldnet.att.net>
Subject: Re: How to echo "% f"?
Message-Id: <7rj90d$3p4$1@bgtnsc02.worldnet.att.net>

If you must use printf:

printf("%s",$_);

will work.


Bill Moseley <moseley@best.com> wrote in message
news:MPG.124159feb0575f298972a@nntp1.ba.best.com...
> Joseph O'Rourke (orourke@grendel.csc.smith.edu) seems to say...
> > When I try to read the string "% f" and print it out, it prints
> > as " 0.000000".  I am using this simple program test.pl:
> >
> > #!/usr/bin/perl
> > while (<>) {
> >         printf $_;
>                ^---- useless use of C experience in line 4
> perldoc -f printf
>
>
> --
> Bill Moseley mailto:moseley@best.com
> pls note the one line sig, not counting this one.




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

Date: Mon, 13 Sep 1999 16:09:47 GMT
From: Amonotod <amonotod@netscape.net>
Subject: Re: Is anyone capable of explaining this??
Message-Id: <7rj7jv$qt8$1@nnrp1.deja.com>

In article <7rj0dr$l70$1@nnrp1.deja.com>,
  ladlad@my-deja.com wrote:
> Hi,
> 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
open (SEARCH,">searchEC.htm"); #open for r/w access
open (SEARCH,"searchEC.htm"); #open for read access
#use all uppercase names to avoid namespace
#overlap with functions
> 				#reading and writting
> while (<search>)
> {
> $_= '123'; 			#modify
> print search $_;	 # and print back to the searchEC.htm
print SEARCH $_; #print to r/w or write filehandle
>
> }
> close(search);
>
> The problem is that it is not written back to the file, in other words
> I can not update the file. But if I use  print
> (to write to STDOUT)
> it writes the changed value properly.
>
> Where do I make a mistake or is it a bug?. Thank you very much for
help.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

Check the FAQs, this is detailed...

HTH,
amonotod
--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: Mon, 13 Sep 1999 16:10:13 GMT
From: Amonotod <amonotod@netscape.net>
Subject: Re: Is anyone capable of explaining this??
Message-Id: <7rj7kp$qth$1@nnrp1.deja.com>

In article <7rj0dr$l70$1@nnrp1.deja.com>,
  ladlad@my-deja.com wrote:
> Hi,
> 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
open (SEARCH,">searchEC.htm"); #open for create/write access
open (SEARCH,"searchEC.htm"); #open for read access
#use all uppercase names to avoid namespace
#overlap with functions
> 				#reading and writting
> while (<search>)
> {
> $_= '123'; 			#modify
> print search $_;	 # and print back to the searchEC.htm
print SEARCH $_; #print to r/w or write filehandle
>
> }
> close(search);
>
> The problem is that it is not written back to the file, in other words
> I can not update the file. But if I use  print
> (to write to STDOUT)
> it writes the changed value properly.
>
> Where do I make a mistake or is it a bug?. Thank you very much for
help.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

Check the FAQs, this is detailed...

HTH,
amonotod
--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: Mon, 13 Sep 1999 12:34:49 -0400
From: "Glenn Kauffman" <glenn.kauffman@worldnet.att.net>
Subject: Re: MSQL.pm Please Help
Message-Id: <7rj90e$3p4$2@bgtnsc02.worldnet.att.net>

Try putting single qoutes around your field names and any values that aren't
a number.

 $sql = qq[INSERT INTO client ('Client_ID','Company','Address') VALUES
('$ID_str','$Company_str', '$Address_str')];
$sth= $self->{ dbh }->query($sql);

You may also try

 $query = "INSERT INTO client VALUES ('$ID_str','$Company_str',
'$Address_str')";

if ALL of the fields values are provided in the correct order.

Glenn Kauffman


CNspots <cnspots@mindspring.com> wrote in message
news:7r8o5s$eb8$1@nntp3.atl.mindspring.net...
> Could someone please tell me what is wrong with thiscode I have been
racking
> my brains  for a week and I still can't figure it out.. Also can anyone
> reccomend a good source for learning msql.pm  Thanfs
>
> #!/usr/local/bin/perl
> use CGI;
> use Msql;
> use DBI;
>
> $cgiobject=new CGI;
> print $cgiobject->header;
>
> #$msql_hostname = "";
> #$msql_databasename = "disnco";
> $query = new CGI;
>
>
>
> #read in submitted Values
>
> if ($query->param)
>
> $ID_str = $query->param('Client_ID');
> $Company_str = $query->param('Company');
> $Address_str = $query->param('Address');
> $City_str = $query->param('City');
> $State_str = $query->param('State');
> $Country_str = $query->param('Country');
> $Zip_str = $query->param('Zip');
> $Phone_str = $query->param('Phone');
> $Fax_str = $query->param('Fax');
> $Email_str = $query->param('Email');
> $Web_Site_str = $query->param('Web_Site');
> $Refferd_by_str = $query->param('Refferd_by');
> $Contact_str = $query->param('Contact');
> $Notes_str = $query->param('Notes');
> $Alt_Contact_str = $query->param('Alt_Contact');
>
> }
>
> #Connect to Database
>
>
> $dbh = Msql->Connect("","disnco") or
>  die "not ok 1: $Msql::db_errstr\n";
>
> #Insert New Client into Database
>
>
> $self = shift;
>
>  $sql = qq[INSERT INTO client (Client_ID,Company,Address) VALUES
> ($ID_str,$Company_str,
>      $Address_str)];
>  $sth= $self->{ dbh }->query($sql);
>
> # CODE BREAKS HERE
>
> print "<HTML><HEAD></HEAD><BODY>";
> print $ID_str, "<BR>";
> print $Company_str, "<BR>";
> print $Address_str, "<BR>";
> print $City_str,"<BR>";
> print $State_str, "<BR>";
> print $Zip_str, "<BR>";
> print $Country_str, "<BR>";
> print $Phone_str, "<BR>";
> print $Fax_str, "<BR>";
> print $Email_str, "<BR>";
> print $Web_Site_str, "<BR>";
> print $Refferd_by_str, "<BR>";
> print $Contact_str, "<BR>";
> print $Notes_str, "<BR>";
> print $Alt_Contact_str, "<BR>";
>
>
>
> print "test5";
> #Create Output Page
> print $cgiobject->footer;
>
>
>




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

Date: Mon, 13 Sep 1999 12:41:43 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: multiple perl's
Message-Id: <37DD2947.DE25D9E1@networkengines.com>

okay, now I know this probably isn't possible, and can think of why if allowed and not done properly could be bad, BUT

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)

Just thought I'd ask.

PS> Please (b)cc me with any replies as well as posting's, thanks!


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

Date: 13 Sep 1999 16:24:44 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <7rj8gc$f70$2@info2.uah.edu>

Following is a summary of articles from new posters spanning a 7 day
period, beginning at 06 Sep 1999 16:29:38 GMT and ending at
13 Sep 1999 06:29:55 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 1999 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Totals
======

Posters:  239 (47.5% of all posters)
Articles: 363 (29.0% of all articles)
Volume generated: 652.0 kb (29.1% of total volume)
    - headers:    275.3 kb (5,502 lines)
    - bodies:     359.9 kb (11,299 lines)
    - original:   273.2 kb (8,918 lines)
    - signatures: 16.4 kb (342 lines)

Original Content Rating: 0.759

Averages
========

Posts per poster: 1.5
    median: 1 post
    mode:   1 post - 197 posters
    s:      3.1 posts
Message size: 1839.2 bytes
    - header:     776.7 bytes (15.2 lines)
    - body:       1015.3 bytes (31.1 lines)
    - original:   770.6 bytes (24.6 lines)
    - signature:  46.2 bytes (0.9 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   46    89.8 ( 32.9/ 47.5/ 31.8)  kragen@dnaco.net (Kragen Sitaker)
   13    22.9 (  9.0/ 13.9/ 10.3)  David Amann <dove@synopsys.com>
    5     9.5 (  3.4/  6.0/  5.1)  "Aldo Calpini" <dada@divinf.it>
    5     5.9 (  3.3/  2.6/  2.1)  "Robert Front" <robertf@emerald.oz.net>
    5     8.9 (  4.0/  4.9/  3.0)  "CNspots" <cnspots@mindspring.com>
    4     8.2 (  2.9/  5.3/  4.5)  Barry Hemphill <ubu@easynet.ca>
    4     6.2 (  3.2/  2.9/  2.0)  cLive hoLLoway <cLive@direct2u.co.uk>
    4     5.2 (  3.1/  2.1/  1.2)  "rdw2 at mindspring dot com"@test.com (Richard Warkentin)
    4     5.6 (  3.1/  2.5/  1.8)  "Oliver Christian Kjær" <Oliver@pop.k-net.dk>
    4     4.5 (  3.0/  1.5/  0.7)  "Allan Hagan" <allan.hagan@bt.com>

These posters accounted for 7.5% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  89.8 ( 32.9/ 47.5/ 31.8)     46  kragen@dnaco.net (Kragen Sitaker)
  57.8 (  0.7/ 57.1/ 53.0)      1  "Leonard Burton" <Leonard.Burton@babt.com>
  22.9 (  9.0/ 13.9/ 10.3)     13  David Amann <dove@synopsys.com>
   9.5 (  3.4/  6.0/  5.1)      5  "Aldo Calpini" <dada@divinf.it>
   8.9 (  4.0/  4.9/  3.0)      5  "CNspots" <cnspots@mindspring.com>
   8.7 (  0.5/  8.2/  7.0)      1  "Kommunedata" <xxx@kmd.dk>
   8.2 (  2.9/  5.3/  4.5)      4  Barry Hemphill <ubu@easynet.ca>
   6.2 (  3.2/  2.9/  2.0)      4  cLive hoLLoway <cLive@direct2u.co.uk>
   5.9 (  3.3/  2.6/  2.1)      5  "Robert Front" <robertf@emerald.oz.net>
   5.9 (  1.9/  4.0/  0.7)      2  "Jason Kohlhoff" <jwk6@earthlink.net>

These posters accounted for 10.0% of the total volume.

Top 10 Posters by OCR (minimum of three posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

1.000  (  2.2 /  2.2)      3  missymanning@my-deja.com
1.000  (  0.8 /  0.8)      3  curtisbeard@my-deja.com
1.000  (  2.4 /  2.4)      3  "Matt King" <mattking@techie.com>
0.852  (  4.5 /  5.3)      4  Barry Hemphill <ubu@easynet.ca>
0.848  (  5.1 /  6.0)      5  "Aldo Calpini" <dada@divinf.it>
0.832  (  1.3 /  1.6)      3  spsanders@home.com
0.787  (  2.1 /  2.6)      5  "Robert Front" <robertf@emerald.oz.net>
0.743  ( 10.3 / 13.9)     13  David Amann <dove@synopsys.com>
0.730  (  1.8 /  2.5)      4  "Oliver Christian Kjær" <Oliver@pop.k-net.dk>
0.669  ( 31.8 / 47.5)     46  kragen@dnaco.net (Kragen Sitaker)

Bottom 10 Posters by OCR (minimum of three posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.730  (  1.8 /  2.5)      4  "Oliver Christian Kjær" <Oliver@pop.k-net.dk>
0.669  ( 31.8 / 47.5)     46  kragen@dnaco.net (Kragen Sitaker)
0.664  (  2.0 /  2.9)      4  cLive hoLLoway <cLive@direct2u.co.uk>
0.618  (  1.3 /  2.1)      3  hatterasNOSPAM@hotbot.com (Jamie Schrumpf)
0.607  (  3.0 /  4.9)      5  "CNspots" <cnspots@mindspring.com>
0.589  (  1.2 /  2.1)      4  "rdw2 at mindspring dot com"@test.com (Richard Warkentin)
0.560  (  1.7 /  3.0)      3  Christoph Bauer <crispbcd@linux.zrz.tu-berlin.de>
0.467  (  0.7 /  1.5)      4  "Allan Hagan" <allan.hagan@bt.com>
0.438  (  0.7 /  1.7)      3  "gilbert" <gilbert@yahoo.com>
0.399  (  1.1 /  2.6)      3  ljl_ljl@my-deja.com

18 posters (7%) had at least three posts.


Top 10 Crossposters
===================

Articles  Address
--------  -------

       6  saratoga@myremarq.com (Chine Bleu)
       6  Karl Schmidt <nospam@nospam.de>
       4  "Jason Kohlhoff" <jwk6@earthlink.net>
       4  hatterasNOSPAM@hotbot.com (Jamie Schrumpf)
       4  sweetp@excite.com
       3  Dave Eastabrook <news@elmbronze.demon.co.uk>
       3  dik@cwi.nl (Dik T. Winter)
       3  larske@hem1.passagen.se.REMOVE (Lars-Åke Aspelin)
       3  Jim@jibbering.com (Jim Ley)
       3  flabreq@ibm.net


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

Date: Mon, 13 Sep 1999 09:11:23 -0700
From: "John Cokos" <jcokos@ccs.net>
Subject: Re: perl -w strangeness
Message-Id: <37dd2290_3@goliath.newsfeeds.com>

Yes,

I had already taken the commas out of the code .... what I copied and pasted
here on the NG was from a different copy of the program that hadn't been
changed yet.

The error still persists, seems to be every line that uses the %urls hash.

John

Entire section is copied below:

In module1.pm:
=========================================================
BEGIN


   # Predefined Variables ... Program Wide Visibility
   use vars qw ($ISP $PROG_URL %global %programs %urls $cext %input %encodedform
       $action $password %admincookie $data_dir $admin_url  $debug  $debug_text
       $directory @dir $key $OUT $file $INUSE $LOGTEXT $cext
      );

   $INUSE=1;

}

BEGIN { use module2.pm; }


In module2.pm:

These are the lines that cause the errors:
(There is a set of "ifs" above this that properly define $cext)

      $urls{'WHATSNEW'}  = "$global{'CGI_DIR'}/admin/new_admin.$cext";
      $urls{'HYPERSEEK'} = "$global{'CGI_DIR'}/admin/hs_admin.$cext";
      $urls{'HF'}        = "$global{'CGI_DIR'}/admin/hf_admin.$cext";
      $urls{'ISEEK'}     = "$global{'CGI_DIR'}/admin/iseek_admin.$cext";
      $urls{'ILINK'}     = "$global{'CGI_DIR'}/admin/ilink_admin.$cext";
      $urls{'ISHOP'}     = "$global{'CGI_DIR'}/admin/ishop_admin.$cext";
      $urls{'WEBRING'}   = "$global{'CGI_DIR'}/admin/ring_admin.$cext";
      $urls{'GBOOK'}     = "$global{'CGI_DIR'}/admin/gb_admin.$cext";
      $urls{'COMMENTS'}  = "$global{'CGI_DIR'}/admin/cmt_admin.$cext";
      $urls{'FILES'}     = "$global{'CGI_DIR'}/admin/filex_admin.$cext";
      $urls{'BBS'}       = "$global{'CGI_DIR'}/admin/bbs_admin.$cext";
      $urls{'CLASS'}     = "$global{'CGI_DIR'}/admin/class_admin.$cext";
      $urls{'SLPAT'}     = "$global{'CGI_DIR'}/admin/splat_admin.$cext";
      $urls{'BANNERS'}   = "$global{'CGI_DIR'}/admin/bm_admin.$cext";
      $urls{'MAIL'}      = "$global{'CGI_DIR'}/admin/mailman.$cext";
      $urls{'USERS'}     = "$global{'CGI_DIR'}/admin/users.$cext";

     if($global{'hsgo'} eq "YES") { $urls{'go_url'} = "$global{'CGI_DIR'}/hsgo.cgi"; }


The only common things in these lines is the use of %urls and $global{'CGI_DIR'}, which
I'm sure is defined, as I can "print" it.  I can also print $cext, so I know that it, too is
defined.


I'm assuming that by doing a "use vars" in one module does, in fact, make the variables
global to any and all required or used modules ... is that assumption correct?

A similar question would be this.... if I define a variable with "my" at the top of  program
either in a BEGIN, or before anything is required, are that variable considered global
to all subroutines within?


John




=========================================================



--

 ................................................................................................................................
John Cokos, President
The CCS Network (http://www.ccs.net)
The Interactive Web (http://www.interactive-web.net)

 >> Tech Support Questions: Please go to http://support.ccs.net/newsgroups.shtml <<
 ................................................................................................................................


John Cokos <jcokos@ccs.net> wrote in message news:37daff5e_4@goliath.newsfeeds.com...
> I'm getting strange errors when running perl -w on a program:
>
> Error:
> Use of uninitialized value at test.cgi line 119.
>
> 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.
>
> Thanks, John
>
>
>
>
>   -----------== 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 ==-----




  -----------== 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: 13 Sep 1999 09:41:00 +0200
From: kaih=7OmmKH$1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Perl / C Memory
Message-Id: <7OmmKH$1w-B@khms.westfalen.de>

dan@tuatha.sidhe.org (Dan Sugalski)  wrote on 12.09.99 in <hzUC3.5897$wW2.8602@news.rdc1.ct.home.com>:

> Kai Henningsen <kaih=7OhjZZ$mw-B@khms.westfalen.de> wrote:
> > dan@tuatha.sidhe.org (Dan Sugalski)  wrote on 04.09.99 in
> > <sf_z3.148$lT.809@news.rdc1.ct.home.com>:
>
> >> Sure it does. Unfortunately just because perl frees memory doesn't mean
> >> memory is returned back to the system. With very few exceptions (I think
> >> MacOS and, under a few circumstances, VMS) any memory allocated to a
> >> process by the OS stays with that process until it exits. This isn't a
> >> perl thing--any program that mallocs memory will do it.
>
> > Linux with glibc2 can also, I gather, return free()d memory to the OS.
>
> > The way to do that is to not use brk(), but instead use mmap() to get the
> > memory. Then you can munmap() it again.
>
> Well, OK, you can do that with any OS that implements mmap, but mapping
> files to memory just so you can free it later seems a tad weasly.

Why?

>Plus the
> memory mapped is usually nonswappable (I think) which would tend to chew
> through available RAM pretty quickly...

Certainly not on in this case.

> A better thing to do would be for someone to go ahead and fix the various
> C libraries to hand free'd memory back, but it's been 30 years and
> nobody's done it yet, so I probably shouldn't hold my breath.

Because it's impossible in general if done with brk(). The number of  
processes that ever free significant amounts of memory at the upper bound  
is microscopic.

It's called a heap because it doesn't behave like a stack.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: Mon, 13 Sep 1999 19:16:27 +0200
From: Steven de Rooij <srooij@wins.uva.nl>
Subject: Re: Question about split
Message-Id: <37DD316B.DFE557BD@wins.uva.nl>

Kragen Sitaker wrote:
[snip]
> 
> I agree with all of these except for 'quicker'.  I'm always very
> reluctant to make assertions about speed without testing first; in this
> case, it turns out you were mistaken -- at least on my machine,
> according to Benchmark.pm.
[long snip]

Thanks for this amazingly thorough reply :-)
I should have worded more carefully.
What I meant is this: I expect my approach to be quicker for strings
containing function calls with a large number of parameters (maybe 100
or so), but even of that I'm not absolutely certain.

Not anymore.

Steven


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

Date: 13 Sep 1999 16:24:42 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <7rj8ga$f70$1@info2.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 06 Sep 1999 16:29:38 GMT and ending at
13 Sep 1999 06:29:55 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 1999 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Excluded Posters
================

perlfaq-suggestions\@(?:.*\.)?perl\.com

Totals
======

Posters:  503
Articles: 1251 (505 with cutlined signatures)
Threads:  414
Volume generated: 2240.0 kb
    - headers:    967.1 kb (19,266 lines)
    - bodies:     1179.4 kb (36,797 lines)
    - original:   827.9 kb (27,454 lines)
    - signatures: 92.2 kb (1,966 lines)

Original Content Rating: 0.702

Averages
========

Posts per poster: 2.5
    median: 1 post
    mode:   1 post - 332 posters
    s:      5.5 posts
Posts per thread: 3.0
    median: 2.0 posts
    mode:   1 post - 131 threads
    s:      2.9 posts
Message size: 1833.5 bytes
    - header:     791.7 bytes (15.4 lines)
    - body:       965.4 bytes (29.4 lines)
    - original:   677.7 bytes (21.9 lines)
    - signature:  75.5 bytes (1.6 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   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
   20    28.7 ( 11.6/ 17.1/  9.3)  Ala Qumsieh <aqumsieh@matrox.com>
   17    27.7 ( 11.4/ 16.2/ 10.4)  Jon Peterson <jpeterson@office.colt.net>
   16    34.6 ( 13.5/ 15.0/  7.8)  Uri Guttman <uri@sysarch.com>
   15    25.1 ( 10.5/ 14.7/ 10.5)  Andrew Gray <agray@infoscience.otago.ac.nz>

These posters accounted for 27.0% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

 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>
  57.9 ( 26.6/ 27.6/ 16.6)     43  moseley@best.com (Bill Moseley)
  57.8 (  0.7/ 57.1/ 53.0)      1  "Leonard Burton" <Leonard.Burton@babt.com>
  55.1 ( 21.7/ 29.4/ 17.4)     35  lr@hpl.hp.com (Larry Rosler)
  47.3 ( 10.5/ 35.1/ 33.6)     13  tchrist@mox.perl.com (Tom Christiansen)
  34.6 ( 13.5/ 15.0/  7.8)     16  Uri Guttman <uri@sysarch.com>
  30.6 ( 11.1/ 19.4/  8.6)     13  Dan Sugalski <dan@tuatha.sidhe.org>

These posters accounted for 28.3% of the total volume.

Top 10 Posters by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.993  ( 12.5 / 12.6)      6  pudge@pobox.com (Chris Nandor)
0.975  (  4.8 /  4.9)      8  Collin Starkweather <collin.starkweather@colorado.edu>
0.957  ( 33.6 / 35.1)     13  tchrist@mox.perl.com (Tom Christiansen)
0.933  ( 21.8 / 23.3)     35  abigail@delanet.com
0.905  (  5.7 /  6.4)      8  Michael de Beer <madebeer@igc.apc.org>
0.848  (  5.1 /  6.0)      5  "Aldo Calpini" <dada@divinf.it>
0.787  (  2.1 /  2.6)      5  "Robert Front" <robertf@emerald.oz.net>
0.777  (  3.3 /  4.3)      6  maas@ensae.fr
0.763  (  8.8 / 11.5)      9  ehpoole@ingress.com
0.756  (  5.5 /  7.3)      7  anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.520  (  7.8 / 15.0)     16  Uri Guttman <uri@sysarch.com>
0.517  (  2.1 /  4.1)      5  mrbog@my-deja.com
0.513  (  4.0 /  7.8)      7  George Reese <borg@imaginary.com>
0.503  (  3.8 /  7.6)      9  "Wyzelli" <wyzelli@yahoo.com>
0.465  (  2.0 /  4.3)      5  ilya@math.ohio-state.edu (Ilya Zakharevich)
0.463  (  1.2 /  2.7)      5  revjack <revjack@radix.net>
0.449  (  1.9 /  4.3)      9  Greg Bacon <gbacon@cs.uah.edu>
0.441  (  8.6 / 19.4)     13  Dan Sugalski <dan@tuatha.sidhe.org>
0.431  (  3.8 /  8.7)     12  elephant@squirrelgroup.com (elephant)
0.424  (  1.7 /  4.1)      7  Tom Briles <sariq@texas.net>

43 posters (8%) had at least five posts.

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   26  Y2K bugs on the Internet
   18  mysql interview
   15  UNCRAP project proposal
   14  Unix Trouble
   14  converting a number into a binary?
   13  Quoting Strategies and the Jeopardy Game
   13  Programmer's Editor
   11  Case insensitive SQL query
   11  suggestion to revise grep (another Q: reference comparison)
   10  Is My computer busted?

These threads accounted for 11.6% of all articles.

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  63.1 ( 22.4/ 38.2/ 27.9)     26  Y2K bugs on the Internet
  57.8 (  0.7/ 57.1/ 53.0)      1  Need help with script.
  41.0 ( 19.2/ 19.4/ 11.6)     18  mysql interview
  37.7 ( 10.9/ 26.2/ 21.5)     13  Quoting Strategies and the Jeopardy Game
  37.7 ( 13.1/ 22.0/ 14.6)     15  UNCRAP project proposal
  31.5 (  7.0/ 24.2/ 15.4)      8  case for open lang on win32 - fill in the table
  28.4 ( 10.1/ 16.8/ 12.9)     14  converting a number into a binary?
  25.9 ( 10.3/ 15.1/ 10.5)     14  Unix Trouble
  22.5 (  8.7/ 13.0/  6.8)     11  suggestion to revise grep (another Q: reference comparison)
  21.0 (  5.7/ 15.2/  8.2)      6  Perl and Threads

These threads accounted for 16.4% of the total volume.

Top 10 Threads by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.863  (  3.7/   4.2)      8  Automating Secure Copy using Perl
0.821  (  4.0/   4.8)      5  division by zero
0.819  ( 21.5/  26.2)     13  Quoting Strategies and the Jeopardy Game
0.795  (  8.9/  11.2)      7  large dataset problem
0.790  (  3.4/   4.3)      5  integer mistery
0.777  (  4.1/   5.2)      7  perl mail filter?
0.769  ( 12.9/  16.8)     14  converting a number into a binary?
0.764  (  2.0/   2.6)      5  Tries to download script when running
0.760  (  1.6/   2.1)      5  How do I load libraries from a non-default path ??
0.754  (  3.7/   5.0)      7  very simple question.

Bottom 10 Threads by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.526  (  4.3 /  8.2)      9  mastering algorithms a munition?
0.526  (  6.8 / 13.0)     11  suggestion to revise grep (another Q: reference comparison)
0.524  (  4.3 /  8.2)     11  Case insensitive SQL query
0.512  (  1.5 /  2.9)      5  Problem with <!--#exec cgi=/scripts/script.pl%22--> in IIS4
0.512  (  3.4 /  6.6)      8  Smile...
0.497  (  1.9 /  3.7)      5  back for more sorting abuse
0.493  (  2.6 /  5.2)      8  Need help with some pattern matching...
0.481  (  2.3 /  4.8)      6  foreach oddity
0.468  (  2.5 /  5.4)      7  Removing a line from a text file
0.430  (  1.7 /  3.9)      5  Pattern Matching Question

71 threads (17%) had at least five posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      41  comp.lang.perl.modules
      27  comp.lang.java.programmer
      26  comp.lang.javascript
      26  comp.lang.c
      19  comp.lang.perl
       9  microsoft.public.scripting.wsh
       8  comp.security.ssh
       8  comp.lang.python
       7  gnu.emacs.help
       5  comp.lang.c++

Top 10 Crossposters
===================

Articles  Address
--------  -------

      10  Jonathan Stowe <gellyfish@gellyfish.com>
       7  pudge@pobox.com (Chris Nandor)
       6  fred@genesis.demon.co.uk
       6  saratoga@myremarq.com (Chine Bleu)
       6  Karl Schmidt <nospam@nospam.de>
       4  sweetp@excite.com
       4  abigail@delanet.com
       4  Arved_37@chebucto.ns.ca (Arved Sandstrom)
       4  nielsenjf@my-deja.com
       4  hatterasNOSPAM@hotbot.com (Jamie Schrumpf)


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

Date: Mon, 13 Sep 1999 16:25:22 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: UNCRAP project proposal
Message-Id: <pudge-1309991225250001@192.168.0.77>

In article <m31zc2suep.fsf@biff.bitsko.slc.ut.us>, Ken MacLeod
<ken@bitsko.slc.ut.us> wrote:

# pudge@pobox.com (Chris Nandor) writes:
# > No one said adding the closing tag makes it not HTML.  Requiring it makes
# > it not HTML (for now, anyway).
# 
# XHTML became a W3C Proposed Recommendation on 24 August 1999.
# 
#   <http://www.w3.org/TR/xhtml1/>

I am not being merely pedantic when I point out that XHTML is not HTML. 
If it were, it would be called XHTML.  Next you'll be trying to convince
me that JavaScript is Java.  :)

But seriously, conformance to HTML does not make it HTML.  It just
doesn't.  If it adds or takes away requirements, or if it disallows what
is allowed, or allows what is not, then it isn't.

In any event, XHTML can also be non-conformant to HTML.  You can do <p/>
in XHTML, but not in HTML.  So it cannot even be said that XHTML is
conformant to HTML.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: 13 Sep 1999 16:26:35 GMT
From: friendly@hotspur.psych.yorku.ca (Michael Friendly)
Subject: Variable matching patterns
Message-Id: <7rj8jr$h11$1@sunburst.ccs.yorku.ca>

I've obviously forgotten something, because I can't get variable patterns
to work in matches.  E.g., I want to use

# Patterns for include-type statements, leaving filename in #1
$include_pat = join('|',
      ('\\input\b\{?(\S+)\}',
       '\\include\s*\{(\S+)\}'
      ));

# Patterns for references to a label, leaving label in $1
$ref_pat = '\\[a-z]*ref\{([^}]+)\}';       # pattern for single ref

in statements like

   open (TEXFILE, $texfile) || die "Can't read $texfile.\n";
   while (<TEXFILE>) {
      chop;  $lineno++;
      s/%.*//;                               # decomment

      # parse references, store info in $label{$key}
      while (m#$ref_pat#g) {
         $ref = $1;
         push @{ $label_ref{$1} }, "$texfile $lineno";
         }

      # Search recursively in included files
      if (m#$include_pat#) {
         $file = $1;
         ....
      }
  }
  close (TEXFILE);

They work only if I insert the patterns explicitly in the match expressions.
What am I forgetting?

--
Michael Friendly     Email: friendly@yorku.ca (NeXTmail OK)
Psychology Dept
York University      Voice: 416 736-5115  Fax: 416 736-5814
4700 Keele Street    http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA


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

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


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