[6756] in Perl-Users-Digest
Perl-Users Digest, Issue: 381 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 27 15:17:19 1997
Date: Sun, 27 Apr 97 12: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 Sun, 27 Apr 1997 Volume: 8 Number: 381
Today's topics:
Re: $#array test fails ??? (Tad McClellan)
case-sensitivity in man (Was: Re: 2D matrices) <tom@geronimo.uit.no>
Re: I want to get a small face picture of Larry Wall. <passani@eunet.no>
Re: localtime.pl NOT Found! <alf@orion.it>
Re: Need Help making random number! (A. Deckers)
Re: Notice to antispammers (Stephen L. Ulmer)
Re: Notice to antispammers (William E. Hatch)
NT WEB SERVERS SUCK! <giorgio@superlink.net>
Re: Object IDs are bad (was: Ousterhout and Tcl lost th (Fergus Henderson)
Re: Object IDs are bad (was: Ousterhout and Tcl lost th <fanf@lspace.org>
Re: Object IDs are good ( was: Object IDs are bad ) (Henry Baker)
Re: Object IDs are good ( was: Object IDs are bad ) (Patrick Doyle)
Re: Ousterhout and Tcl lost the plot with latest paper (Richard Cobbe)
Re: PERL Programmer Needed for Small Project <gwhassan@prodigy.net>
Please Help: MSDOS EOF in binary file (T L)
Re: quote of the day? <gwhassan@prodigy.net>
Re: Removing 2 or more spaces ? <gwhassan@prodigy.net>
Re: Removing 2 or more spaces ? (Nathan V. Patwardhan)
Replacing + <john@RevereMa.com>
Re: Setting UID from CGI script (Tad McClellan)
Re: sorting a *file* (yeah, I know, it's a mainframe co <alf@orion.it>
Re: Substitute File Path For URL <gwhassan@prodigy.net>
Re: undump revisited? (Andrew M. Langmead)
Re: Use Variable in Shell <alf@orion.it>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 27 Apr 1997 07:27:50 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: $#array test fails ???
Message-Id: <6ogvj5.pj.ln@localhost>
Geoffrey Hebert (soccer@microserve.net) wrote:
: OK this one stumps me.
: This test works when there are more than 3 items in the array.
: $word=shift(@aline);
: print '$#aline is '."$#aline\n";
: if ($#aline>0) {$page_title=shift(@aline)}
^^^^^
takes an element out of the @aline array. Since $#aline is the
subscript the last element in @aline, its value just changed...
: if ($#aline>0) {print "found page title $page_title\n"}
: Results when $#aline is 3 - seems to work fine.
: $#aline is 3
: found page title new.cgi
^^^^^^^^^^^^^^^^^^^^^^^^
printed this one because the value of $#aline was '2', which is
still greater that zero.
: Results when $#aline is 1 - fails - notice no print found page
: $#aline is 1
: while (uc(000) ## this is a print later in the test.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 27 Apr 1997 17:39:04 +0200
From: Tom Grydeland <tom@geronimo.uit.no>
Subject: case-sensitivity in man (Was: Re: 2D matrices)
Message-Id: <ofb9124327b.fsf_-_@geronimo.uit.no>
junkmail@sysa.abdn.ac.uk (Kyzer) writes:
> In general, but why should have to type man perlLoL ?
[...]
> That's just stupidity. (I would welcome a 'man -i' a-la grep -i)
At least on my system, man -k is case insensitive. That's a start.
> Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
--
//Tom dot Grydeland at phys dot uit dot no
- I don't write children's books or "Crotch Sniffing for Dummies" - E. Naggum
The case of Randal Schwartz - http://www.lightlink.com/fors/
------------------------------
Date: Sun, 27 Apr 1997 19:41:49 +0200
From: Luca Passani <passani@eunet.no>
To: Jong <jong@mrc-lmb.cam.ac.uk>
Subject: Re: I want to get a small face picture of Larry Wall.
Message-Id: <33638FDD.3B49@eunet.no>
try this:
http://www.ddj.com/ddj/1996/1996.03/larry_wall.gif
Luca
Jong wrote:
>
> Has anybody got one?
>
> thanks,
>
> Jong
------------------------------
Date: 27 Apr 1997 11:16:06 +0200
From: Alessandro Forghieri <alf@orion.it>
Subject: Re: localtime.pl NOT Found!
Message-Id: <m1afmkltbd.fsf@aldebaran.orion.it>
Patrick Durusau <pdurusau@emory.edu> writes:
>
[...]
> The line complained of in the error simply reads:
>
> require "timelocal.pl";
>
> And, yes, timelocal.pl is in the /usr/local/lib/perl5 directory.
>
>
[...]
What are the permissions on timelocal.pl? Can the user under which
the webserver is running read it?
Cheers,
Alessandro
--
'There's nothing like eating hay, when you're faint', he remarked to
her, as he munched away. 'I should think throwing cold water over you
would be better' Alice suggested 'or some sal-volatile' 'I didn't say
there was nothing *better*' the King replied 'I said there was nothing
*like* it'
Alessandro Forghieri http://www.orion.it/~alf
------------------------------
Date: 27 Apr 1997 15:18:11 GMT
From: Alain.Deckers@man.ac.uk (A. Deckers)
Subject: Re: Need Help making random number!
Message-Id: <slrn5m6rhe.ruk.Alain.Deckers@nessie.mcc.ac.uk>
In comp.lang.perl.misc,
netj@nuri.net wrote:
>Hi All?
>
>I'm trying to make randomized number.
>but I don't know the method.
Well, you would have found it if you had searched the free documentation
that's included in the Perl distribution and on any CPAN site
<URL:http://www.perl.com/CPAN/>.
Did you try `man perlfunc | grep rand`?
Try something like this:
#!/usr/bin/perl -w
srand(time ^ $$);
for (1..10) {
printf "%3.2f\n", rand(10);
}
__END__
HTH,
--
Alain.Deckers@man.ac.uk <URL:http://www.man.ac.uk/%7Embzalgd/>
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<
------------------------------
Date: 26 Apr 1997 17:19:18 -0400
From: ulmer@mercury.net (Stephen L. Ulmer)
Subject: Re: Notice to antispammers
Message-Id: <slbu71scrt.fsf@beaker.mercury.net>
+-- In article nvp@shore.net (Nathan V. Patwardhan) writes:
|
|
| Tom Christiansen (tchrist@mox.perl.com) wrote:
| : I am creating a web page that contains the real addresses of everyone
| : who posts a bogus address in their mail message. I'm tired of getting
| : postings I can't reply to, and I don't see why we should suffer just
| : because you can't keep the spammers off your back. Write your congressman
| : or something.
|
| I'm personally fond of whois <whatever.com>, where I give the people a
| "pleasant" phone call and ask them to knock it off. It that fails, I
| follow things in progression. I'm also really kean on e-mail filtering,
| where I've eliminated a good portion of the trash into a spam folder (any-
| thing not recognized goes into spam), which I parse and check for
| addresses.
|
| I'm me and I have my address; I don't like making things difficult for
| everyone else.
|
| --
| Nathan V. Patwardhan
| nvp@shore.net
|
A few traceroute's to figure out who is the hop BEFORE will often
result in a productive phone call for me. Each time I don't get
satisfaction I go one hop back until I get to a "backbone" provider.
If I happen to get to MINE, I threaten to vote with my feet.
Another nice touch is to follow the same progression for anyone who
provides secondary DNS for the spammer.
--
Stephen L. Ulmer http://www.mercury.net/~ulmer/
Senior Systems Administrator ulmer@mercury.net
Mercury Communications USA, Inc. (352) 332-1300
------------------------------
Date: 27 Apr 1997 13:31:48 GMT
From: hatch@cais2.cais.com (William E. Hatch)
Subject: Re: Notice to antispammers
Message-Id: <5jvkg4$opd@news2.cais.com>
Does this guy have a life !!
Tom Christiansen (tchrist@mox.perl.com) wrote:
: I am creating a web page that contains the real addresses of everyone
: who posts a bogus address in their mail message. I'm tired of getting
: postings I can't reply to, and I don't see why we should suffer just
: because you can't keep the spammers off your back. Write your congressman
: or something. Meanwhile, all bogus email address will be tracked down,
: and the real addresses will be added to the "Please do not spam these
: people" page.
: --tom
: --
: Tom Christiansen tchrist@jhereg.perl.com
: "...this does not mean that some of us should not want, in a rather
: dispassionate sort of way, to put a bullet through csh's head."
: Larry Wall in <1992Aug6.221512.5963@netlabs.com>
------------------------------
Date: 27 Apr 1997 18:39:21 GMT
From: "John" <giorgio@superlink.net>
Subject: NT WEB SERVERS SUCK!
Message-Id: <01bc533a$42673580$11464ccf@giorgio.superlink.net>
I am tring desperatly to have a form send my client mail containing the
values
of the form.
Ok normally this is no big deal if the ISP is a UNIX server but it is NT
with
no STDIN or out. I need to make a .dll call or something. I don't know
which
or how to do this.
This also wouldn't be a problem I can use the MAILTO action and Javascript,
but
again MS dicked me! Explorer fires off its mailtool.
CAN ANYONE please help me with this problem......
------------------------------
Date: 27 Apr 1997 13:24:05 GMT
From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
Subject: Re: Object IDs are bad (was: Ousterhout and Tcl lost the plot with latest paper)
Message-Id: <5jvk1l$4bu@mulga.cs.mu.OZ.AU>
ark@research.att.com (Andrew Koenig) writes:
>ML does not offer object identity, because it doen't have objects.
Hmm... aren't ML references objects?
If not, why not?
They seem to me to have at least some of the necessary characteristics
for object-hood, namely state and identity; that's as much as the "objects"
described in the C standard have (although the terminology there is also
different: the C names for state and identity are "storage" and "address").
If "reference" and "object" are the same in all but name, then aren't they
really equal? Oh... that brings us back to our original question ;-)
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
------------------------------
Date: 27 Apr 1997 17:30:57 GMT
From: Tony Finch <fanf@lspace.org>
Subject: Re: Object IDs are bad (was: Ousterhout and Tcl lost the plot with latest paper)
Message-Id: <5k02gh$jhj@lyra.csx.cam.ac.uk>
ark@research.att.com (Andrew Koenig) wrote:
>
>If you do not references, values are all you have. So, for example
>
> val p = [3, 4, 5];
>
> val q = [3, 4, 5];
>
>Now p = q because p and q have the same value, and there is no way to
>determine whether p and q are the same list because even the question
>is meaningless in ML. (The implementation might store p and q as
>pointers to the same memory, or it might not. There is no way to
>tell.)
Why do you need to know where things are stored in memory? It is
irrelevant if the things are immutable. Worrying about the fine
details of implementation is the disease of the C programmer. ML is a
higher level language, so the sordid practicalities of whether
comparing two lists will traverse the whole structure or not is left
entirely to the compiler.
In the tree example that you started with, what is wrong with just
passing round the whole subtree so that it can be compared with as
necessary? Any reasonable implementation will only be passing round a
pointer so you lose nothing.
Tony.
--
o
o o o [[Question: What is special about 1681?]]
o o o o
------------------------------
Date: Sun, 27 Apr 1997 17:08:05 GMT
From: hbaker@netcom.com (Henry Baker)
Subject: Re: Object IDs are good ( was: Object IDs are bad )
Message-Id: <hbaker-2704970908050001@10.0.2.1>
This subject is dealt with at length in:
ftp://ftp.netcom.com/pub/hb/hbaker/ObjectIdentity.html (also .ps.Z)
To summarize:
An 'object' that cannot change (has no 'state') can be replicated, but
the replicas can't be distinguished -- e.g., integer 3, coordinate (3,4), etc.
An 'object' that can change (has internal 'state') cannot be replicated,
so it has 'identity'.
So, in essence, _everything_ has 'identity', since any attempt to distinguish
the various copies of replicable items will fail!
ML and Algol-68 got this right, and Lisp, C, C++, Smalltalk, etc., etc., got
this wrong.
'Shallow-copy' and 'Deep-copy' are ill-defined and dangerous -- even more
dangerous as _concepts_ than as operations, because any attempt to understand
them in any important way will necessarily lead to greater confusion.
I don't expect many to be swayed by these arguments, because much money
is to be made keeping things very confused and mysterious. Clarity makes
things simple so customers can go on to more productive work.
------------------------------
Date: Sun, 27 Apr 1997 14:52:13 GMT
From: doylep@ecf.toronto.edu (Patrick Doyle)
Subject: Re: Object IDs are good ( was: Object IDs are bad )
Message-Id: <E9AxB1.7nA@ecf.toronto.edu>
In article <izhggvrukk.fsf@mocha.CS.Princeton.EDU>,
Matthias Blume <blume@mocha.cs.princeton.edu> wrote:
>
> - Things that _actually_ look the same in each and every
> respect_are_ the same. Things that we can distinguish between
> do _not_ look the same (by definition -- this is what we mean by
> being able to distinguish).
I wouldn't necessarily agree. The difficulty lies in mutable objects. If
I have two mutable objects, alike in every way, and I change one, then the
other doesn't change. If I have one mutable object with two references,
and I change one, the other reference reflects this change because it's
really the same object. But the point is that mutability allows us to have
two things, alike in every way--until one of them changes.
I think if a language has the concept of mutability, then it should also
have the concept of object identity because both the cases presented in
the previous paragraph are very useful in different curcumstances.
Of course if a language has no mutability, then object identity is
unnecessary.
-PD
--
--
Patrick Doyle
doylep@ecf.utoronto.ca
------------------------------
Date: 27 Apr 1997 14:23:15 GMT
From: cobbe@rice.edu (Richard Cobbe)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5jvngj$ckr$1@joe.rice.edu>
James Logajan (jamesl@netcom.com) wrote:
> NOTE TO LISP AND FORTH FANS: one important reason your languages
> have never caught on may be due to the fact that many natural languages
> follow the "subject verb object" form. Usage of SOV, OSV, VSO, and VOS
> are less likely (I don't have any references in front of me; if anybody
> wants details, I'll try to locate what I have). They also lack visual
> redundancy (they aren't alone in this short-coming of course).
Nice theory, but it fails to explain a lot.
A) It might interest you to hear that "The three most comon word
orders (in descending order of frequency) are SOV, SVO, and VSO."
(O'Grady, Dobrovolsky, and Aronoff, Contemporary Linguistics: An
Introduction, 2nd ed, p 316) So: languages like Turkish, Latin, and
several others which use SOV are in fact MORE common than English,
which uses SVO. Plus, there are other languages which use Vxx orders:
Malagasy (VOS), Irish and Hebrew (VSO), and so forth.
B) It's really sort of irrelevant, anyway. Let's take a programming
language with "more traditional", Algol-based syntax, like C or
Pascal. Here, you essentially have 2 basic constructions: applying a
function to arguments, and applying binary or unary operators (leaving
C's ?: out for the moment). Applying a function to arguments seems to
me to be VO, with an understood subject -- this isn't normal English
word order. (Procedures work the same way.) Unary ops are also VO.
Binary ops seem to be OVO, *maybe* SVO in cases like i = 4 or
something like that.
So, when you move to a functional language, you shift emphasis away
from the only PL construct I can think of that's SVO, and just make
everything VO for consistency's sake. Since both the Lisp and Algol
families are both VO (or slight derivatives) anyway, I'm afraid your
argument doesn't hold water.
I'm still a student, though, so I'm somewhat limited in the number of
PL's I know. It might be interesting to compare some other languages
which *aren't* descendents of Lisp or Algol.
Richard
------------------------------
Date: Sun, 27 Apr 1997 07:23:37 +0000
From: Greg Hassan <gwhassan@prodigy.net>
Subject: Re: PERL Programmer Needed for Small Project
Message-Id: <3362FEF9.4A7EDA46@prodigy.net>
Tom Grydeland wrote:
>
>
> > To take advantage of Perl's parallel processing feature, run this (as
> > root) simultaneously on all your servers.
>
> That's good advise.
>
> > That'll be $50.
>
> And I'll only charge $25 for the correction.
>
> > Kevin <buhr@stat.wisc.edu>
>
these scripts get so expensive so fast :)
--
============================================
Greg Hassan
The Independent Solution
Web Developer (CGI, Java, C, Perl, Oracle)
http://www.hassan.com/
gwhassan@prodigy.net, 1-415-969-5856
============================================
New: World-Wide Classified Listings
(http://www.hassan.com/.classifieds/)
============================================
------------------------------
Date: Sun, 27 Apr 1997 17:11:10 GMT
From: lts@bjt.com (T L)
Subject: Please Help: MSDOS EOF in binary file
Message-Id: <3363879e.3556381@news.bjt.net>
Is trying to strip out non-printable characters in MS-DOS binary
files. When using Perl 5.0, while ( <> ) will stop once an crtl-Z is
encounterred before the actual end of file is reached.
Would appreciate any help to get arround this.
Many thanks.
T L (lts x@y bjt.net)
[Please remove x,y and pack the rest, thanks.]
------------------------------
Date: Sun, 27 Apr 1997 06:57:12 +0000
From: Greg Hassan <gwhassan@prodigy.net>
To: John Thomas Mosey <mosey@alpha2.csd.uwm.edu>
Subject: Re: quote of the day?
Message-Id: <3362F8C8.61E1AB6F@prodigy.net>
John Thomas Mosey wrote:
>
> I'd like to make a quote of the day script, only I don't know the syntax
> to call the day. What code to I use to check what day of the month it is?
>
> John Mosey
>
> --
> "Everybody was talking about how there was so much pressure. Pressure is when
> the kids are sick or you don't have food on the table. I enjoy my job."
> -- Alex Fernandez
($s,$m,$h,$dd,$mm,$yy,$wday) = localtime(time);
$mm++;
that should be what you need.
--
============================================
Greg Hassan
The Independent Solution
Web Developer (CGI, Java, C, Perl, Oracle)
http://www.hassan.com/
gwhassan@prodigy.net, 1-415-969-5856
============================================
New: World-Wide Classified Listings
(http://www.hassan.com/.classifieds/)
============================================
------------------------------
Date: Sun, 27 Apr 1997 06:54:57 +0000
From: Greg Hassan <gwhassan@prodigy.net>
To: C Carr <clint@netcom.com>
Subject: Re: Removing 2 or more spaces ?
Message-Id: <3362F841.8333CC4A@prodigy.net>
C Carr wrote:
>
> Is there a quick way to remove two or more spaces in a variable?
>
> Thanks,
> Clinton
$var=~s/\s\s+//g;
--
============================================
Greg Hassan
The Independent Solution
Web Developer (CGI, Java, C, Perl, Oracle)
http://www.hassan.com/
gwhassan@prodigy.net, 1-415-969-5856
============================================
New: World-Wide Classified Listings
(http://www.hassan.com/.classifieds/)
============================================
------------------------------
Date: 27 Apr 1997 13:56:23 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Removing 2 or more spaces ?
Message-Id: <5jvlu7$d7f@fridge-nf0.shore.net>
Nathan V. Patwardhan (nvp@shore.net) wrote:
: C Carr (clint@netcom.com) wrote:
: : Is there a quick way to remove two or more spaces in a variable?
Get the FAQ now.
http://www.perl.com/FAQ
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 27 Apr 1997 16:59:08 GMT
From: "John D. Hamel" <john@RevereMa.com>
Subject: Replacing +
Message-Id: <01bc532c$67e10d80$29c477ce@john>
Please Help!
I'm trying to write me first perl program and can't get this line to work:
$value=~s/+/ /g;
I'm trying to transfer the data from the form to the perl script.
This line should get rid of the + signs.
Please let me know what is wrong. Also, please suggest
another way of getting the data from the form.
I can't get the -->param( ) stuff to work either!
This is what I'm using:
@name_value_pairs=split('&',$ENV{'QUERY_STRING'});
foreach $name_value_pair (@name_value_pairs)
{
($name,$value)=split('=',$name_value_pair);
$value=~s/+/ /g;
$value=~s/%([0-9A-Fa-f][0-9A-Fa-f])/hex($1)/g;
$form{$name}=$value;
}
thanks,
john
------------------------------
Date: Sun, 27 Apr 1997 07:35:44 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Setting UID from CGI script
Message-Id: <07hvj5.im.ln@localhost>
Mark Buchanan (markbuch@mail.superlink.net) wrote:
: All,
: I am wondering if the following can be done, I am running Apache web
: server with .htaccess and .htpasswd files. I wrote a Perl 5 CGI script
: that will need access to write to the .htpasswd file (644 root root
: permissions) in order to change the password from the CGI script. I
: have the script working, but I need to be root in order to do this. Can
: I set UID from a Perl script (I am UID -1 when the script runs).
: In other words, can I setuid or suid? Do I need a syscall to do
^^^^^^ ^^^^
: this? I can't find anything from the Camel or other books I have.
^^^^^^^^^^^^^^^^^^^^^
: Frustrated and alone,
^^^^^
You are not alone. You have the good advice of the documentation that
is included as part of the perl distribution standing by, waiting to
help you at any time. 'Course it won't help if you don't ask it to...
grep setuid *.pod | wc -l
45
grep suid *.pod | wc -l
15
I'd have a look at those sixty lines and see if there is any help there.
You might then have noticed this at the top of the perlsec man page:
--------------
=head1 NAME
perlsec - Perl security
=head1 DESCRIPTION
Perl is designed to make it easy to write secure setuid and setgid
scripts. Unlike shells, which are based on multiple substitution
...
--------------
(I guess you somehow missed these when you checked the man pages
before posting. You did check first, didn't you?)
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 27 Apr 1997 11:44:53 +0200
From: Alessandro Forghieri <alf@orion.it>
Subject: Re: sorting a *file* (yeah, I know, it's a mainframe concept)
Message-Id: <m19124lrze.fsf@aldebaran.orion.it>
dbambw@panther.gsu.edu (Michael) writes:
>
> Hi all,
Hi.
[...]
>
> The records come in in workorder number, and I need to sort them to
> an outfile in lastname/firstname sort order.
>
[...]
A thread like this was all the rage about a year ago. I don't rememeber
whether a consensus was reached ( is it ever, on Usenet?) but I do remember
that a lot of (seemingly) knwledgeable people sugggested something like:
'If it's serious sorting job - use u*x sort'
> All the sorting methods in perl seem to be set up to handle associative
>arrays (ie ONE key field, ONE data field).
This is a really curious way of looking at it,
given the periodic flurry of questions about 'how do I sort a hash?'.
I would rather say that it is standard sorting terminology:
you sort a collection of data (AKA records) according to the value of a 'key'.
Your record can have as many 'fields' it likes - or none at all.
>I don't see how a *record*
>(in the mainframe meaning) could be set up as an assoc array, but I
>can't figure out how to *sort a file* (again in the mainframe concept).
This is also rather curious - have sorted files gone out of fashion lately?
I don't mean to be paternalistic here, but perhaps reviewing the fundamentals
-in terms of terminology and algorithms - of sorting might help you to
have - and communicate - a better understanding of what your problem is?
'cos, frankly, these talks of 'setting up records as assoc arrays'
and 'sorting a file in the mainframe concept' are all but clear -
to me, at least.
Cheers,
Alessandro Forghieri
--
'There's nothing like eating hay, when you're faint', he remarked to
her, as he munched away. 'I should think throwing cold water over you
would be better' Alice suggested 'or some sal-volatile' 'I didn't say
there was nothing *better*' the King replied 'I said there was nothing
*like* it'
Alessandro Forghieri http://www.orion.it/~alf
------------------------------
Date: Sun, 27 Apr 1997 07:10:58 +0000
From: Greg Hassan <gwhassan@prodigy.net>
To: Steve Sloan <stvsloan@longbow.com>
Subject: Re: Substitute File Path For URL
Message-Id: <3362FC02.BB34A8A@prodigy.net>
Steve Sloan wrote:
>
> I'm attempting to get a HTTP_REFERER file name and change it to the actual
> file name needed for reading. I can hardcode the URL and the path, i.e.
> 'http://www.longbow.com/" will always be the URL path, and the file path
> (from my cgi bin directory) will always be "../html/"
>
> I'm trying to do this:
>
> $urlPath = "http://www.longbow.com/";
> $filePath = "../html/";
>
> $fn = $ENV{'HTTP_REFERER'}; #returns "http://www.longbow.com/filename.html"
> ($fn = $fn) =~ tr/$urlPath/$filePath/; #want to return
> "../html/filename.html"
>
> Why is this not working?
>
> TIA to any and all.
you would probably jsut want to do:
$fn =~ s/$urlPath/\.\.\/html\//;
--
============================================
Greg Hassan
The Independent Solution
Web Developer (CGI, Java, C, Perl, Oracle)
http://www.hassan.com/
gwhassan@prodigy.net, 1-415-969-5856
============================================
New: World-Wide Classified Listings
(http://www.hassan.com/.classifieds/)
============================================
------------------------------
Date: Sun, 27 Apr 1997 13:31:23 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: undump revisited?
Message-Id: <E9AtKB.6r7@world.std.com>
Roger Smith <rsmith@proteus.arc.nasa.gov> writes:
>The -u switch and the undump program are one of several options we are
>exploring. I confess that I am a little dissappointed that not one
>response to the original post gave encouragement for this option, but
>then again thats what these forums are all about and if undump is a bad
>choice that answer is more valuable than missplaced encouragement.
>I should also mention that any really good solution has the potential
>for being adapted Agency wide, which encompasses something in the area
>of 10,000 unix systems throughout our WAN.
One solution:
Build perl on one machine for each of the OS/architecture that you are
delivering to. When running configure, choose as few resource hungry
options as possible. Obviously, don't choose any options that won't
exist on all your target machines. (No Dynamic loading. Few statically
built extentsions, No you don't want a suidperl, etc.)
Go into the directory where perl installed all of its files, prune out
what you don't need. (You don't need chat2.pl, you don't need the
static libperl.a, etc. It will wind up being most if not all of the
perl library directory.)
Tar up your perl script, the perl binary, and whatever is left of the
perl library.
Distribute it.
Another solution.
For each OS/architecture you need to distribute. Take one machine and
use the perl compiler module to turn the perl syntax trees into C
source code. Compile the source code and link all of the libraries
statically. This should be functionally idential to a dumped perl
script. Right?
Find out what files in the perl library your binary needs.
Tar up your binary and the parts of the library you need.
Distribute it.
--
Andrew Langmead
------------------------------
Date: 27 Apr 1997 11:12:40 +0200
From: Alessandro Forghieri <alf@orion.it>
Subject: Re: Use Variable in Shell
Message-Id: <m1bu70lth3.fsf@aldebaran.orion.it>
Alex `Taker` Pircher <pircher@informatik.tu-muenchen.de> writes:
[...]
> $ENV{"PERLVARIABLE"}=$thisisit;
> ------------
>
> Then I want to use the Variable 'PERLVARIABLE' generated in the
> Perl-Program. BUT if I do a 'set' in the shell-script I can't see
> this Variable.
> Anyone knows what I have to do, to use it in the shell-script?
>
In short: you can't. This has been beaten to death over the years in
several newsgrouops - but especially comp.unix.shell.
A child process cannot export to its parent's environment - period.
Now it is my turn to ask a question: why try to do a half shell,
half perl job?
If the shell is not enough for your task, why not go perl all the way?
Just my .03 ;)
Cheers,
Alessandro
----
'There's nothing like eating hay, when you're faint', he remarked to
her, as he munched away. 'I should think throwing cold water over you
would be better' Alice suggested 'or some sal-volatile' 'I didn't say
there was nothing *better*' the King replied 'I said there was nothing
*like* it'
Alessandro Forghieri http://www.orion.it/~alf
------------------------------
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 381
*************************************