[13595] in Perl-Users-Digest
Perl-Users Digest, Issue: 1005 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 6 17:05:47 1999
Date: Wed, 6 Oct 1999 14:05:22 -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: <939243921-v9-i1005@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 6 Oct 1999 Volume: 9 Number: 1005
Today's topics:
Re: <<EOL and Sub (Larry Rosler)
Re: [OFFTOPIC] Tad's Back! WAS:Regexp/Interpolation que (Tad McClellan)
Re: C style was Re: Random Numbers <ltl@rgsun5.viasystems.com>
Re: Calculate tan(); <laurensmith@sprynet.com>
Re: Calculate tan(); <ltl@rgsun5.viasystems.com>
Re: Calculate tan(); <emschwar@rmi.net>
Re: Calculate tan(); (Larry Rosler)
Re: Calculate tan(); <sariq@texas.net>
CGI and directory permissions <peterm@idi.ntnu.no>
Re: CGI and directory permissions <peterm@idi.ntnu.no>
Re: CGI/Perl programmer needed for NT <ilya@speakeasy.org>
Re: CGI/Perl programmer needed for NT <ilya@speakeasy.org>
Re: Counter (Abigail)
Re: Damn Comma Delmitation <kbandes@home.com>
Re: Das GlasPerlenspiel <cassell@mail.cor.epa.gov>
Re: Do you now an affordable Perl editor for Windows NT <ilya@speakeasy.org>
Re: Do you now an affordable Perl editor for Windows NT <ilya@speakeasy.org>
Re: Do you now an affordable Perl editor for Windows NT <msalter@bestweb.net>
Re: Exporting ENViroment variables back to the shell (Abigail)
Re: File exists? (Abigail)
Re: File exists? (Abigail)
GD Modul Version 1.19 for win32 ? <schulz@access.ch>
Re: gullible programmers? <ilya@speakeasy.org>
Re: gullible programmers? <ilya@speakeasy.org>
Re: how to change a '\' to '/' ? <cassell@mail.cor.epa.gov>
Re: HTML to ASCII (Kevin Reid)
Re: Knowing sizeof (int) inside a Perl program <cassell@mail.cor.epa.gov>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 6 Oct 1999 13:50:37 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: <<EOL and Sub
Message-Id: <MPG.126555f9a2475ab898a04e@nntp.hpl.hp.com>
In article <puNK3.221$QI5.8726@monger.newsread.com> on Wed, 06 Oct 1999
19:33:41 GMT, Scott McMahan <scott@aravis.softbase.com> says...
> Samay (samay1NOsaSPAM@hotmail.com.invalid) wrote:
> > Hi, Is there anyway, I can do something like
> > $a = <<EOL
> > the result of sub is
> > &mysub
> > EOL
>
> > sub mysub{
> > return 5;
> > }
>
> I do this frequently.
>
> $str = mysub();
>
> $a = <<EOL;
> the result of sub is $str
> EOL
I don't think that answer is what the poster was looking for.
One can interpolate scalars or arrays directly into any double-quoted
string, including a 'here'-document.
$a = <<EOL
the result of sub is
${\mysub()}
EOL
For a list value, the corresponding syntax is @{[mysub()]} .
See perlfaq4: "How do I expand function calls in a string?"
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 6 Oct 1999 11:22:48 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: [OFFTOPIC] Tad's Back! WAS:Regexp/Interpolation question
Message-Id: <8gpft7.4li.ln@magna.metronet.com>
Tom Briles (sariq@texas.net) wrote:
: Tad McClellan wrote:
: >
: <snipped a post by Tad>
: So who won the newsgroup pool? :)
I dunno.
If there was such a pool, nobody thought of bribing
me to influence the outcome...
My name is Tad McClellan.
I am a Usenetaholic.
It has been 2 months since my last post.
What were those 12 steps again?
:-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Oct 1999 20:06:01 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: C style was Re: Random Numbers
Message-Id: <7tga39$9sl$1@rguxd.viasystems.com>
Abigail <abigail@delanet.com> wrote:
:>which actually walks through the array in reverse order. I would
:>write that as:
:> for (my $i = @xvals; $i --;)
:>which looks simpler to me.
Aiieee! Even your C-style for loops look more Perlish than my Perl!
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: Wed, 6 Oct 1999 12:55:07 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: Calculate tan();
Message-Id: <7tg9fo$oa4$1@brokaw.wa.com>
Frank de Bot wrote in message <37FBA193.DDAB3A17@xs4all.nl>...
>How can I calculate tan(n) ?
>I've already tried Math:Complex , but every time there were silly
>numbers rolling out. Not what I've expected. I've used this code
:-) I'm afraid those numbers aren't silly.
>
>$n = 20; # an angle
>$helling = tan(20);
>
>Results:
>
>2.237.......
>
>But it should results this: 0.363.....
The result is assuming the $n is in radians. Since 1 radian is pi/180,
you can do a conversion.
$rad = deg2rad($n); # Lifted almost exactly from Math::Trig manpage
Lauren
------------------------------
Date: 6 Oct 1999 20:16:06 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: Calculate tan();
Message-Id: <7tgam6$9sl$2@rguxd.viasystems.com>
Frank de Bot <debot@xs4all.nl> wrote:
:>How can I calculate tan(n) ?
:>I've already tried Math:Complex , but every time there were silly
:>numbers rolling out. Not what I've expected. I've used this code
:>$n = 20; # an angle
:>$helling = tan(20);
:>Results:
:>2.237.......
:>But it should results this: 0.363.....
Angles can be expressed in varied units. What units is "20"?
What units does the documentation for tan say to use?
The tangent of 20 radians is around 2.237.
Having made this same error more than once and in more than one
programming language, it is a mistake that I recognize quickly. :-)
HTH
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: 06 Oct 1999 14:54:15 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Calculate tan();
Message-Id: <xkf1zb8cirs.fsf@valdemar.col.hp.com>
Frank de Bot <debot@xs4all.nl> writes:
> How can I calculate tan(n) ?
That looks pretty good to me.
> I've already tried Math:Complex , but every time there were silly
> numbers rolling out. Not what I've expected. I've used this code
>
> $n = 20; # an angle
In degrees, no? Reading the docs, I see that sin and cos take an angle
in terms of radians. It seems likely that tan would as well (though my
older copy of Perl doesn't have docs for that), would it not?
> $helling = tan(20);
>
> Results:
>
> 2.237.......
Which is the correct answer. Perl can't help it if you supplied the
wrong number.
> But it should results this: 0.363.....
First convert 20 degrees to radians, and then you'll get the answer
you want.
-=Eric
--
"Cutting the space budget really restores my faith in humanity. It
eliminates dreams, goals, and ideals and lets us get straight to the
business of hate, debauchery, and self-annihilation."
-- Johnny Hart
------------------------------
Date: Wed, 6 Oct 1999 13:56:07 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Calculate tan();
Message-Id: <MPG.12655743b4144b2798a04f@nntp.hpl.hp.com>
In article <37FBA193.DDAB3A17@xs4all.nl> on Wed, 06 Oct 1999 21:22:59
+0200, Frank de Bot <debot@xs4all.nl> says...
> How can I calculate tan(n) ?
> I've already tried Math:Complex , but every time there were silly
> numbers rolling out. Not what I've expected. I've used this code
>
> $n = 20; # an angle
> $helling = tan(20);
>
> Results:
>
> 2.237.......
>
> But it should results this: 0.363.....
The unit for the argument is radians. Multiply arguments in degrees by
pi/180.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 06 Oct 1999 15:47:20 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Calculate tan();
Message-Id: <37FBB558.9DA3DB2@texas.net>
Frank de Bot wrote:
>
> How can I calculate tan(n) ?
$tan=sin($x)/cos($x);
> I've already tried Math:Complex , but every time there were silly
> numbers rolling out. Not what I've expected. I've used this code
>
> $n = 20; # an angle
> $helling = tan(20);
>
> Results:
>
> 2.237.......
That's correct. OK so far.
> But it should results this: 0.363.....
Why would you think that? Did you read the documentation?
- Tom
------------------------------
Date: Wed, 6 Oct 1999 22:34:23 +0200
From: "Peter Møllerud" <peterm@idi.ntnu.no>
Subject: CGI and directory permissions
Message-Id: <7tgbp7$bbk$1@kopp.stud.ntnu.no>
Hi!
I was wondering if there is a way to create a directory from within a CGI
script that will give the oppurtunity to write files into the directory
further into the script ? That is, is there a way to create a directory on
the server with write access for "others" ? Usually that won't work when
you're not owner, as you not are when operating from a browser, but maybe
there is a little trick ? :=)
All help appreciated.
regards
- Peter M.
------------------------------
Date: Wed, 6 Oct 1999 22:48:34 +0200
From: "Peter Møllerud" <peterm@idi.ntnu.no>
Subject: Re: CGI and directory permissions
Message-Id: <7tgcjr$c3c$1@kopp.stud.ntnu.no>
> Hi!
> I was wondering if there is a way to create a directory from within a CGI
> script that will give the oppurtunity to write files into the directory
> further into the script ? That is, is there a way to create a directory on
> the server with write access for "others" ? Usually that won't work when
> you're not owner, as you not are when operating from a browser, but maybe
> there is a little trick ? :=)
The trick was umask :)
------------------------------
Date: Wed, 06 Oct 1999 20:39:13 GMT
From: Ilya <ilya@speakeasy.org>
Subject: Re: CGI/Perl programmer needed for NT
Message-Id: <rvncrh29n8a55@corp.supernews.com>
In comp.lang.perl.misc Ethan H. Poole <ehpoole@ingress.com> wrote:
> Eric Seiler wrote:
>>
>> Hello, I am designing a business site that requires more then what I can get
>> out of pre-written scripts. The sort of scripting I need is pretty
>> advanced, and only those familar with user management, and ecommerce
>> scripting need apply. Pay would be dependent on the net profitability of
>> the website.
> You just ruled out all of the experienced programmers.
> Experienced programmers seldom ever choose to bear another party's risks
> -- it almost never makes any financial sense unless there is a real chance
> that the business is going to become the next MS (which is unlikely and
> even then they would demand shares). The success of a venture depends at
> least as much on the competence of the Sales and Marketing people and the
> product or service. The programmer can develop the best e-commerce
> solution the world has ever seen and it will likely go *nowhere* if nobody
> knows about the product/service or if the product/service is inferior.
> These are variables beyond the programmers control, assuming the risk is
> like voluntarily shooting oneself in the foot.
> If I were a client of yours I would be rather concerned if I knew your
> e-commerce solution was devised by a programmer with limited to no
> experience in the field simply because you wanted to save a few dollars.
Excellent response, I agree!
==============================================================
Paper money eventually returns to its intrinsic value -- zero.
-Voltaire
==============================================================
------------------------------
Date: Wed, 06 Oct 1999 20:50:35 GMT
From: Ilya <ilya@speakeasy.org>
Subject: Re: CGI/Perl programmer needed for NT
Message-Id: <rvndgr6099a44@corp.supernews.com>
In comp.lang.perl.misc Eric Bohlman <ebohlman@netcom.com> wrote:
> Furthermore, most new business ventures *never* turn a profit (if the
> people who did the programming for Amazon or Yahoo had done it on the
> terms Mr. Seiler is offering, they wouldn't have seen a penny yet).
Yep. What were the terms for programmers for Amazon/Yahoo/etc, just out of
curiosity?
> Second, most successful business ventures don't report any profit for the
> first few years of their existence, even if they're actually making money,
> because of the use of (entirely legitimate) accounting techniques intended
> to save on taxes. IIRC, the only Web sites actually currently turning a
> profit are porn sites.
That is reality.
> Thus someone who does "spec work" in return for a percentage of the profits
> is unlikely to *ever* get paid. If he does get paid, he's unlikely to see
> anything for several years. The only thing dumber than agreeing to work for
> a percentage of the profits is agreeing to work for a fixed sum or hourly
> rate to be paid out of the profits. That amounts to giving somebody an
> interest-free non-recourse loan.
That's very well put.
> Spec work only makes sense if the potential payment is open-ended, and even
> then it's rare in practice that the equivalent hourly rate you make on it is
> better than you could make asking customers if they want fries with that.
> If you're foolish enough to do spec work for an hourly rate, you need to
> quote a rate based on dividing your normal hourly rate by the probability of
> getting paid the full amount. For "paid out of profits" that probability is
> going to be about 2% (it would be higher, but still quite low, if you were
> talking about payment out of gross revenues instead), so if your normal
> hourly rate was $75/hr (pretty much the absolute low end for the kind of
> skills Mr. Seiler needs), you'd need a rate of $3750/hr!
> As you alluded to, those who *have* made substantial amounts of money from
> spec work did so by taking equity positions (shares of ownership in the
> company) in return for work, and then cashed in their shares when the
> company went public.
Exactly. But there are a lot of factors that need to make it happen, and most
start ups don't make it.
> But there are signs that the stock market is losing its automatic
> infatuation with anything that has a .com in it, and that in the near future
> the only Internet ventures that will provide spectacular returns on going
> public are going to be those that establish a solid business track record
> while privately owned.
An interesting observation, thanks for sharing.
> To look at it another way, spec work is the equivalent of investing the
> amount of money that you'd normally bill for the time you spent. You need
> to evaluate such propositions the same way you would any other investment.
> Most offers of spec work represent extremely poor investments.
==============================================================
Paper money eventually returns to its intrinsic value -- zero.
-Voltaire
==============================================================
------------------------------
Date: 6 Oct 1999 15:07:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Counter
Message-Id: <slrn7vnbgf.23p.abigail@alexandra.delanet.com>
Chris Loeser (loeser@uni-paderborn.de) wrote on MMCCXXVI September
MCMXCIII in <URL:news:37F9EF1F.3FD99491@uni-paderborn.de>:
;;
;; ich moechte ganz gerne einen Counter in einem HTML-Dokument haben.
;;
;; 1.Server Side Includes ist bei dem HTTP-Server ausgeschaltet, daher :
;;
;; 2. In einer vorhandenen Seite soll ein Perl-Script aufgerufen werden und
;; die Counterzahl soll in das Dokument eingebunden werden....
;;
;; Hat jemand das schon mal gemacht ??
My German isn't well enough to answer in German. But yes, counters
aren't original, and people have done it before. Go to CPAN, there
should be modules that do the work for you.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 06 Oct 1999 16:19:14 -0400
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: Damn Comma Delmitation
Message-Id: <37FBAEC2.5E7B017E@home.com>
Eric The Read wrote:
> What about the FAQ's answer was unclear? I assume you *did* consult
> perlfaq4, "How can I split a [character] delimited string except when
> inside [character]? (Comma-separated files)". Anything we can do to
> make the standard documentation that comes with Perl more useful to
> answer such Frequently Asked Questions would be appreciated, I'm sure.
Actually, the indexing in the FAQ could be a little better. None
of the following queries will find the relevent entry:
perldoc -q "comma-separated"
perldoc -q "Comma-separated"
perldoc -q "comma separated"
perldoc -q "csv"
What does work is
perldoc -q "delimited"
this despite the fact, which folks here never tire of pointing
out, that the data is separated, not delimited, by commas.
By the way, the FAQ refers to Text::CSV, but not the more current
module, Text::CSV_XS. It recommends Text::ParseWords, but from
what I can tell, ParseWords assumes embedded quotes are
represented as \" (backslash-quote) rather than "" (two quotes),
although CSV actually specifies the latter. (Friedl makes
the same error in his otherwise superb book.)
So, yes, by all means point the questioner to the relevant
section, but be a little understanding if he/she didn't find
it (assuming they tried - not, I know, a safe assumption). And
amplify on it a bit, because there's more to this than the FAQ
indicates.
Ken Bandes
P.S. The answer is:
use Text::CSV_XS;
and, of course,
perldoc Text::CSV_XS
Text::CSV_XS is available on CPAN in the JWIED (Jochen
Wiedmann) directory, or via PPM (install Text-CSV_XS).
------------------------------
Date: Wed, 06 Oct 1999 13:44:31 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Das GlasPerlenspiel
Message-Id: <37FBB4AF.57D1A7FE@mail.cor.epa.gov>
Fujitsu Australia Limited wrote:
>
> Is Perl the Glass Bead Game or is the Glass Bead Game available as a Perl
> module?
>
> These rules, the sign language and grammar of the Game, constitute a kind of
> highly developed secret language drawing upon several science and arts, but
> especially mathematics and music, and capable of expressing and establishing
> interrelationships between the contents and the conclusions of nearly all
> scholarly disciplines, The Glass Bead Game is thus a mode of playing with
> the total contents and values of our culture; it plays with them as, say, in
> the great age of the arts painter might have played with the colors of his
> palette. All the insights, noble thoughts, and works of art that the human
> race has produced in its creative eras, all that subsequent periods of
> scholarly study have reduced to concepts and converted to intellectual
> property - on all this immense body of intellectual values the Glass Bead
> Game player plays like an organist on the organ.
>
> Hermann Hesse
> Das Glasperlenspiel
> 1943
Clearly, this is not Perl, but Mystery Science Theater 3000.
You want rec.arts.tv.mst3k.misc instead of this ng.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 06 Oct 1999 20:36:39 GMT
From: Ilya <ilya@speakeasy.org>
Subject: Re: Do you now an affordable Perl editor for Windows NT
Message-Id: <rvncmnh296o21@corp.supernews.com>
Eric Dubreuil <ericdub@sympatico.ca> wrote:
> Hi!
> I just installed Perl on my PC (Windows NT) and would like to get a nice
> editor to edit my Perl code. I looked at a few commercials ones but they
> are too expensive (and have way too many features for myt needs anyway).
> I just need cheap, freeware or chareware editor that could do code identing
> and/or keywords coloring and stuff like that. I'm looking for an editor that
> would be just a little more programmer friendly that Wordpad...
> Any suggestions?
> Thanks!
Yes, vi is an affordable editor. Swap your caps and control keys and you are
in business.
==============================================================
Paper money eventually returns to its intrinsic value -- zero.
-Voltaire
==============================================================
------------------------------
Date: Wed, 06 Oct 1999 20:37:40 GMT
From: Ilya <ilya@speakeasy.org>
Subject: Re: Do you now an affordable Perl editor for Windows NT
Message-Id: <rvncok67n8a53@corp.supernews.com>
Mark A. Hershberger <mah@everybody.org> wrote:
> [mailed and posted]
>> >I just installed Perl on my PC (Windows NT) and would like to get a
>> >nice editor to edit my Perl code. I looked at a few commercials
>> >ones but they are too expensive (and have way too many features for
>> >myt needs anyway).
>> >
>> >I just need cheap, freeware or chareware editor that could do code
>> >identing and/or keywords coloring and stuff like that. I'm looking
>> >for an editor that would be just a little more programmer friendly
>> >that Wordpad...
>>
> Look at NTEmacs. It is free, it is written for programmers and it is
> more powerful than any proprietary editor you could find. The
> included cperl-mode is better than the default perl-mode. The latest
> cperl-mode can be found on CPAN (http://www.cpan.org/).
Oh....
On the other hand, why not just use pencil and paper for an editor?
What more do you need?
==============================================================
Paper money eventually returns to its intrinsic value -- zero.
-Voltaire
==============================================================
------------------------------
Date: Wed, 06 Oct 1999 20:55:23 GMT
From: Mike Salter <msalter@bestweb.net>
Subject: Re: Do you now an affordable Perl editor for Windows NT
Message-Id: <Pine.BSF.4.05.9910061701480.12850-100000@monet.bestweb.net>
Try http://members.xoom.com/synedit
On Wed, 6 Oct 1999, Ilya wrote:
> Date: Wed, 06 Oct 1999 20:36:39 GMT
> From: Ilya <ilya@speakeasy.org>
> Newsgroups: comp.lang.perl.misc
> Subject: Re: Do you now an affordable Perl editor for Windows NT
>
> Eric Dubreuil <ericdub@sympatico.ca> wrote:
> > Hi!
>
> > I just installed Perl on my PC (Windows NT) and would like to get a nice
> > editor to edit my Perl code. I looked at a few commercials ones but they
> > are too expensive (and have way too many features for myt needs anyway).
>
> > I just need cheap, freeware or chareware editor that could do code identing
> > and/or keywords coloring and stuff like that. I'm looking for an editor that
> > would be just a little more programmer friendly that Wordpad...
>
> > Any suggestions?
>
> > Thanks!
>
> Yes, vi is an affordable editor. Swap your caps and control keys and you are
> in business.
>
>
>
>
> ==============================================================
> Paper money eventually returns to its intrinsic value -- zero.
> -Voltaire
> ==============================================================
>
>
------------------------------
Date: 6 Oct 1999 15:32:44 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Exporting ENViroment variables back to the shell
Message-Id: <slrn7vncv4.28a.abigail@alexandra.delanet.com>
Daniel W. Burke (dwb1@home.com) wrote on MMCCXXVII September MCMXCIII in
<URL:news:Pine.LNX.4.10.9910052003110.10931-100000@cc569157-a.warn1.mi.home.com>:
$$
$$ I'm trying to figure out a way to export an enviroment variable back to
$$ the shell. I've been looking and experimenting for a while now, and havn't
$$ been able to come up with anything that works.
You would install VMS.
RTFFAQ.
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 6 Oct 1999 15:36:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: File exists?
Message-Id: <slrn7vnd60.28a.abigail@alexandra.delanet.com>
Mike Heller (mike@dice.net) wrote on MMCCXXVI September MCMXCIII in
<URL:news:37FA63A3.F7C55ABC@dice.net>:
## I am writing a script that will take input from an HTML form. The user
## will input the location of a file (http://server/path/file.exe) and
## submit. I want the script to test if the file exists in the location
## provided. I know how to get data from forms, how can I check to see if
## the file exists? I read about stat() and lstat() and using the -e
## switch but this will only work on the local system, right?
Well, how are you getting the file from the remote system?
And I don't get this connection between URL and file. A URL points to
a resource. Which *may* on the server be a file, but there's absolutely
no reason it has to be. And if you use URLs and HTTP, you'll never know.
Now, how to find out whether a server is willing to give you the resource,
check the HTTP RFC.
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 6 Oct 1999 15:43:44 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: File exists?
Message-Id: <slrn7vndjp.28a.abigail@alexandra.delanet.com>
Mike Heller (mike@dice.net) wrote on MMCCXXVI September MCMXCIII in
<URL:news:37FA70C5.8AEE0926@dice.net>:
-- Thanks for the help, but I'm still having a problem. My script always prints
-- "file exists". Here is the script:
--
-- Any ideas?
It works for me:
$ perl -MLWP::Simple -wle 'print "Yes" if head "http://example.com/"'
$ perl -MLWP::Simple -wle 'print "Yes" if head "http://www.perl.com/"'
Yes
$
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 6 Oct 1999 22:32:42 +0200
From: "Andreas Schulz" <schulz@access.ch>
Subject: GD Modul Version 1.19 for win32 ?
Message-Id: <7tgbpb$7a0$1@pacifica.access.ch>
Was there a win32 version of the gd modul Version 1.19 ? If yes where can I
find it, because the new Version 1.21 supports only png instead of gif.
Thank you
Andreas
schulz@access.ch
------------------------------
Date: Wed, 06 Oct 1999 20:53:41 GMT
From: Ilya <ilya@speakeasy.org>
Subject: Re: gullible programmers?
Message-Id: <rvndmlrp9b625@corp.supernews.com>
lt lindley <ltl@rgsun5.viasystems.com> wrote:
> Eric Seiler <Webmaster@copscorp.com> wrote:
> [snip]
> :> Interesting situation, isn't it? So
> :>what would you do? What form of agreement would you use that would be fair
> :>to everyone involved?
> I would learn Perl and do it myself.
> If you are really going to be successful in your venture, you will
> need to work on your huckster, er um, sales skills. So far you will
> only have succeeded in convincing someone who is gullible. Good
> programmers are not usually gullible. They don't trust the
> documentation, the compiler, the text editor, the last backup tape or
> the ability of the person who gave them an assignment to correctly
> define the problem space, much less your unproven ability to turn a
> profit.
> But heh, I buy a lottery ticket for a dollar every once in a while
> too. The ticket isn't worth anything, but at least I get to dream.
> Maybe someone will buy some dreamtime from you with a little Perl
> development.
> You won't find that person in this newsgroup though.
I agree with that. . .
==============================================================
Paper money eventually returns to its intrinsic value -- zero.
-Voltaire
==============================================================
------------------------------
Date: Wed, 06 Oct 1999 20:54:39 GMT
From: Ilya <ilya@speakeasy.org>
Subject: Re: gullible programmers?
Message-Id: <rvndoffv9b675@corp.supernews.com>
lt lindley <ltl@rgsun5.viasystems.com> wrote:
> Eric Seiler <Webmaster@copscorp.com> wrote:
> :>Quite frankly I feel like this is Salem, and I am on trial. What is up with
> :>you guys anyway? Do people come through here regularly with spam scams or
> :>something? I'm not trying to sell anything, but when someone doubts my
> :>motivations I feel it is necessary to respond.
> I didn't question your motivations. I just questioned your ability
> to make a profit.
> You *are* trying to sell something. You are asking that someone invest
> their time (price) for potential future reward (product). If you
> really expect to sell this, then you need to work on your pitch.
Exactly . . .
> I'm with that movie character that says "show me the money," because
> until you do, I can assume that you are full of crap, and I'll be
> right at least 99.9% of the time.
> It's true that there are many anecdotal stories of people who have
> made huge gobs of money by following someone's dream (their own or
> someone elses), but the truth is that the vast majority of them
> fail. I doubt that I (or most people) have the ability to sort
> the winners from the losers. So though you may be perfectly sincere
> in your belief that this could be a good opportunity for someone,
> it looks like a sucker's bet to me.
> --
> // Lee.Lindley /// I used to think that being right was everything.
> // @bigfoot.com /// Then I matured into the realization that getting
> //////////////////// along was more important. Except on usenet.
==============================================================
Paper money eventually returns to its intrinsic value -- zero.
-Voltaire
==============================================================
------------------------------
Date: Wed, 06 Oct 1999 13:43:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: how to change a '\' to '/' ?
Message-Id: <37FBB45D.DAB67C4D@mail.cor.epa.gov>
HHH wrote:
>
> Tobias Rudolph wrote:
> > <NukeEmUp@ThePentagon.com> wrote:
[snip]
> > When I read the file (@lines = <FILE>), I want to change all the
> > '\'-delimiters to '/'.
>
> How 'bout:
> $path =~ s/\\/\//g;
Good.
But tr/// is a much better choice when making single-character
translations. Like:
tr{\}{/} foreach (@lines);
or
tr#\#/# foreach (@lines); # if you prefer to break
# bad comment-strippers :-)
And, if you want to use s/// , you probably want to use
a different delimiter, so your substitution is easier to read.
We call it "leaning-toothpicks syndrome" around here.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 6 Oct 1999 16:57:22 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: HTML to ASCII
Message-Id: <1dz9e70.7lp2y21ma1ku8N@imac.loc>
John Porter <jdporter@min.net> wrote:
> In article <slrn7vl52n.b94.dha@panix7.panix.com>, David H. Adler wrote:
> >In article <37fa17dd_1@newsread3.dircon.co.uk>, Jonathan Stowe wrote:
> >>In comp.lang.perl.misc John Porter <jdporter@min.net> wrote:
> >>>
> >>> You think? I'm guessing Logo.
> >>
> >>That would explain why they couldnt go up stairs ;-}
> >
> >They must have ported then, as they can, now...
>
> Hmm. I wonder if there is a 3-d version of Logo.
Yes, 3D Logo for the Apple IIGS. It comes with a pair of red-blue
glasses.
--
Kevin Reid: | Macintosh:
"I'm me." | Think different.
------------------------------
Date: Wed, 06 Oct 1999 13:22:21 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Knowing sizeof (int) inside a Perl program
Message-Id: <37FBAF7D.F85E74CE@mail.cor.epa.gov>
Martien Verbruggen wrote:
>
> \begin[pedantic]{offtopic}
>
> On Tue, 05 Oct 1999 09:07:09 GMT,
> JAG <greenej@my-deja.com> wrote:
> > In article <37F93B62.5A371C6@mail.cor.epa.gov>,
> > David Cassell <cassell@mail.cor.epa.gov> wrote:
> > > I thought that by definition sizeof(char) had to be 1.
>
> You are right.
I knew. I've seen the standard too. But I just left
my <sarcasm> tag in my other shirt. See the smiley?
|
|
> > > Huh. Oh well, live and learn... :-) <-
>
> And learn more :)
And still learning. I still have a lot further I want
to move up the Perl learning curve. And my C isn't that
good.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1005
**************************************