[8534] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2151 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 21 12:07:11 1998

Date: Sat, 21 Mar 98 09:00:31 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 21 Mar 1998     Volume: 8 Number: 2151

Today's topics:
        - Looking for a Linkchecker script - (__Olivier__)
    Re: Cacheproblems with cgi-generated html (Jason Gloudon)
    Re: Challenge your programming skill (Bart Lateur)
    Re: Challenge your programming skill <beans@bedford.net>
    Re: Challenge your programming skill (hymie!)
    Re: Challenge your programming skill (Jim Michael)
    Re: Changing Substr's into RegEx... (Jason Gloudon)
        Data Storage Strategies? (Wade Williams)
    Re: Dynamically checking for existing functions (Bart Lateur)
    Re: FileHandle - I really wish it had a 'file_name' met (Jason Gloudon)
    Re: how to know the version of the perl (Gabor)
    Re: how to know the version of the perl (Craig Berry)
    Re: Im a dip so kill me ok! (Gabor)
    Re: Im a dip so kill me ok! (Jason Gloudon)
        job offer (Genetics, Harvard med. school, Boston) <jong@salt2.med.harvard.edu>
    Re: Large programs: is Perl up to it? (Jason Gloudon)
        List a directory command?? pleez help! <mark@imp.net>
        pop3 access via the web (gordon)
        Re:sending mail through perl lihong@public1.guangzhou.gd.cn
    Re: sending mail through perl (Neil Briscoe)
    Re: Squelching STDIN (Jason Gloudon)
    Re: sub-array length? <jhi@alpha.hut.fi>
    Re: Trouble with GD.pm on Win32 Perl (Mark Schmick)
    Re: ts: using "my" inside a loop? <jhi@alpha.hut.fi>
    Re: ts: using "my" inside a loop? (Jason Gloudon)
    Re: Wanted: email address gleaner (Bart Lateur)
    Re: Wanted: email address gleaner (Frank)
    Re: what is wrong with being a novice ?? (Jason Gloudon)
    Re: Wierd redirection problem with Location: (Peter Caffin)
    Re: Win32 Perl and ODBC New User Problems (Schreffman)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 21 Mar 1998 13:27:07 GMT
From: omueller@stud.ee.StoPx.ch (__Olivier__)
Subject: - Looking for a Linkchecker script -
Message-Id: <slrn6h7fot.3lq.omueller@tardis-e3.ee.ethz.ch>


I'm looking for a "Link Checker" script that does following work :
as argument it should takes a filename (the file would be a list
of about 300-500 URL's), and should return the same list, saying
for each URL if it is still valid (working) or not.
The script would run every night.

Does someone know if such a perl program already exists ? If yes,
I'd be _very_ interested ! Otherwise, I'll have to create it
myself...

Thanks for any hints,
Olivier

-- 
Olivier Mueller    |  omueller@stud.ee.SToPx.ch 
EE Student @ ETHZ  |  http://www.stud.ee.ethz.ch/~omueller
 ...Please replace "SToPx" by "Ethz" in my email to reply...


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

Date: Sat, 21 Mar 1998 14:05:05 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: Cacheproblems with cgi-generated html
Message-Id: <slrn6h7i60.2av.jgloudon@manitoba.bbn.com>

In article <35138CED.17EE3ECC@hrz1.hrz.tu-darmstadt.de>, Raphael Breiting wrote:
>Hi All,
>
>i have a serious problem with the caches in the net.
>Can cgi-generated html-documents be cached by proxy servers?
>If they can be cached, what can i do to prevent the proxys from caching
>these pages?
>Everything works fine, after i turned on "direct connection to the
>internet" in my netscape browser 4.0.

grep -i 'perl' in this post turns up no references to perl here. This is not
a perl question this is a cgi question. Ask it on comp.infosystems.www.cgi or 
somesuch group.

-- 
Jason Gloudon


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

Date: Sat, 21 Mar 1998 10:25:24 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Challenge your programming skill
Message-Id: <351b9588.4775289@news.tornado.be>

Abigail wrote:

>However, the human race,
>specially in "modern" countries has the habit of all crawling together and
>live on each others lap. Clusters of humans are sometimes called cities.
>
>If your customers are clustered, your approach doesn't work well.

Customers in the same city do tend to have the same ZIP-code, don't
they?

	Bart.


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

Date: 21 Mar 98 12:46:30 GMT
From: "TomH" <beans@bedford.net>
Subject: Re: Challenge your programming skill
Message-Id: <01bd5403$7b95eca0$119163ce@beans.bedford.net>

I don't really want to start an algorithm war here (especially since, from
other of your postings I assume you are smarter than me), but this approach
is very efficient. 

If the initial box returns too many customers, start cutting the box size
in half and eliminating customers from the set remaining; binary searches
are pretty hard to beat. I suppose one could optimize ahead of time by
assigning an initial box size to each zipcode, but I doubt it would be
worth it.

Anyway, the goal here is to consider only customers in the proximity of the
entered zipcode without missing any; to do that you need geometry on the
earth spheriod, not political boundaries (like cities, states, zipcodes,
etc.). 

I worked on a similar project once where we had several hundred thousand
"customers" (okay, it was a military application and the motto was "If
you're not our friend, you're our target"...but that was before I started
using Perl  :^)  ). 

-Tom   
 ...
> ++ I'd make a first coarse filter by finding all customers within some
> ++ lat/long bounded box around the entered zipcode (plus and minus a
degree or
> ++ two should do it, increase the box size if none are found). '
 ...
> That would work well if you're customers are spread evenly. 
 ...
> If your customers are clustered, your approach doesn't work well.
 ...


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

Date: 21 Mar 1998 14:36:06 GMT
From: hymie@lactose.smart.net (hymie!)
Subject: Re: Challenge your programming skill
Message-Id: <6f0j8m$lm3$1@news.smart.net>

In our last episode, the evil Dr. Lacto had captured our hero,
  bart.mediamind@tornado.be (Bart Lateur), who said:
>Abigail wrote:
>
>>However, the human race,
>>specially in "modern" countries has the habit of all crawling together and
>>live on each others lap. Clusters of humans are sometimes called cities.
>>
>>If your customers are clustered, your approach doesn't work well.
>
>Customers in the same city do tend to have the same ZIP-code, don't
>they?
>
>	Bart.

Nope.  Baltimore, MD -- not a large city by most standards -- has 100
ZIP codes assigned to it, counting PO Boxes and prestigious companies
like Towson University who get private ZIP codes, but only uses about
75 of them. Philadelphia, PA has 200 ZIP codes assigned to it, and if
I had to guess, uses about half.

New York City, the country's largest, has 1000 ZIP codes assigned to it.
Washington, DC has 500, and Los Angeles, CA has 600.

In fact, the nice thing about ZIP codes in these places is that, when
a ZIP codes gets to crowded (for example, 10028), you can just create
a new one (10128).

 ..hymie!         http://www.smart.net/~hymowitz         hymie@lactose.smart.net
===============================================================================
Oh, society's goal is to be part of whe whole.
It may sound good to you, not to me.                              --the Turtles
===============================================================================


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

Date: Sat, 21 Mar 1998 16:26:04 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: Challenge your programming skill
Message-Id: <genepoolEq6GBG.19q@netcom.com>

Abigail (abigail@fnx.com) wrote:

: That would work well if you're customers are spread evenly. Which might
 ...
: If your customers are clustered, your approach doesn't work well.

Perhaps a density function would help, make the lat/long mesh a function
of population density based on population or number of addresses within a
zip code per bounded area the zip code covers (addresses per hectare).
Rural Kansas should have a low zcd, Atlanta metro moderately high, NYC
very high. 

Cheers,

Jim


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

Date: Sat, 21 Mar 1998 13:51:46 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: Changing Substr's into RegEx...
Message-Id: <slrn6h7hd1.2av.jgloudon@manitoba.bbn.com>

In article <351320CA.4B3A3385@mail.earthlink.net>, Benjamin Holzman wrote:
>> sub checkReferrer { # Check who called us...
>> 
>    ...
>    remote_addr =~ /^((?:\d+\.??){3})/;

Why did you use the non-greedy quantifier ?

-- 
Jason Gloudon


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

Date: Sat, 21 Mar 1998 08:04:18 -0600
From: wwilliam@cisco.com (Wade Williams)
Subject: Data Storage Strategies?
Message-Id: <wwilliam-2103980804180001@10.0.0.2>

I'd like to hear the strategies some of you experts have used for storing
complex data structures in files.  

As I see it, there's 3 main approaches:

1)  Use a module that allows more complex DBM's, or uses SQL's, etc.
2)  Store each hash or array into a separate DBM file, and reconstruct
your complex data structure when you read the data back in.
3)  Create your own single-file format, and use seeks and reads.

The first option looks the most attractive since you don't have to
reinvent the wheel, but my group has people developing on Macs and PC's
for final deployment on UNIX.  The headaches associated there might be
significant.

The second option is easy, but would create a lot of files.

The third option would be the most difficult.

So, I'd like to hear from others - how have you approached this problem? 
What has worked and not worked?

I'd love to see examples.  Say for example you're storing a hash of hashes
of hashes.  How would you store it?

Any input greatly appreciated.

Thanks,

Wade

-- 
 ---------------------------------------------------------------------------
 Wade Williams                      "Any escape might help to smooth the
 Systems Engineer, CCIE #3373        unattractive truth, but the suburbs
 Cisco Systems, Inc.                 have no charms to soothe the restless
 Brentwood, TN                       dreams of youth." 
 615-221-2918                              - N. Peart
 wwilliam@cisco.com    
 ---------------------------------------------------------------------------


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

Date: Sat, 21 Mar 1998 10:25:40 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Dynamically checking for existing functions
Message-Id: <35198efc.3116609@news.tornado.be>

I R A Aggie wrote:

>+         print \&James;
>+ 
>+ print something like "CODE(0x153b14)", even though sub James was not
>+ defined?
>
>I am a complete entity. I am not a subroutine!
>
>James -- :) as necessary

Ah. Some background info might clarify the choice of the name:

	sub Jeeves {
		local $\ = "\n";
		print "You rang, mylord?";
	}

This is a code I used to see if "Jeeves" was actually called if I used
"defined &Jeeves". It's not, btw.

"James" is another (typical) butler name, though this particular sub was
not defined.

	Bart.


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

Date: Sat, 21 Mar 1998 12:45:18 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: FileHandle - I really wish it had a 'file_name' method!
Message-Id: <slrn6h7dgd.2av.jgloudon@manitoba.bbn.com>

In article <6eur7o$2hb$1@ns1.arlut.utexas.edu>, Stuart McDow wrote:
>Martin Gregory <mgregory@asc.sps.mot.com> writes:
>> 
>> to provide a method that returns the string that was given in the
>> open (or whatever) method.  Sure, it might return me something like
>
>Maybe. I suppose the name of the file could be stored somewhere and
>accessible via a method.  But, what should be done in the case where
>the file is unlinked (or renamed) before it is closed?

Even if this program was written in C, and you were doing your exception
handling yourself, you can't do much about such events, other than not allowing 
them to take place.

Martin could obtain the behaviour he is interested in by creating a new
subclass of FileHandle and overriding the open methods.

However, FileHandle's do not always refer directly to files, eg. filehandles 
used with fdopen or pipe, so the "whatever" method used to associate the 
filehandle with a descriptor would make it difficult to return descriptive 
information.

You could always define a my_open() which stores the filehandle => filename
association in a hash ie. $handfiles{"$FileHandle"} = $filename, which you
could lookup in your exception handling code. You may have already done
this.

-- 
Jason Gloudon


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

Date: 21 Mar 1998 11:32:35 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: how to know the version of the perl
Message-Id: <slrn6h7a3u.m7p.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Abigail <abigail@fnx.com> wrote :
# lihong@public1.guangzhou.gd.cn (lihong@public1.guangzhou.gd.cn) wrote on
# MDCLXIII September MCMXCIII in <URL: news:6ev1ju$n49$1@nnrp1.dejanews.com>:
# ++ How can I know the version of perl running on my workstation?
# ++ the first line of perl scirpt should be /usr/local/bin/perl.
# 
# perl -weprint$]
# 
# Or you RTFM for a more friedlier approach.

Or one that works. :)
That will give the message
'Illegal varibale name'

You forgot to backslash the $, to keep it from being interpreted by
the shell.


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

Date: 21 Mar 1998 08:12:55 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: how to know the version of the perl
Message-Id: <6evsq7$42t$1@marina.cinenet.net>

lihong@public1.guangzhou.gd.cn wrote:
: How can I know the version of perl running on my workstation?
: the first line of perl scirpt should be /usr/local/bin/perl.

Interactively, you can do 'perl -v'.  Inside a script, you can do

  require 5.003;  # or whatever

to insist on a given version or higher, or refer to the $] variable to 
get the actual version number.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 21 Mar 1998 11:40:28 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: Im a dip so kill me ok!
Message-Id: <slrn6h7ain.m7p.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Uri Guttman <uri@sysarch.com> wrote :
# cstewart@flash.net (Chuck Stewart) writes:
# 
# > I always check the Perl FAQ before I post here. Sometimes I miss the
# > boat because I'm a beginner and rely on experts in the newsgroup to
# > help me and appreciate their help greatly.  This is not the case here.
# > If I knew the answer I wouldn't post here.  If it makes you perl geeks
# > feel better, OK, I'm stupid. I politely ask for help and do not
# 
# my head cold just went away and my eyes can now see :-)
# 
# > expect to get chastised for asking.  Save the bandwidth for answering
# > my post plz and not map me to some damn dark perl hole in cyber hell
# > because you are or think you are smarter than me... I want an answer,
                                                        ^^^^^^^^^^^^^^^^
The above is the part I like the best.  Quite the demanding guy, that
Chuck. :)  He isn't looking for help, he demands that you write his
program.  Isn't the worl a beautiful place, people are now expected to
write code for free on demand.  Just because a newbie demands it.

# you want a program, not an answer to a question. very different. try
# writing something and asking how to fix it rather than say "do it for me"
# 
# > if you have one fine, otherwise I'm not interested in your arrogant
                                                               ^^^^^^^^
Given what I underscored above, I wonder who is arrogant. ;)

# > bullshit. Now if I may, here is my request for help again:


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

Date: Sat, 21 Mar 1998 13:34:39 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: Im a dip so kill me ok!
Message-Id: <slrn6h7gcu.2av.jgloudon@manitoba.bbn.com>

In article <35134683.1628498@news.flash.net>, Chuck Stewart wrote:
This is just as related to CGI as it is related to Perl. Why didn't you
cross post there ? Enough bandwidth wasted.
-- Jason Gloudon


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

Date: Sat, 21 Mar 1998 04:22:52 -0500
From: jong <jong@salt2.med.harvard.edu>
Subject: job offer (Genetics, Harvard med. school, Boston)
Message-Id: <351386EB.5D9EB60C@salt2.med.harvard.edu>

please have a look at:


http://arep.med.harvard.edu/newpos.html



--

   Jong : A biology student

   Tel: 617-432-0503 (lab, I work very late, usually)
   Tel: 617-713-0990





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

Date: Sat, 21 Mar 1998 14:03:15 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: Large programs: is Perl up to it?
Message-Id: <slrn6h7i2h.2av.jgloudon@manitoba.bbn.com>

In article <VA.00000019.00620699@enterprise>, Jean-Louis Leroy wrote:
>I'm working on a big C++ app (hundreds of classes indeed, just for the 
>business layer) in a multiplatform context.
>
>I was wondering:
>
>1) Whether it *could* have been done in Perl + Tk, at least in 
>principle.

That's the principle of Tk.

>2) More realistically (client demanded app in C++), whether I could 
>write admin apps in Perl.
>
>I've heard of the dump'n'retstart feature, but it seems extremely 
>OS-dependant. Also heard rumors of (portbale?) ways of saving the 
>opcodes after compilation, thus skipping the parser at startup time...

The dump and undump method only worked on a few UNIX oses. I don't think anyone
still tries to use it.
The perl compiler can be found on www.perl.com if you search for compiler.
It's still alpha code, but it does eliminate the need for compilation (parsing) 
at startup.

-- 
Jason Gloudon


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

Date: Sat, 21 Mar 1998 10:50:55 -0500
From: "Mark Polakow" <mark@imp.net>
Subject: List a directory command?? pleez help!
Message-Id: <6f0nu3$2ae$1@viper.america.net>

I know this is a supremely NEWBEE question, but that's what I am!

Can someone please tell me how to list a directory in Perl. I am using Perl
on NT so if I call the directory it should list the contents... I just want
a listing of the contents of a directory...

Thank you people smarter than me!




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

Date: Sat, 21 Mar 1998 22:38:01 +1000
From: gordon3@iname.com (gordon)
Subject: pop3 access via the web
Message-Id: <gordon3-2103982238020001@unknown015102.rev.telstra-mm.net.au>

I would like to access my pop3 e-mail from www browser but using a cgi
script on my unix server.
Can anyone point me to the required script? I assume it would be in perl?
Thanks
Gordon


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

Date: Sat, 21 Mar 1998 05:56:42 -0600
From: lihong@public1.guangzhou.gd.cn
Subject: Re:sending mail through perl
Message-Id: <6f09pl$f6u$1@nnrp1.dejanews.com>

HI,
   try this way:
   $a=`cat subjectfile`
   $b=`cat tofile`;
   $filedemel = "| /bin/mailx -s $a $b";

   or simply use \" to replace all "s in the print quote mark.


 LiHong


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 21 Mar 1998 11:11:09 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: sending mail through perl
Message-Id: <memo.19980321111107.47923B@skep.compulink.co.uk.cix.co.uk>

In article <3512317a.14238143@news.mindspring.com>, kucera@mindsrping.com
( Mark Kucera) wrote:

> the below code should work i agree, but you might need to preface your
> @'s with a \ so the perl interpreter doesn't try to make it an
> array...
> mark
>

Yes, Mark, you're quite correct, I should have escaped the @'s, it catches
me nearly every time.

Regards
Neil



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

Date: Sat, 21 Mar 1998 13:39:46 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: Squelching STDIN
Message-Id: <slrn6h7gmh.2av.jgloudon@manitoba.bbn.com>

In article <35130257.CB7EC45@csdept.keene.edu>, Jamie Fullerton wrote:
>Alright, I'll answer my own question.
>
>system "stty -echo";
>
>Silly me.  Sloppy, I suppose, due to the system call, but it works!

The Term::ReadKey module provides a portable way of doing this ie. no system
call. "ReadMode 2;"

-- 
Jason Gloudon


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

Date: 21 Mar 1998 13:41:20 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: sub-array length?
Message-Id: <oeeafak6zkv.fsf@alpha.hut.fi>


Sidney Tupper <sid@mda.ca> writes:
> @test = (["eggs","bacon","juice"],
> 	 ["sandwiches","cheese"],
> 	 ["tofu"],
> 	 ["apple pie"]);
> 
> $length = @test[0];		# how many elements in the first row? 

Close.

	$length = @{ $test[0] };

The $ is required because you are talking about the first element
(a scalar, a singular) of @test (an array, a plural).  The curlies are
required because @ binds tighter than [] -- and we don't want that here.
(Without the curlies $test would have to be an array ref)

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: Sat, 21 Mar 1998 16:31:50 GMT
From: mark@webz.com (Mark Schmick)
Subject: Re: Trouble with GD.pm on Win32 Perl
Message-Id: <3513ea0f.82499443@news.flash.net>

On Sat, 21 Mar 1998 09:44:56 GMT, ender@mythen.ch wrote:

>Hi All
>
>I tryed to create a small CGI-Counter script. First i used fly.exe for
>gif creation. But sometimes I didn't get any picture in the browser.
>So I searched another solution and found the GD.pm module. But it
>doesn't work on my NT box.
>I have NT 4.0 SP3 and Perl for Win32 5.003_07 Build 315.
>I use GD module 1.18

Sounds like you're using ActiveState's version of Win32 Perl.
May I suggest a switch to the new "porter's version" of Perl,
conveniently precompiled for Win32 by Garusamy Sarathy, details
at http://www.perl.com/latest.html

ActiveState's version has many known problems with unbundled
modules, which the porter's version (based on the sources,
rather than a port) doesn't have (so much). Your problem
in particular seems to be resolved -- this from the readme:

WHAT IT CONTAINS
----------------

It includes the following packages:

	perl5.004_02
	dmake-4.1

	Alias-2.3
	Bit-Vector-4.2
	Curses-1.01                          [*]
	Data-Dumper-2.07
	DateCalc-3.2
	DateManip-5.10
	DBD-ODBC-0.16
	DBI-0.89
	Devel-Peek-0.83
	Devel-Symdump-2.00
	DProf-19970614                       [*]
	GD-1.14                              [*]
	libnet-1.0505                        [*]
	libwin32-0.08
	libwww-perl-5.11
	MD5-1.7
	MIME-Base64-2.03
	MLDBM-1.23
	Storable-0.5                         [*]
	String-Approx-2.1
	Tk402.002

NOTES:

[*] These packages needed porting or other fixes to compile and
    run properly.  All changes are included in the form of patches
    (the kind that can be applied using the GNU patch utility) in
    the `patches' subdirectory.  The full sources of all of
    these packages (with the exception of dmake, see below for that)
    can be found on the Comprehensive Perl Archive Network (CPAN).
    Point your web browser at "http://www.perl.com/CPAN" to find the
    CPAN site nearest you.

Hope this helps,
Mark

>
>If I start the following script:
>
>use GD;
>print "Content-type: image/gif\n\n";
>$im = new GD::Image(100,100);
>$im->fill(50,50,$red);
>print $im->gif;
>
>I get this error:
>
>Global symbol "i" requires explicit package name at
>C:\ntanwen\perl_soft02\lib/GD.pm line 243.
>Variable "$i" is not imported at C:\ntanwen\perl_soft02\lib/GD.pm line
>243.
>Global symbol "i" requires explicit package name at
>C:\ntanwen\perl_soft02\lib/G
>D.pm line 243.
>Variable "$i" is not imported at C:\ntanwen\perl_soft02\lib/GD.pm line
>244.
>Global symbol "i" requires explicit package name at
>C:\ntanwen\perl_soft02\lib/G
>D.pm line 244.
>Variable "$i" is not imported at C:\ntanwen\perl_soft02\lib/GD.pm line
>245.
>Global symbol "i" requires explicit package name at
>C:\ntanwen\perl_soft02\lib/GD.pm line 245.
> at C:\web\scgi\giftest.pl line 1.
>
>Does anyone know why it don't work?
>Or does anyone know another way how I can create gif images for an
>cgi-counter on the fly?
>
>I'm very grateful for every help!
>
>Josi



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

Date: 21 Mar 1998 13:32:07 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: ts: using "my" inside a loop?
Message-Id: <oeebtv07008.fsf@alpha.hut.fi>


jgloudon@bbn.subtleantispam.com (Jason Gloudon) writes:
> So the original poster's idea is correct, placing the my variables within
> the for loop does result in slower execution.

Don't guess, Benchmark.

use Benchmark;

timethese(1000,{
	'a'=>'my $i=1;for(1..1000){$j=$i}',
	'b'=>'for(1..1000){my $i=1;$j=$i}'
	});

gives in my machine:

	Benchmark: timing 1000 iterations of a, b...
         a:  3 secs ( 2.37 usr  0.00 sys =  2.37 cpu)
         b:  4 secs ( 4.17 usr  0.00 sys =  4.17 cpu)

Note: Benchmark is not panacea: as soon as IO or any poking at the
filesystem is done, the results will be skewed.  Swapping is also IO,
so better not overdo those dataset sizes.  As soon as the 'system
time' ('sys' in the Benchmark report) starts growing, one can suspect
IO.  A few ticks of system time is not bad, that is for example any
system call, such as time(), but if it starts to be more than few
percentages, IO can be suspected.

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: Sat, 21 Mar 1998 14:17:46 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: ts: using "my" inside a loop?
Message-Id: <slrn6h7itp.2av.jgloudon@manitoba.bbn.com>

In article <oeebtv07008.fsf@alpha.hut.fi>, Jarkko Hietaniemi wrote:
>
>jgloudon@bbn.subtleantispam.com (Jason Gloudon) writes:
>> So the original poster's idea is correct, placing the my variables within
>> the for loop does result in slower execution.
>
>Don't guess, Benchmark.
>
>use Benchmark;

use Benchmark to compare apples to apples.

>
>timethese(1000,{
>	'a'=>'my $i=1;for(1..1000){$j=$i}',
>	'b'=>'for(1..1000){my $i=1;$j=$i}'
>	});

You aren't comparing the same thing I was guessing about.
We were talking about the difference in putting the my inside and outside
of the loop, when explicitly doing the same thing within the loop.

'a'=>'my $i=1;for(1..1000){$i=1;$j=$i}',
'b'=>'for(1..1000){my $i=1;$j=$i}'

or

'a'=>'my $i;for(1..1000){$i=1;$j=$i}',
'b'=>'for(1..1000){my $i=1;$j=$i}'

-- 
Jason Gloudon


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

Date: Sat, 21 Mar 1998 10:25:36 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Wanted: email address gleaner
Message-Id: <35158be3.2323602@news.tornado.be>

joneil@cks.ssd.k12.wa.us wrote:

>Please give a reason why sending the same unsolicited message to thousands of
>people *isn't* spam.

So the Perl MiniFAQ that everybody that posts in this newsgroup for the
first time, gets, is spam? It must be.

	Bart.


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

Date: Sat, 21 Mar 1998 11:07:22 GMT
From: FHeasley@chemistry.com (Frank)
Subject: Re: Wanted: email address gleaner
Message-Id: <35139ec3.1882566@news.halcyon.com>

On Tue, 17 Mar 1998 19:24:12 +0000, Jeff Potter
<jp@glpbooks.BADMAIL.com> wrote:

>I've heard there are programs that search webpages on the internet
>as well as newsgroup posts for email addresses. That's how spam 
>is done, right? Well, there are obviously good uses for such progs, too.
>
You don't need perl to do this, so this thread is off topic.

In the interest of killing a rather boring discussion I will tell you
that, whether for good or evil, there is commercial software on the
net to perform the function.  All you need to do is run a search at
any of the major search engines.

Don't ask me for further information.

Frank



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

Date: Sat, 21 Mar 1998 13:27:21 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: what is wrong with being a novice ??
Message-Id: <slrn6h7fv8.2av.jgloudon@manitoba.bbn.com>

In article <6eumoo$8og$1@nnrp1.dejanews.com>, tim@maroney.org wrote:


>If the flamers actually wanted to change the behavior of these people, they
>would send them _private_ messages pointing them to the FAQs and other online
>resources. The fact that they post in _public_ shows that they are actually
>more concerned with engaging in braggadoccio -- "hey look, everybody, I know
>more than this loser!" This behavior is immature and obnoxious, wastes
>everyone's time, and makes all the technical groups far less usable.

First time posters do receive pointers to the FAQ in email. At least I did 
when I first posted to the group a few months ago. Of course a valid email
address is necessary.

The entire point of a public posting is to make it publically known that there
are FAQs. If we were to stop posting redirects to FAQs on the group then
the likelihood that future posters would be aware of their existence s not
likely to improve. Braggadoccio has nothing to do with it.. the finite 
nature of human patience for "Newbie help question"'s does.

-- 
Jason Gloudon


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

Date: Sat, 21 Mar 1998 16:04:46 GMT
From: UCE-trap_synic@omen.net.au (Peter Caffin)
Subject: Re: Wierd redirection problem with Location:
Message-Id: <3518e2e4.11613397@news.omen.net.au>

culrich@i2000.net did cunningly address to comp.lang.perl.misc..
:             print "Content-type: text/html\n";
:             print "Location: http://www.xyz.com/page1.htm\n\n";
:
:It merely puts a hyperlink on the screen.  It should do redirection to the
:full URL.  Instead, it puts a hyperlink on the screen.  Is this a Perl issue?
:Solaris?  Configuration of Solaris?  Thanks in avance.

Use only: 'print "Location: http://www.xyz.com/page1.htm\n\n";'

By using both, you're telling the web browsers with the first line that "print
'Location: http://www.xyz.com/page1.htm\n\n";' should be interpreted as HTML
rather than as a header.

--:     _         ___  _    _ _ 
 _oo__ |_|_ |__  _ |  |  _ |_|_' _   synic at omen dot net dot a u
//`'\_ | (/_|(/_| .|. |_(_|| | || |  http://www.omen.net.au/~synic
/              PO Box 869, Hillarys WA 6923, AUSTRALIA


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

Date: Sat, 21 Mar 1998 13:58:37 GMT
From: kschreff@harborcom.net (Schreffman)
Subject: Re: Win32 Perl and ODBC New User Problems
Message-Id: <3513c742.2248777@nntp.harborcom.net>

	I got this working just yesterday. Build 315 with Oracle.  I
do agree that it was extremely confusing what to install and patch.   

On Thu, 19 Mar 1998 17:19:19 GMT, davidg@infinex.com (David Griffis)
wrote:

>On Sun, 08 Mar 1998 15:11:50 GMT, keefner@visi.com (keefner) wrote:
>
>>On Wed, 04 Mar 1998 05:37:05 GMT, davidg@teleprompt.com (David
>>Griffis) wrote:
>>
>>>I'm trying to get Activeware Win32 Perl 5.003 build 315 and Dave
>>>Roth's ODBC extention working with my NT 4.0 ODBC for Oracle 733 but
>>>I'm getting a 'parse error'.  What could I have done wrong?
>>
>>You likely have the stock odbc driver for Oracle installed
>>and there is a documented problem with it. Make sure
>>you get the latest from Oracle.
>>
>>Depending on how you want to access the Oracle
>>db (stored functions/procedures/etc) you may want
>>to consider the DBI/DBD modules and the perl port
>>for it.
>>
>>Craig
>
>Craig,
>
>It would be nice if I could get the odbc working so it doesn't matter
>what database I'm using. 
>
>I got the latest Oracle odbc and even tried with the access and odbc
>but no luck.
>
>I think that build 315 or 315 doesn't work with ODBC 970208.
>
>It's also confusing how to apply the patches.
>
>Does anyone have a version of Perl and ODBC 970208 that works
>together.
>
>Right now it's not fetching any data.
>
>Thanks,
>
>David Griffis
>Foster City, CA 94404
>
>



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 2151
**************************************

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