[16515] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3927 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 6 09:05:27 2000

Date: Sun, 6 Aug 2000 06:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <965567114-v9-i3927@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 6 Aug 2000     Volume: 9 Number: 3927

Today's topics:
    Re: #include-type-of-thing-in-Perl <patrick.vogt@unibas.ch.I.hate.spam.mails>
    Re: ActivePerl and MS Access 2000 <carvdawg@patriot.net>
        AW: Re: convert string from uppercase to lower case (Tim Hammerquist)
    Re: bug in localtime()??? <bart.lateur@skynet.be>
    Re: bug in localtime()??? <bart.lateur@skynet.be>
    Re: bug in localtime()??? <gellyfish@gellyfish.com>
    Re: bug in localtime()??? <gellyfish@gellyfish.com>
    Re: can i test cgi scripts on my own pc without a host? <bean@agentkhaki.com>
    Re: convert string from uppercase to lower case (Colin Keith)
    Re: Cookie on the server side (Colin Keith)
    Re: Copy a hash and const? nobull@mail.com
    Re: Dreaded 500 message <kokuryu2@hotmail.com>
    Re: Editing.cfg file for use with anti-leech Perl scrip (Cyber Thief)
    Re: execute a Perl script in another Perlscript nobull@mail.com
    Re: file upload using perl <gellyfish@gellyfish.com>
    Re: file upload using perl (Colin Keith)
    Re: file upload using perl <starktdh@gmx.de>
    Re: First Days of Perl (Newbie) <gellyfish@gellyfish.com>
    Re: Gee, thanks for all the help  :-( <gellyfish@gellyfish.com>
    Re: Getting string nobull@mail.com
    Re: How to capture CGI program .exe output, modify it a nobull@mail.com
    Re: How to show "tail -f" in browser <patrick.vogt@unibas.ch.I.hate.spam.mails>
    Re: insert 'n' amount of questions <gellyfish@gellyfish.com>
    Re: insert 'n' amount of questions <gellyfish@gellyfish.com>
    Re: IP spoofing <gellyfish@gellyfish.com>
    Re: IP spoofing <flogru@gmx.net>
    Re: Learning Perl, 2nd Ed. Exercises. How can I do them (Colin Keith)
    Re: LWP::Simple.pm <gellyfish@gellyfish.com>
    Re: New Perl upload sample code <gellyfish@gellyfish.com>
    Re: passing spaces in URL <gellyfish@gellyfish.com>
    Re: problems with socket programming nobull@mail.com
    Re: regular expression question.... nobull@mail.com
    Re: what mod-perl want me do nobull@mail.com
    Re: Why root can't run perldoc? <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 6 Aug 2000 13:53:03 +0200
From: Patrick Vogt <patrick.vogt@unibas.ch.I.hate.spam.mails>
Subject: Re: #include-type-of-thing-in-Perl
Message-Id: <398d501c.0@maser.urz.unibas.ch>

Ryan,

assume you have a script perl.cgi and a scond file called include.pm (the
pm triggers some buildin support.
Attention, include.pm will have to return true (1) at the end of the script.

include.pm:
some_code_executed while including;

sub a_sub_to_call{
       some_code;
}

1;    #DO NOT FORGET THIS

perl.cgi:

use include;            #include at compiletime
require include;       #include at runtime



Ryan Tarpine wrote:
> 
> How can I include in a Perl script subroutines in an external file in the
> same directory?
> 
> Thanks,
> Ryan Tarpine
> 
> 


-- 
--
Patrick




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

Date: Sun, 06 Aug 2000 07:22:48 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: ActivePerl and MS Access 2000
Message-Id: <398D4A88.EEF1A2DA@patriot.net>

No code, no error message, no impact, no idea....

Juan Carlos Lorente wrote:

> Hello,
>
> I write a mini-application that uses a MS-Access DB via ODBC. When I update
> or delete a record in the DB the DB is updated but the S.O. (W2000) return
> an invalid access error and don't show the script output.
>
> Do you have any idea about the problem?
>
> JC



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

Date: Sun, 06 Aug 2000 12:04:04 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: AW: Re: convert string from uppercase to lower case
Message-Id: <slrn8oqlkb.7ao.tim@degree.ath.cx>

On Sun, 06 Aug 2000 10:40:39 GMT, Colin Keith
<newsgroups@ckeith.clara.net> wrote:
> In article <8mj3ut$qms$1@nnrp1.deja.com>, jliu34740@my-deja.com wrote:
> >I have a defined string as the following:
> >
> >$_="i HAve tWo  Cat home";
> >
> >How do I convert the vowels in the above string from lower case to
> >uppercase?
> 
> *waves his hand mystically and intones Arrr-Tee-Efff-Emmmm* :)
> perldoc perlre
>            \u          uppercase next char (think vi)
> 
> s/([aeiou])/\u$1/g;

Why not just:

    tr/aeiou/AEIOU/;

 ... unless an uppercase 'a' might be different in different locales...?
=)

-- 
-Tim Hammerquist <timmy@cpan.org>
You know, we've got armadillos in our trousers.
It's really quite frightening.
	-- Nigel Tufnel, "This is Spinal Tap"


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

Date: Sun, 06 Aug 2000 10:52:56 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: bug in localtime()???
Message-Id: <5lgqoscj20pvadqcb4lkse1q3h4a7j5027@4ax.com>

Mike King @work wrote:

>However, I'm getting a weird bug here. August is 8, but localtime is
>returning 7 for the month right now.

	$month = (1 .. 12)[7];
	print $month;
-->
	8

Maybe this may help you understanding why localtime() returns 7 for
August. The month number is mostly intended to be use as an array index.
Array indices start at zero, usually. Month numbers for human
consumption start at 1.

	print +(qw'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec')[7];

-- 
	Bart.


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

Date: Sun, 06 Aug 2000 10:54:41 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: bug in localtime()???
Message-Id: <7ugqosgp7s6s3moisgnr6gvnff934q3566@4ax.com>

J. B. Moreno wrote:

>And why were you so convinced that it was a bug even after
>being told there was no bug?

Because it sounds like a design error?

It's a compromose. You can't return a month number that is the best
solution for all applications.

-- 
	Bart.


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

Date: 6 Aug 2000 13:52:33 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: bug in localtime()???
Message-Id: <8mjn2h$og2$1@orpheus.gellyfish.com>

On Fri, 04 Aug 2000 16:18:29 GMT Mike King @work wrote:
> 
> 
> Greg Bacon wrote:
>> 
>> Go back and reread the documentation on localtime in the perlfunc
>> manpage.  You'll find that there is no bug.
> 
> Nope didn't help. 
> 
> perldoc perlfunc
> 
> found the localtime entry. According to the doc, localtime()[4] returns
> the numeric month. August is 8. I am being returned 7. Why?
> 

from the perlfunc manpage :

               All list elements are numeric, and come straight
               out of the C `struct tm'.  $sec, $min, and $hour
               are the seconds, minutes, and hours of the
               specified time.  $mday is the day of the month,
               and $mon is the month itself, in the range `0..11'
               with 0 indicating January and 11 indicating
               December.  $year is the number of years since
               1900.  That is, $year is `123' in year 2023.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 6 Aug 2000 13:56:33 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: bug in localtime()???
Message-Id: <8mjna1$p9p$1@orpheus.gellyfish.com>

On Fri, 04 Aug 2000 16:57:55 GMT Mike King @work wrote:
> 
> 
> Tony Curtis wrote:
>> 
>>  $ perldoc -f localtime
>> 
>>                and $mon is the month itself, in the range `0..11'
>>                with 0 indicating January and 11 indicating
>>                December.  $year is the number of years since
>>                1900.  That is, $year is `123' in year 2023.
> 
> perldoc perlfunc does not detail that (at least on my system).

Time to upgrade your Perl then.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 06 Aug 2000 12:37:50 GMT
From: bean <bean@agentkhaki.com>
Subject: Re: can i test cgi scripts on my own pc without a host?
Message-Id: <MPG.13f723e33a7cdfbf989691@news.concentric.net>

> Dreamweaver... hmm.  There are worse products on the market
> (...FrontPage...) out there.  Personally, something like HomeSite was my
> favorite webpage editor on Win32.  _CODE_ editor, internal browser, and
> supported server mappings.  Very slick, but buggy in the later versions.
> ...ok, this is now a comp.editors argument.  Sorry.  =)

Gah! I so want to argue against this... Argh!

bean


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

Date: Sun, 06 Aug 2000 10:40:39 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: convert string from uppercase to lower case
Message-Id: <Hgbj5.71$DT4.2706320@nnrp2.clara.net>

In article <8mj3ut$qms$1@nnrp1.deja.com>, jliu34740@my-deja.com wrote:
>I have a defined string as the following:
>
>$_="i HAve tWo  Cat home";
>
>How do I convert the vowels in the above string from lower case to
>uppercase?

*waves his hand mystically and intones Arrr-Tee-Efff-Emmmm* :)
perldoc perlre
           \u          uppercase next char (think vi)

s/([aeiou])/\u$1/g;

Of course, it doesn't account for 'y', but that's left as an exercise for 
the reader:)


---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC


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

Date: Sun, 06 Aug 2000 10:44:03 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: Cookie on the server side
Message-Id: <Tjbj5.72$DT4.2706810@nnrp2.clara.net>

In article <slrn8ooli4.pjm.efflandt@efflandt.xnet.com>, efflandt@xnet.com wrote:
>The CGI module (included with Perl 5) can set and read cookies and I heard
>there is another module that does only that.  However, if you are looking

CGI::Cookie is the obj that CGI uses and you can use it stand alone (afaik)

                


---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC


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

Date: 06 Aug 2000 11:04:16 +0100
From: nobull@mail.com
Subject: Re: Copy a hash and const?
Message-Id: <u9og36vh7j.fsf@wcl-l.bham.ac.uk>

Brian Lavender <blavender@spk.usace.army.mil> writes:

> Is the following a good way to make a copy of the hash passed to the
> subroutine? 

>   my %cp_family = %$family;

Yes.

> Is there a way to specify const for the hash reference
> passed to subroutine?

No.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Sun, 06 Aug 2000 07:54:43 -0400
From: Kokuryu <kokuryu2@hotmail.com>
Subject: Re: Dreaded 500 message
Message-Id: <398D5203.DF41F634@hotmail.com>

Excuse me - but this IS the PERL group and the problem IS related to the
ActivePerl setup and the fact that it DOES NOT WORK WITH THE MS PERSONAL
WEB SERVER - quite contrary to all instructions as given all over the
internet.  Why nobody has caught on that this critical piece of
information is erroneous and has been for years is probably due to the
same snobbish attitude that you are exhibiting as well.  A complete lack
of ability to actually do anything.  How "up" with Perl are you?  Are
you ready for Perl 6?  Are you ready to replace every Perl script you
have ever written just to support Perl 6?  Do you even care that the
implementation of Perl 6 may just halt web development for a year until
all the servers that want to support it will?  Do you know what servers
run Perl 6 now?  Do you even care?  If you can't even answer these
questions, then why bother to troll thru the messages in the first
place?  These are all relavent to this same newsgroup - all relavent to
the Perl language.  They may not be programming questions.  Just making
a point.

--Dave


Gwyn Judd wrote:
> 
> I was shocked! How could Kokuryu <kokuryu2@hotmail.com>
> say such a terrible thing:
> >Well, it's a good thing I didnt bother posting any code up here -
> >because the code works just fine!
> 
> I guess we can all sleep easier knowing that.
> 
> >Guess what?  It all worked perfectly from then on.
> 
> *shrug* who cares? This is comp.lang.perl.misc not
> comp.oh-my-god-my-computer-doesn't-work.drool.drool.drool.
> 
> >Next time, please read the message that someone posts rather than jump
> >to the conclusion that there is something wrong with the code.
> 
> We did. If there is nothing wrong with the code then it's not a Perl
> problem. If it's not a Perl problem then why post it here? There are
> more appropriate newsgroups for this sort of thing. Next time I suggest
> you familiarise yourself with the newsgroup before you post and stop
> asking FAQ's.
> 
> --
> Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
> Give your child mental blocks for Christmas.


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

Date: Sun, 06 Aug 2000 12:39:24 GMT
From: fake@address.com (Cyber Thief)
Subject: Re: Editing.cfg file for use with anti-leech Perl script...
Message-Id: <00dj5.23317$RG6.1935511@bgtnsc05-news.ops.worldnet.att.net>

In article <slrn8ops0p.st1.abigail@alexandra.foad.org>, abigail@foad.org 
says...
>
>Besides the fact that your protection is about as silly as putting a
>bucket of water on top of an ajar door to keep burglers out, what on
>earth does your question have to do with Perl?

First of all, I realize that this is not fool proof. Yes, I know the http 
referer can be spoofed, and yes, I know they could just bypass the script and 
link to the file if they know where it resides on the server. But, this was NOT 
the subject of my post. I've been running the site for about four years now, 
and leeching is a re-occuring problem. Yet most of the people I've caught 
simply did a cut and paste job, which this would deter. The way I see it, it's 
better than doing nothing. Would you rather have the bucket of water on the top 
of the ajar door, or nothing at all? 

Second, this group is comp.lang.perl.misc. Once again, I would rather post and 
try to solve this semi-perl related problem than do nothing at all. Plus, I 
posted another question about the same script several lines up, and received 
some good replies.

Lighten up.

-- 
Cyber Thief
http://internettrash.com/users/cyberthief/  
http://wwp.mirabilis.com/83606927
cyberthief@deathsdoor.nospam.com (Remove the .nospam to reply)
1-800-226-0007 Box 233 (After Hours)



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

Date: 06 Aug 2000 10:49:52 +0100
From: nobull@mail.com
Subject: Re: execute a Perl script in another Perlscript
Message-Id: <u9u2cyvhvj.fsf@wcl-l.bham.ac.uk>

AvastYeMatey <my@email.adr> writes:

> nobull@mail.com wrote:
> 
> > "Timothy H. Schilbach" <tschilbach@aodinc.com> writes upside down:
> >
> > > This is an excellent question. If you find out please clue me in :-)
> >
> > No it's not!  It's a damn awfull question.  Not least because there
> > are actully two completely different questions the OP could actually be
> > asking.  But don't take my word for it - go to deja.com (or your
> > favourate Usenet search engine) and see the answers given the last 100
> > or so times this exact question was asked.
> 
> Holy Moly!  Temper, temper there Mr. Schilbach.  If he says he feels it's an
> excellent question let him have his feeling.

Accepting that "Schilbach" should read "NoBull" :-)

What temper?  I'm not angry with Schilbach, I'm disagreeing with
Schilbach.  Schilbach says he thinks this is an excellent question.  I
disagree.  How can you defend Schilbach's right to hold one oppinion
yet deny me the right to hold the oposite oppinion?  Incidently I gave
reasons for my oppinion, Schilbach's oppinion was presented as an
unsupported assertion.

> There's no reason for the nastiness.

There's also no evidence of any nastiness.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 5 Aug 2000 17:30:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: file upload using perl
Message-Id: <8mhffj$c3f$1@orpheus.gellyfish.com>

On Sat, 5 Aug 2000 11:55:14 +0200 Johannes Stark wrote:
> I'm using neither cgi.pm nor cgi-lib. My script should read posted files
> coming via multipart-fomdata. The 25kB test file has been received in every
> trial. But - randomly - only the first 1000 up to 14000 Byte.
> Has anyone an idea?
> 

Yes use CGI.pm and binmode all the filehandles involved.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Sun, 06 Aug 2000 10:51:31 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: file upload using perl
Message-Id: <Tqbj5.73$DT4.2707428@nnrp2.clara.net>

In article <8mgodq$oev$1@merlin.rembrandtstr.bocholt.de>, "Johannes Stark" <starktdh@gmx.de> wrote:
>I'm using neither cgi.pm nor cgi-lib. My script should read posted files

Why not? If you're having problems solving a task that you know something 
else will solve why waste your time when you can spend it better. The fact 
that you know they exist should lead you to go look at the internals to see 
how it is done. Obviously if CGI (cgi-lib is depreciated afaik) doesn't do 
what you want, then you need to invent something that will, but if you 
haven't tried it ...

>coming via multipart-fomdata. The 25kB test file has been received in every
>trial. But - randomly - only the first 1000 up to 14000 Byte.
>Has anyone an idea?

Are you unbuffering your file/socket handles?
Best guess since you've provided no code to work with.



---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC


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

Date: Sun, 6 Aug 2000 14:40:55 +0200
From: "Johannes Stark" <starktdh@gmx.de>
Subject: Re: file upload using perl
Message-Id: <8mjmit$o7t$1@merlin.rembrandtstr.bocholt.de>

Yes of course, I did not really espect to get a hint. But I thought perhaps
this particular problem is known to anyone of you. I think it is a problem
while receiving because it had ran on a loopbacknw.
So to put my question in other words:
Why does:
binmode STDIN;
while($in = read(STDIN, $buf, $ENV{'CONTENT_LENGTH'})
{
$rec += $in;
$fil .= $buf;
}
not wait until $ENV{'CONTNT_LENGTH'} Bytes have been received?

Once more Thanks




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

Date: 6 Aug 2000 14:00:20 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: First Days of Perl (Newbie)
Message-Id: <8mjnh4$q1c$1@orpheus.gellyfish.com>

On Sun, 06 Aug 2000 04:59:20 GMT David Kocchi wrote:
> I downloaded active perl on my windows PC. After I write a line of script,
> and save it as a text file. How do I view what I have written? According to
> the book I'm reading it says to save the file with a cgi extension. When I
> save the file it also adds the .txt at the end is this write?  test.cgi.txt
> 

The you are probably using the wrong book and the wrong editor.

There is absolutely no need to save the file with any particular extension
and the text editor shouldn't be changing the extension anyway.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 5 Aug 2000 17:40:15 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Gee, thanks for all the help  :-(
Message-Id: <8mhg1f$dv5$1@orpheus.gellyfish.com>

On Thu, 03 Aug 2000 21:56:12 -0700 Phil Hawkins wrote:
> I have posted here twice in two days begging for help from you all and
> NO ONE seems to think my question merits anyone's attention.
> 
> Nice group.  Real f****** nice group.
> 

Well there certainly isnt *any* chance of you getting your question answered
now is there ?  What precisely did you hope to achieve with this pathetic
outburst ?

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 06 Aug 2000 10:56:32 +0100
From: nobull@mail.com
Subject: Re: Getting string
Message-Id: <u9snsivhkf.fsf@wcl-l.bham.ac.uk>

root@phil-the-nerd.org (Phil) writes:

> <A HREF="something.gif"> 
> I want to extract the something.gif from that string, taking into
> account...

You could write really complex ad-hoc code but unless speed is of the
essence just use HTML::Parser or one of the other HTML/SGML/XML
parsing tools on CPAN.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 06 Aug 2000 11:08:25 +0100
From: nobull@mail.com
Subject: Re: How to capture CGI program .exe output, modify it and then pass back to browser (client)
Message-Id: <u9n1iqvh0m.fsf@wcl-l.bham.ac.uk>

barrybx@my-deja.com writes:

> I need to run the cgi program, get value from the output and redirect the
> output (data) to another url (html page).

Why have you rejected LWP as a solution?

> Could anybody kindly give me some advice or suggestion?

I suggest reading the group you are about to post to before you post
and look to see if you are about to post a question that's been posted
every day for as long as most people's newsspools hold the group.>

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Sun, 6 Aug 2000 14:04:14 +0200
From: Patrick Vogt <patrick.vogt@unibas.ch.I.hate.spam.mails>
Subject: Re: How to show "tail -f" in browser
Message-Id: <398d52bb.0@maser.urz.unibas.ch>

Probably you best do it in HTML, the following code will call tail.cgi
every 9 seconds. 
<HEAD>
<meta http-equiv="refresh" content="9;URL=/cgi/tail.cgi">
</HEAD>

Hope this helps,
Patrick


Matthias Oswald wrote:
> Hi,
> 
> I am developing a user inferface based on a HTML page and the processing
> 
> behind in perl/ksh script.
> 
> Is there a convenient way to show the log of the processing in the
> browser ?
> I was thinking of doing a tail -f on the process log file and show it
> somehow in another frame of the browser.
> Maybe someone has an example?
> 
> Your help is much appreciated.
> 
> Thanks,
> Matthias Oswald
> email: moswald@husky.ca, mabios@t-online.de
> 


-- 
--
Patrick




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

Date: 6 Aug 2000 13:47:11 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: insert 'n' amount of questions
Message-Id: <8mjmof$nde$1@orpheus.gellyfish.com>

On Fri, 04 Aug 2000 19:05:12 GMT arthur wrote:
> 
> Good Day,
> 
> I am trying to be able to give the "user" (I love that expression) a chance
> to input some questions. I have this:
> ---
> #!/usr/bin/perl -w
> 
> 
> print "How many questions would you like to insert in the program?";
>         chomp ($n = <STDIN>);
> 
> print "\n\nInput questions: ";
> open(QUES, ">ques") || die "can't open ques: $!";
> 
> for ($i=1, $i<=$n, $i += 1;) {
           ^       ^        ^

perldoc perlsyn


/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 6 Aug 2000 13:50:21 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: insert 'n' amount of questions
Message-Id: <8mjmud$o2d$1@orpheus.gellyfish.com>

On Fri, 04 Aug 2000 21:34:38 GMT arthur wrote:
> in article B5AFD165.4BDD%star@sonic.net, arthur at star@sonic.net wrote on
> 8/4/00 12:48 PM:
> 
>> THANKS, I FIXED IT BUT... HOW DO I END THE ENDLESS LOOP?
>> 
>> 
> OH Yeah an ifelse loop
> 

What ifelse loop.

The more Perlish way of doing your loop is:

  for $i ( 1 .. $n )
  {
  }


/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 6 Aug 2000 13:23:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: IP spoofing
Message-Id: <8mjlcf$ikt$1@orpheus.gellyfish.com>

On Sat, 5 Aug 2000 23:58:29 +0800 DT wrote:
> 
> I want to use "Ip spoofing" to do mass submission to search engines. How 
> can I do that. 
> 

You can't.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Sun, 6 Aug 2000 14:27:24 +0200
From: "florian gruber" <flogru@gmx.net>
Subject: Re: IP spoofing
Message-Id: <8mjlh8$ohe$1@news.online.de>

Hi,

<...>

> where can you get aohell ? i was looking for it a long time ago and
> never found it...
>
> is there an underground hacker page soemwhere or soemthing?

look at: http://www.thegrid.net/joe/hpac.htm
ther's a AOHell 96 b.3 release

Silvio




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

Date: Sun, 06 Aug 2000 11:31:28 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: Learning Perl, 2nd Ed. Exercises. How can I do them on win98?
Message-Id: <k0cj5.74$DT4.2711221@nnrp2.clara.net>

In article <398c3e5c$1@212.18.160.197>, "Gonçalo" <tabs_paradise@yahoo.com> wrote:
>Hello.
>I have bought the book Learning Perl by Oreilly, and it is great.
>But, I have a major problem. At the end of each chapter there are some
>exercises. Well, how can I do them with win98? I did a file called
>exercise.pl and run it on apache trough a string like this
>http://localhost/cgi-bin/exercise.pl but I got the 500 error.

Its probably not a CGI script. If its one of the ones early in the book it 
will probably just do something like 'print "The answer is: $x\n";'
which isn't good enough for use on a web server. Its also possible it wasn't 
executable by you, etc. etc. If you're just looking at the command line 
stuff, tootle yerself over to the activestate web site 
<http://www.activestate.com> and download a copy of Perl for win32 from 
there. You'll be running it from a DOS prompt though. So when they say 'now 
execute it using "oreilly% ./exercise.pl"' you'll be using 
"c:> \perl\bin\perl.exe exercise.pl" (or similar, its been a while since I 
used the win32 version)

>Thanks in advance.

Everyone sends TIA, be different, send Meerkats :) :)



---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC


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

Date: 6 Aug 2000 14:33:12 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: LWP::Simple.pm
Message-Id: <8mjpeo$kv$1@orpheus.gellyfish.com>

On Sat, 05 Aug 2000 01:40:51 GMT b_e_n_d_e_r@my-deja.com wrote:
> 
> I'm looking for advice for using LWP::Simple.pm to retrieve the content
> of a url.  I've got the library (and all the supporting libraries)
> installed and when I try to run my program I get a couple of errors.
> The UserAgent.pm library says it can't find
> auto/LWP/UserAgent/env_proxy.al and auto/LWP/UserAgent/_need_proxy.al.
> Does anyone know what these files are and what they do?  I've searched
> around ww.perl.com and the CPAN sites but can't find any reference to
> these files.  Please help????
> 

You did install this properly , rather than just copy the files you thought
you needed ?  In the version of LWP::UserAgent I have both env_proxy() and
_need_proxy() are methods supplied directly by the module and are not
involved in any autoloading stuff - infact the module doesnt do any
autoloading - I would guess that have inconsistent versions of LWP::Simple
and LWP::UserAgent ..

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 5 Aug 2000 17:47:58 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: New Perl upload sample code
Message-Id: <8mhgfu$fe4$1@orpheus.gellyfish.com>

On Fri, 04 Aug 2000 10:44:29 GMT Abel Almazan wrote:
> Hi people
> 
> This is a sample code of how to upload a file with minimum code and
> getting additional info with the upload, like file desciption, etc...
> 
> #!/usr/bin/perl
> 

No -w, no 'use strict;'

> print "Content-type: text/html\n\n";
> 

You are using CGI.pm, why dont you use the header method to do this :

  print header();

> #!/usr/local/bin/perl
> 
> use CGI qw(:standard);
> 

<snip>

> 
> 
> $fichero = param('fichero');
> $descripcion=param('descripcion');
> 
>   $tmpfile=tmpFileName($fichero);

You should read what it says in the CGI.pm manpage what it says about using
param() for file fields - it recommends using upload() instead.

> 
>   open TMP,"$tmpfile";

No check on opening of the file.

>   binmode TMP;
>   @pathunix = split('/', $fichero);
>   @pathdos = split(/\\/, $fichero);
> 
>   open OUT,"> ../htdocs/$pathdos[$#pathdos]";

No check on opening of the file.

>   binmode OUT;
>   while (<TMP>)
>   {
>     print OUT $_;
>   }
>   close TMP;
>   close OUT;
> 
> system("chmod 777 ../htdocs/$pathdos[$#pathdos]");
> 

Why are making the file executable and world writable ?

> If u have troubles, send me a msg.
> 

I *am* troubled by the fact that you are presenting this as a piece of
example code.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 6 Aug 2000 13:43:05 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: passing spaces in URL
Message-Id: <8mjmgp$mi3$1@orpheus.gellyfish.com>

On Sat, 05 Aug 2000 10:49:17 -0400 Michael Ragsdale wrote:
> jthornton@my-deja.com wrote:
>> 
>> Why don't you just code your values with the seperator.
>> 
>> Instead of:     my $x = 'I need help';
>> do:             my $x = 'I%20need%20help';
>> or even better: my $x = 'I+need+help';
>> 
>> 
> That's fine and dandy when the value of $x is declared in
> the script, but what about when $x is being filled by
> $q->param() or from a DBI call?
> 

If that is the case you will be wanting to do more than just URL encode
the strings - please see the CERT advisory on malicious content.

> I think I'll try the URI::Escape module that Tony Curtis
> mentioned and see what I can do with that.  Thanks for the
> help guys.

At the very simplest URL encoding could be :

  $string =~ s/([^a-zA-Z0-9])/sprintf "%%%02X",ord($1)/eg;

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 06 Aug 2000 10:58:15 +0100
From: nobull@mail.com
Subject: Re: problems with socket programming
Message-Id: <u9r982vhhk.fsf@wcl-l.bham.ac.uk>

"karamazov" <none> writes:

> #Accept loop for client requests
> for(; accept(Client,Server); close Client)
>   {
> 
>     open(Incoming, ">Incoming.txt");
> 
>     while($inLine = <STDIN>)
                       ^^^^^

?!

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 06 Aug 2000 11:01:48 +0100
From: nobull@mail.com
Subject: Re: regular expression question....
Message-Id: <u9punmvhbn.fsf@wcl-l.bham.ac.uk>

arun_rajappa@my-deja.com writes:

> hi,
> 
> i have a simple question. i have a program that generates file names of
> the format
> 
> 20000801122801.deo
> 
> where the first 6 chars signify the date.
> 
> i would like to have a regular expression to verify that the input file
> is of this format - however, i am new to perl and dont know how i can
> do this.
> 
> i tried the following, but it has limitations (allows names like
> 20001939******.deo)
> 
> /2000[01][0-9][0123][0-9]\d\.deo/
> 
> can anyone help me by telling me a more accurate way of doing this ?
> can it be done in a single regular expression ??

It can be done in a regular expression but I doubt that's a good way!
Given that months are of unequal length and there are leap years it
makes more sense to use a regex to rearrange the date into a format
where it can be semantically checked by on of the date manipuation
packages from CPAN.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 06 Aug 2000 11:16:27 +0100
From: nobull@mail.com
Subject: Re: what mod-perl want me do
Message-Id: <u9lmyavgn8.fsf@wcl-l.bham.ac.uk>

eastking@my-deja.com writes:

> When I run it under normal perl environment, it worked well.
> But when run it under mode-perl for serveral times, it said that
> I used uninitialized value of $query.

See the documentation for mod_perl.  Note the bit about the warning
"shared variable will not remain shared" (or words to that effect) and
how to get around it.

BTW are you not seeing this warning in your logs?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 5 Aug 2000 18:47:14 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Why root can't run perldoc?
Message-Id: <8mhjv2$qpe$1@orpheus.gellyfish.com>

On Fri, 04 Aug 2000 02:25:35 GMT Edmond Cheng wrote:
> Hi,
> 
> I login in as root and try to read some perl document using the
> perldoc.  But I get the message:
> 
> Superuser must not run /usr/local/bin/perldoc without security audit and
> taint checks.
> 
> My questions are:
> 1. Why user root cannot run perldoc?

Greg already explained that one.

> 2.  How can I get around of it without logout of root.
> 

perldoc -U perldoc


/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

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


------------------------------
End of Perl-Users Digest V9 Issue 3927
**************************************


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