[8533] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2150 Volume: 8

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

Date: Sat, 21 Mar 98 03:00:29 -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: 2150

Today's topics:
    Re: Accepting Input from Forms (Abigail)
        Cacheproblems with cgi-generated html <totalrel@hrz1.hrz.tu-darmstadt.de>
    Re: Can't understand /g (match global) operator - help! audttjk@dbs.com.sg
    Re: Challenge your programming skill <kiml@zplace.com>
    Re: Challenge your programming skill (Abigail)
    Re: Chicago Perl Mongers (David Adler)
    Re: detecting error 404 in perl5 (Abigail)
    Re: how to know the version of the perl (Abigail)
        Im a dip so kill me ok! (Chuck Stewart)
    Re: Im a dip so kill me ok! <uri@sysarch.com>
    Re: Im a dip so kill me ok! sloop@mailcity.com
    Re: is there anything like "geturl()" in perl? (Abigail)
        job offer (genetics, Harvard Med. School, Boston) <jong@salt2.med.harvard.edu>
    Re: Large programs: is Perl up to it? <jll@skynet.be>
        No need to read.Just a test lihong@public1.guangzhou.gd.cn
    Re: Problem with dealing with serial ports using Perl f <jimbo@soundimages.co.uk>
    Re: qw (was: Re: Newbie question: using split() while i <zenin@archive.rhps.org>
        Stripping out SSIs <tcfb@tcfb.com>
    Re: Stripping out SSIs <zenin@archive.rhps.org>
    Re: Stripping out SSIs (Abigail)
    Re: sub-array length? (Abigail)
        Testing website PERL <progg.mxf@poboxes.com>
    Re: Tied and blessed? <jll@skynet.be>
        Trouble with GD.pm on Win32 Perl ender@mythen.ch
        Win32 Perl, Java Web Server, NT <rpearse@healthway.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 21 Mar 1998 07:46:10 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Accepting Input from Forms
Message-Id: <6evr82$gtg$3@client2.news.psi.net>

mr.anime@usa.net (mr.anime@usa.net) wrote on MDCLXIII September MCMXCIII
in <URL: news:3513067B.8A6AD106@usa.net>:
++ I'm writing a perl script, and I'm having trouble finding out how to
++ read in javascript variables.  I know it can be done through forms, but
++ I don't know how to write the code.  Any help would be appreciated.


Looks like a javascript problem to me. Oh well, I guess you just
misspelled 'javascript' as 'perl.misc'....


Abigail
-- 
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-


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

Date: Sat, 21 Mar 1998 10:48:29 +0100
From: Raphael Breiting <totalrel@hrz1.hrz.tu-darmstadt.de>
Subject: Cacheproblems with cgi-generated html
Message-Id: <35138CED.17EE3ECC@hrz1.hrz.tu-darmstadt.de>

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.

Please help me...........!!!!!!

THX in advance

Raphael

--
*************************************************************
* VNW Virtual Net Worlds                V   V N  N W     W  *
* Raphael S. Breiting, TotalReflexion   V   V NN N W  W  W  *
* fon: +49 (0) 6151-47027                V V  N NN  W W W   *
* fax: +49 (0) 6151-47027                 V   N  N   W W    *
* icq: 6332071                                              *
* eMail 1: vnw@mail.com                                     *
* eMail 2: vnw@premiumservice.com                           *
* eMail 3: totalrel@hrz1.hrz.tu-darmstadt.de                *
* http: http://www.tu-darmstadt.de/~totalrel/index.html     *
*************************************************************




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

Date: Fri, 20 Mar 1998 23:08:24 -0600
From: audttjk@dbs.com.sg
Subject: Re: Can't understand /g (match global) operator - help!
Message-Id: <6evhs6$atp$1@nnrp1.dejanews.com>

In article <6eu8jg$i46$1@nnrp1.dejanews.com>,
  brosser@gil.com.au wrote:

>
> 1.	"abc" =~ /([abc])*/g	gives (c, undef).
>
> 	Why doesn't it match the 'a' first, then the 'b',
> 	and then the 'c', giving (a,b,c)?  And why the trailing
> 	undef (in all cases where I've used parenthesis and /g)?

1. Programming Perl 2nd Edition page 29/63:
   "Perl quantifiers, by default, are greedy"

   Since '*' is a quantifier, the regexp engine will greedily match out
   'abc' to '/c*/', one of the alternative patterns, immediately
   (now $& is 'abc' but what get pushed to the list is bracketed 'c').
   I don't know how to explain the 'undef', all I know is if you
   use '+' instead of '*', there won't be any 'undef'.

   By the way, what you want is:
   "abc" =~ /[abc]/g;

> 2.	"aXa" =~ /(a)*/g	gives (a, undef, a, undef)
>
> 	which I guess I can understand - at least it's giving
> 	me both 'a' tokens, although I still don't know why
> 	the undefs come in.  But
>
> 	"aaaaaXa" =~ /(a)*/g	also gives (a, undef, a, undef)
>
> 	i.e. it's ignoring the multiple string of a's in the
> 	first part.
>
> Can someone be kind enough to discuss how this works, or poi

What you want is:

"aaaaaXa" =~ /a+?/g; # non-greedy match



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


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

Date: Fri, 20 Mar 1998 21:38:55 -0800
From: Kim Lo <kiml@zplace.com>
To: schwern@starmedia.net
Subject: Re: Challenge your programming skill
Message-Id: <3513526F.C615B5A5@zplace.com>

I am still trying to figure out your explanation. How do you go from 73,45 to
73.125,44.888?
What book are you talking about? Is the algorithm in there? Please give title.

Thanks.

schwern@starmedia.net wrote:

> An idea, which is probably wrong, but I'm throwing in here just to see how
> Abigail tears it apart. :)
>
> Keep an index of your customer's coordinates at a granularity level that's
> appropriate... like an index point every degree...
>
> # Enter the customer into the regular DB.
> $customerDB->{$id}{name} = 'Fred';
> $customerDB->{$id}{long} = 72.672;
> $customerDB->{$id}{lat}  = 45.223;
>
> # Add them to the coordinates index at 73,45
> push @{ $CoordsIndex->{long}{round $customerDB->{$id}{long}} },
>        $customerDB->{$id};
> push @{ $CoordsIndex->{lat}{round $customerDB->{$id}{lat}} },
>        $customerDB->{$id};
>
> # Search for the nearest customer to 73.125, 44.888
> @nearbyCustomers = intersection $CoordsIndex->{round 73.125},
>                                 $CoordsIndex->{round 44.888};
>
> # If @nearbyCustomers is empty, expand your search to
> # $long + and - 1 degree and $lat + or - 1 degree
> # continue expanding until you find a customer.
>
> # After you find customers, expand +1 and -1 once more to compensate
> # for the problem that your closest customer might be in the next "grid"
> # over.
>
> # Then check for the minimum distance of the set of @nearbyCustomers
>
> This is a very sloppy indexing scheme, but it reduces the problem from O(n) to
> O(n/granularity of your indexing scheme).  And its very suseptable to
> clustering of customers in one area of the country (the indexing won't be as
> effective in NYC as in say... Iowa).
>
> I should have a look at Ab's suggested books myself, though I've been holding
> off for the new edition of Knuth.
>
> In article <3510AEA6.DF610245@zplace.com>,
>   Kim Lo <kiml@zplace.com> wrote:
> >
> > Perl programmers,
> > I am facing with the challenge of writing a program to find the closest
> > customer name based on an input zipcode. I have the data file containing
> > zipcode, state, longitude and latitude in a database already.
> > My approach to this problem is very simple however I want to find out
> > from you programmers if this is the most efficient way to do it. Here're
> > the steps:
> > 1. Get the long and lat based on the input zipcode
> > 2. For each customer do
> >       a. Get customer zipcode and determine long and lat
> >       b. Delta long and lat from step1 and 2a. Get the absolute value
> >       c. Convert the long and lat into an R value using pythagore
> > theorem (R^2=x^2+y^2)
> > 3. Sort the R value and the smallest R will contain the closest customer
> > to the input zipcode.
> >
> > The problem I am having with this algorithm is that it could take a long
> > time to compute as the number of customers grow. To minimize computing,
> > I thought of just getting customers from the same state as the input
> > zipcode and compute those only. The caveat to this approach is that for
> > someone that lives closeby 2 states (especially on the East Coast), this
> > may return incorrect result.
> > Any feedback is welcome.
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/   Now offering spam-free web-based newsreading





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

Date: 21 Mar 1998 07:53:17 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Challenge your programming skill
Message-Id: <6evrld$gtg$4@client2.news.psi.net>

TomH (beans@bedford.net) wrote on MDCLXIII September MCMXCIII in
<URL: news:01bd53dd$6a418ac0$8f9163ce@beans.bedford.net>:
++ 
++ A fairly interesting problem, although it really has nothing to do with
++ Perl.
++ 
++ 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). With customers
++ ordered by their lat/long you should be able to cut the list down to
++ managable size quickly. Using the Pythagorean Theorem is probably close
++ enough, although it would be more accurate to get cartesian vectors to the
++ zipcode and customer from the center of the earth and take the dot product
++ between them (this gives the cosine of the earth central angle); or at
++ least factor in the cosine of the latitude for the distance between two
++ longitudes (obviously they get closer together as you move away from the
++ equator).


That would work well if you're customers are spread evenly. Which might
be the case if you are selling fertilizer. 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.




Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle 'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Additional/s) [0]'


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

Date: 21 Mar 1998 05:27:25 GMT
From: dha@panix.com (David Adler)
Subject: Re: Chicago Perl Mongers
Message-Id: <6evj3t$gpo@news1.panix.com>

On 18 Mar 1998 10:05:01 -0500, Jonathan Feinberg <jdf@pobox.com> wrote:
>petdance@maxx.mc.net (Andy Lester) writes:
>
>> DONUTS AND DANCING GIRLS!  At EVERY meeting!
>
>Well, that's it, I'm moving back.

Oh, fine.  Copious amounts of alcohol aren't good enough for you huh?

--
David H. Adler - <dha@panix.com>
"The perversity of the Universe tends towards a maximum."


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

Date: 21 Mar 1998 07:55:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: detecting error 404 in perl5
Message-Id: <6evroq$gtg$5@client2.news.psi.net>

Niksun (niksun@intop.net) wrote on MDCLXIII September MCMXCIII in
<URL: news:35131E56.B536F48C@intop.net>:
++ I'm processing an html form and part of it is a url a user submits.  I
++ want to check if that url exists or results in a 404 error (doesn't
++ exist).  How can I do this?


By reading the documentation of LWP::UserAgent.



Abigail
-- 
perl -pwle '$_ .= reverse'


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

Date: 21 Mar 1998 07:58:11 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: how to know the version of the perl
Message-Id: <6evruj$gtg$6@client2.news.psi.net>

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.


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Sat, 21 Mar 1998 05:29:36 GMT
From: cstewart@flash.net (Chuck Stewart)
Subject: Im a dip so kill me ok!
Message-Id: <35134683.1628498@news.flash.net>

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
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,
if you have one fine, otherwise I'm not interested in your arrogant
bullshit. Now if I may, here is my request for help again:

I have a tab delimited file that is 1000 lines long.  I want to be
able to show 50 lines at a time via html with a "next 50" as an
option.  I do not know how to do this because I am not proficient in
Perl.  If you have an example to help a beginner, bless you and I
thank you.  If not plz do not bless me with your "that's already been
answered or here is a link written by Dr Perl."  just leave me alone
and go to the next message.  To those who have helped me in the past,
you knew this was coming and I apologize for being blunt but
newsgroups are for sharing and not just for those who are too wrapped
within themselves to do that.  Probably Republicans and listen to
Limbaugh....;-)        

Banned from Perl for life I suppose, big deal!!


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

Date: 21 Mar 1998 01:31:32 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Im a dip so kill me ok!
Message-Id: <x7vht8h7wb.fsf@sysarch.com>

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,

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
> bullshit. Now if I may, here is my request for help again:

this is not a FAQ but a request for a full cgi program. have you tried
to write it? it is not a one liner so we (IMHO) gurus and experts would
have to spend soem time (time > 5 minutes) to write this. 

> I have a tab delimited file that is 1000 lines long.  I want to be
> able to show 50 lines at a time via html with a "next 50" as an
> option.  I do not know how to do this because I am not proficient in

how about describing what you want to do with the tabs? html will just
make them into whitespace. and what is an option? do you mean a link for
the next fifty lines?

> Perl.  If you have an example to help a beginner, bless you and I

no it is $self = bless {}, $package

> thank you.  If not plz do not bless me with your "that's already been
> answered or here is a link written by Dr Perl."  just leave me alone
> and go to the next message.  To those who have helped me in the past,
> you knew this was coming and I apologize for being blunt but

you are too blunt :-)

> newsgroups are for sharing and not just for those who are too wrapped
> within themselves to do that.  Probably Republicans and listen to
> Limbaugh....;-)        

i doubt that most of the Dr. Perl's are Limbaugh fans. they have brains :-)

> Banned from Perl for life I suppose, big deal!!

you may never use perl again. the source has been modified to check for
your user id and crash upon execution of any script you run. we banish
you to write for the rest of your life in COBOL. :-)

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----  8 Years of Perl Experience, Available Immediately
uri@sysarch.com  ---------  Resume and Perl Example at http://www.sysarch.com
Use the Best Search Engine on the Net  --------  http://www.northernlight.com


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

Date: Sat, 21 Mar 1998 08:16:21 GMT
From: sloop@mailcity.com
Subject: Re: Im a dip so kill me ok!
Message-Id: <3513754a.2014464@news.xmission.com>

On Sat, 21 Mar 1998 05:29:36 GMT, cstewart@flash.net (Chuck Stewart)
wrote:

[Entire rude post snipped]

The following is a list of groups in which Mr. Stewart's message would
have found a more appropriate home:


rec.humor
alt.usenet.kooks  (I love that one)
misc.test

And here are some fake groups that ought to be created so such people
would have somewhere fully legitimate to post.

alt.conspiracy.smart.people.hate.me
alt.bite.the.hand.that.feeds.you
rec.troll
soc.unite.lamers
misc.my.heart.bleeds
soc.misfits
comp.lang.gimme.gimme.gimme



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

Date: 21 Mar 1998 07:59:22 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: is there anything like "geturl()" in perl?
Message-Id: <6evs0q$gtg$7@client2.news.psi.net>

Bill Grogan (bgrogan@bullfrog-tech.com) wrote on MDCLXIII September
MCMXCIII in <URL: news:35131F08.3DFC7287@bullfrog-tech.com>:
++ I am attempting to write a little program to monitor the availability of
++ a web site.
++ 
++ Is there any way to have perl try and open a url?
++ 
++ I have been look and havn't come up with anything yet. Any ideas?


Get libwww.


Abigail
-- 
perl -we '%_ = map {local $_ = $_; y/a-z/n-za-m/; ($_, $_)} @_ = map {lc} <>;
          print grep {$_{$_}} @_' < /usr/dict/words


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

Date: Sat, 21 Mar 1998 04:19:18 -0500
From: jong <jong@salt2.med.harvard.edu>
Subject: job offer (genetics, Harvard Med. School, Boston)
Message-Id: <35138616.4ADD58F0@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 10:23:27 +0100
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: Large programs: is Perl up to it?
Message-Id: <VA.00000019.00620699@enterprise>

Thanks, Zenin & all, that's the kind of input I'm looking for.

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.

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...

Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy/



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

Date: Sat, 21 Mar 1998 02:00:50 -0600
From: lihong@public1.guangzhou.gd.cn
Subject: No need to read.Just a test
Message-Id: <6evrve$ngi$1@nnrp1.dejanews.com>

a post test

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


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

Date: 21 Mar 1998 10:24:50 +0000
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: Problem with dealing with serial ports using Perl for Win32
Message-Id: <uvht8xrwt.fsf@soundimages.co.uk>

"AC" <chhang@unixg.ubc.ca> writes:

> I'm encountering the following problem and I hope some folks can help me
> out.
> 
> open(PORT, "COM3") || die "Can't open COM3 for read: $!";   #open COM for
> reading
> 
> while (defined ($line = <PORT>) {     #read from COM3
>      chomp($line);
>      print "line is ($line)";
> }

Use sysread to access the serial port rather than buffered IO.


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

Date: 21 Mar 1998 07:14:41 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: qw (was: Re: Newbie question: using split() while ignoring regexps)
Message-Id: <890464861.880252@thrush.omix.com>

Uri Guttman <uri@sysarch.com> wrote:
: it is used at compile time and not run as in split.
	>snip<

	Actually, it seems to be done at run time. -Anything in a 'use'
	statement is done at compile time however (from what I can tell).
	Running the split at compile time is in the Todo list.

: perl probably uses split internally for should be hidden and the error you show
: shouldn't be printed. it is a legal quoted string which is not an error
: or needs a warning.

	It's legal, but it should throw a warning in that usage. -Maybe
	not the error it gives, but it should give an error.  The reason is
	that in such usage is the same as:

		perl -we '("foo", "bar")'

	Which will throw a valid warning of, "Useless use of a constant in
	void context at -e line 1.".

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: Sat, 21 Mar 1998 00:16:59 -0500
From: Lionel Bourne <tcfb@tcfb.com>
Subject: Stripping out SSIs
Message-Id: <35134D4B.406C@tcfb.com>

I want to let others upload html files to my server, but for security
sake, I want to strip out Server Side Include stuff before I accept
them. is there any *REALLY SAFE* way to do this in perl like running
through the code with:

 $cleancode =~ s/<!--(.|\n)*-->//g;

but without stripping out all the comments like the above code will?

Thanks,

p.s. I've already read every security faq out there. Did I miss
something?

Stephen
--



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

Date: 21 Mar 1998 07:17:18 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: Stripping out SSIs
Message-Id: <890465019.298033@thrush.omix.com>

Lionel Bourne <tcfb@tcfb.com> wrote:
: I want to let others upload html files to my server, but for security
: sake, I want to strip out Server Side Include stuff before I accept
: them. is there any *REALLY SAFE* way to do this in perl like running
: through the code with:
	>snip<

	Why not just disallow any *.shtml files to be uploaded?  Or better
	yet (and easier), disable SSI under there directory?

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: 21 Mar 1998 08:08:21 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Stripping out SSIs
Message-Id: <6evshl$gtg$8@client2.news.psi.net>

Lionel Bourne (tcfb@tcfb.com) wrote on MDCLXIII September MCMXCIII in
<URL: news:35134D4B.406C@tcfb.com>:
++ I want to let others upload html files to my server, but for security
++ sake, I want to strip out Server Side Include stuff before I accept
++ them. is there any *REALLY SAFE* way to do this in perl like running
++ through the code with:
++ 
++  $cleancode =~ s/<!--(.|\n)*-->//g;
++ 
++ but without stripping out all the comments like the above code will?

That will strip out everything from the first <!-- in your document
to the last -->. I doubt you want to do that.

In order to strip out SSI's, yet leave other comments in tact
you need to know exactly what your server's policy is. There are
various variants of SSI over time, so a generic answer doesn't
help.

Furthermore, SSI's are *NOT*, I repeat *NOT* HTML comments.
They may look like them, they aren't.

<IMG SRC = "foo.gif" ALT = "<!-- Some SSI -->"> will happily be
parsed by your server. Your browser though, will not see such
a construct as a comment.

The safest and easiest approach will be to have the server *NOT*
parse those documents for SSI. Safer, and faster as well.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: 21 Mar 1998 07:42:44 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: sub-array length?
Message-Id: <6evr1k$gtg$2@client2.news.psi.net>

Sidney Tupper (sid@mda.ca) wrote on MDCLXIII September MCMXCIII in
<URL: news:3513098F.41C67EA6@mda.ca>:
++ How can you get the length of an array that's an element of another
++ array?
++ 
++ For example, the naive approach doesn't work (prints 581688):
++ 
++ #!/usr/local/bin/perl
++ 
++ @test = (["eggs","bacon","juice"],
++ 	 ["sandwiches","cheese"],
++ 	 ["tofu"],
++ 	 ["apple pie"]);
++ 
++ $length = @test[0];		# how many elements in the first row? 

Well, that's easy. All we need to do is get the array, and evaluate
it in scalar context.

$test [0] is a ref to the first row.

Hence, @{$test [0]} is the first row.

Now we eval it in scalar context:

printf "%d\n", scalar @{$test [0]};


And that prints '3'.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: 21 Mar 1998 08:21:01 GMT
From: "Progg" <progg.mxf@poboxes.com>
Subject: Testing website PERL
Message-Id: <01bd54a3$0f030320$185cead0@meka>

I need a way to test my website PERL scritps on my computer. I don't want
to have to upload them to the server to find out they don't work. I think
there may be a way to do this with MS Personal Web Server, but I'm not
exactly sure. Can anyone help?

Jay Cain


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

Date: Sat, 21 Mar 1998 10:23:26 +0100
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: Tied and blessed?
Message-Id: <VA.00000018.0062020f@enterprise>

> > I may soon have the need to tie a hash and have it behave like
> > an object as well.  Is that allowed? 
>  
> Allowed?  Bucko!  It's intrinsic!

I had somewhat expected 'tie' to be a 'bless' + something. Not so. If 
the package has other metods, you still can't call them through the 
tied reference.

Thank you and Mike for making me realize I was creating two objects. I 
got it to work now:

   package Test;

   sub new
   {
      my $class = shift;
      my $self = {};
      bless $self, $class;
      tie %$self, $class, $self;
      return $self;
   }

   sub test
   {
      print "ok\n";
   }

   sub TIEHASH
   {
      print "tied to $_[0]\n";
      return $_[1];
   }

   sub FETCH
   {
      print "FETCH\n";
      return 33;
   }

   sub DESTROY
   {
      untie $_[0];
      print "destroyed\n";
   }

   package main;

   $t = new Test;
   print $t->{x}, "\n"; # 'FETCH' then '33'
   $t->test;
   
   output:
      tied to Test
      FETCH
      33
      ok
      destroyed

In case you're wondering, I'm looking for a nice syntax for a 
persistence module. I want a 'query object' (somewhat eqvt to a SQL 
table alias) to reflect the attributes of its related class:

    $qperson = $storage->query_object('Person'); # tied & blessed
    
    $filter = $qperson->{firstName} eq 'Homer'
       && $qperson->{name} eq 'Simpson';

    # can call methods as well
    $qperson->select(); # used internally


Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy/



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

Date: Sat, 21 Mar 1998 09:44:56 GMT
From: ender@mythen.ch
Subject: Trouble with GD.pm on Win32 Perl
Message-Id: <351384c4.13308386@news.unisource.ch>

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

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: Thu, 19 Mar 1998 17:26:38 -0600
From: Robert Eric Pearse <rpearse@healthway.net>
Subject: Win32 Perl, Java Web Server, NT
Message-Id: <3511A9AE.7D975BF4@healthway.net>

Just installed Java Web Server 1.03 on my NT workstation to check it
out. It came with a few Perl scripts (test, redirect, etc.). However,
when I access them through a browser, the cgi servlet acts up. I think
the error is within the script header. On my Solaris account,
#!/usr/local/bin/perl works (like it should). However, how is the Win32
Perl interpreter addressed in the script? I just dropped installed it in
c:\perl, but using that instead of /usr/local/bin/per doesn't work.
Should I put the perl\bin stuff in bin in the web server directory.
Anybody have any experience with this? How about using IIS with Win32
Perl? I guess I need help setting up Win32 Perl. . .

Thanks,

Robert

--
_______________________________________________________
Robert Eric Pearse                rpearse@healthway.net
Internet Developer                www.healthway.net
Healthway Interactive             512.502.3685




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

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

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