[9994] in Perl-Users-Digest
Perl-Users Digest, Issue: 3587 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 30 04:03:56 1998
Date: Sun, 30 Aug 98 01: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, 30 Aug 1998 Volume: 8 Number: 3587
Today's topics:
Re: [BUG?] A suspected bug in m// and s/// (but probab (Ronald J Kimball)
Re: AS400 PROGRAMMERS W/JD EDWARDS NEEDED FOR MIGRATION (Jonathan Stowe)
Re: Can you reload frames (Abigail)
Re: CGI Script Question <rootbeer@teleport.com>
Re: Change NT IP Address Using Perl <tlilley@perspex.com>
Re: File creation simple@nanospace.com
Re: HELP! I get a /usr/libexec/ld.so: warning (Jonathan Stowe)
Re: how can I print 10 digit nos. using 0s as place hol <zenin@bawdycaste.org>
Re: How to extract first letter in string? (Jonathan Stowe)
Re: How to extract first letter in string? (Mike Stok)
Re: Imagine... a non-greedy world! (Jonathan Stowe)
Re: Imagine... a non-greedy world! <uri@sysarch.com>
Re: Imagine... a non-greedy world! (Michael Rubenstein)
Re: Installation Problem on redhat linux (Jonathan Stowe)
Re: not able to output to browser (Jonathan Stowe)
Re: parsing "mulitpart form-data" with cgi-lib.pl on JW (Jonathan Stowe)
Re: Perl documentation (Jonathan Stowe)
Re: Perl documentation (Jonathan Stowe)
Re: Perl documentation (Jonathan Stowe)
perl regex bug? (or feature?) (Peter J. Kernan)
Re: Perl Script to Retreve HTML Files from the Internet <nguyend7@msu.edu>
Re: Posting images from a mSQL database simple@nanospace.com
Re: running as setuid (Jonathan Stowe)
Re: tripped on chomp (Larry Rosler)
Re: Uploading Binary files <rootbeer@teleport.com>
Re: Uploading Binary files simple@nanospace.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 29 Aug 1998 23:55:09 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: [BUG?] A suspected bug in m// and s/// (but probably already known :-)
Message-Id: <1dejr34.xu43oi12blz0wN@bay2-42.quincy.ziplink.net>
Wade Holst <wade@cs.ualberta.ca> wrote:
> In the following tidbit of code, note the existence of a '/' in the
> comment associated with the regular expression.
m/ How should Perl deal with # this? /x;
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 30 Aug 1998 00:15:07 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: AS400 PROGRAMMERS W/JD EDWARDS NEEDED FOR MIGRATION PROJECT
Message-Id: <35e8928d.48772685@news.btinternet.com>
On Sat, 29 Aug 1998 16:36:29 GMT, yashford@bellsouth.net wrote :
> ATTENTION CONSULTANTS/CONSULTING FIRMS
> 30 AS400 PROGRAMMERS W/JD EDWARDS NEEDED!!!!!!!!!
Eat photon death fleshy one !
I dunno about anyone else but I dont see no Perl in there at all - but
maybe its a challenge I mean there is a port to AS/400 isnt there?
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 30 Aug 1998 00:10:55 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Can you reload frames
Message-Id: <jM0G1.58$Ts1.128288@client.news.psi.net>
Mark FINOCCHIARO (mfin@ecr.mu.oz.au) wrote on MDCCCXXIV September
MCMXCIII in <URL: news:6s83oi$ciu$1@mulga.cs.mu.OZ.AU>:
++ Using forms is is possible to send data to more than one perl script?
Sure it is. Just hack your server the same way as you would to send
data to more than on C program.
HTH. HAND.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
------------------------------
Date: Sun, 30 Aug 1998 00:23:05 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: CGI Script Question
Message-Id: <Pine.GSO.4.02A.9808291721210.15614-100000@user2.teleport.com>
On Sat, 29 Aug 1998 rknig@my-dejanews.com wrote:
> Subject: CGI Script Question
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
> open (OUT,">req1");
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 29 Aug 1998 20:42:55 -0400
From: Tripp Lilley <tlilley@perspex.com>
Subject: Re: Change NT IP Address Using Perl
Message-Id: <Pine.LNX.3.95.980829203538.15485Y-100000@mail.perspex.com>
> - <root.noharvest.\@not_even\here.com> =A6=B8=BCg=A4J=A8=EC=A5D=C3D
> <35d48707.268535298@news2.cais.com>...
> > "wkchiu" <wkchiu@yahoo.com> Said this:
> >=20
> > >Is it possible to change the IP Address and Gateway using Perl ? What
> Perl
> > >command can I use ?
> > >
> >=20
> > Don't you still have to reboot an NT machine to change the IP address
> > anyway? =20
> >=20
> > Get a linux box, and you can do it "on the fly" any way you like,
> > perl, shell script, whatever. ;)
While I heartily agree with you, this isn't exactly useful commentary. I
believe the answer the original poster sought is "yes, you can, and
here's how:".
IP address and gateway are stored in the registry. I'll be damned if I can
remember the fully-qualified key, and I'm on a Win95 box right now, but if
you search the registry for your hostname, you'll find the IP address and
such nearby.=20
You can manipulate the registry using the Win32::Registry package, which
ought to be in your Perl distribution, but is available in libwin32. If
you aren't up to building libwin32, try Gurusamy Sarathy's Win32 kit
(http://www.perl.com will point you there).
- t.
-----------------------------------------------------------------------
Tripp Lilley, Perspex Imageworks, Inc. (tripp.lilley@perspex.com)
-----------------------------------------------------------------------
"As long as America's educational system : Professor Dick Solomon
remains woefully inadequate, I rule!" : Third Rock from the Sun
------------------------------
Date: Sat, 29 Aug 1998 17:02:14 +0100
From: simple@nanospace.com
Subject: Re: File creation
Message-Id: <simple-2908981702140001@tc1-dialin17.nanospace.com>
Its a permissions problem:
Files have permissions for User, Group, and Other:
The directory your cgi stuff is in is probably set to 755.
Thats read, write and execute for User (thats you), read and execute for
group and read and execute for other. When the webserver invokes a
script, it invokes it as nobody. They do this for security reasons. I'd
creete a directory somewhere that is set to 666. Read and write for U, G,
and other. That way your script can write files when invoked by the web
server but the files wont be executable in case somebody is trying to work
some mischief.
In article <1998Aug24.115737@orchid>, salamat@cs.concordia.ca (Hooman
Salamat) wrote:
> I have a question.
> How we can create a file using perl when you write CGI program.
> For example: open(FH,"+>filename"); although it works for perl,
> but it doesn't work, if you use it in a CGI program and that file
> doesn't exist.
>
> Hooman
> --
> Hooman
>
>
> ==================================================================
> Homepage: http://www.cs.concordia.ca/~grad/salamat
>
> Address(office) : Concordia university
> Sir George Williams Campus
> 1455 De Maisonneuve Blvd. West
> Office location: S LB 1041-1
------------------------------
Date: Sun, 30 Aug 1998 00:15:08 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: HELP! I get a /usr/libexec/ld.so: warning
Message-Id: <35e89493.49290793@news.btinternet.com>
On Sat, 29 Aug 1998 12:37:05 -0600, QDesigns wrote :
>Hello folks:
>
>Im new in server configuartion, but yesterdar I try to configure
>perl 5.0004 in my server and after many problems I finally do it
>
>but now when I run perl5 command I get this error
>
>/usr/libexec/ld.so: warning: /usr/lib/libc.so.3.0: minor version 0 older
>than expected 1, using it anyway
>
I would suggest that you compiled your perl on a system other than the
one you are now running it.
Rebuild Perl on the system - that will resolve the problem.
>And it is causing some problems whit my scripts
>
Yes I suppose it would do.
>How cant I quit this message
Recompile or turn off your monitor.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 29 Aug 1998 20:49:06 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: how can I print 10 digit nos. using 0s as place holders
Message-Id: <904423501.805445@thrush.omix.com>
John Porter <jdporter@min.net> wrote:
: I noticed that it was very sensitive to how I rigged it up
: -- e.g. creating multiple lvalue refs in a loop/map crashed,
Or when trying to make many substr() lvalue refs all
pointing to different pieces of the same SV. Yes, I
was sick and twisted enough to try that. :-)
: but creating the same in distinct statements was o.k.
Pretty much. But they did seem to freak out the older
DBD::Oracle driver and make perl to some really, really
odd things like skipping opcodes altogether or running
some multiple times... Funky stuff.
: (I'm using 004_04.) So, is it fixed and stable in 005?
Well, the perldelta page actually documents it, and since
there are no cavents listed we can safely assume it's stable,
right? :-)
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Sun, 30 Aug 1998 00:35:16 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: How to extract first letter in string?
Message-Id: <35e89c45.51181751@news.btinternet.com>
On Sat, 29 Aug 1998 22:25:48 GMT, Rick Delaney wrote :
>Jonathan Stowe wrote:
>>
<snip>
>>
>> @char = split(//,$string);
>>
>> print @char[0],"\n";
>>
>
>You mean $char[0], of course.
>
I meant $char[0], of course.
>
>use Benchmark;
>timethese(1000000,
> {
> SPURIOUS => sub { "This is the first character" =~ /(^.{1})/ },
> NORMAL => sub { "This is the first character" =~ /^(.)/ },
> }
>)
>__END__
>Benchmark: timing 1000000 iterations of NORMAL, SPURIOUS...
> NORMAL: 14 secs (15.24 usr 0.00 sys = 15.24 cpu)
> SPURIOUS: 18 secs (17.62 usr 0.00 sys = 17.62 cpu)
>
This I do find interesting - I would have thought that the two would
have resolved to the same thing or does the regex engine build the
entire mechanism to deal with any values between the {} regardless ?
Look at the code and take some headache pills I guess.
>Probably not as meaningful as the extra second to type it.
>
And I thought my typing was slow.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 30 Aug 1998 00:31:39 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: How to extract first letter in string?
Message-Id: <6sa6hb$tu@news-central.tiac.net>
In article <35E7D91D.A1CE61ED@NOSPAMstridhammar.pp.se>,
Daniel Stridhammar <daniel@NOSPAMstridhammar.pp.se> wrote:
>> Are there anyone, who can tell me how to extract the first letter in a
>> string..
>
>Use:
>
>$firstLetter = substr($string, 1, 1);
Might something like
($firstLetter) = $string =~ /([^\W\d_])/;
be better if the original poster really wanted the first letter, not the
first character?
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Sun, 30 Aug 1998 00:15:01 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Imagine... a non-greedy world!
Message-Id: <35e888c2.46265634@news.btinternet.com>
On Sat, 29 Aug 1998 14:44:35 GMT, Patrick Timmins wrote :
>In article <35E7B28D.2207FF28@mine.com>,
> Mee <mee@mine.com> wrote:
>> To: All priests of Perl black maguc
>>
>> My favorite beef with Perl (besides it being the ugliest
>> language man has ever devised) is its implementation of
>> Regular Expresssions (regexp).
>
>Wheeeeere's the Beef!? You have no beef ... only problems.
>
No that is his problem - he's had too much beef and them prions
screwed with his faculties. I for one have no problem with the Perl
implementation of regular expressions but A) I dont have any
experience of another programming language that can even be said to
make a fair fist of them, and B) I have been vegetarian for eighteen
years and thus have probably not been attacked by the prion.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 30 Aug 1998 02:36:41 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <x7zpcn2cxy.fsf@sysarch.com>
>>>>> "M" == Mee <mee@mine.com> writes:
M> Michael, Your explanation would make sense if '*?' was considered
M> as one quantifier by Perl, but they sure look like two to me.
M> Perl seems to agree by merrily accepting '*' alone as a quantifier.
this thread is very annoying. or rather your comments are annoying. the
replies to you have been mostly humorous and somewhat worth the use of
electrons and pixels.
have you read the previous reply about greedy and '?' or read perlre or
read mastering regular expressions or used any other regex in any other
system before? obviously not. the history of quantifiers is greedy.
perl changed and improved that that by adding the non-greedy MODIFIER
(emphasis for mee who can't see :-) of ? so *? is ONE modifier which is
non-greedy. can you grok that? you have CHOICE with perl regexes. just
learn the damned difference of the greedy vs. non-greedy syntax and use
them the way you want.
for a more technical discussion og '*?' being misunderstood by you as 2
modifiers, what can the trailing '?' be modifying? if * means 0 or more
of the previous thing and ? means 0 or 1 of the previous thing then what
logical meaning has '*?' ? 0 or or 0 or 1 of the previous thing? useful
semantics, eh? so larry in his infinite wisdom (all bow down to larry
now :-) made that useless combination into something VERY valuable in
the regex world which is the ability to choose greediness and we all
thank him for it. it has saved many a regex from being more complicated
than abigail or friedl could fathom.
the reason you got teased, flamed, abused, etc. is your lack of
understanding of what a modifier or quantifier is before you flamed the
perl language for its use and of them. perl was designed not in a vacuum
but in a history rich with other languages and it stole many features from
them. this actually made it very popular since if you knew one or more
of those languages (C, sh, awk, sed, lisp, others) you could pick up
perl quicker and understand its great philosophy.
your comments on perl's regex behaviour were not clear, valid, rooted in
understanding of regexes, or anything else useful to this group.
i hope i expressed the feelings of many regulars here.
new subject: imagine... lusers RTFM
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Sun, 30 Aug 1998 07:38:18 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Imagine... a non-greedy world!
Message-Id: <35eafcac.362098700@nntp.ix.netcom.com>
On Sat, 29 Aug 1998 22:25:43 -0700, Mee <mee@mine.com> wrote:
>Michael,
>
>Your explanation would make sense if '*?' was
>considered as one quantifier by Perl, but they
>sure look like two to me.
>
>Perl seems to agree by merrily accepting '*'
>alone as a quantifier.
*? is two characters, but it is one quantifier -- it does a nongreedy
match. Both *? and * are single quantifiers; the normal *? means
nongreedy. You remove the ? to get the nondefault greedy matching.
As I said, it seems strange, but you must recognize that other, less
enlightened authors, had already used * for greedy matching. To avoid
confusion, Perl made the normal, nongreedy quantifier *?.
In case you're still having trouble with this, let me rephrase my
point:
WHAT THE HELL DIFFERENCE DOES IT MAKE? Perl offers both greedy and
nongreedy versions of the quantifiers. Which one you call the normal
and which you call the modified one is entirely arbitrary.
--
Michael M Rubenstein
------------------------------
Date: Sun, 30 Aug 1998 00:35:15 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Installation Problem on redhat linux
Message-Id: <35e89a30.50674354@news.btinternet.com>
On Sat, 29 Aug 1998 23:03:50 GMT, rknig@my-dejanews.com wrote :
>I am trying to compile perl version 5.004_04. The configure script runs fine
>but when I type make I get the following error:
>
>[perl5.004_04]$ make
>makefile:441: *** missing separator. Stop.
>
Interesting. I have seen this error message for instance when trying
to use a DOS makefile in Unix. You didnt by any chance download to a
WIN/DOS machine and unpack the files with a WIN/DOS utility of some
description.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 30 Aug 1998 00:15:05 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: not able to output to browser
Message-Id: <35e88f87.47998902@news.btinternet.com>
On Sat, 29 Aug 1998 08:34:44 -0700, Dan Bassett wrote :
>Can anyone tell me why the following simple code will not output to the
>browser,
>but if you run it through the shell, the output is displayed? Am I missing
>something? I'm trying to output the quota command results to the web
>browser.
>
<snip code>
When something works fine from the command line but fails to do so in
some other environment (such as CGI,cron etc etc) that is a sure sign
that this is not a Perl problem but is entirely due to the differences
in the runtime environment which would effect a program written in any
language. The question would be most appropriately asked in a
newsgroup related to the environment to which you have submitted your
program.
Things to look out for however might include: the rights of the user
that runs the program to any resources the program might require;
Environmental information that is not available in the environment
that the program is run in; the method of out put used by the
program.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 30 Aug 1998 00:15:03 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: parsing "mulitpart form-data" with cgi-lib.pl on JWS
Message-Id: <35e88c7c.47219901@news.btinternet.com>
On Sat, 29 Aug 1998 14:07:33 +0100, simple@nanospace.com wrote :
>I've posted this before, but let me rephrase it.
>
I know, I saw the previous post but ignored it
>I need to use the cgi-lib.pl to parse a file upload via http. That is I've
>created a form on a web page that uploads a file from your hard drive. In
>the form you have to specify an enctype of multipart/form-data.
>
Any reason why you arent using CGI.pm ? As a matter of interest.
>This same Perl script which requires cgi-lib.pl v2.17 correctly parses an
>uploaded file through IIS on windows NT and through Apache on Linux and
>Solaris. It fails on Java Web Server on Windows NT.
>
Ah, then this isnt really a problem with Perl then ? This is a bug
in, or misconfiguration of, your server n'est ce pas ?
>I can simply do away with cgi-lib.pl and redirect STDIN to write to file,
>but there are other elements that need to be parsed out. I'm trying to
>avoid rewriting that part of cgi-lib.pl that deals with parsing
>mulitpart/form-data. At least until I've made a reasonable check of the
>news groups.
>
I would suggest that saving the data to a file and then running a Perl
program over them at some later point to do the required parsing could
be a possible solution if the problem with the server proves
intractable.
>
>Does anyone have experience using web forms to do file uploads to a Java
>Web Server and successfully using the cgi-lib.pl to parse the data?
Anyhow I thought the big thing about the Java Web Server was that you
could write server extension classes in Java. I was impressed with
Jigsaw but it all seemed a bit complicated from my Apache-centric
point of view (thats probably a reaction to over-exposure to IIS).
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 30 Aug 1998 00:14:54 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl documentation
Message-Id: <35e87cb2.43320061@news.btinternet.com>
On Sat, 29 Aug 1998 14:43:40 GMT, David Hawker wrote :
>On 27 Aug 1998 05:30:28 GMT, Tom Christiansen <tchrist@mox.perl.com> felt
>the need to post:
>
>>In comp.lang.perl.misc, <A HREF="mailto:david.hawker@cableol.co.uk">
>>writes:
>>
>>:>Everyone should be familiar with the pointers in the top-level
>>:>manpage. I've starred the ones most important to beginners.
>>:
>>:I'm familiar with it but I'm not going to mush my brain by reading through
>>:20 huge texts looking for something whose whereabouts I'm unsure of.
>>
>>Grep.
>>
>>grep grep grep grep grep grep. grep grep grep grep grep grep.
>>
>>Grep.
>
>I take it grepping is some means of searching through files for text
>strings?
>
Or the noise that toads make.
No not "some means" - *the* means on Unix - it has a regular
expression engine almost as powerful as that of Perl with some
features that make it ideal for this kind of task (i.e. searching
textual documentation) - You are familiar with the perlfunc of the
same name of course ? For your command line pleasure there are a
number of ports of GNU software to the MS platforms - those based on
djgpp a DPMI dos extender available from www.delorie.com (or mirrors)
which will run on any DOS system with a DPMI server (windows
3.11,OS/2,Win95 etc) and those based on cygwin32(which only run on
Win32 platforms - Win9[58],NT) available from www.cygnus.com.
Download and enjoy. Tell them Jonathan sent you ;-}
Life without grep is like life without beer - and I just went to the
fridge and got a grep.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 30 Aug 1998 00:14:59 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl documentation
Message-Id: <35e882d9.44753054@news.btinternet.com>
On Sat, 29 Aug 1998 14:43:32 GMT, David Hawker wrote :
>On 23 Aug 1998 23:00:15 GMT, abigail@fnx.com (Abigail) felt the need to
>post:
>>
>>If you're that afraid of spam, don't post to Usenet.
>
>The benefits are too great.
>
>>Better weld your mailbox shut too.
>
>Oh?
>
Well for myself I find that I get more paper Junk mail through the
letter box than I do spam. Infact I have had no spam all week but
have had several offers of cheaper credit cards/cheap airfares/save my
soul for a donation to some charity/ etc etc. And I take no
precautions whatsoever against spam - and obviously one cant put a
false name and address when applying for bank account/credit card or
whatever and it is a real pain in the butt to go the office of the
data protection registrar to complain every time I get a bit of
unsolicited mail. Maybe I should get the Postman to sue for an
industrial injury.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 30 Aug 1998 00:14:58 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl documentation
Message-Id: <35e880ed.44261311@news.btinternet.com>
On Sat, 29 Aug 1998 14:44:33 GMT, David Hawker wrote :
>I don't think Windows 3.1 had a built-in search facility. Neither did
>MS-DOS. That's how deprived we are (or were).
I dunno, I've got Caldera OpenDos 7.01, nee DR-DOS here and the FIND
command does go so some of the way toward being a grep clone of sorts
[although of course it does not support regular expressions at all as
far as I can determine].
Of course one can always supply oneself a grepoid thing using perl - I
think that Tom Christiansen posted one back at the beginning of the
year - it was called TCGREP you could look it up in DejaNews.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 30 Aug 1998 04:11:29 GMT
From: pete@theory2.phys.cwru.edu (Peter J. Kernan)
Subject: perl regex bug? (or feature?)
Message-Id: <6sajdh$rtc$1@pale-rider.INS.CWRU.Edu>
perl -ne 'print if /^[^aeiouA-Z][aeiou][^aeiou]$/' < /usr/dict/words
bad
bag
bah
ban
bar
bat
bay
be #whoa there!
bed
...
i expected somthing like egrep's behavior
egrep '^[^aeiouA-Z][aeiou][^aeiou]$' /usr/dict/words
bad
bag
bah
ban
bar
bat
bay
bed
...
(looks good)
w/perl5.004_04 i need to
perl -ne 'print if /^[^aeiouA-Z][aeiou][^aeiou\n]$/'
to get what i expected at the top w/perl and got w/egrep.
which surprised me and seems bizarre. If the /[^aeiou]$/
matches the new-line in the character class why does the
end-of-line anchor also match the newline? if it was
matching "be\n\n" this would seem more reasonable (yet
still absurd), but that can not happen with the -n switch.
should i re-read the owl book? the camel book? the perlre
manpage?
bug or feature?
--
Pete Kernan CWRU Physics/Statistics Depts
http://theory2.phys.cwru.edu/~pete
------------------------------
Date: 30 Aug 1998 05:39:38 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: Perl Script to Retreve HTML Files from the Internet
Message-Id: <6saoiq$pn2$1@msunews.cl.msu.edu>
Brian Zuill <brian@toogood.com> wrote:
: I don't want to view the file on screen and I don't want to use Lynx
: or any browser to get the file.
I'm assuming that this file isn't on your computer, otherwise this
would just be a stupid question.
Do you have FTP access to this file?
if( condition ) {
use Net::FTP;
}
else {
use LWP::Simple; #it's easier to use
}
Note, that if you do not have FTP access, then you probably will have
to grab it through HTTP. Remember that's if HTTP is used the content
may be tailored to the specific browser.
-dan
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: Sat, 29 Aug 1998 17:13:51 +0100
From: simple@nanospace.com
Subject: Re: Posting images from a mSQL database
Message-Id: <simple-2908981713510001@tc1-dialin17.nanospace.com>
Lets say you have an image file some where:
open (IMAGE, "$imagefile");
print "Content-Type: image/jpeg\n\n";
while (<IMAGE>) {
print;
}
or
while ($line = <IMAGE>) {
print $line;
}
close IMAGE;
In article <6rju5a$ccs$1@nnrp1.dejanews.com>, sbernard@mail.esiea.fr wrote:
> Hi all,
>
> Well, I'm in trouble because I don't manage to send a variable as an image.
> Well, I've made a script to upload a image file, and put it in a database. All
> is ok, but then, I want to put this image into an HTML page, and I just can't
> make the browser print it by a simple :
> print "Content-type : image/jpeg\n\n";
> print $image;
>
> Well $image contains my image, it is a concatenation of many bytes handled
> as if they are characters (the same thing in fact).
>
> If someone can helps ...
> Sebastien BERNARD
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Sun, 30 Aug 1998 00:15:10 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: running as setuid
Message-Id: <35e8960f.49670654@news.btinternet.com>
On Sat, 29 Aug 1998 16:35:20 -0500, Paul Phillips wrote :
>I have seen various references in this group to running a perl program
>as setuid. I'm afraid that I need some help understanding what this
>means.
>
<snip>
>
>I know of course that the real user of a program is the one who created
>it. I also know how to use chmod to modify permissions. How would I
>use chmod to change the effective user of a program? Why would I want
>to?
>
I would encourage to read the chmod(3) manpage on your unix system if
you have access to it.
Essentially, setting the setuid bit on an executable files permissions
indicates that the process should be run as if by the owner of the
file. You might set that permission with "chmod o+swrx,gu+rx <file>"
or the possibly more sensible "chmod 4755 <file>".
Again check the manpage for chmod(3) and possibly the setuid library
function.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 29 Aug 1998 23:59:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: tripped on chomp
Message-Id: <MPG.10529848280de287989813@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <35E8B809.95D519CE@postoffice.pacbell.net> on Sat, 29 Aug 1998
19:25:13 -0700, bray1@postoffice.pacbell.net
<bray1@postoffice.pacbell.net> says...
...
> In its Perl FAQ, the host server says Perl 5 is located in
> /usr/local/bin/perl. That's how the #! reads in my little script.
> When I edit the script to chop ($name), it runs without errors.
> Is chomp new to Perl 5? Could I be using 4 on the server, even though
> I've followed the faq's instructions?
It certainly seems that way. To prove it, either type:
/usr/local/bin/perl -v
from a command line, or run this script:
#!/usr/local/bin/perl
print $], "\n";
Then ask your system administrator to install or point you to Perl 5.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 30 Aug 1998 00:26:40 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Uploading Binary files
Message-Id: <Pine.GSO.4.02A.9808291723170.15614-100000@user2.teleport.com>
On Sat, 29 Aug 1998 simple@nanospace.com wrote:
> binmode <STDIN>;
That's not likely to be what you want.
> binmode <STDOUT>;
That's even more likely not to be what you want.
> binmode <STDERR>;
And that's nothing like anything you would ever want. (Do you really think
that your error messages are going to be in binary? What a thought!)
Better luck next time!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 29 Aug 1998 16:41:45 +0100
From: simple@nanospace.com
Subject: Re: Uploading Binary files
Message-Id: <simple-2908981641450001@tc1-dialin17.nanospace.com>
I'll bet your on some kind of Windows box that makes a distinction between
binary and text files.
Try this at the beginning of your script. Not at the very beginning, but
before you make any attempt to read or parse the data.
binmode <STDIN>;
binmode <STDOUT>;
binmode <STDERR>;
In article <35E71CA8.193F8915@SDRC.com>, Jeff Handley
<Jeff.Handley@SDRC.com> wrote:
> I am trying to write a CGI script in Perl which handles a file upload
> from a form. I can read in and save text files without a problem, but
> when I read in binary files, they become corrupt. Has anyone done this
> successfully?
>
> Thanks in advance,
>
> Jeff
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3587
**************************************