[18767] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 935 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 19 06:05:34 2001

Date: Sat, 19 May 2001 03:05:06 -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: <990266706-v10-i935@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 19 May 2001     Volume: 10 Number: 935

Today's topics:
    Re: best way to evaluate $1 so it's not read-only? <goldbb2@earthlink.net>
    Re: best way to evaluate $1 so it's not read-only? (Abigail)
        good perl... <bulfig@bargainisp.net>
    Re: Handling JPEGs without modules <ebo_mike-antispam-remove-t@hottmail.com>
    Re: Has this already been done? <stan@alamo-smccann2.nmsu.edu>
    Re: Hash: keys to variable names, or variable names to  (fe)
    Re: How to match the password created in Linux shadow s (Abigail)
        HTTP Response suppression <elmer_fudd@yahoo.com>
        Hyphenated File Names <ewcoate@nighthawk.dyndns.org>
    Re: Hyphenated File Names (Abigail)
        internalServerErrorNote ? <davsoming@lineone.net>
    Re: page transition when submitting form <ss@sl.net.ua>
    Re: page transition when submitting form (Abigail)
        Perl 5.6.1 on SCO5.0.4 - Problem with dynamic loading <ptm@xact.co.uk>
    Re: Retrieving substring with regular expressions <c_clarkson@hotmail.com>
        Simple Search problem <reevehotNOSPAM@hotmail.com>
        virtual server problem.... <boqichi0@earthlink.net>
        virtual server? perl prob... <boqichi0@earthlink.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 19 May 2001 00:55:48 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: best way to evaluate $1 so it's not read-only?
Message-Id: <3B05FCD4.79F0CAC2@earthlink.net>

xris wrote:
> 
> In article <u78iets4b8e0rb90bcesatjoprc71sd8h2@4ax.com>,
>  Bart Lateur <bart.lateur@skynet.be> wrote:
> 
> > This is called micro-optimization. It'll only save you unmeasurable
> > fractions of percents of execution time. I wouldn't even bother.
> > It's not worth it.
> 
> maybe.   but that's just how I am.

Whether you do micro-optomization or not is up to you, but what you
really should do first, before doing it, is to profile your code, and
see where the bottlenecks are, and optomize that, first.  *Then* do
whatever micro-optomizations you want.

That said, I'll describe some ways to do what I think you want.

> > >   sub t {
> > >      $_[0] =~ tr/a-z/A-Z/;
> > >      return $_[0];
> > >   }
> > This not only returns the new value, but also modified the passed
> > argument. Unless this is intentional, this coding practice is
> > considered a very bad habit.
> 
> actually, it IS intentional; that was the whole point my my question.
> I have several routines..  things like:
> 
>    sub ISOLatin1ToHTML {
>       $_[0] =~ s/([\xA0-\xFF]|&(?!(?:#\d+|[a-z0-9]+);))/'&#' .
>                          ord $1 . ';'/sgieo;
>       return $_[0];
>    }
[snip]
> that used to read something like:
> 
>    sub ISOLatin1ToHTML {
>     (my $str = shift) =~ s/([\xA0-\xFF]|&(?!(?:#\d+|[a-z0-9]+);))/'&#'
>                             . ord $1 . ';'/sgieo;
>       return $str;
>    }
[snip]
> I was hoping to be able to use them as general functions, so I could
> have:
> 
>    &ISOLatin1ToHTML($var);
> 
> (or go so far as to do a "use subs" for them) instead of:
> 
>    $var = &ISOLatin1ToHTML($var);

In other words, you want it both ways -- to be able to have it modify
the passed arg when desired, and have it *not* modify the arg other
times.

The way to determine the difference between the above two items is the
wantarray operator.  It will return true in a list constext, false in a
scalar context, and undef in a void context.

So here's one [untested] way to rewrite the above sub.
sub ISOLatin1ToHTML {
	my $str = (defined wantarray) ? \"$_[0]" : \$_[0];
	$$str =~ s/(
		[\xA0-\xFF] |
		&(?!(?:#\d+|\w+);)
		)/ '&#' . ord $1 . ';' /sgieox;
	return $$str;
}
# note that the re is changed slightly, not just via the /x modifiyer

Thus:
	ISOLatin1ToHTML($a);
	$c = ISOLatin1ToHTML($b);
both should work like you would expect them to.  $a is changed, but $b
is not.

> I came across the $_[0] thing a few days ago when someone here
> suggested it, and thought I'd try it out for some optimization (and it
> does help - speeds some of these routines up by about a factor of 7 -
> granted, it's not noticeable if they're only run once or twice, but
> I'd like to think that everything helps).

Changing to be able to work *both* with a reference and non-reference
will probably eliminate the speed-up.  I would suggest having two
versions of the sub, one with, and the other without, the
hard-reference.  Also, are you sure it's the making of a copy, rather
than the shift() call that slows things down?

Here's some [untested] code which should do the comparisons you need to
know about.

use Benchmark;
sub useshift { my $x = shift; $x =~ /foo/bar/; $x }
sub noshift { my $x = $_[0];  $x =~ /foo/bar/; $x }
sub hardref { $_[0] =~ /foo/bar/; $_[0] }
timethese( 10_000, {
	'useshift' => sub { my $x = "foo"; useshift($x) },
	'noshift'  => sub { my $x = "foo";  noshift($x) },
	'hardref'  => sub { my $x = "foo";  hardref($x) },
} );

Note that the third version *does* have side-effects.

-- 
Customer: "I would like to try on that suit in the window."
Salesman: "Sorry sir, you will have to use the dressing room."


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

Date: Sat, 19 May 2001 09:38:56 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: best way to evaluate $1 so it's not read-only?
Message-Id: <slrn9gcfpg.sk5.abigail@tsathoggua.rlyeh.net>

Benjamin Goldberg (goldbb2@earthlink.net) wrote on MMDCCCXVIII September
MCMXCIII in <URL:news:3B05FCD4.79F0CAC2@earthlink.net>:
**  xris wrote:
** > 
** > In article <u78iets4b8e0rb90bcesatjoprc71sd8h2@4ax.com>,
** >  Bart Lateur <bart.lateur@skynet.be> wrote:
** > 
** > > This is called micro-optimization. It'll only save you unmeasurable
** > > fractions of percents of execution time. I wouldn't even bother.
** > > It's not worth it.
** > 
** > maybe.   but that's just how I am.
**  
**  Whether you do micro-optomization or not is up to you, but what you
**  really should do first, before doing it, is to profile your code, and
**  see where the bottlenecks are, and optomize that, first.  *Then* do
**  whatever micro-optomizations you want.


But before you are going to profile any code, you should first analyze
your algorithm, and see whether you are better off using a faster
algorithm. One can profile and micro-optimize the hell out of bubblesort,
a non-profiled, not micro-optimized heapsort is going to beat the crap
out of it.



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


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

Date: Sat, 19 May 2001 02:32:11 -0400
From: "Brent Ulfig" <bulfig@bargainisp.net>
Subject: good perl...
Message-Id: <wqoN6.79$ce.370666@newsrump.sjc.telocity.net>

I'm looking for a good book for learning perl.  I need to write some scripts
for a linux server we have here.

Thanks,

Brent Ulfig
Senior Network Engineer
Bargain ISP
bulfig@bargainisp.net

"Home of the $10/month unlimited internet access...nationwide."




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

Date: Sat, 19 May 2001 10:47:11 +0200
From: "Michael A. Krehan" <ebo_mike-antispam-remove-t@hottmail.com>
Subject: Re: Handling JPEGs without modules
Message-Id: <9e5c15$m90$01$1@news.t-online.com>


> : A) Do the image processing elsewhere, then put the results on the
server.
> : B) Write a pure-perl JPEG processor and use it in your code.
> : C) Find a hoster that will install the modules you need.
> :
> I think he was looking for hints on how to do B.  I agree that A or C
> would be preferable.

I agree with all of that: Yes, I'm aware that having something binary handle
my JPEGs is much more efficient and elegant but yes, this is obviously not
an option here (and I will not switch the hoster because of this glitch). I
will not be calling the function very often (only once per image submission)
so performance is not much of an issue here.

So... once again. Is there a pure-perl JPEG processor available somewhere?!
I have not been able to find anything.

--
Michael A. Krehan





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

Date: Fri, 18 May 2001 11:07:43 -0600
From: Stan McCann <stan@alamo-smccann2.nmsu.edu>
Subject: Re: Has this already been done?
Message-Id: <3B0556DF.D70F4A48@alamo-smccann2.nmsu.edu>

David Soming wrote:
> 
> Im new to perl so have a laugh at my expense if you will but...
> Just an idea for creating a unique 12 digit ID Using the date and time :)
> If such a module exists already based on this concept please ignore.

I'm no expert by any means so I don't know if something like this exists
in an existing module.  It is such a simple thing to do, though, that I
doubt it.

> 
> Today's date 18:05:01
> Time 10:41:21
>  concatenation= "180501104121" =Unique 12 digit ID
> 
> If its a crap idea, well OK.
> If there is a module which is better, (in the sense of output being easily
> readable-and readily understood, meaningful) or gives similar output then I
> don't wish to reinvent the wheel right?
> But could this be used say as a date stamp to verify an file upload or
> acknowledgement.

Probably not a good idea.  If you want unique, you'll have to do a bit
more.  What happens when two or more people upload within a second of
each other?  You've lost your "unique" date-stamp.

> Any suggestions on manipulating these variables or sample code I can play
> around with?
> 
> Thanks for your thoughts and possible sarcasm too! lol.

Aren't you doing things a bit backwards?  Let's see, I have this idea
for a bit of code that I have no use for.  Well, I've spent all this
time working this code out so I had better find a use for it.

I'd much rather develop code for a purpose instead of develop a purpose
for code.  Make sense?

> 
> David Soming

-- 
Stan McCann
Computer Services Manager
New Mexico State University at Alamogordo


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

Date: Sat, 19 May 2001 07:08:20 +0000 (UTC)
From: f.galassi@e-mind.it (fe)
Subject: Re: Hash: keys to variable names, or variable names to keys?
Message-Id: <0ee513610071351MAIL6@galactica.it>

#!/usr/bin/perl -w
	
my ($VALUE, $MIN_LEN, $MAX_LEN) = 0..2;

my %params = (
	lastname	=> [undef, 1, 30],
	firstname 	=> [undef, 1, 20],
	# ...
);

for my $name (keys %params) {
	$params{$name}[$VALUE] = $cgi_input->param($name);
	my $len = length $params{$name}[$VALUE];
	die "too short"		if $len < $params{$name}[$MIN_LEN];
	die "too long"		if $len > $params{$name}[$MAX_LEN];
}

# ok ...


-- 
Posted from mail6.galactica.it [212.41.208.23] 
via Mailgate.ORG Server - http://www.Mailgate.ORG


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

Date: Sat, 19 May 2001 09:44:01 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: How to match the password created in Linux shadow suite?
Message-Id: <slrn9gcg31.sk5.abigail@tsathoggua.rlyeh.net>

Joseph Chen (yen_hung@yahoo.com) wrote on MMDCCCXVIII September MCMXCIII
in <URL:news:bf927196.0105182003.1e825283@posting.google.com>:
""  Dear Perl Users,
""  
""  I move a CGI program from an IBM machine to a Linux machine.
""  In the IBM machine, the program allows users to enter their 
""  login password and uses the password to match the one in 
""  /etc/passwd file. It works ok. But, after I move the program
""  to the Linux machine. The password comparison fails.


Due to shadow passwords. This is a feature. It avoids security problems
like programs from other users asking for passwords and checking them.
A quick way to collect passwords from other people on the system.

You are not experiencing "a problem", just like a bank robber isn't
experiencing "a problem" when facing the vault. You are both encountering
a safety device designed to keep you out.


Unless you are root, you have no business of collecting peoples passwords.
And when you are, you shouldn't have to ask how to do it.



Abigail
-- 
$"=$,;*{;qq{@{[(A..Z)[qq[0020191411140003]=~m[..]g]]}}}=*_=sub{print/::(.*)/};
$\=$/;q<Just another Perl Hacker>->();


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

Date: Fri, 18 May 2001 21:29:07 -0700
From: "Elmer Fudd" <elmer_fudd@yahoo.com>
Subject: HTTP Response suppression
Message-Id: <tgbtlumhu74teb@corp.supernews.com>

How do I suppress the returned HTTP Response from an exec cgi call?

I have searched every FAQ I could find, and various attempts with Yahoo.
Although there is a waelth of info on headers, I could not find suppression.

I tried messin with the extensions .pl and .cgi. I even tried nph- and
created the header myself, but in that instance I got no return at all
(minus header AND data).

The setup is my host who uses WIN2000 and Activeperl (I believe). Anytime I
use 'exec cgi' I get the std HTTP Reponse header (200) and I don't know how
to suppress it. SSI works fine.

The script itself is very very basic/minor. I do get the expected/requested
data back from the script, it's just accompanied with a std HTTP Response.
That response gets embedded into my HTML page along with the data and
renders visibly to my visitors.

tia
Brian.





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

Date: Sat, 19 May 2001 07:19:30 GMT
From: Ed Coates <ewcoate@nighthawk.dyndns.org>
Subject: Hyphenated File Names
Message-Id: <8f7cgt0a0cujoalp35mejupkapfo1v0d7u@4ax.com>

I'm using perl 5.00_02 work and was wondering if it has problems with
opening files using scalar variables containing hyphenated file names.
Here's the situation.  I've got  a directory filled with reports from
different machines.  The ones that I'm interested in are
machine.latest.status.  I've read the directory and done the parsing
and I'm left with an array @machines containing the machine names that
I'm looking for.

I'm trying to print out a web page containing a table with a row for
each machine.  I'm looping through the array with a foreach statement
and opening each file  $host.latest.status for reading and printing
into the table.  Only the table is never printed, or even the headers
for that matter.  Under further investigation, it seems that machine
names that contain a hypen bomb out when the name is passed into a
scalar variable like $host.latest.status.  If I go back and hardcode
it in, it performs like it should, opens the file, and prints the
table.

So, does 5.005_02 have problems opening hyphenated filenames when the
hyphenated part is contained in a scalar?

Ed

P.S.  If you want, I can post the code here.  Didn't think that I
would need to, to find out if 5.005_02 has problems.


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

Date: Sat, 19 May 2001 09:47:13 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Hyphenated File Names
Message-Id: <slrn9gcg91.sk5.abigail@tsathoggua.rlyeh.net>

Ed Coates (ewcoate@nighthawk.dyndns.org) wrote on MMDCCCXVIII September
MCMXCIII in <URL:news:8f7cgt0a0cujoalp35mejupkapfo1v0d7u@4ax.com>:
\\  I'm using perl 5.00_02 work and was wondering if it has problems with
\\  opening files using scalar variables containing hyphenated file names.

Did you try? Do you have some lines of code showing the problem?  What's
the value of $! ? Did you use -w? And strict? Wouldn't you think that if
it turned out to be a problem, it was fixed in 5.005_03, 5.6.0 or 5.6.1,
and you could read the Changes files of those releases to find out?



Abigail
-- 
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;        
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";


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

Date: Sat, 19 May 2001 06:15:56 +0100
From: "David Soming" <davsoming@lineone.net>
Subject: internalServerErrorNote ?
Message-Id: <tgc014idneg2dd@corp.supernews.co.uk>

I call this script from my browser and get internalServerErrorNote (I dont
have access to logs).
However, it does create and write to the file but why the error? -I'm
certain this is correct including permissions/path/transfer mode. even
with -w omitted.
No error or warnings from program from the command line under windows.

#!/usr/bin/perl -w

if  (open(LOGFILE, ">>message.log")) {
 print LOGFILE  ("this is test number 1.\n");
 print LOGFILE  ("this is test number 2.\n");
close (LOGFILE);
}





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

Date: Sat, 19 May 2001 12:10:21 +0300
From: dene K <ss@sl.net.ua>
Subject: Re: page transition when submitting form
Message-Id: <p5ccgtkhej51ljthmupptfp35gsl2tdm4q@4ax.com>

On Sat, 19 May 2001 00:07:38 +0000 (UTC), abigail@foad.org (Abigail)
wrote:

>;;  how is possible to call perl script(form submitting) using post
>;;  method, avoiding page transition?

>
>This has nothing to do with Perl.
>

>Could you rephrase your question?

well, when perl script process form data it resend user to a new
document, generating it or just pointing new location to browser.

using get method i can call perl script as an image source,
transmitting data to it w/o changing current browser location.

but i need post method. Is there a trick?



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

Date: Sat, 19 May 2001 09:34:22 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: page transition when submitting form
Message-Id: <slrn9gcfgu.sk5.abigail@tsathoggua.rlyeh.net>

dene K (ss@sl.net.ua) wrote on MMDCCCXVIII September MCMXCIII in
<URL:news:p5ccgtkhej51ljthmupptfp35gsl2tdm4q@4ax.com>:
__  On Sat, 19 May 2001 00:07:38 +0000 (UTC), abigail@foad.org (Abigail)
__  wrote:
__  
__ >;;  how is possible to call perl script(form submitting) using post
__ >;;  method, avoiding page transition?
__  
__ >
__ >This has nothing to do with Perl.
__ >
__  
__ >Could you rephrase your question?
__  
__  well, when perl script process form data it resend user to a new
__  document, generating it or just pointing new location to browser.
__  
__  using get method i can call perl script as an image source,
__  transmitting data to it w/o changing current browser location.
__  
__  but i need post method. Is there a trick?


I *think* your question boils down to 

    "How do I do an HTTP redirect that uses POST".


Count the number of times Perl appears in the above question.

It's not a Perl specific question, and hence, does not belong in this group.



Abigail
-- 
#!/opt/perl/bin/perl -w
$\ = $"; $; = $$; END {$: and print $:} $SIG {TERM} = sub {$ := $_}; kill 15 =>
fork and ($; == getppid and exit or wait) foreach qw /Just another Perl Hacker/


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

Date: Sat, 19 May 2001 09:22:04 +0100
From: "Paul Mahoney" <ptm@xact.co.uk>
Subject: Perl 5.6.1 on SCO5.0.4 - Problem with dynamic loading
Message-Id: <9e5dmu$s3a$1@reader-00.news.insnet.cw.net>

I've download and build perl 5.6.1 on my SCO 5.0.4 system and compiled it
using gcc 2.95.2 (from sco skunkware). I checked the hints/sco.sh file for
instructions and run the following:
   sh Configure -de -Dcc=gcc
   make
   make test
   make install

This went well. Only one test failed (lib/bigfltpm) which didn't worry me.
So I then tried to rebuild and install my favourite modules...

Running  "make test" I keep getting:
  Can't Load '/usr/local/lib/perl5/5.6.1/i386-sco/auto/IO/IO.so' for module
IO:
    dynamic linker: /usr/local/bin/perl: relocation error: symbol not found:
fsync
      at /usr/local/lib/perl5/5.6.1/i386-sco/XSLoader.pm line 75.
        at /usr/local/lib/perl5/5.6.1/i386-sco/IO.pm line 9.

I tried a rebuild of perl using the native "cc", but this made no
difference.

I really need a dynamic loading version. Can anybody help?

Thanks
Paul.




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

Date: Fri, 18 May 2001 23:42:52 -0500
From: "Charles K. Clarkson" <c_clarkson@hotmail.com>
Subject: Re: Retrieving substring with regular expressions
Message-Id: <08ACF60946866E2C.8B879CCF455998C3.4A3EBF93A6854B41@lp.airnews.net>

Alan Baker <abaker97@yahoo.com> wrote:
:
: I'm trying to create a regular expression that returns a substring from a
: string using a regular expresssion.
:
: I have the following string:
:
: /basedir/subdir1/subdir2/some_dir/subdir4/filename
:
: I would like to populate a variable with whatever directory is in between
: subdir2 and subdir3. The number of directories can change, but I will
always
: know the name of the preceding and following directories of some_dir.
:

    I assume you mean between the susdir2 and subdir4. There
wouldn't be anything between the second and third directories. If
the string always begins with /, split will give you the subdirectory
without the need for other directory names:

    (split '/')[4]

    Generally, the index is the subdirectory + 1:

Subdirectory:
    first        = (split '/')[2]
    second   = (split '/')[3]
    third       = (split '/')[4]
    fourth     = (split '/')[5]

    assuming string is in $_.


HTH,
Charles K. Clarkson









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

Date: Sat, 19 May 2001 15:28:57 +1000
From: "James R" <reevehotNOSPAM@hotmail.com>
Subject: Simple Search problem
Message-Id: <evnN6.712$Ld4.32283@ozemail.com.au>

I'm applying Matt Wright's Simple Search perl script to an HTML-based CD Rom
which I'm constructing (where a virtual web server is running via software
called "Microweb").

See http://worldwidemart.com/scripts/search.shtml and
http://www.indigostar.com/microweb.htm for more information. The whole
script is very small and found at that first site.

The search works fine on defined files - eg. @files = ('xyz.htm','abc.htm').
However, not when I try to use wild-cards (which the help files indicates
should work).

Here is some of the suspect code...

$basedir = '/';  # I've brought everything back to the root for testing
simplicity
@files = ('*.htm');
 ....
   foreach $file (@files) {
      $ls = "ls $file";   # the original script had single inverted commas
here (') but it was causing an error
      @ls = split(/\s+/,$ls);
      foreach $temp_file (@ls) {
         if (-d $file) {
            $filename = "$file$temp_file";
            if (-T $filename) {
               push(@FILES,$filename);
            }
         }
         elsif (-T $temp_file) {
            push(@FILES,$temp_file);
         }

I get no responses even when I search for a word I know to be in the html
files.

Any help would be greatly appreciated as I'm not much of a Perl guru...

James





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

Date: Sat, 19 May 2001 09:37:32 GMT
From: Franco Luissi <boqichi0@earthlink.net>
Subject: virtual server problem....
Message-Id: <3B066AA5.344E8CE1@earthlink.net>

i posted this to a BSD group, since its a BSD server- dont know what web
server- but only got one response, about "pkg_info" which my BSD server
did not understand.... below is all the info- any help would be greatly
greatly appreciated- and it seems most other groups i have found are
mostly spam, and the perl groups have the most interested (nad
interesting) people, so i have hope that someone will at least read this
and point me somewhere, sorry if its a bit unrelated, it *is* a perl
script i am trying to run.... thanks!!! [ below is the same text i sent
to the BSD group]

perl hack has a BSD question:

Actually, its a bit of a cgi question, but i think its the config of a
BSD server that I need to fix.

A cgi script (don't worry its not the CGI thats causing the prob, been
writing CGIs for years) in perl is sitting in the cgi-bin of a BSD
server- a friend is using it for free (but its not a free server), so i
have no tech support but have some freedom- like almost unlimited space
it seems for storing and running things...but not root privilages or
anything like that, i mostly install things into ~username
dirs...anyway:

BSDI BSD/OS 3.1 Virtual Kernel #17:

is what it says when i login...

So my prob is this:

## background, dont worry its not a perl question##
I can run perl CGIs but they default (any perl run from command too,
actually defaults) to a perl4 (yikes) running somewhere normal like
/usr/bin/perl - to run perl5 i must say perl5 from the command line (and

have the #! line put the right location of course)... fine, but even
that perl is missing most of its modules, and since i have so much space

instead of just installing the modules (in my user directory) i'd rather

istall 5.6 !  So, I do and it runs fine from the command line but when I

put its address in the #! line it still runs from the command line but
*breaks* as a CGI - i think maybe from the command line its still
running the old perl5 regardless of the #! actually...it could be that
my installation of perl5.6 is broken but i just want to find out if that

is it, and anyway find out the following:
## end background ##

So!  Questions:

1. how do I find out what web server I'm running?  Its not Apache, and
"RPM" doesn't work (does that work on BSD anyway?)...
2. where might I find a config file or something else that is telling
the cgi-bin what perl to use etc [ also the files in @INC are all messed

up...but that doesn't matter much as I can add them, but the #! comes
first before anything and so must not break]...i looked and grepped
through all the .files in the home dir and the cgi-bin, made some
changes but none seemed to help (it was long enough ago that the server
must have been restarted since)
3. anything else that might help??





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

Date: Sat, 19 May 2001 09:41:45 GMT
From: Franco Luissi <boqichi0@earthlink.net>
Subject: virtual server? perl prob...
Message-Id: <3B066BB2.21FD42A8@earthlink.net>

i posted this to a BSD group, since its a BSD server- dont know what web
server- but only got one response, about "pkg_info" which my BSD server
did not understand.... below is all the info- any help would be greatly
greatly appreciated- and it seems most other groups i have found are
mostly spam, and the perl groups have the most interested (nad
interesting) people, so i have hope that someone will at least read this
and point me somewhere, sorry if its a bit unrelated, it *is* a perl
script i am trying to run.... thanks!!! [ below is the same text i sent
to the BSD group]

perl hack has a BSD question:

Actually, its a bit of a cgi question, but i think its the config of a
BSD server that I need to fix.

A cgi script (don't worry its not the CGI thats causing the prob, been
writing CGIs for years) in perl is sitting in the cgi-bin of a BSD
server- a friend is using it for free (but its not a free server), so i
have no tech support but have some freedom- like almost unlimited space
it seems for storing and running things...but not root privilages or
anything like that, i mostly install things into ~username
dirs...anyway:

BSDI BSD/OS 3.1 Virtual Kernel #17:

is what it says when i login...

So my prob is this:

## background, dont worry its not a perl question##
I can run perl CGIs but they default (any perl run from command too,
actually defaults) to a perl4 (yikes) running somewhere normal like
/usr/bin/perl - to run perl5 i must say perl5 from the command line (and

have the #! line put the right location of course)... fine, but even
that perl is missing most of its modules, and since i have so much space

instead of just installing the modules (in my user directory) i'd rather

istall 5.6 !  So, I do and it runs fine from the command line but when I

put its address in the #! line it still runs from the command line but
*breaks* as a CGI - i think maybe from the command line its still
running the old perl5 regardless of the #! actually...it could be that
my installation of perl5.6 is broken but i just want to find out if that

is it, and anyway find out the following:
## end background ##

So!  Questions:

1. how do I find out what web server I'm running?  Its not Apache, and
"RPM" doesn't work (does that work on BSD anyway?)...
2. where might I find a config file or something else that is telling
the cgi-bin what perl to use etc [ also the files in @INC are all messed

up...but that doesn't matter much as I can add them, but the #! comes
first before anything and so must not break]...i looked and grepped
through all the .files in the home dir and the cgi-bin, made some
changes but none seemed to help (it was long enough ago that the server
must have been restarted since)
3. anything else that might help??






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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 935
**************************************


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