[7250] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 875 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 15 16:17:37 1997

Date: Fri, 15 Aug 97 13:00:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 15 Aug 1997     Volume: 8 Number: 875

Today's topics:
     Re: "Powered by Perl" logo found. Details inside. (Matthew Burnham)
     Re: ** redirection question. ** (Terry Michael Fletcher - PCD ~)
     Re: a perl4 question (Andrew Dalke)
     Auto proxies config with Netscape browser <pascal_amram@ml.com>
     Re: Can you stop this leak?? (Ilya Zakharevich)
     Re: changing perl to gibberish (Matthew Burnham)
     Re: File Locking... (Tad McClellan)
     Re: File Locking... <mturk@westonia.com>
     Re: Help with a Password Script (Matthew Burnham)
     Re: How can I send data to printer (Matthew Cravit)
     Re: How can I send data to printer <henryto@ix.netcom.com>
     Re: How can I send data to printer (Matthew Cravit)
     Re: How do you determine program runtime? (Matthew Burnham)
     How to fix "Can't locate Curses.pm in @INC" <kerr_tung@sdt.com>
     Re: How to fix "Can't locate Curses.pm in @INC" (Tad McClellan)
     Re: incredibly simple question (Mike Stok)
     Re: incredibly simple question (Tad McClellan)
     Re: Is there a perl IDE? (Matthew Burnham)
     Re: Is there a perl IDE? (Matthew Burnham)
     Newbie-type question <jeffbell@uu.net>
     Re: Newbie-type question (Matthew Cravit)
     Re: NT File Permission Assignment <bleasdes@kochind.com>
     Re: perl and oracle server <tw36027@glaxowellcome.com>
     Re: perl and oracle server (Christian Roy)
     Re: Perl Interface to /etc/passwd (Matthew Burnham)
     perl question ptrainor@aura.title14.com
     Re: perl question (Matthew Cravit)
     Re: perl question <rootbeer@teleport.com>
     Re: perl5 regexes slower than perl4? (Andrew Dalke)
     Q: find my own IP address, not 127.0.0.1 (Michael W. J. West)
     Re: Q: find my own IP address, not 127.0.0.1 (Mike D. Kail)
     Re: Server Push in Perl??? (Matthew Burnham)
     The CGI & PERL Discussion Forum Here! nospam@this.address
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 14 Aug 1997 17:11:55 GMT
From: danew@enterprise.net (Matthew Burnham)
Subject: Re: "Powered by Perl" logo found. Details inside.
Message-Id: <33f40dea.3166547@news.enterprise.net>

"Richard K. Downer" <rkd7949@ballard.ca.boeing.com> wrote:

>Hmmmm.... It says on this web site that "O'Reilly said we can't use
>camels on this site... So we use Rhinos." How many people think of Perl
>when they see a Rhino?
How many people WANT to think of Perl when they're on Safari, whatever
animal it is they can see? ;)



-- 
Matthew Burnham         | danew@enterprise.net
Manager, MindWeb        | http://www.mindweb.co.uk/
Web design and hosting  | UKP24/Mb/Year for DIY space
WWW, FTP, CGI scripting, mailing lists, autoresponders and more!


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

Date: 15 Aug 1997 18:21:29 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: ** redirection question. **
Message-Id: <5t26n9$pdg$1@news.fm.intel.com>

Tom Phoenix (rootbeer@teleport.com) so eloquently and verbosely pontificated:
> On Fri, 8 Aug 1997, e.joel.hall wrote:
> 
> > you cannot have perl output:
> > Location: document.html#internal_link
> > to make it go to an internal link within that document.  That doesn't
> > work at all.

strange.  even though this is an HTML/CGI problem, i dont see why it is a
problem.  i have had no problem doing that before, or even:

print "Location: document.html?$some_query_string\n\n";
# or
print "Location: document.html#$some_name_ref\n\n";

there must be something else wrong.

--
               "Give me ambiguity or give me something else."
 ______                       ______ _               _               
(_) |                        (_) |  | |             | |              
    | _   ,_    ,_              _|_ | |  _ _|_  __  | |     _   ,_   
  _ ||/  /  |  /  |  |   |     / | ||/  |/  |  /    |/ \   |/  /  |  
 (_/ |__/   |_/   |_/ \_/|/   (_/   |__/|__/|_/\___/|   |_/|__/   |_/
*+*+*+*+*+*+*+*+*+*+*+* /| *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+* 
                        \|    tfletche@pcocd2.intel.com
*+*+*+*+*+ Views expressed...not INTeL's...yadda yadda yadda.... *+*+*+*+*+*





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

Date: 15 Aug 1997 19:14:13 GMT
From: dalke@ks.uiuc.edu (Andrew Dalke)
Subject: Re: a perl4 question
Message-Id: <5t29q5$o1q$2@vixen.cso.uiuc.edu>

Randal Schwartz <merlyn@stonehenge.com> said:
> Perl 4.  Just Say No.

But in a parallel thread ("perl5 regexes slower than perl4?") I
showed that for the task I need, perl5 regex searches are between
1.4 to 5.6 times slower than the exact same script in perl4.  In
the worst case, perl4 took about 6 minutes while perl5 took a bit
over half an hour.

So how about "Perl 4.  Nearly Always Say No" :)

						Andrew Dalke
						dalke@ks.uiuc.edu


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

Date: Fri, 15 Aug 1997 19:15:34 +0200
From: Pascal AMRAM <pascal_amram@ml.com>
Subject: Auto proxies config with Netscape browser
Message-Id: <33F48EB6.2F41A582@ml.com>

How can i setup an automatic proxy configuration with a netscape
browser, a IIS server AND PERL ?
Have you some scripts example for NT please ? or help ....

Many thanks for your help



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

Date: 15 Aug 1997 17:39:16 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Can you stop this leak??
Message-Id: <5t2484$t74@agate.berkeley.edu>

In article <jgibb-1508970924110001@news.rrnet.com>,
Jason A. Gibb <jgibb@rrnet.com> wrote:
> The problem - An apparent memory leak in a non-forking perl chat server.
> Every new client that connects increases sz by 1-2K, but this memory is
> never released.
> 
> The diagnosis - My guess is that a new chatter object is being created by
> Chatter->new() but is never actually destroyed when the client disconnects.
> To test this theory I added a DESTROY method to print a message to stderr,
> but it never gets called. Why this would be happening, I couldn't say.
> my @chatters;
> while(@ready = $select->can_read) {
>          Chatter->new($new_socket, $select, \@chatters);

You use `new' in void context.  Do not.

> }
> package Chatter;
> 
> sub new {
>    my($class,$socket,$select,$chatters) = @_;
>    my $self = {   'socket' => $socket,
>                'select' => $select,
>                'chatters' => $chatters };
>    bless $self,$class;
>    $chatters->[$socket->fileno] = $self;

You put the newly created object in global variables.  Do not.

>    $self->select->add($socket);
>    $self->ask_for_handle;
>    return $self;
> }

Hope this helps,
Ilya



























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

Date: Thu, 14 Aug 1997 17:13:05 GMT
From: danew@enterprise.net (Matthew Burnham)
Subject: Re: changing perl to gibberish
Message-Id: <33f9126c.4320088@news.enterprise.net>

Phil Carmody <pc1@scigen.co.uk> wrote:

>Victor Magdic wrote:
>> 
>> Does anyone know if there are any programs that will take perl source
>> and scramble it into gibberish, so that it is effectively unreadable
>> (i.e. human readable variable names are converted to strings of
>> letters+numbers, spaces compacted etc.)
>
>Russ Allbery does, see his .sig -
>
>#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
>$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ >
>0gFzDgD,
> 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e
>0.),01,pnn,y{
>rw} >;,$0=q,$,,($_=$^)=~y,$/
>C-~><@=\n\r,-~$:-u/#y,d,s,(\$.),$1,gee,print

Huh? Running that gives:

#!utrquahmuodqk/--/Qtrr/@kkadqy,/Itrs/@mnsgdq/Odqk/G`bjdq u0]<p:]:,
00<p, 0,,( 0
^< 0])<~y, 0u "B-~=;?<[m[q,-~ 00tu "#y,c,r,([0.),01,fdd,oqhms u


-- 
Matthew Burnham         | danew@enterprise.net
Manager, MindWeb        | http://www.mindweb.co.uk/
Web design and hosting  | UKP24/Mb/Year for DIY space
WWW, FTP, CGI scripting, mailing lists, autoresponders and more!


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

Date: Fri, 15 Aug 1997 08:52:48 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: File Locking...
Message-Id: <gvm1t5.403.ln@localhost>

David Mellors (dgm@globalnet.co.uk) wrote:
: Does perl automatically lock files when writing to them?

Nope.


: If not, can anyone supply information on the best way of locking files
: using Perl running under Linux and BSDI.

flock()

There are three Frequently Asked Questions about file locking in the
Perl FAQ, part 5...



: Many Thanks

You're welcome.


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Fri, 15 Aug 1997 14:57:32 -0400
From: Mike Turk <mturk@westonia.com>
Subject: Re: File Locking...
Message-Id: <33F4A69C.7333@westonia.com>

David Mellors wrote:
> 
> Does perl automatically lock files when writing to them?
> If not, can anyone supply information on the best way of locking files
> using Perl running under Linux and BSDI.
> 
> Many Thanks
> 
> Dave Mellors
> dgm@globalnet.co.uk

There is a function called flock.
Info on this can be found at
http://www-ns.rutgers.edu/doc/perl/pod/perlfunc.html

Mike Turk
mturk@westonia.com


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

Date: Thu, 14 Aug 1997 17:12:07 GMT
From: danew@enterprise.net (Matthew Burnham)
Subject: Re: Help with a Password Script
Message-Id: <33f50e52.3270098@news.enterprise.net>

Dominic Wen <g4dom@cdf.toronto.edu> wrote:

>How are you going
>to allow the web server to access the system's password file, which only
>'root' has privilege to?

chmod it to 777 :)



-- 
Matthew Burnham         | danew@enterprise.net
Manager, MindWeb        | http://www.mindweb.co.uk/
Web design and hosting  | UKP24/Mb/Year for DIY space
WWW, FTP, CGI scripting, mailing lists, autoresponders and more!


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

Date: 15 Aug 1997 17:52:02 GMT
From: mcravit@shell3.ba.best.com (Matthew Cravit)
Subject: Re: How can I send data to printer
Message-Id: <5t2502$7ge$1@nntp1.ba.best.com>

In article <33F44EBA.686@ix.netcom.com>,
Henry J. Torralvo <henryto@ix.netcom.com> wrote:
>I am new to perl, I would like to know how to make perl send the data to
>printer.

You haven't given enough information to answer this question. You need to
be more specific about:

	* what OS you're using
	* what kind of data (text/graphics/???)
	* what kind of printer

To print stuff to a UNIX printer, for example, you could do something like:

    open PRINTER, "|/bin/lp -dprinter" or die "Could not open printer: $!\n";
    print PRINTER "This is some data\n";
    print PRINTER "Here's some more.\n";
	close PRINTER;

Hope this helps; if not, provide some more detail about exactly what you're
trying to do, and maybe someone else can help.

/MC

--
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

Date: Fri, 15 Aug 1997 14:44:54 +0000
From: "Henry J. Torralvo" <henryto@ix.netcom.com>
Subject: Re: How can I send data to printer
Message-Id: <33F46ABB.7743@ix.netcom.com>

Matthew Cravit wrote:
> 
> In article <33F44EBA.686@ix.netcom.com>,
> Henry J. Torralvo <henryto@ix.netcom.com> wrote:
> >I am new to perl, I would like to know how to make perl send the data to
> >printer.
> 
> You haven't given enough information to answer this question. You need to
> be more specific about:
> 
>         * what OS you're using
>         * what kind of data (text/graphics/???)
>         * what kind of printer
> 
> To print stuff to a UNIX printer, for example, you could do something like:
> 
>     open PRINTER, "|/bin/lp -dprinter" or die "Could not open printer: $!\n";
>     print PRINTER "This is some data\n";
>     print PRINTER "Here's some more.\n";
>         close PRINTER;
> 
> Hope this helps; if not, provide some more detail about exactly what you're
> trying to do, and maybe someone else can help.
> 
> /MC
> 
> --
> Matthew Cravit, N9VWG               | Experience is what allows you to
> E-mail: mcravit@best.com (home)     | recognize a mistake the second
>         mcravit@taos.com (work)     | time you make it.


Matthew,

my OS is MSDOS, the data is text and the printer Epson dot matrix.

Thanks

Henry


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

Date: 15 Aug 1997 19:45:26 GMT
From: mcravit@shell3.ba.best.com (Matthew Cravit)
Subject: Re: How can I send data to printer
Message-Id: <5t2bkm$99t$1@nntp1.ba.best.com>

In article <33F46ABB.7743@ix.netcom.com>,
Henry J. Torralvo <henryto@ix.netcom.com> wrote:

>my OS is MSDOS, the data is text and the printer Epson dot matrix.

I don't use DOS anymore, really, but if I recall correctly, something like
this might work:

    # Substitute LPT1, LPT2 or whatever as appropriate
    open (PRINTER, ">>PRN") or die "Could not open printer: $!\n";
	print PRINTER "Here's some data\n";
	print PRINTER "Here's more\n";
	close PRINTER;

/MC
	
--
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

Date: Thu, 14 Aug 1997 17:13:27 GMT
From: danew@enterprise.net (Matthew Burnham)
Subject: Re: How do you determine program runtime?
Message-Id: <33fa145f.4819353@news.enterprise.net>

ils@pipcom.com (Scott Card) wrote:

>How can i determine the running time of a program?
>
>I have a cron cgi program and need to know exactly how many
>milliseconds it runs until it terminates.

In a similar vein, is there a way to stop a program after x minutes (or
seconds).



-- 
Matthew Burnham         | danew@enterprise.net
Manager, MindWeb        | http://www.mindweb.co.uk/
Web design and hosting  | UKP24/Mb/Year for DIY space
WWW, FTP, CGI scripting, mailing lists, autoresponders and more!


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

Date: Fri, 15 Aug 1997 12:27:47 -0500
From: Kerr Tung <kerr_tung@sdt.com>
Subject: How to fix "Can't locate Curses.pm in @INC"
Message-Id: <33F49193.3FA9@sdt.com>

Hi all,

I downloaded perlmenu.v4.0 and tried to run the demo program, got the
following error message:

Can't locate Curses.pm in @INC at demo line 23.
BEGIN failed--compilation aborted at demo line 23.

Maybe the perl v5.003 was not installed correctly. What is missing. How
do I fix this?

Thanks,
Kerr


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

Date: Fri, 15 Aug 1997 14:08:38 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How to fix "Can't locate Curses.pm in @INC"
Message-Id: <mf92t5.l06.ln@localhost>

Kerr Tung (kerr_tung@sdt.com) wrote:

: I downloaded perlmenu.v4.0 and tried to run the demo program, got the
: following error message:

: Can't locate Curses.pm in @INC at demo line 23.
: BEGIN failed--compilation aborted at demo line 23.

: Maybe the perl v5.003 was not installed correctly. 


Maybe. But that is not this problem. I don't believe that Curses.pm
is one of the standard modules that comes with the perl distribution.


: What is missing. 

Curses.pm  ;-)


: How
: do I fix this?


Go to

   http://www.perl.com/CPAN

And download the Curses perl module.

See the README that comes with it.


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 15 Aug 1997 18:04:24 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: incredibly simple question
Message-Id: <5t25n8$q1j@news-central.tiac.net>

In article <slrn5v8kht.aet.nicholas@neko.binary9.net>,
Nicholas J. Leon <nicholas@neko.binary9.net> wrote:

>>note that /^y+/i will allow them to enter anything beginning with a y and
>>succeed.
>
>Doesn't
>
>   $resp=~/^y+/i
>
>actually mean any number of "y"s?? Such as "yyyy" or "yyyyyyy", but
>not "yes". Wouldn't something like:

/^y+/i "means" match the beginning of the string followed by one or more
y characters in a case insensitive manner.  We haven't said anything about
what comes after the ys. "yes" does include the sequence <beginning of
string> <one or more y characters>.

  DB<1> $resp = 'yes'

  DB<2> print $resp=~/^y+/i
1

Mike




-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Fri, 15 Aug 1997 08:57:00 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: incredibly simple question
Message-Id: <c7n1t5.403.ln@localhost>

Nicholas J. Leon (nicholas@neko.binary9.net) wrote:
: >There's a space between = and ~ it's =~  You might want to say
: >
: >  chomp ($resp = <STDIN>);
: >  if (lc $resp qe 'y') {
: >    # that's Y or y
: >  }
: >  else {
: >    # it's not
: >  }
: >
: >note that /^y+/i will allow them to enter anything beginning with a y and
: >succeed.

: Doesn't

:    $resp=~/^y+/i

: actually mean any number of "y"s?? Such as "yyyy" or "yyyyyyy", but
: not "yes". Wouldn't something like:


but yes "yes"  ;-)

because it does indeed start with at least one 'y'...


: $resp=~/^y/i

: be more appopriate?


y


(that's at the beginning of the line, so it means: Yes, your suggestion
 would be more appropriate ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Thu, 14 Aug 1997 17:12:48 GMT
From: danew@enterprise.net (Matthew Burnham)
Subject: Re: Is there a perl IDE?
Message-Id: <33f7103c.3759818@news.enterprise.net>

"Oliver Weinitschke" <owl@iki.fi> wrote:

>The best IDE is probably Emacs, because it has code coloring and automatic
>indention (among other automations). Of course you'd need to learn emacs,
>which is not that easy.
How would I do colour highlighing with VB4? Is it possible with a normal
win95 text box?


-- 
Matthew Burnham         | danew@enterprise.net
Manager, MindWeb        | http://www.mindweb.co.uk/
Web design and hosting  | UKP24/Mb/Year for DIY space
WWW, FTP, CGI scripting, mailing lists, autoresponders and more!


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

Date: Thu, 14 Aug 1997 17:12:59 GMT
From: danew@enterprise.net (Matthew Burnham)
Subject: Re: Is there a perl IDE?
Message-Id: <33f810b3.3878951@news.enterprise.net>

scott@lighthouse.softbase.com (Scott McMahan) wrote:

>: Is perl not worthy of anything more robust that Notepad?
>I'm honestly stunned that anyone actually *USES* notepad.
>It's little more than a joke, a throwaway example of an
>edit control.
I've gone on to WordPad now because my mailserver script is too big for
notepad :-(



-- 
Matthew Burnham         | danew@enterprise.net
Manager, MindWeb        | http://www.mindweb.co.uk/
Web design and hosting  | UKP24/Mb/Year for DIY space
WWW, FTP, CGI scripting, mailing lists, autoresponders and more!


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

Date: Fri, 15 Aug 1997 13:33:37 -0400
From: Jefferson Bell <jeffbell@uu.net>
Subject: Newbie-type question
Message-Id: <33F492F1.41C67EA6@uu.net>

I'm writing a program and I have a line where I say (well, actually I
typed. not said):

    $studone[4]="$studone[4]".","."$adclassname";

meaning of course "take what's in studone[4] and concatenate (I think
that's the term) it with a , and another variable then assign it back to
studone[4].

Is there a way to say "if studone is empty than don't cat it with the
comma just the variabel?

I know you can use a standard if-then-elsif, but there has to be some
other way of doing it that won't take up three or four lines.  

Jeff

--
   Jefferson Eliot Bell
   jeffbell@UU.NET


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

Date: 15 Aug 1997 17:58:44 GMT
From: mcravit@shell3.ba.best.com (Matthew Cravit)
Subject: Re: Newbie-type question
Message-Id: <5t25ck$7jl$1@nntp1.ba.best.com>

In article <33F492F1.41C67EA6@uu.net>, Jefferson Bell  <jeffbell@uu.net> wrote:
>I'm writing a program and I have a line where I say (well, actually I
>typed. not said):
>
>    $studone[4]="$studone[4]".","."$adclassname";
>
>Is there a way to say "if studone is empty than don't cat it with the
>comma just the variabel?

I'd do it like this, myself:

	$studone[4] .= "," unless ($studone[4] eq undef);
	$studone[4] .= $adclassname;

Hope this helps.

/MC

--
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

Date: Fri, 15 Aug 1997 11:57:04 -0500
From: "Scott Bleasdell" <bleasdes@kochind.com>
Subject: Re: NT File Permission Assignment
Message-Id: <33f48ab9.0@146.209.16.197>

 Win32::FileSecurity

Kevin Genus wrote in article
<01bca98b$2c976980$a346788a@new.us.newbridge.com>...

>Is there are module or process that I can employ which will allow me to
>add/remove file and directory permissions from a perl script.
>
>I've got a file with various directories and permission schemes taken from
>a mac which are to be migrated to NT.  As of now, the files are:
>
>directory mac file permissions
>\\server\share\directory,fold file chg
>
>With what tools would one go about assigning these permissions?  My scripts
>are done, I need only add this to them.
>
>-Kevin Genus
>




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

Date: Fri, 15 Aug 1997 13:20:56 -0400
From: Thad Welch <tw36027@glaxowellcome.com>
To: Nicola Maderna <madernan@logica.com>
Subject: Re: perl and oracle server
Message-Id: <33F48FF8.7FFA6D5A@glaxowellcome.com>

Yes,

    Your right, you described the classic 3 tier approach.  The client
browser,
    doesn't need any Oracle products installed (No sqlnet or tnsnames).
The
    web page server machinge however does need
    Oracle sqlnet, library files, etc. to connect
    to your db server.   You need to install the following perl modules
on the web
    server machine to allow you to access Oracle from perl.

    Goto http://ftp.io.com/pub/mirror/CPAN/CPAN.html

    DBI - generic relational database interface.
    DBD::Oracle - access Oracle through DBI

Hope this gets you started ...

    Also, you will want the CGI module also, if you haven't already got
it.

Nicola Maderna wrote:

> Guess that I want to acces an oracle 7 dbase from some intranet pages.
>
>  I have 3 machines: a pc with a browser on, an HTTP server on a
> machine and
> a oracle server on the 3rd one.
> It's not a problem, right? since the browser is accessing the http
> server
> with a script that is accessing the DB client that is accesing the db
> server.
> is it right, or it doesn' t work like that?
>
> I hope someone can confirm it or tell me how it works.
>
> bye
> nicola
>
> madernan@logica.com





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

Date: Fri, 15 Aug 1997 18:19:56 GMT
From: roychri@total.net (Christian Roy)
Subject: Re: perl and oracle server
Message-Id: <33f49ccb.154125463@news.total.net>

On 15 Aug 1997 13:49:44 GMT, "Nicola Maderna" <madernan@logica.com>
wrote:

>Guess that I want to acces an oracle 7 dbase from some intranet pages.
> I have 3 machines: a pc with a browser on, an HTTP server on a machine and
>a oracle server on the 3rd one.
>It's not a problem, right? since the browser is accessing the http server
>with a script that is accessing the DB client that is accesing the db
>server.
>is it right, or it doesn' t work like that?
>I hope someone can confirm it or tell me how it works.
>

We are going to end up doing the same thing here.
I would say that you got it.
The DBClient will use ODBC to communicate to your Oracle DB.
ODBC can be use to communicate between two computers (HTTP server and
oracle server). You will need a ODBC driver and some other stuff to
make the ODBC connectivity to work. This is the most difficult part.
OpenLink software have drivers like that. But it cost money.
I haven't found any free oracle ODBC driver yet.

I haven't try any of the stuff I talk here with Perl.
I used C++ to communicate between 2 computer.
My c++ script was able to connect the the distant machine to get data
in the database. I guess you can do the same thing with Perl. You'll
need to use the ODBC module. I don't recall the exact name.




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

Date: Thu, 14 Aug 1997 17:11:28 GMT
From: danew@enterprise.net (Matthew Burnham)
Subject: Re: Perl Interface to /etc/passwd
Message-Id: <33f30cc0.2867904@news.enterprise.net>

xxbbell@voicenet.com (Bob) wrote:

>	I find this stuff very interesting.  If I understand you,
>because the salt varies, you run crypt on every word for each account.
>With a constant salt, you would run crypt on every word only once.
>Assume that the crypt routine takes some significant portion on time,
>this increases the amount of time to hack into one account in a list
>of accounts.
That's the way I understand now (thanks to everyone who's helped by
posting or mailing me - or both!)

>	I suppose this is getting off track, but how is this done in
>.htpasswd?  It contains just a username and encrypted text.  Unless...
>perhaps that encrypted text also has the salt (i.e., the first 4 (or
>any number) characters are the salt, or even the username itself is
>the salt)?
I think crypt automagically puts the salt in the first two chars of the
encrypted password (or at least htpasswd does - perhaps that's why my
scripts using crypt don't work with htpasswd? I'd better check,
anyway....) I think only the first two chars of the encrypted string are
used as the salt from what I've been told.



-- 
Matthew Burnham         | danew@enterprise.net
Manager, MindWeb        | http://www.mindweb.co.uk/
Web design and hosting  | UKP24/Mb/Year for DIY space
WWW, FTP, CGI scripting, mailing lists, autoresponders and more!


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

Date: Fri, 15 Aug 1997 12:42:03 -0600
From: ptrainor@aura.title14.com
Subject: perl question
Message-Id: <871666756.7680@dejanews.com>

where:

        if (&parse_input(*fields)) {
                $ADD=$fields{'ADD'};
                $SECTION=$fields{'SECTION'};
        }

        $a="SECT_" . $SECTION . "_CHOICES";

        print " \$a is $a <br>\n";

SECTION is passed as a 4 digit number.. like 0001 or 0003, etc..

when this perl script is run, it strangely yields:


$a is SECT_0004
$b is SECT_0004

        ..??? Why can't I (no matter how hard I try) make (in this
case):

a$ equal to: SECT_0004_CHOICES ??

tia!


pat
:)

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 15 Aug 1997 18:02:59 GMT
From: mcravit@shell3.ba.best.com (Matthew Cravit)
Subject: Re: perl question
Message-Id: <5t25kj$7lj$1@nntp1.ba.best.com>

In article <871666756.7680@dejanews.com>,  <ptrainor@aura.title14.com> wrote:
>where:
>        $a="SECT_" . $SECTION . "_CHOICES";
>
>        print " \$a is $a <br>\n";

Hmm...I just tried this, and got the following:

    $SECTION = "0004";
    $a       = "SECT_" . $SECTION . "_CHOICES";
    print "The value of \$a = $a\n";

    The value of $a = SECT_0004_CHOICES

What version of Perl are you using?

/MC

--
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

Date: Fri, 15 Aug 1997 11:35:24 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: ptrainor@aura.title14.com
Subject: Re: perl question
Message-Id: <Pine.GSO.3.96.970815112702.1951e-100000@julie.teleport.com>

On Fri, 15 Aug 1997 ptrainor@aura.title14.com wrote:

> Subject: perl question

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

>         if (&parse_input(*fields)) {

You should really use CGI.pm. It'll make your life easier. Among other
joys, it lets you easily debug your scripts from the command line.
 
>                 $ADD=$fields{'ADD'};
>                 $SECTION=$fields{'SECTION'};
>         }

> SECTION is passed as a 4 digit number.. like 0001 or 0003, etc..

Let's make sure of that. Add this code (for debugging purposes only). Does
it tell you anything interesting?

	if ($SECTION =~ /^\d\d\d\d$/) {
	    print "SECTION '$SECTION' is good.<br>\n";
	} else {
	    print "SECTION '$SECTION' has bad data!<br>\n";
	}

>         $a="SECT_" . $SECTION . "_CHOICES";
> 
>         print " \$a is $a <br>\n";
> 
> 
> when this perl script is run, it strangely yields:
> 
> 
> $a is SECT_0004

Where's the <br>? :-)  Let's look at the HTML output, rather than what the
browser does, so that we can get a better idea of what's really going on
in the script. Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 15 Aug 1997 19:03:34 GMT
From: dalke@ks.uiuc.edu (Andrew Dalke)
Subject: Re: perl5 regexes slower than perl4?
Message-Id: <5t2966$o1q$1@vixen.cso.uiuc.edu>

Ilya Zakharevich <ilya@math.ohio-state.edu> replied to my question
about the speed difference between perl4 and perl5 regex searches:
> A table of $&/no-$& vs. perl5/perl4 would be handy to
> recognize problems.

The times I got when I tested $&/no-$& were not enough to suggest
that this was warrented.  I tried to build the table of this just
now but because the machine usage and network traffic is higher
than when I did the first batch last night, the numbers are noisy
and thus hard to compare, so I can't generate the list.

> From your table it looks like 300000 iterations gives pretty
> good view of things, so you do not need to vary this number.

I think I see where a point of confusion might be.  I am not
doing 300,000 iterations of the same string.  I generated a
string of length 300,000 letters and tested each of the 1,000
or so regexs against it once, one at a time.  A better
description is:

  generate string of length N
  start timing
  for each regex from a file
    while that regex matches the string
      print the match position
  end timing

> Also the exact version of Perl would be interesting. 

  More than was in the original post?
: I tested perl5.004 regex speed against perl4.036 

No, I have not yet compiled 5.004_1 or later .

> You problem is that you recompile your RE each time in the loop, and
> the compilation time *is* going to be slower and slower as new
> optimizations are enabled.  It may be feasible to autogenerate a giant
> body of while(<>) loop and evaluate it.  This would allow running your
> RE without recompilation.

  That doesn't sound right for my case.  There should be roughly
a two-step process; 1) compile the regex and 2) evaluate against
the string.
  All of the compilations should take comperable time, which
accounts for a constant initialization time.  What is left is the
evaluation time, which should optimally grow linearly with string
size.
 (proof: the regexs I used can be implemented as a DFA without
cycles so any test should take less than a fixed time.  There are
R regexs so if T is the max time for any regex then the string
starting at position i takes at most R*T time.  In a string of
size N there are N possible start positions so the total time is
proportional to N.  See, that automata theory class was good for
something after all.  :)

  By this model the times should be described by a simple function:

   time = startup time + evaluation speed * string size

Mapping that to the data in the table I posted you can see it
grows linearly with the string length over a wide range.

(gratuitous gnuplot of the perl4 times shown here)
Time in seconds
   1000 ++-+---+-++--+----+-++--+---+-++--+---+-++--+----+-++--+---+-++
        +         +          +         +         +          +         +
        +                                                             A
        +                                                           **+
        +                                                         **  +
    100 ++                                                       A   ++
        +                                                      **     +
        +                                                    **       +
        +                                                  *A         +
        +                                                **           +
        |                                              **             |
     10 ++                                           *A              ++
        +                                          **                 +
        +                                        A*                   +
        +                                      **                     +
        +                                    **                       +
      1 ++                                **A                        ++
        +                            **A**                            +
        A*********A****A*****A****A**                                 +
        +                                                             +
        +                                                             +
        +         +          +         +         +          +         +
    0.1 ++-+---+-++--+----+-++--+---+-++--+---+-++--+----+-++--+---+-++
        1        10         100      1000      10000     100000     1e+06
                               String length

and an eyeball fit shows it is roughly

     time(perl4) = 0.45sec + (string size / 2800) sec

Hence the problem cannot be the regex compliation times as all of that
takes less than half a second.

BTW, the equation for perl5 is roughly

     time(perl5) = 0.66sec + (string size / 1600) / sec

OTOH, if we really are talking about different things and you think
that I'm doing:

  generate string of length 3000
  start timing
  foreach i in (1, 3, 10, 30, 100, 300, 1000, 3000, 10000, ..., 1000000)
    open file
    foreach regex in file
      while regex matches string
        print info about the match
    close file
  end timing

Then yes, building a loop with the regex's compiled in would
improve performance since that 0.45 seconds would only done once.
But I'm not doing that.



  The end result of all this is:  I can understand why regex
compilation might be slower in perl5 - more optimizations and
capabilities are added over perl4's - but why should the evaluation
time be slower?  Is there too much `N' in perl5's NFA so more
backtracking is done?

						Andrew Dalke
						dalke@ks.uiuc.edu


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

Date: 15 Aug 1997 12:46:50 -0600
From: mwest@nyx.cs.du.edu (Michael W. J. West)
Subject: Q: find my own IP address, not 127.0.0.1
Message-Id: <5t286q$lc2@nyx.cs.du.edu>


How can I use perl to figure out my (single session ISP-assigned PPP) 
IP address as known to the outside world?  (This is needed so that the 
outside world can contact my Apache server when I am on-line.)

The faq suggests: 

"The Sys::Hostname module (part of the standard perl distribution) will 
give you the hostname after which you can find out the IP address 
(assuming you have working DNS) with a gethostbyname call. 

    use Socket;
    use Sys::Hostname;
    my $host = hostname();
    my $addr = inet_ntoa(scalar(gethostbyname($name)) || 'localhost');
"

However, that simply tells me that my IP is 127.0.0.1 !  
That is my loopback, but not the IP for Apache as viewed 
by the outside world.

Perhaps as a novice, I set up the loopback wrong?  But I can typically
get the right info from 'netstat', however I would rather not parse that
if there is an easier way.

Regards, Mike West mwest@nyx.net



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

Date: 15 Aug 1997 19:07:40 GMT
From: mdkail@fv.com (Mike D. Kail)
Subject: Re: Q: find my own IP address, not 127.0.0.1
Message-Id: <slrn5v9adk.dhr.mdkail@dime.fv.com>

On 15 Aug 1997 12:46:50 -0600, Michael W. J. West <mwest@nyx.cs.du.edu> wrote:
>
>How can I use perl to figure out my (single session ISP-assigned PPP) 
>IP address as known to the outside world?  (This is needed so that the 
>outside world can contact my Apache server when I am on-line.)
[...]
>However, that simply tells me that my IP is 127.0.0.1 !  

fix the following line

	my $addr = inet_ntoa(scalar(gethostbyname($name)) || 'localhost'); 
                                              ^^^^^

should be $host


-- 
/*-------------------------------------------------------------*/
/*  Mike D. Kail                    |  voice:  (619) 350-3524  */
/*  Unix System Architect           |  fax:    (619) 793-2950  */
/*  FIRST VIRTUAL Holdings Inc.     |  e-mail: mdkail@fv.com   */
/*-------------------------------------------------------------*/



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

Date: Thu, 14 Aug 1997 17:12:28 GMT
From: danew@enterprise.net (Matthew Burnham)
Subject: Re: Server Push in Perl???
Message-Id: <33f60fa9.3613302@news.enterprise.net>

mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:

>>Try unbuffering the output: $| = '';
>Close, but...
>
>Set $| to a true value (conventionally 1) for unbuffered output.
>Setting a false value (such as '') sets buffered output.

I knew there was something odd about that when I wrote it! I couldn't
put my finger on it :-(

Thanks for the correction.



-- 
Matthew Burnham         | danew@enterprise.net
Manager, MindWeb        | http://www.mindweb.co.uk/
Web design and hosting  | UKP24/Mb/Year for DIY space
WWW, FTP, CGI scripting, mailing lists, autoresponders and more!


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

Date: Fri, 15 Aug 1997 19:16:31 GMT
From: nospam@this.address
Subject: The CGI & PERL Discussion Forum Here!
Message-Id: <33fea89d.1919944@news.enterprise.net>

Hi,

For any questions regarding CGI & PERL, why not post them at the 
Programming discussion forum? 

http://www.bitsmart.com/sas

You may well increase the chances of your questions being answered.

Please pass the word around and lets see if we can all help each
other.
		
Regards

Toto shootem@hotmail.com




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

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

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