[8308] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1925 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 18 21:17:46 1998

Date: Wed, 18 Feb 98 18:00:37 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 18 Feb 1998     Volume: 8 Number: 1925

Today's topics:
        '.db' file extension automatic with dbmopen() ? (dk smith)
    Re: ANNOUNCE: IndexMaker 4.1: an index.html maker from  (ShadowMAC Administrator)
    Re: Apache server not recognising perl scripts in cgi-b <ric@megsinet.net>
    Re: calling a java applet from perl (Jonathan Feinberg)
    Re: calling a java applet from perl scott@softbase.com
    Re: Displaying Integers (Martin Vorlaender)
    Re: Displaying Integers <ludlow@us.ibm.com>
    Re: Displaying Integers (Jonathan Feinberg)
        Eval subroutines left afterwards: BUG or FEATURE? (Taylor Gautier)
    Re: Eval subroutines left afterwards: BUG or FEATURE? (Jonathan Feinberg)
    Re: FAQless Forays (was: Code Example Needed) (Craig Berry)
        Help Need ASAP! <srod@fedex.com>
    Re: HTTP_USER_AGENT List? (Jonathan Feinberg)
        I want to buy a message board!!! <rickryan@datrixnet.com>
        if you're going to answer FAQs, mark them as such (was  <Russell_Schulz@locutus.ofB.ORG>
    Re: internet:clearing user login data and forcing relog <xxTony.Curtis@vcpc.univie.ac.at>
    Re: keypressed <tchrist@mox.perl.com>
    Re: Killfile Triage <gberigan@cse.unl.edu>
    Re: Newbie question:  script directory (Martin Vorlaender)
    Re: Newbie question:  script directory (Jonathan Feinberg)
    Re: on reading FAQs and gurus answering questions (Rev Zoweee Wow KSC DFC )
        opengl module setup problem:  symbol not found <drk@rpisun1.mdacc.tmc.edu>
        Opinions about SWIG? (Stuart McDow)
        Problem with CGI script and sockets (Ronan Cremin)
    Re: Problem with CGI script and sockets (Jonathan Feinberg)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 18 Feb 1998 13:08:55 -0800
From: dks@mediaweb.com (dk smith)
Subject: '.db' file extension automatic with dbmopen() ?
Message-Id: <dks-1802981308550001@tulini.mediaweb.com>


In general, if Berkley DB is explicitly included with,

   use DB_File;

and then a subsequent call to dbmopen occurs like this,

   dbmopen( %DB, "/etc/aliases", undef);

isn't the ".db" extension appended to the filename? So
in this case the file name is actually:

   /etc/aliases.db

Are there cases when this is not true? I'm running on Solaris 2.5.1, Perl
5.004_03. Would gladly read yet another document if directed.

Thanks,
dk smith

-- 
DK Smith                                  MediaWeb, Inc.
dks@mediaweb.com                          Mountain View, CA, USA
======================================>>> http://www.mediaweb.com
Quality Web Hosting, Excellent Rates                 


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

Date: Wed, 18 Feb 1998 01:03:33 -0600
From: admin1@ShadowMAC.org (ShadowMAC Administrator)
Subject: Re: ANNOUNCE: IndexMaker 4.1: an index.html maker from PDF,HTML,VRML and other files
Message-Id: <admin1-ya02408000R1802980103330001@news.winternet.com>

In article <6caqug$lk3$1@client3.news.psi.net>, abigail@fnx.com wrote:

> ++ I'm afraid I broke when testing it on an HTML frameset with a <TITLE>
> ++ in the NOFRAMES block.  Now you might say that one would'nt normally
> ++ do that but the piece of HTML was an example from Netscape soooo..

> Hahahahhahhahahahahhaha. That the piece of HTML was an example
> from Netscape says enough. Netscape doesn't consider standards
> something to worry about. I've yet to see a Netscape product that
> can parse HTML 2.0, (current practise of half a year before the
> first Netscape beta became available).
> 
> I'd rather go to Microsoft to learn about Perl and Unix than
> to Netscape to learn about HTML.

  Yeah right'o!

  Learn from Microsloth, people who say military intelligence is a
contridiction in terms obviously have never dealt with Microsloth.  But
then again, it must be nice to have the privilage of being a beta tester
for Microsloth every time they put out a package, esp when people beta for
other companies they get compensated for the testing hassles they go
thru...  unlike MS, heck, Explorer can't even send files properly when
uploading, without having to resort to customizing your file processor just
for Explorer.

  Not saying that Netscape doesn't need to learn some elementary lessons
either, but to use MS as an example is really low!


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

Date: Wed, 18 Feb 1998 10:56:06 -0600
From: Ricky <ric@megsinet.net>
To: Gilles Chong <glchy@csah.com>
Subject: Re: Apache server not recognising perl scripts in cgi-bin
Message-Id: <34EB12A6.53A974FF@megsinet.net>

that happened to me on my apache server, but my problem was me.  after
looking over my script a thousand times, i FINALLY realized that i
didn't have the little leading / before the usr. i had

#!usr/local/bin/perl

of course this could be completely irrelevant to your situation since i
have no idea what your script looks like, but usually i find that when
something is really supposed to work, it doesn't because of some stupid
little detail i missed.  all i can say is check your script super good.
if no problems, then the previous post before mine is totally right -
post in the correct group.



Gilles Chong wrote:

> Hi,
> im getting some kinda hair-pulling prob here.
> My apache server is not recognising my perl script as an 'executable',
>
> i.e not running it. The browser merely display the perl script code
> (i.e
> like any other text file).
> Ive checked the config files for apache, all the cgi-bin dir
> references
> are correct. Ive restarted the server many times. My perl compiler
> (perl5.003) is working perfectly as well. I am guessing that the
> problem
> comes from the server.
> Any of u guys n gals came across tt prob before?
> Any suggestions, pls email me directly.
> Cheers
>
> G.
> --
> Gilles Chong (glchy@csah.com, glchy@csa.com.sg)
> Systems Engineer, Internet Division
> CSA Holdings Ltd, Singapore.





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

Date: Wed, 18 Feb 1998 13:43:14 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: calling a java applet from perl
Message-Id: <MPG.f54f5cfc65caae09896fd@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

djd@saul7.u.washington.edu said...
: I have inherted some perl code that displays a list of data and a few radio 
: buttons. It uses perlcgi. 
                   ^^^^^^^
I don't know what that is.

: I have another perl script that will print out 
: which radio button they selected and which list (checkboxes) items they 
: selected. What would really help is if I could then pass these data values 
: to a java applet I have, which would then plot out the required data.

I think that the difficulties you face are related not to the Perl language 
per se (which is what this group is for), but rather to a bunch of other 
concepts including, but not limited to: the relationship between a java applet 
and the server on which it resides; the way CGI works; the way httpd works; 
the way servers are configured, etc.  Since you seem inclined to do some 
research on your own, you'll enjoy the following list of resources that'll 
help you get to where you're going.  Good luck!

[This list courtesy of Tom Christiansen.]

    CGI FAQ
        http://www.webthing.com/page.cgi/cgifaq

    The CGI Newsgroup (NOT THIS ONE):
        comp.infosystems.www.authoring.cgi

    CPAN's Web-related modules in Perl:
http://www.perl.com/CPAN/modules/by-category/15_World_Wide_Web_HTML_HTTP_CGI/

    The Idiot's Guide to solving Perl/CGI problems 
        http://www.perl.com/perl/faq/idiots-guide.html

    Perl FAQs
        http://www.perl.com/CPAN/doc/FAQs/

    Perl Manpages (old)
        http://www.perl.com/CPAN/doc/manual/html/

    WWW Security FAQ
        www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html

    Web FAQ
        http://www.boutell.com/faq/

    HTTP Spec
        http://www.w3.org/pub/WWW/Protocols/HTTP/

    HTML Spec
        http://www.w3.org/pub/WWW/MarkUp/

    CGI Spec
        http://hoohoo.ncsa.uiuc.edu/cgi/interface.html

-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: 18 Feb 1998 18:42:22 GMT
From: scott@softbase.com
Subject: Re: calling a java applet from perl
Message-Id: <6cfa2e$cdj$1@mainsrv.main.nc.us>

David Doll (djd@saul7.u.washington.edu) wrote:


> I have inherted some perl code that displays a list of data and a few radio 
> buttons. It uses perlcgi. I have another perl script that will print out 
> which radio button they selected and which list (checkboxes) items they 
> selected. What would really help is if I could then pass these data values 
> to a java applet I have, which would then plot out the required data.

The easiest solution is to have the Perl script generate an HTML
page as output. On that page, it can code the HTML for the
<applet> tag, and supply any parameters to the Java applet that
are needed.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: Wed, 18 Feb 1998 20:47:49 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Displaying Integers
Message-Id: <34eb3ae5.524144494f47414741@radiogaga.harz.de>

Ovanes Manucharyan (olm@mail1.csun.edu) wrote:
: I have a quick question.  How can I force an integer to print with 2
: digits, instead of one.
: Lets say I have numbers 0, 1, 3, 14..    How can I make them print  00,
: 01, 03, 14
: Any reference would be appreciated.

perldoc -f printf

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Wed, 18 Feb 1998 12:42:54 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Displaying Integers
Message-Id: <34EB2BAE.2C6C@us.ibm.com>

Ovanes Manucharyan wrote:
> 
> I have a quick question.  How can I force an integer to print with 2
> digits, instead of one.
> Lets say I have numbers 0, 1, 3, 14..    How can I make them print  00,
> 01, 03, 14

#!/usr/bin/perl -w
$integer = 5;               # or whatever
print &add_zero($integer);  # Either prints "0" or ""
print $integer;             # prints your integer

sub add_zero {
    my($number) = @_;
    if ($number < 10) {
        return "0";
    }
    else {
        return "";
    }
}

--
James Ludlow (ludlow@us.ibm.com)
This isn't tech support, and all opinions are my own.


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

Date: Wed, 18 Feb 1998 14:46:52 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Displaying Integers
Message-Id: <MPG.f5504b8971df477989701@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

olm@mail1.csun.edu said...
: I have a quick question.  How can I force an integer to print with 2
: digits, instead of one.

: Any reference would be appreciated.

perldoc -f printf
perldoc -f sprintf

Hypothetical, totally random example:
   
    printf "%02d\n", $int;

-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: 18 Feb 1998 18:47:16 GMT
From: tgautier@monazite.geoworks.com (Taylor Gautier)
Subject: Eval subroutines left afterwards: BUG or FEATURE?
Message-Id: <6cfabk$c4$1@news>
Keywords: eval sub memory leak

I am using an eval to effect a "plugin" architecture, where I have 
modules defined as small snippets of code, using a well defined API
of subroutines to initialize, shutdown, and do other useful functions
within this architecture.

I have noticed that if a string that is eval'd contains subroutines in it,
these subroutines are generally available to the code that eval'd the 
string after the eval has finished (and also seems to cause memory leaks,
see bottom of post).

For instance:

[=====
$x = "sub doit { return \"hello\"; };";

eval $x;
print &doit(), "\n";
=====]

will print :
hello

to STDOUT.  

[Sidenote:  this same effect can also be created with the "do" function]

Initially I did not take advantage of this "feature", but I have now
realized that I *can* take advantage of it.  

I can eval the particular plugin code I am interested in running, 
and then run the subroutine right after that to get the results of the 
particular subroutine I wanted to run.  

Something like:

### Subroutine RunPlugin
sub RunPlugin {
  my ($routine, $code, @parameters)  = @_;
  
  # Actually, I take care to eval a bit of code that "blanks out" 
  # unwanted subroutines, by defining default (usually blank) versions
  # of all of the possible subroutines defined in the $code variable
  #
  # something like :
  #
  # eval $BLANK_CODE;
  #
  eval $code;
  if ($@) {
    $@ = "Error compiling routine";
    return;
  }

  return $routine->(@parameters);
}

My question is this:

Is this a BUG, or a FEATURE?  Because if it is a BUG I do not want to rely
on it.  If it is a FEATURE then great, but I suspect it is causing my
memory leaks, which leads into the second part of my question.

It seems that when I eval a string that contains subroutines, I generate a
memory leak, thus causing my program to grow to infinity and generally
upsetting the machine I am running my program on.

It seems that I am not the only one with this problem, as I noticed a post
in late 1997 on dejanews that alluded to the same problem (apparently
earlier memory leaks for versions <= 5.001 have been fixed, according to a
post in 1995 or 1996 by Larry Wall).

Does anyone have any [more] information regarding this subject?  

tg
_________________________________________________________________________
Taylor Scott Gautier                                tgautier@geoworks.com


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

Date: Wed, 18 Feb 1998 15:00:55 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Eval subroutines left afterwards: BUG or FEATURE?
Message-Id: <MPG.f55080067b88048989703@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

tgautier@monazite.geoworks.com said...
: I have noticed that if a string that is eval'd contains subroutines in it,
: these subroutines are generally available to the code that eval'd the 
: string after the eval has finished (and also seems to cause memory leaks,
: see bottom of post).

The *very first words* of the perldoc entry for the eval builtin are 

"EXPR is parsed and executed as if it were a little Perl program. It is 
executed in the context of the current Perl program, so that any variable 
settings or subroutine and format definitions remain afterwards."

-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: 18 Feb 1998 21:26:20 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <6cfjlt$8d2$1@marina.cinenet.net>

Randal Schwartz (merlyn@stonehenge.com) wrote:
: >> In comp.lang.perl.misc, cberry@cinenet.net (Craig Berry) writes:
: >> :Perl follows its normal rule -- using the number of list elements. 
: >> 
: >> There is no normal rule.  
: 
: Craig> Ack, walked right into that one.  OK, how about its 'usual'
: Craig> rule?  'Most common' rule?  'One-I've-actually-used-most-often'
: Craig> rule? :) Seriously, although it's utterly true that there's no
: Craig> universal rule for turning a list into a scalar,
: 
: There's not even a *rule* for turning a list into a scalar.
: 
: It can't happen.

OK, folks, that was my last fit of resistance.  In my former programming 
life, I approached learning languages by building up rules and patterns 
which I could apply in new situations.  I see the futility of that now.  
I have been assimilated.  I am Perl.(b)org.

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


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

Date: Wed, 18 Feb 1998 14:10:45 -0600
From: Savonnya rodrigues <srod@fedex.com>
Subject: Help Need ASAP!
Message-Id: <34EB4045.B0F1EC94@fedex.com>

Need to be able to do a function call in a Perl script to a C program. I
know someone told its not possible, but I am just asking. The program
that I am using is doing a function call in C to a C compiler. Is there
a way I could use a function call for Perl?


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

Date: Wed, 18 Feb 1998 13:35:47 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: HTTP_USER_AGENT List?
Message-Id: <MPG.f54f40e600663b09896fc@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

cbullock@newman.pcisys.net said...
: Some time back I recall seeing a list of all possibilities (or at least 
: the majority of possibilities) for HTTP_USER_AGENT values.  Does anyone 
: know if such a list still exists?

I'll bet lots of people know that stuff.  I'll bet they subscribe to Usenet 
newsgroups that discuss CGI, HTTP, and other such things.  On the other hand, 
this newsgroup exists solely for the discussion of Perl language issues.

[This list courtesy of Tom Christiansen.]

    CGI FAQ
        http://www.webthing.com/page.cgi/cgifaq

    The CGI Newsgroup (NOT THIS ONE):
        comp.infosystems.www.authoring.cgi

    CPAN's Web-related modules in Perl:
http://www.perl.com/CPAN/modules/by-category/15_World_Wide_Web_HTML_HTTP_CGI/

    The Idiot's Guide to solving Perl/CGI problems 
        http://www.perl.com/perl/faq/idiots-guide.html

    Perl FAQs
        http://www.perl.com/CPAN/doc/FAQs/

    Perl Manpages (old)
        http://www.perl.com/CPAN/doc/manual/html/

    WWW Security FAQ
        www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html

    Web FAQ
        http://www.boutell.com/faq/

    HTTP Spec
        http://www.w3.org/pub/WWW/Protocols/HTTP/

    HTML Spec
        http://www.w3.org/pub/WWW/MarkUp/

    CGI Spec
        http://hoohoo.ncsa.uiuc.edu/cgi/interface.html

-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: Wed, 18 Feb 1998 13:53:16 -0600
From: "Rick Ryan" <rickryan@datrixnet.com>
Subject: I want to buy a message board!!!
Message-Id: <6cfddk$45g@camel15.mindspring.com>

Does anyone have a message board (with source) for sale? I'd prefer
something stores messages in a database instead of text files.

Any ideas? How much?

--
Rick Ryan                   Web page  : www.datrixnet.com
Datrix                      Voice     : 615-822-7829
P.O. Box 2975               FAX       : 615-824-0943
Hendersonville, TN 37077    E-mail    : rickryan@datrixnet.com





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

Date: Wed, 18 Feb 1998 14:11:34 +0000
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: if you're going to answer FAQs, mark them as such (was Re: PerlShop)
Message-Id: <19980218.141134.0H1.rnr.w164w_-_@locutus.ofB.ORG>

tchrist@mox.perl.com (Tom Christiansen) writes:

>     The CGI Newsgroup (NOT THIS ONE):
>         comp.infosystems.www.authoring.cgi

[etc.]

does this list of resources need to be included in every followup?  is
there any header I can kill on to avoid seeing them over and over again?

note that the person posting them is NOT inexperienced.
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: 18 Feb 1998 17:56:47 +0100
From: Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at>
Subject: Re: internet:clearing user login data and forcing relogin?
Message-Id: <7xen10q2b4.fsf@beavis.vcpc.univie.ac.at>

Re: internet:clearing user login data and forcing relogin?,
Heidi <heidi.housten@edt.ericsson.data> said:

Heidi> I am trying to figure out how I can force a relogin
Heidi> if a user returns after a certain period of

I just get the feeling this is CGI...

Heidi> I was working on trying to pass the viewer through a
Heidi> cgi-script that checks their last access... The
Heidi> problem is: if I return a Status:401 the user is
Heidi> given a new login dialog box, they can cancel the box

This is a perl newsgroup, not a CGI-WWW-configuration one.

Please go to a more relevant newsgroup.

    news:comp.infosystems.www.authoring.cgi

thanks


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

Date: 18 Feb 1998 20:08:43 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: keypressed
Message-Id: <6cff4b$d2q$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, "Patrick.Husi" <internet@reimer.ch> writes:
:Is there a function in perl like keypressed in pascal, to check if the
:user has pressed any key?

Ok, class, where do you find a list of functions in perl?  
Would you believe the *perlfunc* manpage?  Did notice the
getc function?  Did you see what it said?  Have you looked at 
the perlfaq8 manpage?  Did you see what *it* said about these
things?  

In short, where did you look this up before posting?  It's
all in the standard manpages.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
> (It's sorta like sed, but not.  It's sorta like awk, but not.  etc.)
  Guilty as charged.  Perl is happily ugly, and happily derivative.
		--Larry Wall in <1992Aug26.184221.29627@netlabs.com>


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

Date: 18 Feb 1998 18:13:03 GMT
From: Greg Berigan <gberigan@cse.unl.edu>
Subject: Re: Killfile Triage
Message-Id: <6cf8bf$gb7$2@unlnews.unl.edu>

In news.software.readers, spt@cstr.ed.ac.uk (Richard Caley) wrote:
>@ (Bart Lateur) writes:

>> Did you know that over 95% of the spam I receive, does not include my
>> e-mail address, neither in the "To:" nor in the "cc:" field?

> Did you know that a significant proportion of the legitimate mail I
> recieve does not contain my address in the To: or Cc: fields?

Did you know that you can filter-in known, welcomed mailing list traffic,
which generally does not contain your e-mail address in the To or Cc
headers, before you filter-out messages that don't include your address
in those headers?  Presumably you know what legitimate mailing lists you
are subscribed to so that you can construct this filter.

-- 
         ,=<#)-=#  <http://incolor.inetnebr.com/wotw/> (The War of the Worlds)
    ,_--//--_,
 _-~_-(####)-_~-_  "Did you see that Parkins boy's body in the tunnels?" "Just
(#>_--'~--~`--_<#)  the photos.  Worst thing I've ever seen; kid had no face."


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

Date: Wed, 18 Feb 1998 21:19:50 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Newbie question:  script directory
Message-Id: <34eb4266.524144494f47414741@radiogaga.harz.de>

John O'Brien (jobrien@world.std.com) wrote:
: How do I find out what directory my perl script is executing in?
: Pointers to relevant FAQ's would be appreciated.

perldoc Cwd

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Wed, 18 Feb 1998 14:54:43 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Newbie question:  script directory
Message-Id: <MPG.f55068a1e73c23e989702@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

jobrien@world.std.com said...
: How do I find out what directory my perl script is executing in?
: 
: Pointers to relevant FAQ's would be appreciated.

There's been a thread about that very topic in this newsgroup within the last 
couple of days.  Go on over to 
 
    http://www.dejanews.com/

and search for the relevant keywords.  You'll want to set up a filter to only 
see articles from comp.lang.perl.misc.  DejaNews is a very powerful resource, 
and it's always worth checking.  I recommend setting "Results format" to 
"Threaded."

-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: 18 Feb 1998 04:33:00 GMT
From: zoweee@the.satanic.org (Rev Zoweee Wow KSC DFC )
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <887776330.126552@the.satanic.org>

Recently, Bart Lateur babbled the following koan:
: Randal Schwartz <merlyn@stonehenge.com> wrote:

: Just imagine what impression people that are relatively new to Perl and
: to this newsgroup must be getting. 40% of the posts (according to
: Randal's figures) are fames to newbies for (a) asking FAQ's and (b)
: posting in the wrong newsgroup.
: 
: We must look just like a bunch of old grumpy farts.

Not even remotely. Actualy, this is my very firstest time reading clpm (I 
just slogged through 300 messages), I came here hoping to read some *good*
perl and passively learn tips to hopefully improve my (currently abyssmal)
perl tactics.

And what I found doesn't sound like grumpy old farts, it sounds much like
me in my home ng... lamenting the kooks and spammers who seem to have
blown the signal-to-noise all to hell.

[To: merlyn] Damn, Randall (Mr. Schwartz??), I read your book and found it
to be one of, if not the, most enjoyable technical book reading experience
of my life. Proof that informative != boring by necessity.

Not only that, but you really ARE hanging about answering questions.
That's incredible! And it really sucks that the crap count here is so high
that you appear to be on your way out JUST as I get my booty in gear and
find the place. But then again, I barely post anymore either... got sick
and tired of telling people to take their off-topic, unrelated, already
answered, or inappropriate bull elsewhere.

But, DAMMIT, there's lots of us out here, lurking about, eager to watch
the wizards submit elegant examples of perl so we can glean some knlwedge
from it.

Perhaps setting up a decoy group (comp.lang.perl.ask.me.questions) to act
as the perl.* null device would work to keep out the clueless newbies til
they have a firmer grasp on things (write an autoresponder that emails a
copy of all the perl FAQs to anyone posting in it, with a cover letter
that explains why the extreme measures are being taken).

Failing that, moderation MAY work (though it may kill the ng, too).

-- 
Reverend Zoweee I. Wow KSC +     + "'Nothing new.'  I admire the way we
Another year, another .sig         can lie, putting reason on our side.
http://satanic.org/~zoweee  clink  Evidently, nothing new has happened,
                                   if you care to put it that way..."
                           +     +        -- Jean-Paul Sartre, _Nausea_


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

Date: Wed, 18 Feb 1998 11:42:04 -0600
From: Darrell Kachilla <drk@rpisun1.mdacc.tmc.edu>
Subject: opengl module setup problem:  symbol not found
Message-Id: <34EB1D6B.49B091F6@rpisun1.mdacc.tmc.edu>

This is a multi-part message in MIME format.
--------------695868DB438A426E566F779C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

hi

perl module problem...

have installed , tested Mesa ok, then


SETUP...............................................................................

loaded and in OpenGL-0.4 perl module edited Makefile.PL:
 ...

WriteMakefile(
    'NAME' => 'OpenGL',
    'VERSION' => '0.4',
     'LIBS' => '-L/SYS/Drktemp/Mesa/Mesa-2.6/lib '.
       '-l/usr/openwin/lib/Xext -l/usr/openwin/lib/X11 '.
              '-lMesaGL -lMesaGLU',
    'INC' => '-I/SYS/Drktemp/Mesa/Mesa-2.6/include',
);
##revised from    'LIBS' => '-lXext -lX11 -lGL -lGLU',
 ...

THEN
warp{drk}307% perl Makefile.PL
Note (probably harmless): No library found for -l/usr/openwin/lib/Xext
Note (probably harmless): No library found for -l/usr/openwin/lib/X11
Writing Makefile for OpenGL


THEN
     make
gcc -c -I/SYS/Drktemp/Mesa/Mesa-2.6/include -I/usr/local/include
-I/opt/gnu/include -O     -DVERSION=\"0.4\"  -DXS_VERSION=\"0.4\" -fpic
-I/opt/perl/lib/sun4-solaris/5.00401/CORE  OpenGL.c
Running Mkbootstrap for OpenGL ()
chmod 644 OpenGL.bs
LD_RUN_PATH="" gcc -o blib/arch/auto/OpenGL/OpenGL.so  -G
-L/usr/local/lib -L/opt/gnu/lib OpenGL.o
chmod 755 blib/arch/auto/OpenGL/OpenGL.so
cp OpenGL.bs ./blib/arch/auto/OpenGL/OpenGL.bs
chmod 644 blib/arch/auto/OpenGL/OpenGL.bs

THEN TEST.................................

  examples/cube
gives

ld.so.1: /usr/local/bin/perl: fatal: relocation error: symbol not found:
glXChooseVisual: referenced in
/opt/perl/lib/site_perl/sun4-solaris/auto/OpenGL/OpenGL.so


ENVIRONMENT.........................................................

SunOS warp 5.5.1 Generic sun4u sparc SUNW,Ultra-Enterprise

 perl -v
This is perl, version 5.004_01


and Mesa apps run ok
eg- in same X window where above fails,

/SYS/Drktemp/Mesa/Mesa-2.6/demos/bounce
runs ok
so apparently setenv params ok for Mesa.


so it looks to be a perl  module include|library setup problem

suggestions??




--
------------------------------------------------------------------------
Darrell Kachilla  - working but not speaking for...
   M.D. Anderson Cancer Center, Diagnostic Imaging -57
   1515 Holcombe Blvd.,   Houston, Tx 77030
drk@rpisun1.mdacc.tmc.edu     W: 713-745-2361   FAX: 713-745-0581
http://recon.mdacc.tmc.edu



--------------695868DB438A426E566F779C
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Path: news.uth.tmc.edu!news.uh.edu!cs.utexas.edu!news-peer.sprintlink.net!news-pull.sprintlink.net!news-in-east.sprintlink.net!news.sprintlink.net!Sprint!199.0.65.142!news-feed1.tiac.net!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!panix!news.panix.com!comdog
From: comdog@computerdog.com (brian d foy)
Newsgroups: comp.lang.perl.misc
Subject: Re: Calling a Perl script from a Perl script CAN YOU HELP??
Date: Wed, 12 Nov 1997 17:21:58 -0500
Organization: Computer Dog, Inc.
Message-ID: <comdog-ya02408000R1211971721580001@news.panix.com>
References: <34689917.48130AD8@ait.acl.ca> <slrn66hq4d.qg9.wkc@amanda.dorsai.org>
NNTP-Posting-Host: 206-153-118-244.walrus.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: Yet Another NewsWatcher 2.4.0
Xref: news.uth.tmc.edu comp.lang.perl.misc:102800

In article <slrn66hq4d.qg9.wkc@amanda.dorsai.org>, wkc@dorsai.org (Wesley) wrote:

>Just a little off topic but I bet there will be a couple people just post
>"READ THE FAQ!" without any pointers to where or which FAQ to read. 
>Sometimes, it's true. Read the FAQ and the answers are there.  I found
>this CGI.pm thing in the FAQ, too.  
>Before I reponse to this question, I tried to look for the CGI.pm FAQ's
>address so that I can point the person who asked this question to read
>more about it.  I couldn't find the FAQ even I read it before.  So,
>whoever just want to post "READ THE FAQ!", please also consider there are
>MANY FAQs out there.  At least try to point to which FAQ to read.

read the relevant one, or all of them :)

well, you could always bookmark the CGI Meta FAQ which has references
to every FAQ you mentioned.  personally, i got tired of typing the
references to everything to which i referred.

you might also consider looking at the periodic postings or using a 
search engine, not to mention that site about perl that Tom C. does, 
although i can't remember the address.

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>

--------------695868DB438A426E566F779C--



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

Date: 18 Feb 1998 21:21:41 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Opinions about SWIG?
Message-Id: <6cfjd5$4ra$1@ns1.arlut.utexas.edu>

Howdy!!

I downloaded SWIG after reading about it in TPJ. I like it. The
interface is really clean and I like the fact that you can use legacy
code (provided that it's well-behaved). In fact, I've already used
SWIG to make a module that twiddles bits on a DSP board. (HP-UX.9).

Question: Is there any advantages or disadvantages to using SWIG over
plain old XSUBs? I find SWIG much, much cleaner to use.

Opinions, please.

--
Stuart McDow                                      Applied Research Laboratories
smcdow@arlut.utexas.edu                       The University of Texas at Austin


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

Date: Wed, 18 Feb 1998 18:59:23 GMT
From: ronan.cremin@isocor.com (Ronan Cremin)
Subject: Problem with CGI script and sockets
Message-Id: <34eb2d86.1448598324@news.isocor.com>

I'm using the latest version of ActiveState's NT port of Perl (build
315) to run a CGI script (see below) that simply connects to port 25
on a machine to send mail. The problem is that if I give a parameter
for the script as part of the URL that calls it, it simply doesn't
work. For example http://machine/cgi-shl/test.pl works fine but
http://machine/cgi-shl/test.pl?param doesn't, failing at the following
line:

$iaddr   = inet_aton($remote) || die "no host: $remote";

Can anybody tell me why is this line affected by a parameter to the
script? The web server is O'Reilly's Website 1.1.



#!/usr/bin/perl -w
use Socket;
use FileHandle;

my ($remote,$port, $iaddr, $paddr, $proto, $line);
$remote  = shift || 'prowler.isocor.com';
$port    = shift || 25;  
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port" unless $port;
$iaddr   = inet_aton($remote) || die "no host: $remote";
$paddr   = sockaddr_in($port, $iaddr);
$proto   = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto)  || die "socket: $!";
connect(SOCK, $paddr) || die "connect: $!";
select(SOCK); $| = 1; select(STDOUT);

print <<HEADER;
Content-type: text/html

<HTML>
<HEAD>
<TITLE>
Test CGI page
</TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF>
HEADER

print "OK";

print <<FOOTER;
</BODY>
</HTML>
FOOTER

close SOCK;
exit;


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

Date: Wed, 18 Feb 1998 15:19:35 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Problem with CGI script and sockets
Message-Id: <MPG.f550c61360deab9989705@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

ronan.cremin@isocor.com said...
: I'm using the latest version of ActiveState's NT port of Perl (build
: 315) to run a CGI script (see below) that simply connects to port 25
: on a machine to send mail.

[shnip]

I have three strong suggestions for you:

1) Get Gurusamy Sarathy's Win32 port of Perl, as it's much more up-to-date 
with respect to language features and bugfixes.  It also comes with what I'm 
now about to mention...

2) Use CGI.pm.  In paricular, if you
  
   use CGI::Carp qw( fatalsToBrowser );

then you'll get informative error messages in your browser.  Finally,

3) Use IO::Socket.  Your code will look a lot cleaner, and will therefore be a 
lot easier to maintain.

Four! Four suggestions:

4) If you want to send mail, use the Mail modules from CPAN.

I know I didn't answer your question at all, but I feel like this advice is 
ultimately much more valuable.  I hope it helps.

   http://www.perl.com/CPAN-local//

-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

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

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