[11072] in Perl-Users-Digest
Perl-Users Digest, Issue: 4672 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 17 08:04:28 1999
Date: Sun, 17 Jan 99 05:00:45 -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: 4672
Today's topics:
Re: A plea for less goofy signature files! <rra@stanford.edu>
Re: A plea for less goofy signature files! <new_email@see.web.page>
Re: A plea for less goofy signature files! <new_email@see.web.page>
Re: A plea for less goofy signature files! <rra@stanford.edu>
Re: A plea for less goofy signature files! (Tramm Hudson)
Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus <jdf@pobox.com>
Re: Data Structure Notation (Brian Greenfield)
FAQ <scotc@europa.com>
Re: grep question (Bart Lateur)
Re: Help with a TLD search program (Tad McClellan)
Hepl Wanted <bob@tokensystems.com>
Including a CGI script in a Web Page jgalenski@my-dejanews.com
Re: Keyword search notification scripts (Tad McClellan)
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Perl for Win32 Newbie <tszeto@mindspring.com>
Perl5.005* fails make test fails io/fs.t on BSDI4.0? <i1@i-1.net>
Perl5.005* fails make test fails io/fs.t on BSDI4.0? <i1@i-1.net>
Routing picture from my other site <Jay@westerdal.com>
Re: Set current position in a file (I can't resist) <gmj@netaxis.com>
Re: Treating Strings as FILEHANDLES (Bart Lateur)
Upper and lower case problem with swedish chars <ed98mba@lc.vetlanda.se>
Re: Were to learn PERL Online. <blainn@worldnet.att.net>
Re: Which Perl reference book? <aem@netzero.net>
Re: Which Perl reference book? (Matthew Bafford)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Jan 1999 18:01:14 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: A plea for less goofy signature files!
Message-Id: <ylpv8e4pzp.fsf@windlord.stanford.edu>
Phlip <new_email@see.web.page> writes:
> "The Cause" - beating the commercial idiots at their own game, in our
> spare time, and for free - depends on the QA format of public fora to
> answer questions which are then warehoused; in DejaNews or in each list
> server's archives. But signature files like this jam the search engines
> with smug false hits!
A search engine for Usenet posts should exclude anything after the
signature tear line ("-- \n") from searches unless someone explicitly asks
for signatures to be included. I don't know if DejaNews already does this
or not, but if not, they certainly should.
I'm really curious what you could be searching for that my signature would
give you false hits....
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 16 Jan 1999 23:19:08 PST
From: "Phlip" <new_email@see.web.page>
Subject: Re: A plea for less goofy signature files!
Message-Id: <77s2tc$f8e@journal.concentric.net>
Snowhare wrote:
>> (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
>> y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
>Have you ever tried *running* one of those signatures (hint1)?
([Hint3] This may come as something of a shock, but I was flaming
Perl on a Perl newsgroup. I understand _that's_ not particularily
original either, but nobody will deny the language thrives on tongue
twisters...)
>Doing searches on keywords from computer languages is stupid
>anyhow (hint2)
We are playing the odds. 'open' and 'eval' matched the above string,
but only in _combination_ with another (non-keyword) search term
that the poster discussed in the body of their letter. Put them
together, and you get a false hit.
(BTW for anyone to take my plea seriously, I'd need to proffer
evidence that the _rate_ of false hits was actually skewed by these
signatures compared to those of other technical newsgroups.)
>my $name=join('',reverse(split(//,'Benjamin "Snowhare" Franz')));
>$_='024e046b794c446f25423a6375477d6c14450a39447a07637e';
>s/(..)/push(@ARGV,hex($1))/eg;while($_=chop $name){
>$_=ord^shift;$_+=$a;$_%=108;print chr(($a=$_)+10)}
I _knew_ I'd flush more out of the woodwork!!
>iQCVAwUBNqDrOejpikN3V52xAQHrugP/Xm26GlaCTiNrPlRdon/Bn9M3lV208Udr
>sZCMR9qNUKDi6NvyqYF6b3lqrCsKtQkAJDxW2O3b5AWpnSf/1/cIwpTmY1Tq18oj
>Wr5IBT2rttfYN54s5WlA77n6EjiCc8c8mRWIGWcTTXoO+Tt1eKZn8VoLNhIM7Rii
>J9yIOhzeOdk=
I promise never to search for 3lqrCsK, so PGP keys are acceptable.
Russ Allbery wrote:
>A search engine for Usenet posts should exclude anything after the
>signature tear line ("-- \n") from searches unless someone
explicitly asks
>for signatures to be included. I don't know if DejaNews already
does this
>or not, but if not, they certainly should.
Uh, maybe you should learn them some Perl? (Or any of the other
embedded regular expression languages?)
Robert Gwynne wrote:
>...It seems that Phlip, on evidence of the content of
politizen.com, is another
>right winger who...
...judges folks based on the _front_page_ of a Web site, authored by
someone else, that they programmed to support a full depth and
breathed of various opinion-based contents, including reader
submissions? (BTW the only part _I_ actually authored is the Con
paragraphs of the Pro-Con page of the current Spotlighted Issue...)
-- Phlip at politizen dot com (address munged)
======= http://users.deltanet.com/~tegan/home.html =======
-- Friends don't let friends use Win98 --
------------------------------
Date: 16 Jan 1999 23:22:07 PST
From: "Phlip" <new_email@see.web.page>
Subject: Re: A plea for less goofy signature files!
Message-Id: <77s32v$fcq@journal.concentric.net>
Hey! Jonathan Feinberg (the one who signed with "(open
0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,> y
\,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}")
posted something and then cancelled it!
Did he have anything to say for himself?
> -- Phlip at politizen dot com (address munged)
>======= http://users.deltanet.com/~tegan/home.html =======
-- All sensors report Patti having a very good time --
------------------------------
Date: 16 Jan 1999 23:51:16 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: A plea for less goofy signature files!
Message-Id: <ylemou1gnf.fsf@windlord.stanford.edu>
Phlip <new_email@see.web.page> writes:
> ([Hint3] This may come as something of a shock, but I was flaming Perl
> on a Perl newsgroup. I understand _that's_ not particularily original
> either, but nobody will deny the language thrives on tongue twisters...)
I'll deny that the language *thrives* on tongue-twisters. That's not at
all the same thing as lots of people who use the language enjoying writing
them.
> Russ Allbery wrote:
>> A search engine for Usenet posts should exclude anything after the
>> signature tear line ("-- \n") from searches unless someone
> explicitly asks
>> for signatures to be included. I don't know if DejaNews already
> does this
>> or not, but if not, they certainly should.
> Uh, maybe you should learn them some Perl? (Or any of the other embedded
> regular expression languages?)
Maybe you should learn how to use a newsreader that can wrap properly?
I'm quite sure the people doing development for DejaNews already knows
lots of languages that can handle regular expressions. The issue of false
positives from signatures, whether you were trolling or not, is one that's
gotten notice to the extent of motivating a long discussion in the IETF
working group for Usenet article formats. As a result, the signature tear
line is likely to get standardized in the next version of the Usenet RFC.
The primary motivation for doing so is to help sites like DejaNews with
their indexing.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 17 Jan 1999 02:16:57 -0700
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: A plea for less goofy signature files!
Message-Id: <77s9q9$s3j@boofura.swcp.com>
In article <ylemou1gnf.fsf@windlord.stanford.edu>,
Russ Allbery <rra@stanford.edu> wrote:
[Snip lots]
>... As a result, the signature tear
>line is likely to get standardized in the next version of the Usenet RFC.
>The primary motivation for doing so is to help sites like DejaNews with
>their indexing.
If DejaNews is so concerned about sig-dashes, they really should
have their posting software configured to produce them for their
ads. I wrote to bugs@dejanews.com pointing out that they are
emiting posts that lack the appropriate divider. They wrote back
with a non-specific "We're looking into that" message.
Hmm -- this version of trn didn't strip Russ's sig when it
brought me into the editor. Yes, he has the appropriate sig-dash.
Is that a bug or a feature?
To contribute to the silly sig discussion, I'll post two of my
efforts:
print map{($c,$o)=('X',' '); (map{ if(/[0-9]/){ ($c,$o)=($o,$c); $c x $_} }
map{(/[^A-Z]/&&$_)||split(//,scalar("1"x(ord($_)-ord('A')+1)));}split //),"\n"}
qw( 3E22A34A2A2A2A23E3A3 3G4A4D2F2A2E3C 3F32A43C2D2A23A3A2 H3A2A4F2D2A2E3C
2A3A223A4E2A2A3A2D3B21 0 4223A32A4C2A32E3A3 4E3C2A4I3E3C
4222223A43A3B322222 4A3A3C2A4I3E3C 4A33B2B32G22E3B2A);
print map{$n=hex $_;/[A-F0-9]/&&((map{$_?"L":" "}(map{$n&$_}(map{1<<$_}
(reverse (0..3))))),++$l%16?"":"\n")} (split //,
"2A6E1 249D 5 D C 0 0 0 1 2 A 842B 5495 140 0 0
1 2 A E 4 3A D4 9D D8 0 0 0 1 A A 2 4 2 AD 4
9 514 0 0 0 1 4 4 C 4 2A489 5 D 2 0 00119 D C 8 5 2
3 5 7 70000 1 1 5 1 4 8 5 5 4 5 4 5 0 0 0 0 11
9 9 8 8 7 7 4 6 6 6 0 0 0 01 U1 1 1 4 8 5 5 4
5 4 5 0 0 0 0 1 1 1 D 2E5 5357 480 001 " );
Tramm
(Note proper '-- ' separator!)
--
o hudson@cs.tulane.edu tbhudso@cs.sandia.gov O___|
/|\ http://www.cs.tulane.edu/~hudson/ H 505.266.59.96 /\ \_
<< KC5RNF @ N5YYF.NM.AMPR.ORG W 505.284.24.32 \ \/\_\
0 U \_ |
------------------------------
Date: 17 Jan 1999 02:18:00 +0000
From: Jonathan Feinberg <jdf@pobox.com>
To: dturley@pobox.com
Subject: Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus!
Message-Id: <m3lnj24p7r.fsf@joshua.panix.com>
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!
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Sun, 17 Jan 1999 12:32:26 GMT
From: not-for-replies@dtseven.demon.co.uk (Brian Greenfield)
Subject: Re: Data Structure Notation
Message-Id: <916576353.19513.0.nnrp-01.9e98f345@news.demon.co.uk>
On Fri, 15 Jan 1999 22:45:36 -0500, "John Mason Jr" <masonj@erols.com>
wrote:
>www.effectiveperl/pegs
Or even www.effectiveperl.com/pegs...
--
You're reading this in a newsgroup because that's where I posted it.
That's where I'd like to read your reply too. DON'T MAIL AND POST!
But, if you really want to reply by email, my reply-to *IS* valid ;)
------------------------------
Date: Sat, 16 Jan 1999 18:51:02 -0800
From: "Scot C" <scotc@europa.com>
Subject: FAQ
Message-Id: <77rjb2$jcl$1@remarQ.com>
First posting to get the automatic FAQ sent...
sorry to take up bandwidth
--
Scot C
Portland, OR
scotc@europa.com
ICQ: 1184823
www.europa.com/~scotc
------------------------------
Date: Sun, 17 Jan 1999 10:25:36 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: grep question
Message-Id: <36a7b364.4130414@news.skynet.be>
Robert Gwynne wrote:
>Would someone please explain how the following construction works.
>
>%FIELDS = ('Personal Information'
> =>['Name','Address','Telephone','Fax'],
> 'References'
> =>['Personal Ref 1', 'Personal Ref 2']
> );
>
>foreach (values %FIELDS){
> grep($ALL_FIELDS{$_}++, @$_);
>}
>
>The above is from p. 71 of Official Guide to Programming with CGI.pm. The
>grep function is the part that I don't understand.
This is sick! They're using grep in a void context, which is even worse
than using map in a void context, which is practically doing nothing but
a foreach.
Note that the condition (the BLOCK) is executed for every item. Items
are filtered out depending on the ouscome, but this result is just
thrown away.
Replacement code:
foreach (values %FIELDS){
foreach(@$_){
$ALL_FIELDS{$_}++
}
}
Bart.
------------------------------
Date: Sun, 17 Jan 1999 00:10:18 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help with a TLD search program
Message-Id: <asur77.10r.ln@magna.metronet.com>
Bill Skitt (skitt@massed.net) wrote:
: Hello. I am reasonably new to perl and trying to write a program that
: searches a database of country codes. The database file is in the form of
: extension=country (example: com=United States Commercial).
.com does not imply the United States. Could be anywhere.
: Im not quite sure
: what the logic behind a program like this is like.
I'm not quite sure what the logic behind wanting such a
program is, given that TLDs are not reliable indicators.
It would be more accurate to ask the user to enter what
country they are in.
: If anyone can help me
: brainstorm
I advise giving up on this project.
: or throw some snippets of code at me it is greatly appreaciated.
If you insist on doing it anyway, you could start with the
Perl FAQ, part 6:
"How do I efficiently match many regular expressions at once?"
if ($addr =~ /\.(?:com|edu|gov|net|mil)$/) {
print "I still don't really know where you are...\n"
}
:-)
A hash data structure may come in handy as well.
: Since I am new to newsgroups,
You should monitor the
news.announce.newusers
newsgroup for a while so you don't unwittingly commit a
faux pas...
: please email skitt@massed.net rather than
: posting a response.
... oops!
Too late.
You are probably not the only person in the world who has
this question.
If the answer is posted, everybody gets access to the answer
(or non-answer as the case may be).
If it is emailed to you, then only you get the answer.
Which may be what _you_ want, but most of us are here
to serve the entire community rather than to serve you.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 16 Jan 1999 21:39:47 -0800
From: "bob@tokensystems.com" <bob@tokensystems.com>
Subject: Hepl Wanted
Message-Id: <36A177A3.E87A2F7A@tokensystems.com>
PERL PROGRAMMER WANTED
Very experienced in Perl. Must be able to create anything we need in
Perl, and must be able to adapt to a tremendous amount of currently
existing code. Sys. Admin skills on Red Hat is a big plus. Work at
home, full time+ Write bob@tokensystems.com
------------------------------
Date: Sun, 17 Jan 1999 03:42:27 GMT
From: jgalenski@my-dejanews.com
Subject: Including a CGI script in a Web Page
Message-Id: <77rm72$l2q$1@nnrp1.dejanews.com>
I'm trying to include a CGI script in a web page (HTML) via the exec sever
side include. If my script does not require any inputs, it works ok.
However, if I have to pass in inputs, it fails. Here's a sample of what I'm
trying to do:
<!-- test.shtml -->
<html><body bgcolor="#123456">
This is a test
<p>
<!--#exec cgi="/cgi-local/weather/weather.cgi?Augusta&ME"-->
</body></html>
When 'test.shtml' is accessed, it should run 'weather.cgi' using 'Augusta'
and 'ME' as the inputs.
Any ideas how to do this?
Thanks,
-John Galenski (johng@mathworks.com)
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 17 Jan 1999 00:28:51 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Keyword search notification scripts
Message-Id: <3vvr77.10r.ln@magna.metronet.com>
Alfred Tay (alfred@sperio.com) wrote:
: Is it possible to let my users search and then opt for a auto
: notification by email wHenever the search is satisfied over a period of
: time?
Yes.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 17 Jan 1999 07:04:30 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn7a32rt.967.dformosa@godzilla.zeta.org.au>
In article <36A098DD.11C5A0B1@ngb.se>, Staffan Liljas wrote:
>topmind@technologist.com wrote:
[...]
>> Design a language for cryptologists and the best ......
>
>But you have still not showed us one single piece of cryptological code
>that wasn't part of a sig or written for a competition.
I don't know, Crypt::IDEA is quite cryptological.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
------------------------------
Date: Sat, 16 Jan 1999 22:42:48 -0000
From: "Ted" <tszeto@mindspring.com>
Subject: Perl for Win32 Newbie
Message-Id: <77s0rm$u8l$1@camel21.mindspring.com>
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??
Thanks in advance.
Regards,
Ted
tszeto@mindspring.com
------------------------------
Date: Sat, 16 Jan 1999 19:45:42 -0600
From: "Brad Jackson" <i1@i-1.net>
Subject: Perl5.005* fails make test fails io/fs.t on BSDI4.0?
Message-Id: <77rgr2$lp0$1@news1-alterdial.uu.net>
This is really odd, and it's keeping me awake during the day... :-)
I grabbed both the current stable and the devel archives for Perl5 i.e.
5.005_02 and 5.005_54 ... both builds compile correctly (no errors or
warnings) using the bsdi hints file instructions. Both builds then fail the
"make test" step at step 18.
The test being run is t/io/fs.t and the code being run is:
[tests 1 - 13 omitted]
if (rename('a','b')) {print "ok 14\n";} else {print "not ok 14\n";}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('a');
if ($ino == 0) {print "ok 15\n";} else {print "not ok 15\n";}
$delta = $Is_Dosish ? 2 : 1; # Granularity of time on the filesystem
$foo = (utime 500000000,500000000 + $delta,'b');
if ($foo == 1) {print "ok 16\n";} else {print "not ok 16 $foo\n";}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('b');
if ($ino) {print "ok 17\n";} else {print "not ok 17\n";}
if ($wd =~ m#/afs/# || $^O eq 'amigaos' || $^O eq 'dos')
{print "ok 18 # skipped: granularity of the filetime\n";}
elsif ($atime == 500000000 && $mtime == 500000000 + $delta)
{print "ok 18\n";}
else
{print "not ok 18 $atime $mtime\n";}
I conclude that the utime() call is failing to set the atime (last access
time) correctly. In fact, peeking at the values returned by stat() shows
that the although the entire stat structure has been (correctly) altered
after the rename call, and although utime() succeeds in altering the mtime
of the test file, it fails to update the atime value.
Poking around in the source a little I found that there's a dependency on
BIG_TIME being defined for BSDOS, since it uses a time_t type for time
values.
MTIA..
Brad Jackson
Network Administrator
I-1 Internet Group, Inc.
------------------------------
Date: Sat, 16 Jan 1999 20:10:11 -0600
From: "Brad Jackson" <i1@i-1.net>
Subject: Perl5.005* fails make test fails io/fs.t on BSDI4.0?
Message-Id: <77rgr3$lp0$2@news1-alterdial.uu.net>
This is really odd, and it's keeping me awake during the day... :-)
I grabbed both the current stable and the devel archives for Perl5 i.e.
5.005_02 and 5.005_54 ... both builds compile correctly (no errors or
warnings) using the bsdi hints file instructions. Both builds then fail the
"make test" step at step 18.
The test being run is t/io/fs.t and the code being run is:
[tests 1 - 13 omitted....]
if (rename('a','b')) {print "ok 14\n";} else {print "not ok 14\n";}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('a');
if ($ino == 0) {print "ok 15\n";} else {print "not ok 15\n";}
$delta = $Is_Dosish ? 2 : 1; # Granularity of time on the filesystem
$foo = (utime 500000000,500000000 + $delta,'b');
if ($foo == 1) {print "ok 16\n";} else {print "not ok 16 $foo\n";}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('b');
if ($ino) {print "ok 17\n";} else {print "not ok 17\n";}
if ($wd =~ m#/afs/# || $^O eq 'amigaos' || $^O eq 'dos')
{print "ok 18 # skipped: granularity of the filetime\n";}
elsif ($atime == 500000000 && $mtime == 500000000 + $delta)
{print "ok 18\n";}
else
{print "not ok 18 $atime $mtime\n";}
[... more tests]
I conclude that the utime() call is failing to set the atime (last access
time) correctly. In fact, peeking at the values returned by stat() shows
that the although the entire stat structure has been (correctly) altered
after the rename call, and although utime() succeeds in altering the mtime
of the test file, it fails to update the atime value.
Why it fails though... I can't fathom. I've looked at the source, and (of
course) cant see any 'obvious' problems. I've checked dejanews, Nexial's
BSDI list archive, various Perl FAQs and other resources, but havent found
an answer. Has anyone else experienced this error, with BSDI 4.0 or any
other platform?
MTIA..
Brad Jackson
Network Administrator
I-1 Internet Group, Inc.
------------------------------
Date: Sat, 16 Jan 1999 19:27:01 -0800
From: "Jay Westerdal" <Jay@westerdal.com>
Subject: Routing picture from my other site
Message-Id: <77rkts$sco$1@news-2.news.gte.net>
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 05:55:14 +0000
From: "Geir Magnusson Jr." <gmj@netaxis.com>
Subject: Re: Set current position in a file (I can't resist)
Message-Id: <36A17B42.6601910F@netaxis.com>
Giga Tron wrote:
>
> Hello All,
>
> how can I set the current position in a file. do something and then
> continue from that position
'seek', and ye shall find.
geir
--
Geir Magnusson Jr. gmj@netaxis.com
Any technology sufficiently advanced is | Zen of mac development: "be
indistinguishable from a Perl script. | at peace while rebooting"
------------------------------
Date: Sun, 17 Jan 1999 10:25:34 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Treating Strings as FILEHANDLES
Message-Id: <36a6b14d.3598740@news.skynet.be>
Tad McClellan wrote:
> while ( $string =~ /(.*\n|.+\n?)/g ) {
>
> 'zat do it?
I don't think you need that "\n?". If the left side matches, the right
side won't even be tested. Not even if it would have matched a longer
substring.
while ( $string =~ /(.*\n|.+)/g ) {
$_ = $1;
as in:
#! perl -w
foreach $string ("one\ntwo\nthree","a\nb\nc\n") {
while ( $string =~ /(.*\n|.+)/g ) {
$_ = $1;
print "<$_>\n";
}
print "--\n";
}
Result:
<one
>
<two
>
<three>
--
<a
>
<b
>
<c
>
--
so it appears to be working al right.
Bart.
------------------------------
Date: Sun, 17 Jan 1999 12:12:32 +0100
From: ed98mba <ed98mba@lc.vetlanda.se>
Subject: Upper and lower case problem with swedish chars
Message-Id: <36A1C5A0.E11F7F80@lc.vetlanda.se>
Hi!
Im am trying do develop a catalog over the students at a "input
facillity". As some of you might know, the swedish alhabet has some
strange chars in it. these are e(E) d(D) and v(V). (perhaps you get the
wrong chars, thats because you dont have your browser foucus4d on
swedish).
The problem:
When i try to search the database that I have stored the catalog in, I
get the wrong awnser. this i due to fact that perl dont recon.. that the
swedish chars have a upper and lower case.
Does some one has solvation to this problem
pardon my bad english!
thanks! // Martin belohorka
------------------------------
Date: 17 Jan 1999 06:47:09 GMT
From: Blain Nelson <blainn@worldnet.att.net>
Subject: Re: Were to learn PERL Online.
Message-Id: <36A0FD65.F0F42EDF@worldnet.att.net>
Sam Holden wrote:
>
> On 16 Jan 1999 07:34:49 GMT, Eric Smith <eric@nafex.comi> wrote:
> >
> >If u looking for online tut:
> >http://agora.leeds.ac.uk/Perl/start.html
>
> If you want a tutorial that doesn't even mention 'my' when talking about
> subroutines (and even uses local in it's place)...
>
> If you want a tutorial that doesn't do error checking on open() when talking
> about file handling...
>
> If you want a tutorial tha uses chop() to remove newlines...
>
> I'm sure you could find a more useful tutorial somewhere off
> http://www.perl.com, though I must admit I haven't looked...
>
Well, you'd sure be welcome to write a better one. Or contact the author and
offer to help by rewriting some of his stuff to correct the mistakes you've
found.
I'm not so sure that there's a more useful tutorial out there. I know that I
couldn't find a heck of a lot when I was first looking.
> --
> Sam
>
Take care,
Blain
--
The opinions expressed here are not only mine, they are yours too.
Aren't you glad I told you? http://www.blainn.cc/
blain@blainn.cc ICQ:19857966 anon-20630@anon.twwells.com
<c> 1999 Blain Nelson All Rights Reserved Film rights available
------------------------------
Date: Sat, 16 Jan 1999 21:54:47 -0800
From: "AE Meza" <aem@netzero.net>
Subject: Re: Which Perl reference book?
Message-Id: <S%eo2.7188$yt4.22945@typhoon-sf.pbi.net>
Thanks for the tip, I just picked up this book for $15 at Barnes & Nobles!
Guess they thought it was just another obsolete book. BTW, excuse my
ignorance but what are the
Llama and Camel you reffered to?
>"AE Meza" writes:
>
>>
>> What about Perl 5 Interactive Course by Jon Orwant? Is it a good book for
>> learning perl? Anybody used it?
>>
>
>I have it on my desk. It was a excellent learning tool for me,
>especially that it contains problems after each chapter (solutions are
>also provided). Note: I read it after reading the Llama and before
>reading the Camel.
>
>It's only disadvantage (from my point of view) is the large number of
>typos. Jon assured me that almost all of the typos were due to the
>publisher. Nevertheless, it contains a large number of good examples
>that were very helpful.
>
>I do recommend it.
>
>Ala
>
------------------------------
Date: Sun, 17 Jan 1999 06:12:51 GMT
From: dragons@news.scescape.net (Matthew Bafford)
Subject: Re: Which Perl reference book?
Message-Id: <slrn7a2vl3.ef7.dragons@scescape.net>
[
It's customary to place your followup beneath the previous post,
snipping out non-relevant text as you go.
]
On Sat, 16 Jan 1999 21:54:47 -0800,
AE Meza <aem@netzero.net> pounded in the following:
=> Thanks for the tip, I just picked up this book for $15 at Barnes & Nobles!
=> Guess they thought it was just another obsolete book. BTW, excuse my
=> ignorance but what are the Llama and Camel you reffered to?
The Camel is _The Bible_, and goes by the official name of:
_Programming_Perl_
Larry Wall, Tom Christiansen, Randal L. Schwartz
ISBN: 1-56592-149-6
The Llama is more like Sunday School, and is a great read for a newbie.
I don't have a copy, but its official name is:
_Learning_Perl_
Another similar book is the Geko, which is the Llama geared towards Win32.
All of these books are from O'Reilly.
HTH!
--Matthew
------------------------------
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 4672
**************************************