[11073] in Perl-Users-Digest
Perl-Users Digest, Issue: 4673 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 17 12:04:30 1999
Date: Sun, 17 Jan 99 09:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 17 Jan 1999 Volume: 8 Number: 4673
Today's topics:
Re: A plea for less goofy signature files! <jdf@pobox.com>
Re: A plea for less goofy signature files! <new_email@see.web.page>
Re: A plea for less goofy signature files! ptimmins@netserv.unmc.edu
Re: CGI error with C extensions in PERL <gellyfish@btinternet.com>
Re: CGI error with C extensions in PERL <blackk@dial.oleane.com>
CGI/Email modules? <chrisl@hamptons.com>
Re: CGI/Email modules? (Alastair)
Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus <ebohlman@netcom.com>
Re: FAQ (Randal L. Schwartz)
Re: File Upload. <gellyfish@btinternet.com>
Re: File Upload. <gwynne@utkux.utk.edu>
Re: File Upload <gellyfish@btinternet.com>
Re: File Upload <gsx97@yooo-esssss-aaaa.net>
Re: filter href-links from web-page ? <gellyfish@btinternet.com>
Re: Free Perl enabled CGI Webhosting Service (Randal L. Schwartz)
Re: Is perlcc installed by default with 5.004_04 ? <gellyfish@btinternet.com>
Re: looking for serial to socket program <gellyfish@btinternet.com>
Re: Perl Criticism (Richard Clamp)
Re: Perl for Win32 Newbie <gellyfish@btinternet.com>
Personalized webpage <awc@usit.net>
Re: Regex challenge (Ilya Zakharevich)
Re: Routing picture from my other site <onasc@home.com>
Re: Syntax help wanted: "use strict" and sort $a and $ <ebohlman@netcom.com>
Re: Treating Strings as FILEHANDLES <rick.delaney@home.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Jan 1999 16:49:55 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: "Phlip" <new_email@see.web.page>
Subject: Re: A plea for less goofy signature files!
Message-Id: <m367a5nbks.fsf@joshua.panix.com>
"Phlip" <new_email@see.web.page> writes:
> Hey! Jonathan Feinberg
> posted something and then cancelled it!
> Did he have anything to say for himself?
I was going to claim authorship (and correct the code) but it was done
for me.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 17 Jan 1999 08:17:10 PST
From: "Phlip" <new_email@see.web.page>
Subject: Re: A plea for less goofy signature files!
Message-Id: <77t2e6$562@journal.concentric.net>
Russ Allbery wrote:
>...the signature tear line ("-- \n")...
I have to ask - is that space between the second dash and the
linefeed part of the standard?
--
Phlip at politizen dot com (address munged)
======= http://users.deltanet.com/~tegan/home.html =======
-- I'l have my Web site call your Web site --
------------------------------
Date: Sun, 17 Jan 1999 16:17:29 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: A plea for less goofy signature files!
Message-Id: <77t2ej$mrk$1@nnrp1.dejanews.com>
In article <77qo3u$lq7@journal.concentric.net>,
"Phlip" <new_email@see.web.page> wrote:
> Newsgroupies
>
> Perl users, for some reason moreso than for other languages, like to
> invent strings of nonsense that vaguely resemble source code and put
> them in their signature files, like this:
>
> (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
> y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
>
> That practice is not in the Open Source Software movement's best
> interests.
Another problem solved ... good work Phip! I can *hear* the Open Source
Software movement springing back to life ... it's been teetering on the
brink of collapse in recent months ... Your post may have single-handedly
changed the future of computing.
> "The Cause" - beating the commercial idiots at their own game, in
I think you have this one under control as well ... bravo!
> in each list server's archives. But signature files like this jam
> the search engines with smug false hits!
The smug ones are *particularly* annoying. I hate it when I search on
"perl" and a good 35%-45% of the 1,228,777 hits returned (Infoseek)
contain an air of smugness ... I'm sure this must annoy others as well.
Patrick Timmins
$monger{Omaha}[0]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 17 Jan 1999 12:46:02 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: CGI error with C extensions in PERL
Message-Id: <77sm2a$t0$1@gellyfish.btinternet.com>
On Sat, 16 Jan 1999 18:02:50 +0100 Black K wrote:
> Hye and thanks for your help.
>
> I call a C function from Perl ( XS ) to make an extension.
> The Perl script works under shell, but the CGI fail to call the function
> while it is running.
> I did not install the extension yet.
>
> Any clue about what I missed ? Do I have to install the extension beofre
> being able to run the cgi?
>
I would say so - inasmuch as I guess that you ran the test program in the
same directory that you compiled the directory and it worked - you will
need to install the extension in the correct place for Perl to know where
to find it.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 17 Jan 1999 15:33:23 +0100
From: "Black K" <blackk@dial.oleane.com>
Subject: Re: CGI error with C extensions in PERL
Message-Id: <77ssgr$rct$1@minus.oleane.net>
Thanks for your answer.
I cannot run make install because I don't have the rights to do it.
Do you know another way to install the extension ?
Thanks again,
KB
------------------------------
Date: Sun, 17 Jan 1999 15:39:17 GMT
From: Chris <chrisl@hamptons.com>
Subject: CGI/Email modules?
Message-Id: <36A20425.475A7503@hamptons.com>
Howdy,
I need to do some simple CGI with Perl - nothing beyond sending some
Emails. I did this all years ago, but it was Perl 4 and I didn't use any
modules. It wasnt hard to do by hand, but if some standard/prevalent
modules have been developed for this I'd just as soon use em, for
reasons of code quality and, more importantly, laziness. Is there
anything? And where do I find out about modules in general?
Thanks,
Chris
------------------------------
Date: Sun, 17 Jan 1999 16:47:41 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: CGI/Email modules?
Message-Id: <slrn7a452j.5f.alastair@calliope.demon.co.uk>
Chris <chrisl@hamptons.com> wrote:
>Howdy,
>
>I need to do some simple CGI with Perl - nothing beyond sending some
>Emails. I did this all years ago, but it was Perl 4 and I didn't use any
>modules. It wasnt hard to do by hand, but if some standard/prevalent
>modules have been developed for this I'd just as soon use em, for
>reasons of code quality and, more importantly, laziness. Is there
>anything? And where do I find out about modules in general?
Check the CGI module ;
http://stein.cshl.org/~lstein/
(or CPAN ofcourse : http://www.cpan.org).
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Sun, 17 Jan 1999 15:26:20 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus!
Message-Id: <ebohlmanF5pMvx.7u6@netcom.com>
Jonathan Feinberg <jdf@pobox.com> wrote:
: dturley@pobox.com writes:
: > (Remembering that half the world is below average intelligence.)
: I think you'll find that half the world is below *median*
: intelligence. HTH!
Since psychometricians have, for the last 75 years, assumed that any
instrument that is a valid measurement of intelligence must give scores
that follow a normal distribution (one of whose properties is symmetry,
i.e. the mean and median are identical), his statement isn't that far off.
Note that intelligence tests are specifically constructed to produce a
normal distribution of scores, and potential test items that give an
asymmetric distribution of performance in pilot testing don't make it
into the final tests. The business of intelligence testing is a lot more
arbitrary than most people think (similarly, test items that show a
performance difference between males and females are excluded, simply
because Lewis Terman and his colleagues believed that there could be no
true intelligence differences between the sexes and that therefore any
measure that showed a difference must be measuring achievement rather than
aptitude).
------------------------------
Date: 17 Jan 1999 06:38:04 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: FAQ
Message-Id: <m1pv8ermlv.fsf@halfdome.holdit.com>
>>>>> "Scot" == Scot C <scotc@europa.com> writes:
Scot> First posting to get the automatic FAQ sent...
Scot> sorry to take up bandwidth
Just so nobody else starts doing this, thinking it's a good idea...
this is the SAME FAQ that gets posted every few days here.
So, don't post to get it. Just *read* it. :)
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 17 Jan 1999 12:13:38 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: File Upload.
Message-Id: <77sk5i$rk$1@gellyfish.btinternet.com>
On Sat, 16 Jan 1999 18:25:06 -0500 Alex Blyumenkrants wrote:
> Hi!
>
> I have the following problem:
>
> i need to upload a file from an Html,
> if i use type="file"
> what should i do to save this file in my Cgi?
>
If you look at <http://www.webreview.com> there is an article there
by Brent Michalski that describes how this might be done using CGI.pm.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 17 Jan 1999 09:05:37 -0500
From: "Robert Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: File Upload.
Message-Id: <77src7$fkc$1@gaia.ns.utk.edu>
I don't know exactly what you want; however, maybe the following will point
you in the right direction:
Go to: http://stein.cshl.org/WWW/software/CGI/cgi_docs.html
Search the doc for "file upload."
You need to do three things:
1. Use start_multipart_form() to create a fill-out-form.
2. Include a filefield() input element in the form.
3. Read the contents of the file from a filehande provided by param().
The complete instructions are on pp. 149 ff. of Official Guide to
Programming with CGI.pm.
I don't know if that's what your looking for. If not, look at the
documentation for LWP and for BasePlus.pm.
---
Bob Gwynne
JAPN
anAlex Blyumenkrants <alexb@ipwiz.com> wrote in message
news:77r718$eg8$1@winter.news.rcn.net...
>Hi!
>
>I have the following problem:
>
>i need to upload a file from an Html,
>if i use type="file"
>what should i do to save this file in my Cgi?
>
>
>Thank You,
>Alex
>
>
------------------------------
Date: 17 Jan 1999 14:32:04 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: File Upload
Message-Id: <77ss94$13i$1@gellyfish.btinternet.com>
On Fri, 15 Jan 1999 21:41:14 -0500 GSX wrote:
> Does anyone know of a site that provides info on what is needed to write
> a script for a CGI file upload via a browser?
>
> I know that there are scripts written for this already and that CGI.pm
> can also handle this, but I would like to learn to do it myself ....
Whatever your motivations might be for reinventing the wheel I would
nonetheless strongly recommend you to use the facilities provided by
CGI.pm to do this - this area is one that seems to spawn a great number
of misunderstandings.
There is an article by Brent Michalski on how to do this kind of thing
at <http://www.webreview.com>
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 17 Jan 1999 11:31:21 -0500
From: GSX <gsx97@yooo-esssss-aaaa.net>
Subject: Re: File Upload
Message-Id: <36A21059.89FDB917@yooo-esssss-aaaa.net>
Thank you for your help. However, unless your car is mounted on 4 stone
circles, I would have to say that companies such as Goodyear and
Firestone who have "reinvented the wheel" have done us some good.
> Whatever your motivations might be for reinventing the wheel I would
> nonetheless strongly recommend you to use the facilities provided by
> CGI.pm to do this - this area is one that seems to spawn a great number
> of misunderstandings.
------------------------------
Date: 17 Jan 1999 12:54:12 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: filter href-links from web-page ?
Message-Id: <77smhk$tf$1@gellyfish.btinternet.com>
On Fri, 15 Jan 1999 23:59:45 GMT bluepuma@mailexcite.com wrote:
> Hi there,
>
> could someone explain me how to filter href-links from a web-page ?
>
You will almost certainly want to use the module HTML::LinkExtor
available from CPAN. It allows you to simply extract all of the links
from a page.
Attempting to use a regex to do this is probably not a good idea as you
will almost always hit upon case that you hadnt considered previously.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 17 Jan 1999 06:47:32 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Free Perl enabled CGI Webhosting Service
Message-Id: <m1lnj2rm63.fsf@halfdome.holdit.com>
>>>>> "info" == info graffiti <info_graffiti@my-dejanews.com> writes:
info> Free Perl enabled CGI accounts for anyone and everyone are now
info> available from Graffiti.net. For information on how to obtain an
info> account at no cost and in about three minutes, take a look at
info> http://www.CGIrealms.com
$ host www.cgirealms.com
Host not found.
info> or http://www.graffiti.net
At least this one responds. :)
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 17 Jan 1999 12:18:23 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Is perlcc installed by default with 5.004_04 ?
Message-Id: <77skef$ro$1@gellyfish.btinternet.com>
On 17 Jan 1999 01:48:14 GMT avm wrote:
> Is perlcc installed by default with 5.004_04 ?
>
<snip>
> At home I have RedHat Linux 5.1 with the same version of perl 5.004_04.
> But perlcc was not installed by default. Does it have to be installed
> separately from CPAN, or are there Linux specific problems with it?
perlcc is not distributed with 5.00404 - If you want it you will
probably be better of downloading the 5.00502 source and compiling it -
The modules probably are avilable from CPAN (I havent looked ) however
I think upgrading your Perl is a better bet.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 17 Jan 1999 14:40:33 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: looking for serial to socket program
Message-Id: <77ssp1$13l$1@gellyfish.btinternet.com>
On Fri, 15 Jan 1999 22:06:02 GMT kos@tdd.hbo.nec.com wrote:
> Greeting!
>
> I am currently working on an assignment that requires a serial I/O handling
> program (running on NT 4.0) talking to other programs through a socket. At
> this moment, I had collected the following information:
>
If I understand you correctly you want to be able to create a TCP server
program that will control a serial port.
Someone I believe has created a Win32::Serial module that should be
available from CPAN - this will take care of the serial side of your
application.
The socket connections can be fairly simple - if you look at the perlipc
manpages there are examples of the kind of server that you would want -
you can replace the screen output with writing/reading to the serial port.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 17 Jan 1999 13:22:49 GMT
From: richardc@tw2.com (Richard Clamp)
Subject: Re: Perl Criticism
Message-Id: <36a11dcc.14814486@news.highwayone.net>
On Sat, 16 Jan 1999 02:55:26 GMT, topmind@technologist.com wrote:
>
>I told you so! Some programmers write cryptic code out of
>the shear challenge of jaming as much "functionality" into
>as small a space as possible. Call it
>"College Phone-booth Programming".
I'm stopping myself doing a spelling correction about now.
It never makes it into production code[1] and I'd do it in a
Table-Oriented Programming language too. No-one claimed that
programmers don't do it, just that responsible ones avoid it in real
code, which nixes your main complaint (that programmers can't be
trusted) anyhow.
What I was mentioning is that there are times when you want to play
with a language, which you can do with Perl, because it's not
babysitting you.
Richard
[1] To me, production code is any code someone else might have to
maintain.
--
Richard Clamp richardc@tw2.com
Frisbeetarianism, n.:
The belief that when you die, your soul goes up on the roof and gets stuck
------------------------------
Date: 17 Jan 1999 12:34:01 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Perl for Win32 Newbie
Message-Id: <77slbp$ss$1@gellyfish.btinternet.com>
On Sat, 16 Jan 1999 22:42:48 -0000 Ted wrote:
> Hi,
>
> I'm getting the message: "The name specified is not recognized as an
> internal or external command, operable program or batch file." when I try to
> run a perl script under Windows NT.
>
> What am I doing wrong??
>
On NT you can use the ASSOC and FTYPE commands to associated a particular
filetype (in theis case I assume .pl ) with a particular application
- read the NT help for more on how to use those commands.
Alternatively there are an number of solutions in the perlrun manpgae.
>From this I assume that you are not running the latest ActivePerl because
that prompts you as to whether you want the associations done for you
when you install - either that or you asked not to do the associations.
You can get the lastest ActivePerl from:
<http://www.activestate.com/ActivePerl>
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 17 Jan 1999 16:03:23 GMT
From: "awc" <awc@usit.net>
Subject: Personalized webpage
Message-Id: <fRno2.380$1H2.152594@news1.usit.net>
Anybody know where I can find the script that allows people to register on
my site and their name appear on the homepage..I want to use perl NOT java..
webdude@mcminn.net
------------------------------
Date: 16 Jan 1999 20:50:23 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Regex challenge
Message-Id: <77qu2f$5a7$1@mathserv.mps.ohio-state.edu>
[redirected to moderated]
[A complimentary Cc of this posting was sent to Daniel Grisinger
<dgris@moiraine.dimensional.com>],
who wrote in article <m3emovh9q3.fsf@moiraine.dimensional.com>:
> > Not with the current pitiful state of the REx engine. But with the
> > proposed onion-rings syntax (see clp.moder) and it can be done as
> >
> > (?<> ( (\&)? t (\&)? a (\&)? b (\&)? l (\&)? e (\&)? )
> > <> ( \A \w* \&? \w* \z)
> > )
> >
> > Here I assume that in the "inner" onion ring \A and \z match at
> > boundaries of the outer onion ring.
[a lot edited out below]
> Consider this data-
>
> /* This is a comment
> * foo "bar" baz (and random words)
> */
>
> int main() {
> char *foo = "bar";
> }
>
> And this regex-
>
> (?<>
> ( $double_quoted )
> !( $c_comment )
> ( bar )
> )
>
> If I'm understanding correctly, this would say to match the literal
> string `bar' if it occurs in a double quoted string, but not if it
> occurs in a C comment. This seems okay (although I'm not sure that I
> like the <> notation. The diamond operator already has too deep an
> idiomatic meaning in perl to be used here, I'm guessing).
>
> What I don't understand is what will be set after this regex is applied
> to the given data. I see two distinct possibilities.
>
> First, there is the obvious but wrong-
>
> $1 = '"bar"' # the literal string containing our expression
> $2 = undef # negated expressions can never capture a value
> $3 = 'bar' # our match
>
> $` = ? #
> $' = ? # don't know what these would be
> $& = ? #
This is "correct" = "what I currently prefer".
$& is what was matched (5 chars " b a r " ) by the outer ring, $` and
$' - correspondingly.
> Then, the (perhaps) less obvious but correct-
> $& = 'bar' # in this example, could also be set via \g< \g>
If you want $& to be set to a subset of what was matched, use
( \g< bar \g> )
as the innermost onion ring (these are proposed "set match boundary"
operators).
> Theses are the proper results because the only way to know that you've
> got proper nesting is to start at the beginning and move forward,
> testing at each new position. This seems, to me, to be far too
> expensive a process to have to repeat. Since you have already found
> all of the comments and all of the string literals between \A and your
> match, you should keep them. I suppose that you could turn $1 into
> an array ref, but I don't think that that is such a hot idea. Especially
> since @1 is available and natural.
>
> Am I thinking wrong?
You are thinking correct. But you are thinking about something
complicated: how onion rings work with //g in scalar context, right?
Then propably you had no problem in understanding simpler cases.
Good. ;-)
As I explained already in another thread, the current info preserved
between matches (=pos()) needs to be extended if we want onion rings
to work in this most compicated scenario. One needs to preserve
boundaries of the outer onion rings, and the end of the innermost
onion ring. (And probably some more info if backreferences are used.)
Currently pos() magic contains a number (with a Perl way to access it)
and an additional bit for 0-length matches (without a Perl way to
access it). I see no problem with extending this "magic" structure by
an additional array (probably without a way to access it from Perl, if
you want such access, put capturing parens into your REx).
Hope this helps,
Ilya
------------------------------
Date: Sun, 17 Jan 1999 16:04:01 GMT
From: Brett Foster <onasc@home.com>
Subject: Re: Routing picture from my other site
Message-Id: <36A217DF.135D3046@home.com>
You can do that by using the lwp module, I think. I have never writen
anything with it so I can't help you...
Jay Westerdal wrote:
>
> I have a tough question for a Guru out there.
> Can someone tell me how to fetch a picture off another server.
> And then Server it like it actually came from my server.
>
> I don't want to reveal to my user where the image is coming from.
> I would like to call it like this
> <img src=/cgi-bin/image.pl >
> and it would return as an image.
> But that image would be from a URL that I had defined in the CGI
> script. Can anyone show me how to do this?
>
> Here is my attempt at it, but it doesn't work.
>
> #!/usr/local/bin/perl
> $file = "http://www.westerdal.com/link.gif";
> print "Content-type: image/gif\n";
> print "\n";
> open(IMAGE, "<$file") || die "Can't open $file: $!";
> while (<IMAGE>)
> {
> print $_;
> }
> close(IMAGE);
>
> Thanks in advance,
> Jay Westerdal
> jay@westerdal.com
------------------------------
Date: Sun, 17 Jan 1999 15:19:15 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Syntax help wanted: "use strict" and sort $a and $b parameters...
Message-Id: <ebohlmanF5pMK3.7Aw@netcom.com>
William Herrera <posting.account@lynxview.com> wrote:
: if the program "perl -w test.pl *.txt"
: is run, where the default directory contains "1.txt" and "2.txt" and
: test.pl
: looks like:
: #
: print @ARGV;
: #
: my version on Win32 of perl 5.001 will print 1.txt2.txt
: and 5.004 prints *.txt
>From a while back:
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Newsgroups: comp.lang.perl.misc,comp.lang.perl.tk
Subject: Re: Win 95 Perl & Tk
Date: 13 Sep 1997 16:26:53 GMT
Organization: University of Michigan, Ann Arbor
Lines: 44
Message-ID: <5veesd$mov@srvr1.engin.umich.edu>
In article <5vd4qf$nlr@q.seanet.com>, Allen Evenson <ase@seanet.com> wrote:
>Harold Corbin wrote in article <340F31AC.7D86@erols.com>...
>>I haven't run much yet, just the widget demo and there is only one way
>>to describe it - WOW, WOW!!!!!!! Thank You Gurusamy Sarathy and
>>everyone who helped make this available.
>
>I second this emotion! I have also had success downloading and installing
>the port on my Win95 box.
Glad to hear it works, thanks.
>The only trouble i've had to date, is with argv globbing that used to work
>with a
>previosly installed activeware port.
>
>my old script (a grading program) used to work untouched with the following
>invocation:
>'perl -w grader key *.grd'
>
>with the new port i received "*.grd" not found, until I READ THE
>DOCUMENTION!
>I needed to 'use File::DosGlob 'glob'; # override CORE::glob'
>and modify my script to glob each argv element [...]
There's of course a more transparent way to get @ARGV globbing
(one that doesn't involve hacking every source file).
Set PERL5OPT in your environment to "-MWild" (or append, if you already
have something in PERL5OPT), and make sure you put Wild.pm below in
your perl's "lib" directory:
# Wild.pm - emulate shell @ARGV expansion on shells that don't
use File::DosGlob;
@ARGV = map { my @g = File::DosGlob::glob($_) if /[*?]/; @g?@g:$_ } @ARGV;
1;
Unlike compiling the @ARGV expansion into the binary (which has
compatibility and reliability problems too), this is a fully
*optional* solution.
- Sarathy.
gsar@umich.edu
------------------------------
Date: Sun, 17 Jan 1999 16:23:00 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Treating Strings as FILEHANDLES
Message-Id: <36A21024.107CE417@home.com>
Tad McClellan wrote:
>
> If matching null strings is a problem, howsabout we just
> rewrite it so that it can't match 'em?
>
> while ( $string =~ /(.*\n|.+\n?)/g ) {
>
> 'zat do it?
That's it! I knew there had to be a simple way. I was going to point
out that it can be simplified further to
while ( $string =~ /(.*\n|.+)/g ) {
but Bart Lateur has already done that for me.
Thanks to all for helping me get my mind around this little teaser.
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4673
**************************************