[17069] in Perl-Users-Digest
Perl-Users Digest, Issue: 4481 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 1 09:06:36 2000
Date: Sun, 1 Oct 2000 06:05:19 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <970405518-v9-i4481@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 1 Oct 2000 Volume: 9 Number: 4481
Today's topics:
Re: Arrogant kid takes on huge group of programmers (wa (Tim Hammerquist)
Re: Arrogant kid takes on huge group of programmers (wa (Tim Hammerquist)
Re: Arrogant kid takes on huge group of programmers (wa <bart.lateur@skynet.be>
Re: Arrogant kid takes on huge group of programmers (wa <mcarruth@talk21.com>
Re: Arrogant kid takes on huge group of programmers (wa (Peter J. Acklam)
Re: automatic email attachments <philipg@atl.mediaone.net>
Re: automatic email attachments <dave@marballs.co.uk>
Re: Bacic Log file script - Calling it from my HTML pag <dave@marballs.co.uk>
Re: Candidate for the top ten perl mistakes list <bart.lateur@skynet.be>
compiling modules on win32 rereidy@my-deja.com
Re: compiling modules on win32 <reedfish@ix.netcom.com>
die() ignores tied STDERR? <newspost@coppit.org>
Re: finding the structure of a hash <mauri@unixrulez.org>
Re: finding the structure of a hash <celliot@tartarus.uwa.edu.au>
ftp module vivek@cse.iitd.ernet.in
Re: How to get length of scalar? <bcaligari@my-deja.com>
Re: Newbie can't handle the "true"th... explanation de <lr@hpl.hp.com>
OT: Re: CGI trouble (Tim Hammerquist)
Parsing improvements <MartinSchneider@TNTSoftware.com>
Re: redirect script <janwille@dds.nl>
Re: redirect script <flavell@mail.cern.ch>
Re: Serious SMS-related question. (Tony L. Svanstrom)
Re: Substituting characters <bcaligari@my-deja.com>
Re: What happened to __DIE__ and __WARN__ signal hander (Tim Hammerquist)
Re: What happened to __DIE__ and __WARN__ signal hander <bart.lateur@skynet.be>
Re: What happened to __DIE__ and __WARN__ signal hander <reedfish@ix.netcom.com>
while ($s = <WHATEVER>) <bcaligari@my-deja.com>
Re: why it's called a "hash" (and a whole lot more) <anmcguire@ce.mediaone.net>
Re: why it's called a "hash" (and a whole lot more) <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 01 Oct 2000 05:58:47 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Arrogant kid takes on huge group of programmers (was Re: How to get length of scalar?)
Message-Id: <slrn8tdlep.6b4.tim@degree.ath.cx>
Keith Calvert Ivey <kcivey@cpcug.org> wrote:
> I don't understand the point of coming into a newsgroup and
> pissing off the inhabitants as quickly as possible.
Possibly a troll? In which case, he would end up in killfiles anyway.
--
-Tim Hammerquist <timmy@cpan.org>
The optimist thinks this is the best of all possible worlds.
The pessimist fears it is true.
-- Robert Oppenheimer
------------------------------
Date: Sun, 01 Oct 2000 06:13:05 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Arrogant kid takes on huge group of programmers (was Re: How to get length of scalar?)
Message-Id: <slrn8tdm9j.6b4.tim@degree.ath.cx>
[Fixed jeopardy-style quoting]
Mark Carruth <mcarruth@talk21.com> wrote:
> > 1) Uri, my wife cannot call me in idiot as I am 13 and have no wife :P
>
> "Tim Hammerquist" <tim@degree.ath.cx> wrote:
> > No problem with that. I was doing 80x86 assembly programming at 13, so
> > there's no minimum age requirement in my book. As far as having a
> > wife...well, nevermind. =)
>
> Thats probably because you're so old that there was very little programming
> when you were 13.
Mark, this was an attempt to defend your place in this newsgroup. I
encourage young programmers. It appears, however, that it is not your
age nor aptitude which causes a problem...it's your attitude.
> Though I am happy that someone from CPAN has replied, I am
> glad my message is reaching important people.
As much as my ego would love to accept this, having a cpan.org email
addy means merely that I've contributed modules or scripts to the
archive. I am far from a Perl elder, and only rank an Expert on Tom
C.'s Seven Levels of Perl Mastery (except for that JAPH part; never got
into it, though I greatly appreciate the aesthetics of Larry Wall's JAPH).
print "Just Another Perl Hacker"; # compliments of Mr. Wall
--
-Tim Hammerquist <timmy@cpan.org>
Programmers are achievement oriented; give them an impossible task,
and they'll do their best to give you what they think you would have
asked for if you had a clue as to what was possible.
-- Peter Coffee, PC Week
------------------------------
Date: Sun, 01 Oct 2000 07:35:34 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Arrogant kid takes on huge group of programmers (was Re: How to get length of scalar?)
Message-Id: <77qdtsc2ps2touk4lndkbhslk3hpqr8hsb@4ax.com>
Mark Carruth wrote:
>And as for the quoting, I will quote whatever I like. There is no English
>rule against it.
No, no English rule. There's no English rule against driving in the
wrong direction in a one way street, either.
You sinned against the rules of the community. Get for some heavy
flaming.
--
Bart.
------------------------------
Date: Sun, 1 Oct 2000 09:19:10 +0100
From: "Mark Carruth" <mcarruth@talk21.com>
Subject: Re: Arrogant kid takes on huge group of programmers (was Re: How to get length of scalar?)
Message-Id: <8r6s34$1eg$1@neptunium.btinternet.com>
"Bart Lateur" <bart.lateur@skynet.be> wrote in message
>
> >And as for the quoting, I will quote whatever I like. There is no English
> >rule against it.
>
> No, no English rule. There's no English rule against driving in the
> wrong direction in a one way street, either.
>
> You sinned against the rules of the community. Get for some heavy
> flaming.
>
> --
> Bart.
LOL, you make it sound like I have committed a crime. Pathetic!
For my VERY last point I would just like to bring up one guys point from
earlier on.
I quote, "As a good portion of the American highway system is built from
concrete, I think it a good idea that everyone drive a cement truck". This
was after I had said that as the majority of the web was HTML centred, I
could post HTML.
My reply to this is that, if you were to see a concrete truck driving down
the American Highway, would you all wind down your windows and start
shouting at it??? I don't think I would.
------------------------------
Date: 01 Oct 2000 13:12:41 +0100
From: jacklam@math.uio.no (Peter J. Acklam)
Subject: Re: Arrogant kid takes on huge group of programmers (was Re: How to get length of scalar?)
Message-Id: <wk8zs8bw06.fsf@math.uio.no>
"Mark Carruth" <mcarruth@talk21.com> writes:
> LOL, you make it sound like I have committed a crime. Pathetic!
You are pissing off the people who are most valuable to you.
They day you need help and get none, you might realize how
incredibly stupid you have been acting.
Peter
--
$\="\n";$_='The quick brown fox jumps over the lazy dog';print +(split
//)[20,5,24,31,3,36,14,12,31,1,2,11,9,23,33,29,35,15,32,36,7,8,28,29];
------------------------------
Date: Sun, 01 Oct 2000 04:29:30 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: automatic email attachments
Message-Id: <K4zB5.4981$cW3.922529@typhoon.southeast.rr.com>
Dave <dave@marballs.co.uk> wrote in message
news:8r63i3$llu$1@newsg2.svr.pol.co.uk...
> Hello,
>
> Sorry if this is a basic question but I have scanned for similar and have
> not managed to find one.
>
> Does anybody know how I can code Perl to automatically send an email with
an
> attachment.
>
> My understanding is that the sendmail command can not have attachments and
> commands like Pine cannot but run from the command line with out user
> interaction.
>
> Therefore does anyone know what I should do. I am looking for the most
> simple solution possible as I would like users of my web site to be able
to
> enter their email address and be sent an email with the attachment right
> away.
>
> Please help me with this matter and if a better solution lies not in PERL
> then please suggest.
>
> Thanks in advance
>
> Dave
Try the MIME::Lite module, available on CPAN at
http://www.perl.com/CPAN/modules/by-module/MIME
hth,
p
------------------------------
Date: Sun, 1 Oct 2000 11:07:02 +0100
From: "Dave" <dave@marballs.co.uk>
Subject: Re: automatic email attachments
Message-Id: <8r7284$mcd$1@news7.svr.pol.co.uk>
Thank you for your input. Another basic question I am afraid.
I am using someone else's server who has perl installed. Can I assume they
already have these modules on there commercial server because I surely would
not be able to install new modules on my web space providers server. They
say they have full cgi-bin support.
Thanks again.
Dave
"Philip Garrett" <philipg@atl.mediaone.net> wrote in message
news:K4zB5.4981$cW3.922529@typhoon.southeast.rr.com...
> Dave <dave@marballs.co.uk> wrote in message
> news:8r63i3$llu$1@newsg2.svr.pol.co.uk...
> > Hello,
> >
> > Sorry if this is a basic question but I have scanned for similar and
have
> > not managed to find one.
> >
> > Does anybody know how I can code Perl to automatically send an email
with
> an
> > attachment.
> >
> > My understanding is that the sendmail command can not have attachments
and
> > commands like Pine cannot but run from the command line with out user
> > interaction.
> >
> > Therefore does anyone know what I should do. I am looking for the most
> > simple solution possible as I would like users of my web site to be able
> to
> > enter their email address and be sent an email with the attachment right
> > away.
> >
> > Please help me with this matter and if a better solution lies not in
PERL
> > then please suggest.
> >
> > Thanks in advance
> >
> > Dave
>
> Try the MIME::Lite module, available on CPAN at
> http://www.perl.com/CPAN/modules/by-module/MIME
>
> hth,
> p
>
>
------------------------------
Date: Sun, 1 Oct 2000 11:54:50 +0100
From: "Dave" <dave@marballs.co.uk>
Subject: Re: Bacic Log file script - Calling it from my HTML page
Message-Id: <8r7528$n8a$1@news5.svr.pol.co.uk>
So is that the way everybody does log files.
do they have to use SSI. I thought that SSI slowed down your web page with
extra processing.
"Drew Simonis" <simonis@myself.com> wrote in message
news:39D6AB10.56ADBAF1@myself.com...
> SSI, but thats not Perl...
------------------------------
Date: Sun, 01 Oct 2000 07:30:31 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <svpdtsgkda1qh7j61nm4evkhdu1aa4irlt@4ax.com>
David Steuber wrote:
>My biggest Perl mistake was trying to learn Perl. Now I am punishing
>myself for this horrid mistake by trying to learn Perl.
That is what they call positive feedback, in control systems.
--
Bart.
------------------------------
Date: Sun, 01 Oct 2000 06:44:55 GMT
From: rereidy@my-deja.com
Subject: compiling modules on win32
Message-Id: <8r6mh7$59o$1@nnrp1.deja.com>
Hi,
I know this has been gone over many times, but I need to compile some
modules on WinNT that are not on ActiveState's site. What tools do I
need to do this (I have cgywin installed).
Thanks for your help and advice.
Ron Reidy
Oracle DBA
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 1 Oct 2000 05:18:24 -0400
From: "Brian Kelly" <reedfish@ix.netcom.com>
Subject: Re: compiling modules on win32
Message-Id: <8r6vp9$gcu$1@nntp9.atl.mindspring.net>
I've had the most success with win32 modules using Microsoft's Visual C++
5.0 with
service pack 3 installed. A couple of years ago, it seemed getting "any"
module to
compile with win32 was a "hold your breath and say a prayer" afair. But
lately, I've had
success with everything I've tried. (Visual C++ 6.0 chokes on a couple of
encryption
modules - or so says the readmes). I've haven't tried cygwin's compiler for
win32.
Maybe someday - after I remove the dustballs from under my bed ...
Also, winzip does a great job taking apart ...tar.gz compressed modules.
After that,
all you need is perl 5.6, WinNT 4.0, and LOT of patience. When all else
fails READ THE
DOCUMENTATION!
Cheers,
Brian Kelly
<rereidy@my-deja.com> wrote in message news:8r6mh7$59o$1@nnrp1.deja.com...
> Hi,
>
> I know this has been gone over many times, but I need to compile some
> modules on WinNT that are not on ActiveState's site. What tools do I
> need to do this (I have cgywin installed).
>
> Thanks for your help and advice.
>
> Ron Reidy
> Oracle DBA
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Sun, 1 Oct 2000 01:48:26 -0400
From: David Coppit <newspost@coppit.org>
Subject: die() ignores tied STDERR?
Message-Id: <Pine.GSO.4.21.0010010145410.26576-100000@mamba.cs.Virginia.EDU>
I tied STDERR to a module in order to detect when something goes wrong
in a CGI script. Unfortunately, die() doesn't seem to do "print
STDERR". Below is a test script. Any suggestions, besides checking $?
in addition to checking for output to STDERR?
Thanks,
David
package CATCH;
sub TIEHANDLE
{
my $package = shift;
return bless {},$package;
}
sub PRINT
{
# Temporarily untie the filehandle so that we won't recursively call
# ourselves
untie *STDERR;
print "Caught STDERR:\n";
print STDERR @_;
tie *STDERR,__PACKAGE__;
}
package main;
tie *STDERR,'CATCH';
die "died!";
------------------------------
Date: Sun, 01 Oct 2000 08:49:51 GMT
From: Maurizio Cimaschi <mauri@unixrulez.org>
Subject: Re: finding the structure of a hash
Message-Id: <90p6r8.mo.ln@HAL9000.jupiter.space>
Cameron Elliott <celliot@tartarus.uwa.edu.au> wrote:
> while ( ($key, $value) = each %grp_data) {
> print "$key = $value\n";
> }
print( map { "$grp_data => $grp_data{$_}\n" } keys %grp_data );
--
Ciao, Maurizio.
------------------------------
Date: Sun, 1 Oct 2000 19:37:13 +0800
From: "Cameron Elliott" <celliot@tartarus.uwa.edu.au>
Subject: Re: finding the structure of a hash
Message-Id: <39d72220$0$31975@echo-01.iinet.net.au>
Thanks Gwyn,
that worked perfectly once I got a new version of perl..
ta..
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote in message
news:slrn8tc1c7.1kn.tjla@thislove.dyndns.org...
| I was shocked! How could Cameron Elliott <celliot@tartarus.uwa.edu.au>
| say such a terrible thing:
| >Hi,
| >
| >I have a hash and I would like to know what is stored in it exactly.
| >How can I go about this?
| >
| >Is there a way to find out the exact structure of the hash as well?
|
| How about this:
|
| use Data::Dumper;
|
| print Dumper \%my_hash;
|
| And here is the documentation:
|
| perldoc Data::Dumper
|
| --
| Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
| There once was a young man named Gene,
| Who invented a screwing machine.
| Concave and convex,
| It served either sex,
| And it played with itself inbetween.
------------------------------
Date: Sun, 01 Oct 2000 08:39:00 GMT
From: vivek@cse.iitd.ernet.in
Subject: ftp module
Message-Id: <8r6t74$al7$1@nnrp1.deja.com>
looking for a module which can help me download part of a big file on a
ftp server. i would like to specify offset and the number of bytes to
download. The Net::FTP module only supports offset but downloads whole
file after the given offset.
vivek malik
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 01 Oct 2000 12:08:13 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: How to get length of scalar?
Message-Id: <8r79fc$i17$1@nnrp1.deja.com>
In article <8qthfc$26d$1@uranium.btinternet.com>,
"Mark Carruth" <mcarruth@talk21.com> wrote:
> Why is it you people have such a problem with HTML. Either, get a
decent
> mail client for Windows, or if you use Unix and you are such a bloody
genius
> at it to go criticising other people, make yourself a f*c*i*g HTML
parser
> that will work on Windows.
>
> You will notice that this message is in plain text for
you "Challenged"
> people.
>
Off topic ....but:
I administer a pretty large network. On said network,
email traffic chews up nearly as much bandwidth as
web browsing. Typically, a mail client would send
an html souped up as mime multipart, hence with
additional headers, and at least two copies of the
original text message (plain text & marked up).
It is also pretty selfish (and microsoftish) to
assume that everybody else is using the same
software / capabilities. I had users wishing me
beheaded ebcause the nicely formatted emails
composed in outlook express showed up differently
rendered in outlook and netscape communicator.
And then again, I believe that news is not meant
to be marked up in any way!!!
Brendon
PS: shouldn't there be another NG...say...
comp.lang.perl.offtopic where the perl community
can rant in general?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 1 Oct 2000 00:16:10 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Newbie can't handle the "true"th... explanation desired
Message-Id: <MPG.14408490dc0115fd98ade6@nntp.hpl.hp.com>
In article <m3ya09zrp9.fsf@solo.david-steuber.com>, nospam@david-
steuber.com says...
...
> Anything whatsoever assigned to a scaler is true except "0", "", and
> undef. At least, that is how I understand it.
You forgot the number 0, however evaluated.
> Actually, I think
> undef makes the name go away.
$name = undef; # The value of $name is now undefined.
undef $name; # The variable $name no longer exists.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 01 Oct 2000 05:55:55 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: OT: Re: CGI trouble
Message-Id: <slrn8tdl9d.6b4.tim@degree.ath.cx>
Rand25@juno.com <Rand25@juno.com> wrote:
> I read the httpd.conf file and got all that, but assuming I'm a newbie
> you can be assured my permissions are not set correctly and it is in
> the correct directory, I created it there....
Actual file-structure permissions are really not an issue with Win98.
All applicable permissions are pretty much set in httpd.conf. Since the
default httpd.conf that comes with Apache has cgi-bin/ ScriptAlias'ed,
this shouldn't be, and doesn't appear to be, an issue.
> Error 500 (in the title bar, I didn't look up there before)
Then it's a problem with your script; server config is usually correct
if you get a 500 error.
I repeat:
> > Check your error.log (aka error_log) to figure out what's causing the
> > error and if it's a script problem, THEN it's a Perl question.
This will most likely tell you what the problem is.
> I got the script out of a book teaching Perl and CGI (Visual Quickstart
> Guide Perl and CGI for the World Wide Web)
>
> #!(I've tried everything here)
> print "Content-type:text/html\n\n";
> print "Hellow World";
My guess is that the script is finding the interpreter fine, but just in
case, assuming you have a standard ActivePerl installation:
#!c:/perl/bin/perl.exe -w
and this shouldn't matter, but maybe try putting a single space (' ')
after the ':' in the Content-type line.
> > Check the server documentation that
> > comes with your server at http://localhost/manual on my box.
>
> I looked at all the stuff they had for CGI and tried all the things it
> suggested, but I may have gotten something wrong...
Read the parts where you don't (yet) have a problem. If your server NG
is anything like this one, we're really _very_ fond of RTFM replies. ;)
> My other computer has Red Hat Linux 6.1 on it, I like the Matrix like
> screen saver with the falling text....waz berkley?
>
> > [*] http://www.freebsd.org/
Go to the above URL to find out. Berkely was a reference to FreeBSD and
it's many relatives, eg, OpenBSD, NetBSD, etc. BSD is 'Berkeley
Standard Distribution' or 'Berkeley Software Design', depending on where
it's used. BSD is considered by many to be more stable and more
faithful to the original Unix OS.
If and when I find myself dissatisfied with my linux box (which I don't
see happening anytime soon), I may just try BSD. ;)
--
-Tim Hammerquist <timmy@cpan.org>
Any emotion, if it is sincere, is involuntary.
-- Mark Twain
------------------------------
Date: Sun, 01 Oct 2000 07:59:15 GMT
From: Martin Schneider <MartinSchneider@TNTSoftware.com>
Subject: Parsing improvements
Message-Id: <8r6qsi$96i$1@nnrp1.deja.com>
Hi,
I'm new to Perl, and have some code which appears to work, but would
like to learn how to improve it. THE PROBLEM: I get text files
containing a known list of files and details, but carriage returns are
in the wrong place. For example I get this:
WINMM.dll 4.00 10/14/96 03:38:00 149264 C:\WINNT\System32\USER32.dll
4.00 11/18/99 11:04:00 335120 C:\WINNT\system32\KERNEL32.dll 4.00
11/18/99 11:04:00 375056 C:\WINNT\system32\
But I want this:
WINMM.dll 4.00 10/14/96 03:38:00 149264 C:\WINNT\System32\
USER32.dll 4.00 11/18/99 11:04:00 335120 C:\WINNT\system32\
KERNEL32.dll 4.00 11/18/99 11:04:00 375056 C:\WINNT\system32\
ONE SOLUTION: Since I can predict the file names, I put them in
@modlist. After this I open the listing of files, strip out all
carriage returns, then put them back where I want. Like this:
-------------------------------------------------------------
open (FIL, ".\\" . $ARGV[0]);
while (<FIL>) {
$messy = $messy . $_;
}
close (FIL);
open (REPORT, ">c:\\clean.txt") or
die "Cannot open clean.txt for output: $!";
foreach $mod (@modlist) {
chomp $mod;
$data =~ s/(.*)($mod.*)/$1\n$2/;
}
print REPORT "$data";
-------------------------------------------------------------
I expect this can be more terse, but at my current knowledge level I'm
more concerned about my program being brittle and inefficient. Any
suggestions?
--
Thank you for your time,
Martin Schneider
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 1 Oct 2000 10:38:50 +0200
From: "JW" <janwille@dds.nl>
Subject: Re: redirect script
Message-Id: <8r6tdk$c82$1@news1.xs4all.nl>
Dear Mr. Espresso,
Perl is amazing!! It is possible to have a perl script print a redirect
header to the browser. This will make the browser redirect to the new
location.
The funny thing is that mr. Anders Lund already mentioned this method...
Ofcourse the original posting ain't worth the effort of all these replies.
Cheers,
JW
Digital Espresso <webmaster@digital-espresso.com> wrote in message
news:39D6625D.39F2846F@digital-espresso.com...
> Hello, Keat, You cannot accomplish this with a CGI/Perl.
> This kind of function is done by JavaScript.
>
> Keat wrote:
>
> > I'm looking for a perl script that will automatically open up another
url
> > when exiting the original, I know its possible as I've seen it done on
the
> > xxx sites, but I cant seem to find a script anywhere. Does anyone have
any
> > ideas where I can find such a script....????
> >
> > Please reply to keat@beal.org.uk
> > Keaton Roebuck
>
> --
> Regards
>
> Digital Espresso
> ________________
>
> WEB:> http://www.digital-espresso.com
> PHONE:> 907.337.3201; CELL: 907.441.9649; PAGER/V-MAIL: 907.275.9448
> ADDRESS:> PO BOX 240414 Midtown Station Anchorage, AK 99524-0414
>
>
------------------------------
Date: Sun, 1 Oct 2000 11:49:32 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: redirect script
Message-Id: <Pine.GHP.4.21.0010011130330.22863-100000@hpplus03.cern.ch>
On Sun, 1 Oct 2000, JW threw netiquette to the winds and blurted out:
> Dear Mr. Espresso,
This is usenet - a public forum. If you want to exchange personal
messages, email is at your disposal.
> Perl is amazing!! It is possible to have a perl script print a redirect
> header to the browser.
First of all you don't "print to the browser", unless you are a web
server. Your script is invoked by the server (for example via the CGI
programming interface), and returns its results to the server; it's
the server's job to put them into a form for returning them to the
browser.
Of course, there is no "redirect header" as such. Redirection is done
with a "Location" header.
Yeah, well, you could send a Location: header with a simple shell
script; but, no matter how you send it, it won't perform the trick
which you so comprehensively quoted but, it seems, omitted to read
before replying. (Seems to be a natural law among upside-down
quoters).
Restoring the OP's context:
> > I'm looking for a perl script that will automatically open up
> > another url when exiting the original, I know its possible as I've
^^^^^^^^^^^^^^^^^^^^^^^^^
> > seen it done on the xxx sites,
> This will make the browser redirect to the new location.
Instead of displaying the original URL, yes.
> The funny thing is that mr. Anders Lund already mentioned this method...
Right. He evidently hadn't read the question either.
> Ofcourse the original posting ain't worth the effort
You haven't given it any, so that's fine. Score duly adjusted.
------------------------------
Date: Sun, 1 Oct 2000 06:27:10 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Serious SMS-related question.
Message-Id: <1eht8ii.kq1f1e1fhsqrkN%tony@svanstrom.com>
Alan J. Flavell <flavell@mail.cern.ch> wrote:
> On Sat, 30 Sep 2000, Tony L. Svanstrom wrote:
>
> > I did a quick search without finding something,
>
> You surprise me. I found lots of matches, though I haven't had time to
> study how much use they are. Did you really mean that you didn't find
> anything, or that what you found turned out not to be useful?
I meant one that talks directly to a server by dialing in and sending
the SMS and that is in pure perl...
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
on the verge of frenzy - i think my mask of sanity is about to slip
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©99-00 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Sun, 01 Oct 2000 12:14:23 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Substituting characters
Message-Id: <8r79qu$i4n$1@nnrp1.deja.com>
In article <39d72282.9534219@news.redhotant.com>,
phil@nospam.co.uk wrote:
> Any suggestions on how i can substitute all
> instances of , say a comma, with say a no space?
>
> Example:
>
> 123,456,789,101,112,131 should then read 123456789101112131.
>
> Phil
One can transliterate a character for another character...
check the docs for 'tr///'
on the other hand, one might wish to substitute
an expression with another (possible blank) one.
check the docs for 's///'
If your string is in $whatever, this should do the trick:
$whatever =~ s/,//g;
Brendon
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 01 Oct 2000 06:27:38 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: What happened to __DIE__ and __WARN__ signal handers????????
Message-Id: <slrn8tdn4s.6b4.tim@degree.ath.cx>
Brian Kelly <reedfish@ix.netcom.com> wrote:
> Where in the world is the documentation for the "__DIE__" and "__WARN__"
> signal handlers in the 3rd Edition of Perl Programming?
pg. 673 under Special Variables -> %SIG. The doc looks frighteningly
similar to that of the Camel 2. I believe the Cookbook goes into more
depth, though.
--
-Tim Hammerquist <timmy@cpan.org>
The mind of a bigot is like the pupil of the eye.
The more light you shine on it, the more it will contract.
-- Oliver Wendell, Jr. Holmes
------------------------------
Date: Sun, 01 Oct 2000 08:57:57 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: What happened to __DIE__ and __WARN__ signal handers????????
Message-Id: <25vdts0ob6s3v01r8b941f3t77ffh6edtn@4ax.com>
Tim Hammerquist wrote:
>The doc looks frighteningly
>similar to that of the Camel 2.
Probably because they have the same origin.
--
Bart.
------------------------------
Date: Sun, 1 Oct 2000 05:02:36 -0400
From: "Brian Kelly" <reedfish@ix.netcom.com>
Subject: Re: What happened to __DIE__ and __WARN__ signal handers????????
Message-Id: <8r6ur2$dic$1@slb7.atl.mindspring.net>
Thank you sir! I "are" relieved! Now can anyone answer why it's not in the
index like it was in the 2nd edition? (don't work too hard answering this
one!)
Brian Kelly
Tim Hammerquist <tim@degree.ath.cx> wrote in message
news:slrn8tdn4s.6b4.tim@degree.ath.cx...
> Brian Kelly <reedfish@ix.netcom.com> wrote:
> > Where in the world is the documentation for the "__DIE__" and "__WARN__"
> > signal handlers in the 3rd Edition of Perl Programming?
>
> pg. 673 under Special Variables -> %SIG. The doc looks frighteningly
> similar to that of the Camel 2. I believe the Cookbook goes into more
> depth, though.
>
> --
> -Tim Hammerquist <timmy@cpan.org>
> The mind of a bigot is like the pupil of the eye.
> The more light you shine on it, the more it will contract.
> -- Oliver Wendell, Jr. Holmes
------------------------------
Date: Sun, 01 Oct 2000 09:58:39 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: while ($s = <WHATEVER>)
Message-Id: <8r71sf$dgq$1@nnrp1.deja.com>
is "defined()" automatically assumed for a reading a file from within
a "while" loop? Is this part of the 'while readign file' magic similar
to the read line contents being saved to $_?
Under 'strict' and 'warnings', I 'whiled' across a file whose last line
was a "0" not followed by a newline (I made sure of that). It still
output all the lines.
while ($s = <WHATEVER>) {
print("$s");
}
This was not the same for an "if ($s = <WHATEVER>) ..." statement that
evaluated to false on the last line unless "if (defined($s =
<WHATEVER>)" was used instead.
Brendon
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 30 Sep 2000 23:22:01 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: why it's called a "hash" (and a whole lot more)
Message-Id: <Pine.LNX.4.21.0009302310020.28967-100000@hawk.ce.mediaone.net>
On Sun, 1 Oct 2000, Martien Verbruggen quoth:
MV> On Sat, 30 Sep 2000 21:12:24 -0500,
MV> Andrew N. McGuire <anmcguire@ce.mediaone.net> wrote:
MV> > On Sat, 30 Sep 2000, Jeff Pinyan quoth:
MV> >
MV> > [ snip ]
MV> >
MV> > JP> The macro is not a function. It's more like this code is plopped in where
MV> > JP> PERL_HASH(...) is. If we wrote this in Perl, we'd have to use a function,
MV> > JP> because Perl doesn't have the concept of macros.
MV> >
MV> > [ snip ]
MV> >
MV> > That is not entirely true...
MV> >
MV> > #!/usr/bin/perl -wP
MV> > use strict;
MV> > #define P print
MV> >
MV> > P "hello, world\n";
MV> > __END__
MV> >
MV> > But that is generally considered not so good a practice,
MV> > primarily, I surmise, because it is not very Perlish/
MV> > flexible.
MV>
MV> And because it uses an external program that isn't part of the Perl
MV> distribution, and isn't available by default on many systems (cpp).
[ snip ]
No doubt, perhaps I should have been more detailed, but when I said "not
very Perlish/flexible", I was taking into account quite a bit. I merely
wanted to point out that that one little comment was not entirely accurate.
MV> As a personal experience note: I've had to port a few hundred thousand
MV> lines of code from Perl 4 to Perl 5, which was not hard, until we had to
MV> run some of it on a machine where there was no cpp available. Since the
MV> previous developers came from the C world, they had decided that to
MV> avoid the abovementioned problem with Perl comments, they would only use
MV> C comments, and rely on the cpp to strip them out.
MV>
MV> It took a bit fo time to reliably clean that up.
I don't doubt that one bit, and you have my sympathy. I have had similar
experiences. I am a system administrator by trade, but do alot of Perl
programming (scripting). The sad thing is, I know some developers who
call me up to tell me that their script just "magically" broke. It has
been my experience that the developer has usually broken his own script,
because it was so poorly designed from the get-go, that when s/he modified
it, s/he confused himself. Yet it never fails, they find a way to blame it
on everything but their own code, usually the server itself. Even an E10k
only does what it is told.
Regards,
anm
--
$ENV{PAGER} = 'perl -wpe0';
system perldoc => '-t', '-F', $0;
=head1
Just another Perl Hacker
------------------------------
Date: Sun, 01 Oct 2000 09:06:01 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: why it's called a "hash" (and a whole lot more)
Message-Id: <tcvdts8movfp5sk2ukfg8hpmri9vb907i5@4ax.com>
Jeff Pinyan wrote:
> The hash algorithm is defined in the `PERL_HASH(hash, key,
> klen)' macro:
>
> hash = 0;
> while (klen--)
> hash = (hash * 33) + *key++;
> hash = hash + (hash >> 5); /* after 5.6 */
Cute. I have been looking for this kind of info a few months ago. Having
to search through all of Perl's source, just to find this, isn't very,
er, user-friendly. MJD has some Perl sample code on hash key clashing,
but that's about it.
An article like this should be permanently put on a website,
(<www.perl.com>?), or perhaps even included with Perl's standard docs.
(FAQ?)
--
Bart.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4481
**************************************