[15834] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3247 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 4 09:05:25 2000

Date: Sun, 4 Jun 2000 06:05:10 -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: <960123910-v9-i3247@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 4 Jun 2000     Volume: 9 Number: 3247

Today's topics:
        如何在pc下安裝perl?? <dyu_web@pchome.com.tw>
        如何利用perl寫一個可以在unix環境下可以跑的檔案上載程式? <dyu_web@pchome.com.tw>
    Re: "system" and output flush <abe@ztreet.demon.nl>
        3 questions about perl chao98@my-deja.com
    Re: 3 questions about perl <abe@ztreet.demon.nl>
        about redirection in perl CGI <cellecialNOceSPAM@21cn.com.invalid>
    Re: CGI.pm param function troubles <derekdangelo@earthlink.net>
    Re: CGI.pm!! <gellyfish@gellyfish.com>
    Re: DBI and Apache 1.3 <gellyfish@gellyfish.com>
        DBI and MS Access <Karl-Heinz.Brenzinger@t-online.de>
    Re: Email this story to a friend - html to text <gellyfish@gellyfish.com>
    Re: How do I update records in a file?  (cgi & perl) (brian d foy)
    Re: How do I update records in a file?  (cgi & perl) <flavell@mail.cern.ch>
    Re: How do I update records in a file?  (cgi & perl) <nayler@SPAMOFFses.curtin.edu.au>
        How to make a stand-alone exe ?? <catzNOcaSPAM@mad.scientist.com.invalid>
    Re: NT GROUP ? <carvdawg@patriot.net>
        obfuscation scripts (Eric Smith)
        open http file <dfgdfg@dsfgdfg.it>
    Re: please help in checking the referer site and giving <vvacme@worldonline.nl>
    Re: please help in checking the referer site and giving <vvacme@worldonline.nl>
    Re: please help in checking the referer site and giving <joydip_chaklader@my-deja.com>
    Re: please help in checking the referer site and giving (jason)
    Re: Predicted generation of ID numbers <webmaster@beautiful-ladies.com>
    Re: Predicted generation of ID numbers <webmaster@beautiful-ladies.com>
    Re: problem with perl garbage collecting poppln@my-deja.com
    Re: Require statement kills script <abe@ztreet.demon.nl>
    Re: Require statement kills script <nayler@SPAMOFFses.curtin.edu.au>
        Secure CGI session in Perl <maciek@treko.net.au>
        Using Net::SMTP lmorgan@lineone.net
    Re: Win32::AdminMisc::LogonAsUser <carvdawg@patriot.net>
    Re: Win32::Eventlog <carvdawg@patriot.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 4 Jun 2000 07:34:26 GMT
From: "sheu" <dyu_web@pchome.com.tw>
Subject: 如何在pc下安裝perl??
Message-Id: <8hd0q2$o3q$1@news.seed.net.tw>

hi~
請問一下perl最新版要去哪下載?而如何在pc下安裝perl?
Thank you ^^





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

Date: 4 Jun 2000 07:08:44 GMT
From: "sheu" <dyu_web@pchome.com.tw>
Subject: 如何利用perl寫一個可以在unix環境下可以跑的檔案上載程式?
Message-Id: <8hcv9s$mdj$1@news.seed.net.tw>

Hi:您好~
請問一下如何利用perl寫一個簡易的檔案上載至遠端主機,但要利用密碼來控制上載人員的身份...
麻煩了! ^^
thank you !





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

Date: Sun, 04 Jun 2000 13:19:51 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: "system" and output flush
Message-Id: <h66kjs87p580h7jt6ibqdho6q1k6tlk0ld@4ax.com>

On 3 Jun 2000 15:25:36 GMT, feng chen <fchen@fas.harvard.edu> wrote:

> Hi, There.
Hi,
> 
> I have a perl script which uses several "system" calls
> to run other perl script such as:
> 	system "perl p1.pl ......";
                ^^^^^^^^^^
now why would you want to do that? Isn't one perl enough?
just put:
	require 'p1.pl';
and if you want to pass (commandline) arguments to it (mind the
curlies):
	{
	  local @ARGV = qw(arg1 arg2); #set arguments;
	  require 'p1.pl';
	}


-- 
Good luck,
Abe


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

Date: Sun, 04 Jun 2000 09:55:58 GMT
From: chao98@my-deja.com
Subject: 3 questions about perl
Message-Id: <8hd93c$uko$1@nnrp1.deja.com>

Hi,
  As I am a new comer to perl, I have 2 questions while I read a
perl guide.
  The first one is about "last". It is said that "last" can force
program to exit from current statement block. For example,
@array = ("A".."Z");
for ($index = 0; $index < @array; $index++) {
  if ($array[$index] eq "T") {
     last;
  } <--1
} <--2
print ("$index\n");
  While condition becomes true, it should jump out of block pointed
by 2. But according to the definition, "if" clause also forms a
statement block. So, how to explain this?
  The second is a structrue @data{@fieldList} can be used a hash.
I don't know how it is converted.
  Could anyone help me to explain these 2 questions?
  Thanks a lot!
  BR / Chao
  2000.6.4


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sun, 04 Jun 2000 14:35:17 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: 3 questions about perl
Message-Id: <s8fkjso74k3fhp0g0boira4cnab3psjsfo@4ax.com>

On Sun, 04 Jun 2000 09:55:58 GMT, chao98@my-deja.com wrote:

Subject: 3 questions about perl

different questions deserve different posts, with their own subject.

> Hi,
>   As I am a new comer to perl, I have 2 questions while I read a
                                        ^^^^^^^^^^^
> perl guide.
>   The first one is about "last". It is said that "last" can force
> program to exit from current statement block. For example,
> @array = ("A".."Z");
> for ($index = 0; $index < @array; $index++) {
>   if ($array[$index] eq "T") {
>      last;
>   } <--1
> } <--2
> print ("$index\n");
>   While condition becomes true, it should jump out of block pointed
> by 2. But according to the definition, "if" clause also forms a
> statement block. So, how to explain this?
By reading what perlfunc has to say about 'last':
    last LABEL
    last    The `last' command is like the `break' statement in C (as
            used in loops); it immediately exits the loop in question.
            If the LABEL is omitted, the command refers to the innermost
            enclosing loop.

'if' is not a loop.
perldoc perlsyn (section 'Loop Control')

>   The second is

>                  a structrue @data{@fieldList} can be used a hash.
> I don't know how it is converted.
It's called a hash-slice. You will want to read:
	http://www.sysarch.com/perl/tutorials/hash_slices.txt


-- 
Good luck,
Abe


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

Date: Sun, 04 Jun 2000 02:08:35 -0700
From: CuriousSnail <cellecialNOceSPAM@21cn.com.invalid>
Subject: about redirection in perl CGI
Message-Id: <0a865790.b3353e54@usw-ex0105-037.remarq.com>

Hi,

I use perl to write CGI. What I want to do is:
users click a submit button on the webpage, my
CGI execute a program.This program generate a
file,then this file is automatically downloaded
to users' local machine.

My example.pl like below:

#!/usr/sbin/perl

print "Content-type:text/html\n\n";
 ..
$str=`c:\myprog.exe $arg1 $arg2`;
print $str;


When executing myprog.exe , it will generate a
*.cer file. I wish to download this file to
users' local machine.
Someone advise me to add
"print "Location:http://localhost/a.cer\n\n"
at end of example.pl to redirect to a.cer, but
it has no effect.

Any suggestions? Thanks in advance.

Best Regards,

Curious Pink Sea-Snail

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Sun, 04 Jun 2000 10:54:22 GMT
From: "Derek Dangelo" <derekdangelo@earthlink.net>
Subject: Re: CGI.pm param function troubles
Message-Id: <yzq_4.6173$NT4.185455@newsread1.prod.itd.earthlink.net>

I'm running the scripts on a remote server (tripod), so I really don't know
the version of perl they have..  That must be the problem...
"Drew Simonis" <care227@attglobal.net> wrote in message
news:3938090D.40CCF17D@attglobal.net...
> Derek D'Angelo wrote:
> >
> > I have, a previous message explained I could use the functions from
> > CGI.pm without worrying about the OO method ( object->function )
> > I have not been able to do this successfully.  Even the first line,
> > when I include the CGI library like above, I can't use header; or header
> > (), or anything without the object reference.  I've tried a number of
> > ways, even copying and pasting code from examples without the object
> > reference and I've had zero luck.  I always get a member error.
> >
>
> So that begs the question as to what version of Perl and CGI.pm
> you are using.  I have no problems using either the function or
> object ways of dealing with CGI.pm
>




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

Date: 3 Jun 2000 12:57:57 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI.pm!!
Message-Id: <8hars5$d2v$1@orpheus.gellyfish.com>

On Wed, 31 May 2000 11:30:04 GMT Arun Mahajan wrote:
> hi Everybody,
> 
> First of all let me thank you everybody who is answering my question. This 
> is a great interactive group, where i am always sure to get a good 
> positive feedback. thanks once again who ever is contributing.
> 
> As I am new to cgi programming and just come to know about the CGI.pm lib. 
> i 'll be highly obliged if somebody can provide the good reference site 
> for the same.
> 

The authors site at  <http://stein.cshl.org/> has an online version of
the manpage but you might want to start with :

   man CGI

or

   perldoc CGI

If you search this group on Deja News <http://www.deja.com/home_ps.shtml>
for the string 'use CGI' you are bound to come up with loads of examples.

/J\
-- 
I'm glad you asked, son. Being popular is the most important thing in
the world.
-- 
fortune oscar homer


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

Date: 3 Jun 2000 12:51:54 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: DBI and Apache 1.3
Message-Id: <8hargq$bug$1@orpheus.gellyfish.com>

On Fri, 02 Jun 2000 17:45:32 GMT lennie_jarratt@my-deja.com wrote:
> I am trying to access my database via DBI on an
> Apache 1.3.12 server.  I cannot get it to load the
> .so files for DBI.  How can I set this up?
> BTW, the program runs fine from the command line,
> just not from Apache.
> 

Depending on what DBD::* module you are using youare likely to have to
set various environment variables so both the dynamic linker and your
databases client libraries can locate the required components - for
Informix for instance I would set :

    INFORMIXDIR=/usr/local/informix
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFORMIXDIR/lib:$OMFORMIXDIR/lib/esql

but you would want to check what the actula values are for your system.
You might want to ask in a newsgroup about your particular database.

Apache has facilities to set environment variables for child processes
but you will want to look in the Apache manual or ask in the newsgroup
comp.infosystems.www.servers.unix

/J\
-- 
Mmmm, purple.
-- 
fortune oscar homer


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

Date: Sun, 04 Jun 2000 09:36:14 +0200
From: Karl-Heinz Brenzinger <Karl-Heinz.Brenzinger@t-online.de>
Subject: DBI and MS Access
Message-Id: <393A06EE.79791E63@t-online.de>

Hallo.

How can I use functions, which are defined within MS Access through the
DBI package?

I defined a function eg. calcsomething(a,b) within the DB and I like to
use the result of this calulation in the
where-clause of the SELECT. eg.

SELECT tab.*  WHERE (calcsomething(tab.a, tab.b))

This doesn't work. Can someone give me a hint?
Do I have to define the function calcsomething() from Perl?

Thank You.

Karl-Heinz



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

Date: 3 Jun 2000 12:36:19 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Email this story to a friend - html to text
Message-Id: <8haqjj$8v3$1@orpheus.gellyfish.com>

On Fri, 02 Jun 2000 20:00:02 GMT rk27@my-deja.com wrote:
> In article <87itvsghyl.fsf@limey.hpcc.uh.edu>,
>   Tony Curtis <tony_curtis32@yahoo.com> wrote:
>> >> On Fri, 02 Jun 2000 16:19:28 GMT,
>> >> rk27@my-deja.com said:
>>
>> > I would like to add a feature to my website where the
>> > clients can email a story to their friends. I want the
>> > email to be sent in *plain text*. I have already written
>> > the code to grab the contents of a website in html and
>> > email it but I would like to convert the html to plain
>> > text before I mail it.
>>
>> Try the HTML::Parser, HTML::TreeBuilder and
>> HTML::FormatText modules.
>>
> 
> But how do I installed these modules. I tried extracting the files and
> putting them in a HTML folder inside the lib folder but the perl
> program was unable to find the files.
> 
> I am on an NT.
> 

You should be able to use PPM to do this :

   PPM install HTML::Parser


/J\
-- 
Stealing! How could you?! Haven't you learned anything from that guy
who gives those sermons at church? Captain Whats-his-name?
-- 
fortune oscar homer


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

Date: Sun, 04 Jun 2000 04:44:51 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: How do I update records in a file?  (cgi & perl)
Message-Id: <brian-ya02408000R0406000444510001@news.panix.com>

In article <8hcp69$a69$1@ftp.curtin.edu.au>, "Thaddeus" <nayler@ses.curtin.edu.au> posted:

> There are actually several reason why I couldn't research what I required:
 
> 1. I am remotely logged onto the development server

so?

> 2. Which has no perldocs installed (seemingly)

the docs are online, and they do not differ from machine to machine
(save for version differences).

> 3. My connection is very slow - meaing i cant access http sites.

then install something locally.  it might take you a bit of time,
but it solves the problem.  download while you have dinner or sleep,
perhaps.

i suppose that it is not so slow that you can access usenet though.

> 4. I have a telnet window as a development environment (cut/paste difficult
> to impossible).

that sounds more like a problem with your choice of software.

> 5. I have two days to complete this project which I was given on the side.

cry me a river.  that seems like loads of time to some of us.

> Excuses?  Absolutely.  Its up to you whether or not to think they were
> worthy of pissing off the great Tad McClellan.

if you want to create a bad situation for yourself by using crappy
software or working in an environment that doesn't provide you with
the means for success, then don't cry to us because you set yourself
up for failure.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Sun, 4 Jun 2000 11:01:23 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How do I update records in a file?  (cgi & perl)
Message-Id: <Pine.GHP.4.21.0006041054050.7923-100000@hpplus01.cern.ch>

On Sun, 4 Jun 2000, Thaddeus wrote:

> "Tad McClellan" said:
> 
> all sorts of nasty stuff....  see the preceeding post (its pretty obvious
> what I am replying to if you do this)
> 
> bit shirty aint we Tad??

I hope you understand that you're volunteering for the killfile.

> I think you should check your net manners....

pot, kettle

>  some people just happen to
> have trouble finding things at 3am and resort to a possible quick fix. 

As you would know from the FAQs, using usenet as a substitute for
documentation is basically doomed to failure.

> There are actually several reason why I couldn't research what I required:
> 
> 1. I am remotely logged onto the development server
> 2. Which has no perldocs installed (seemingly)
> 3. My connection is very slow - meaing i cant access http sites.
> 4. I have a telnet window as a development environment (cut/paste difficult
> to impossible).
> 5. I have two days to complete this project which I was given on the side.

So it transpires that you're even more stupid than it at first seemed.



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

Date: Sun, 4 Jun 2000 19:00:27 +0800
From: "Thaddeus" <nayler@SPAMOFFses.curtin.edu.au>
Subject: Re: How do I update records in a file?  (cgi & perl)
Message-Id: <8hdcsu$h3o$1@ftp.curtin.edu.au>


Dear Brian and Adam,

This reminds me of a schoolyard gang when I was a wee lad in knickerbockers.
You big bunch of bullies!

I was simply making the following points:

a) I'm not a programmer
b) I'm not trying to horn in on your careers so your egos are safe.
c) I don't have the best environment or resources - which cant be helped.
d) I was looking for the easiest way out in the shortest possible time.
e) I found it.
f) Apart from you arseholes.
g) Bring on the killfile if you think its going to teach me a lesson.

I'm off to go cry a river, meatball.

Thad.





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

Date: Sun, 04 Jun 2000 01:21:21 -0700
From: Catz <catzNOcaSPAM@mad.scientist.com.invalid>
Subject: How to make a stand-alone exe ??
Message-Id: <12b4ac27.8ff3cd18@usw-ex0109-069.remarq.com>

Hi

Can anyone tell me how to create a stand-alone .exe out of
a .pl script?

Thanks
Theodore Catz


* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


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

Date: Sun, 04 Jun 2000 08:22:12 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: NT GROUP ?
Message-Id: <393A49F4.90C8442@patriot.net>



> On Thu, 01 Jun 2000 17:19:45 -0400, Eli Mansour Wrote:
> > Is there any newsgroup that I can post Win32 API calls ?

Are you talking just the API calls, or as they relate to Perl?

Dave Roth has several newsgroups off of his server at news.roth.net
that may be of interest to you.  You can also use these groups for any
Perl-related stuff, as well, or you can go to ActiveState and post on their
list servers (in the support area)...



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

Date: 4 Jun 2000 12:32:58 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: obfuscation scripts
Message-Id: <slrn8jkj3p.g72.eric@plum.fruitcom.com>

I know there are scripts that obfuscate your perl code by alterning variable
names and remove white space etc.  You can also convert your script into
some kind of ascii image.

I am looking for some references to the above.

thanx
-- 
Eric Smith
eric@fruitcom.com


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

Date: Sun, 4 Jun 2000 12:39:37 +0200
From: "fdxcfgd" <dfgdfg@dsfgdfg.it>
Subject: open http file
Message-Id: <8hdbqt$rru$3@sirmdpsin17.inwind.it>

please can anyone tell me why this structure doesn't work?
how can I correct the problem?
the program always tells me that is unable to open the script

I have to reqeust the file without copying it to th harddisk!

many thanks
giorgio



 use URI::URL;



     $script = new URI::URL 'http://www.domain.com.file.txt';

open (script,"<$script") or shout ('critical', "Unable to open script
$script: $!");
shout ('info',"Now processing commands from $script");






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

Date: Sun, 04 Jun 2000 13:27:13 +0200
From: Vincent Voois <vvacme@worldonline.nl>
Subject: Re: please help in checking the referer site and giving page view  authorisation
Message-Id: <393A3D11.168178A7@worldonline.nl>

This is also a solution that works, i don't know if it's safe enough

$referer = $ENV{'HTTP_REFERER'};

# Split all http marks by "/" sign, in this case you secure it has to be called from HTTP://
# else the below condition check won't work at all
my @refs = split(/\//, $referer);

# check for list object 2 for the server ip or alias.

if (@refs[2] eq 'www.hitostat.com' || @refs[3] eq '64.65.31.50'){

  # Script called from the above server-IP or it's 'alias'
  # your code to process the page goes here

} else {

  # oops the user called the script by bookmark, redirect...

}

David Efflandt wrote:
> 
> On Sun, 04 Jun 2000, Joydip Chakladar <joydip_chaklader@my-deja.com> wrote:
> >
> >I am trying to make a referer check to a certain page where i give a
> >service of search engine submission programme which is free.Now I want
> >person to come from my server rather than from an bookmark or from the
> >copy of the html file which somebody has made into thier server.I am
> >trying this checksitereferer subroutine and it is showing the page
> >blank or showing documents contains no data . Things are working superb
> >if I get ride of this subroutine.
> 
> Seems like you could use a simple pattern search for that.  However,
> requiring an optional variable that is NOT required by any standards is
> generally a bad idea.  So something like this would be better:
> 
>     if (!$ENV{HTTP_REFERER}
>       || $ENV{HTTP_REFERER} =~ m|^\Q$HitOStatdotcom\E|) {
> 
>         ## search engine submission code
> 
>     } else {
>         print "Location: $HitOStatdotcom\n\n";
>         exit;
>     }
> 
> One other note is that your redirect is invalid because it uses an
> incomplete URL (trailing slash required if not referencing a file) and the
> extra space in your location header makes it "http://www.hitostat.com "
> which with the trailing space would really be invalid.  The newlines
> should immediately follow the variable like I have it above.
> 
> >sub Checksitereferer()
> >
> >{
> >
> >my($sClientID)=@_;
> >
> >$HitOStatdotcom="http://www.hitostat.com";
> >
> >if (lc(substr($ENV{'HTTP_REFERER'}, 0, length($HitOStatdotcom))) eq
> >$HitOStatdotcom)
> >{
> >               ## search engine submission code
> >}
> >else
> >{
> >
> >             print "location: $HitOStatdotcom \n\n";
> >             exit;
> >
> >}
> >
> >}
> >
> >
> >--
> >Joydip Chakladar
> >http://www.allindialive.com
> >From India to world
> >A meeting place of surfers and webmasters
> 
> --
> David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
> http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
> http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/

-- 
##############################################
                     Vv

       *Programming related activities*
       http://xbasicdocs.freeservers.com


           *SidBace maintainance*
       http://sidbase.webprovider.com


            *Musical activities*
      http://artists.traxinspace.com/Vv
             http://listen.to/Vv
##############################################


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

Date: Sun, 04 Jun 2000 13:33:57 +0200
From: Vincent Voois <vvacme@worldonline.nl>
Subject: Re: please help in checking the referer site and giving page view  authorisation
Message-Id: <393A3EA5.E42430A1@worldonline.nl>

Sorry i made one typo:
> if (@refs[2] eq 'www.hitostat.com' || @refs[3] eq '64.65.31.50'){

should be
if (@refs[2] eq 'www.hitostat.com' || @refs[2] eq '64.65.31.50'){


Vincent Voois wrote:
> 
> This is also a solution that works, i don't know if it's safe enough
> 
> $referer = $ENV{'HTTP_REFERER'};
> 
> # Split all http marks by "/" sign, in this case you secure it has to be called from HTTP://

-Snip-

Vv.


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

Date: Sun, 04 Jun 2000 07:00:28 GMT
From: Joydip Chakladar <joydip_chaklader@my-deja.com>
Subject: Re: please help in checking the referer site and giving page view authorisation
Message-Id: <8hcuqa$nka$1@nnrp1.deja.com>




> while this is an unreliable method of securing a service (the
> HTTP_REFERER header is easily faked) there appears to be nothing wrong
> with your code
>
> have you tried just putting something really simple in the true clause
> of your condition ? .. maybe it's your "search engine submission code"
> that is faulty
>


tell me an reliable method .

Mentioning again without the referer check things are going superb. So
there is nothing wrong in search engine submission code.


I have also implemented an simpler if clause but that was showing blank
screen or giving the error message "the document contains no data"


that was like this


$referer="hitostat.com";

if ($referer -eq $ENV{'HTTP_REFERER'})

{

//search engine submission code

}

else

{

  print "authorization failed";

}













> --
>  jason - elephant@squirrelgroup.com -
>

--
Joydip Chakladar
http://www.allindialive.com
From India to world
A meeting place of surfers and webmasters


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sun, 04 Jun 2000 08:49:14 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: please help in checking the referer site and giving page view authorisation
Message-Id: <MPG.13a4b530e6c52ad698970c@news>

Joydip Chakladar writes ..

>> while this is an unreliable method of securing a service (the
>> HTTP_REFERER header is easily faked) there appears to be nothing wrong
>> with your code
>
>tell me an reliable method .

a reliable method is to have your start page (http://www.hitostat.com) 
set a single use cookie on the viewer's browser .. your search page 
should require that cookie to be present before presenting the 
information to the browser

>Mentioning again without the referer check things are going superb. So
>there is nothing wrong in search engine submission code.

but in your first post you said

"
I am trying this checksitereferer subroutine and it is showing the page
blank or showing documents contains no data.
"

so .. if it's appearing blank then clearly the else clause is not being 
executed .. because the else clause sent a Location header to the 
browser .. so .. if the referer check was failing then you'd be 
redirected to the start page

in other words .. the referer check is being executed (or never 
evaluated) .. so the code that's generating the blank page is the 
"search engine submission code"

so we're back to...

>> have you tried just putting something really simple in the true clause
>> of your condition ? .. maybe it's your "search engine submission code"
>> that is faulty

which I think will show you whether the if clause is actually being 
evaluated or not

>if ($referer -eq $ENV{'HTTP_REFERER'})

this will never work

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Sun, 04 Jun 2000 06:56:19 GMT
From: Andrej <webmaster@beautiful-ladies.com>
Subject: Re: Predicted generation of ID numbers
Message-Id: <8hcuih$nbb$1@nnrp1.deja.com>

Ok It worked!
Thank you!
Andrej


  phill@modulus.com.au wrote:

> >
> > No problems, I have found a way to remove flock :-)
> > Just
> > ID,2; seek ID,0,0;
> >
> > Now I should add this code to basic script
> >
> > and use $id as
> > $ENV{'RAND'} = $id;
> >
> > I tried
> > --------------------------------
> > sub Rnd {
>
>   my $id;
>
> > $idfile = "id_num";
> > if (open(ID,"+<$idfile")) {
> >     flock ID,2; seek ID,0,0;
> >     $id = <ID>; chomp($id);
> >     seek ID,0,0; print ID ++$id,"\n";
> >     close ID;
> > } elsif (open(ID,">$idfile")) {
> >     $id = 400;
> >     flock ID,2; seek ID,0,0;
> >     print ID "$id\n";
> > } else {
> >     print "Can't open $idfile: $!\n";
> >     exit;
> >         }
>
>     return $id;
>
> > }
>
> $ENV{'RAND'} = Rnd();
>



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sun, 04 Jun 2000 07:10:28 GMT
From: Andrej <webmaster@beautiful-ladies.com>
Subject: Re: Predicted generation of ID numbers
Message-Id: <8hcvd1$nva$1@nnrp1.deja.com>

Other question, is the similar scheme of auto definition UNIX/WIN
efficient here?

if (-s "/bin/ln" ) {
	# unix
	$ENV{'UNIX'} = "UNIX";
$mail_cmd       = '/usr/sbin/sendmail -t';

sub Rnd {
my $id;
$idfile = "$base_path/id_num";
if (open(ID,"+<$idfile")) {
    flock ID,2; seek ID,0,0;
    $id = <ID>; chomp($id);
    seek ID,0,0; print ID ++$id,"\n";
    close ID;
	} elsif (open(ID,">$idfile")) {
    $id = 400;
    flock ID,2; seek ID,0,0;
    print ID "$id\n";
	} else {
    print "Can't open $idfile: $!\n";
    exit;
	}
   return $id;
}
	} else {
        # WIN
	$ENV{'UNIX'} = "WIN";
$mail_cmd       = 'c:\usr\sbin\sendmail.exe -t';
sub Rnd {
my $id;
$idfile = "$base_path/id_num";
if (open(ID,"+<$idfile")) {
ID,2; seek ID,0,0;
    $id = <ID>; chomp($id);
    seek ID,0,0; print ID ++$id,"\n";
    close ID;
	} elsif (open(ID,">$idfile")) {
    $id = 400;
ID,2; seek ID,0,0;
    print ID "$id\n";
	} else {
    print "Can't open $idfile: $!\n";
    exit;
	}
   return $id;
	}
}
$ENV{'RAND'} = Rnd();

--
Thank you,
Andrej
http://www.beautiful-ladies.com/


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sun, 04 Jun 2000 08:06:17 GMT
From: poppln@my-deja.com
Subject: Re: problem with perl garbage collecting
Message-Id: <8hd2lm$qpj$1@nnrp1.deja.com>

In article <8h8g21$15q$1@charm.magnus.acs.ohio-state.edu>,
  ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
> [A complimentary Cc of this posting was sent to
> <poppln@my-deja.com>],
> who wrote in article <8h856d$evn$1@nnrp1.deja.com>:
> > > Even if the debugger is run non-interactively in non-stop mode?
> >
> > How do you run the debugger non-interactively?
>
>   perldoc perldebug

Thanks, I found it. ( sorry about not RFTM before posting ).

> > perl-5.00502 is old?
>
> Close to unusable...

Really? I've been working with it close to a year and this is the first
Time I've run into REALLY strange behavoir.

> > What is the must updated version? ( before 5.6 - I need a perl that
> > WORKS! )
>
> I think there were several developer releases which could be better
> than 5.6.0.  And no, you do not need the version which "WORKS" if what
> you need is debugging strange problems.

Well, what I need is the version that does not have strange problems :)

  Nadav


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sun, 04 Jun 2000 13:19:51 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Require statement kills script
Message-Id: <os8kjs0v422ui0nc246e4m869j984b3he3@4ax.com>

On Sun, 4 Jun 2000 13:31:35 +0800, "Thaddeus"
<nayler@SPAMOFFses.curtin.edu.au> wrote:

> 
> "Rodney Engdahl" <red_orc@my-deja.com> wrote in message
> news:8hbnnk$u6r$1@nnrp1.deja.com...
> > chances are that your required file does not have a
> > 1;
> 
> it sure does.
> 
> it also has correct file permissions, and its accessible from the other
> scripts, and the procedures are exactly the same as when i place them
> directly in the scripts.
> 
> and more info?
You will want to know the error message perl produced. One way is to put

	use CGI::Carp 'fatalsToBrowser'; #suggested by Bob Walton

in your script.
Another way is to run the script from the command line which is what I
usually do before running it as a cgi on a server.

-- 
Good luck,
Abe


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

Date: Sun, 4 Jun 2000 20:45:56 +0800
From: "Thaddeus" <nayler@SPAMOFFses.curtin.edu.au>
Subject: Re: Require statement kills script
Message-Id: <8hdj2m$jb4$1@ftp.curtin.edu.au>


"Abe Timmerman" <abe@ztreet.demon.nl> wrote in message
news:os8kjs0v422ui0nc246e4m869j984b3he3@4ax.com...
> You will want to know the error message perl produced. One way is to put
>
> use CGI::Carp 'fatalsToBrowser'; #suggested by Bob Walton
>
> in your script.
> Another way is to run the script from the command line which is what I
> usually do before running it as a cgi on a server.


Thanks.

The cli didnt tell me anything.  It came up clean, yet I was still getting a
500 error.

I've sorted it though, still not entirely sure what was wrong.  Might have
been a delayed file update or something like that.  I didnt change much
today and it worked straight away.

Thad.




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

Date: Sun, 04 Jun 2000 19:01:30 +0800
From: Maciej Mastalarczuk <maciek@treko.net.au>
Subject: Secure CGI session in Perl
Message-Id: <393A370A.6E80DD0F@treko.net.au>

Hi Gurus,

I am making a secure website in Perl (Apache-SSL, Redhat 6.0). There are
some lines below, but I think the problem is trivial.

Description:
The user fetches a login page and puts username and password which are
POST-ed to a script called say 'login.cgi'.
The script validates the user and performes certain action or refuses to
do so if appropriate.
Whole site consists of many scripts and none of them should be invoked
without prior login. To achive this every script contains the same
authentication routine. For obvious reasons I don't want a user to have
to type the password so many times, thus I need to pass the password
between scripts. Now, after first succesful login username and encrypted
password (using crypt routine) are attached to every form as hidden
fields (I know this is silly).

Problem:
Although it works fine, the password is included in HTML code and
everything can be found in browser's cache (and probably in proxy cache
too).

Question:
Is there any secure method of passing data between CGI scripts? I am not
worried about the transmission which is SSL secured. Could I disable
caching of the page somehow and is it good enough?
Or maybe there is a method to call one CGI script from inside the other
one withiout submitting any HTML forms.

I know that instead of passing the password everytime I could sent user
a cookie after sucsesful login and validate him/her on that basis, but
is is secure?

Any idea is greatly apprecieated.

Thanks & regards,
--
Maciej Mastalarczuk
maciek@treko.net.au





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

Date: Sun, 04 Jun 2000 10:52:09 GMT
From: lmorgan@lineone.net
Subject: Using Net::SMTP
Message-Id: <8hdccn$kv$1@nnrp1.deja.com>

Hi,

I've tried to use an example of Net::SMTP that I found, however I can't
get it to work...
One thing I have noticed is that Net::SMPTP doesn't require a password
to log onto the mail server... why not? With OE (Outlook Express) and
other mail programs it is neccessary to have a password or is that only
used for pop3???

It may be that my server doesn't have Net::SMTP installed, does it come
as standard with version 5?? But even so I would have though a password
would be needed to send mail??

thanx 4 any1's help...

Luke
aka Phantom*Breeze
lmorgan@lineone.net


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sun, 04 Jun 2000 08:24:07 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: Win32::AdminMisc::LogonAsUser
Message-Id: <393A4A67.EE760519@patriot.net>

Try looking here;

http://www.roth.net/perl/adminmisc/#LogonAsUser

John Chajecki wrote:

> Hi,
>
> I am using a Win32 version of Perl and trying to exploit the
> Win32:AdminMisc::LogonAsUser function to create a sudo user type  session so
> that I can run a process as Administrator. Unfortunately I can't get it to
> work.
>
> I have done as follows:
>
> 1. I have created a group called Sudo Users.
> 2. Assigned the following user rights to the group:
>    - Act as pert of the operating system
>    - Bypass traverse checking (already assigned to everyone)
>    - Replace a process level token
>    - Increase quotas (not required by Perl but used by other SU tools)
> 3. Assigned users to the group.
>
> I have logged on as one of the users in the Sudo Users group and tried to run
> the following test Perl script, which is a modification to the example in Dave
> Roths Win32 Perl Programming - The Standard Extensions book:
>
> -------------------------------------------------------------
> use Win32;
> use Win32::AdminMisc;
>
> Win32::AdminMisc::LogonAsUser("","Administrator","adminpassword");
> $UserName = Win32::AdminMisc::GetLogonName();
> &Notify("Logged in as: ".$UserName."\n");
> if ("\L$UserName" eq "\LAdministrator"){
>    &Notify("Logged in successfully.\n");
>    Win32::AdminMisc::LogoffAsUser();
> }else{
>    &Notify("Did not log in as Administrator.");
> }
> ------------------------------------------------------------------
>
> The script always returns the user name I am logged in as (rather than
> Administrator) along with 'Did not log in as Administrator' indicating that
> Administrator level login was not successfull.
>
> Testing using an SU tool shows that the operating system and (Windows NT 4.0)
> and Sudo Users are set up correctly to run processes with Administrator
> priviledges.
>
> Can anyone figure out why this does not log me in as Administrator?
> Also, how can I tell from Perl wether the user has the appropriate rights to
> use the Win32::AdminMisc::LogonAsUser function?
>
> Any help would be greatly appreciated.
>
> Regards.



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

Date: Sun, 04 Jun 2000 08:20:04 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: Win32::Eventlog
Message-Id: <393A4974.FA45E82F@patriot.net>

Try adding '&' before the barewoord [sic]

Eli Mansour wrote:

> Still can't get it straight. My syntax is like yours and here is the error
> Message
> Barewoord "EVENTLOG_ERROR_TYPE" not allowed while "strict subs"
> in use
>
> what in the world am I doing wrong ?
>
> Eli
>
> jason wrote:
>
> > Eli Mansour writes ..
> > >Can somebody give me an example of writing an error to
> > >to NT eventlog.
> > >
> > >I can' seem to get the syntax straight.
> >
> > the following code will work with my EventLog.pm .. but from memory I
> > had to change a couple of things in the Report method because they were
> > set up more for reading from the event log rather than writing to it
> > (from memory the Source element of the hash was incorrectly implemented)
> >
> > let me know how the following code goes because I'd be surprised if
> > EventLog wasn't fixed up - the code below certainly works with (what I'm
> > fairly sure is) a fresh installation of v5.6
> >
> > #!/usr/bin/perl -w
> > use strict;
> >
> > use Win32::EventLog;
> >
> > my $ref = new Win32::EventLog( 'my app', 'fire');
> >
> > Win32::EventLog::Report( { Computer => $ENV{COMPUTERNAME}
> >                , Source => 'my application'
> >                , EventType => EVENTLOG_WARNING_TYPE
> >                , EventCategory => 0
> >                , EventID => 0
> >                , Data => ''
> >                , Strings => 'Something new here'
> >                }
> >              );
> >
> > __END__
> >
> > --
> >  jason - elephant@squirrelgroup.com -



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

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


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