[11227] in Perl-Users-Digest
Perl-Users Digest, Issue: 4827 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 4 18:11:39 1999
Date: Thu, 4 Feb 99 15:00:24 -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 Thu, 4 Feb 1999 Volume: 8 Number: 4827
Today's topics:
Re: [JOB]: Miami Beach, Florida : Perl Programmer (I R A Aggie)
Re: any comments on the Ultimate Bulleting Board? <jeromeo@atrieva.com>
Re: any comments on the Ultimate Bulleting Board? <smiles@wfubmc.edu>
can cgi(perl) do this? <jeff909@hotmail.com>
Re: can cgi(perl) do this? <jeromeo@atrieva.com>
checking existance of subroutine <arranp@datamail.co.nz>
Re: Checking for reachable URL (Marc-A. Woog)
Re: Comments in Perl code (Martien Verbruggen)
compression in perl <ryan.h.bark@boeing.com>
Re: Error in mod_perl INSTALL.apaci file? <sweeney@informix.com>
Re: finding path to perl executable <tripp.lilley@perspex.com>
Re: finding path to perl executable (Martien Verbruggen)
Re: How do I get local IP Address ? droby@copyright.com
Re: How do I get local IP Address ? <jmc1@gte.com>
Re: How do I get local IP Address ? <ludlow@us.ibm.com>
Re: How do I get local IP Address ? <jmc1@gte.com>
Re: How do I get local IP Address ? <uri@ibnets.com>
Re: Is perl a freeware? dhosek@webley.com
Re: Is perl a freeware? (Sean McAfee)
Re: Is perl a freeware? <tripp.lilley@perspex.com>
Re: Newbie question on regular expressions (Mab)
Re: Newbie question on regular expressions (Martien Verbruggen)
Re: Newbie question on regular expressions <uri@ibnets.com>
Re: Perl NT login scripts help... (Martien Verbruggen)
Perl Programer Needed <zebra@cyberhighway.net>
Perl, ISAPI and Personal Web Server? (Mab)
Re: Perl, ISAPI and Personal Web Server? <cdkaiser@delete.these.four.words.concentric.net>
Postifix?? What is it? <jeff909@hotmail.com>
Re: Postifix?? What is it? (Larry Rosler)
Re: Question: Arrays of associative arrays (Larry Rosler)
Readdir gives me garbage... panduh@eudoramail.com
Re: Reference Question.... droby@copyright.com
Re: Reference Question.... <uri@ibnets.com>
Re: Sending Perl output to 2 diffent html frames <jmc1@gte.com>
Re: Sending Perl output to 2 diffent html frames <emschwar@mail.uccs.edu>
Re: Unix Perl Debugger Question <ludlow@us.ibm.com>
Re: Unix Perl Debugger Question (Ilya Zakharevich)
Re: Unlink Symlink (Martien Verbruggen)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 4 Feb 1999 20:03:22 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: [JOB]: Miami Beach, Florida : Perl Programmer
Message-Id: <slrn7bjvd3.4nh.fl_aggie@enso.coaps.fsu.edu>
On Thu, 04 Feb 1999 17:23:01 GMT, chad@vcn.net <chad@vcn.net> wrote:
+ Plus if you think your God's gift to perl scripting,
+ try to be more humble, no attitudes here!
Are you sure you're looking for a perl programmer?
Hubris. Laziness. Impatience.
James - :)
------------------------------
Date: Thu, 04 Feb 1999 12:03:27 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: 23_skidoo@geocities.com
Subject: Re: any comments on the Ultimate Bulleting Board?
Message-Id: <36B9FD0F.8311575A@atrieva.com>
23_skidoo wrote:
>
> well, i thought it was relevant since i was asking about any inherent
> difficulties in modifying a perl script, i'm asking if it's well written
> Perl or not *shrugs* everytime someone comes on this NG and says "i'm
> having trouble with wwwboard" everyone says "uuurrgh, don't use it, it
> sucks". this kind of information would have saved me a lot of time and
> trouble about 6 months ago, just wondering if there are any opinions
> about UBB in here.
Most of the "It sucks, don't use it" recomendations are there not
because experience with any particular product, but because of general
experience with products from this particular author. I have never used
wwwboard, but I have seen enough of Matt Wrights code to know that it
can be pretty grim, and would advise against using it.
This would make it difficult to render an opinion on another product,
though, as we are not familiar with the author, or his reputation.
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Wed, 03 Feb 1999 15:13:09 -0500
From: Steve Miles <smiles@wfubmc.edu>
Subject: Re: any comments on the Ultimate Bulleting Board?
Message-Id: <36B8ADD5.906B2E0E@wfubmc.edu>
Well, at www.indexfinger.com there is a cheaper takeoff on UBB. But UBB is
the best I've seen so far from a "users" POV. Also, you can go to
www.cgi-resources.com and look for others. The only other good one I know of
is WWWThreads, which you can find by searching at cgi-resources.
Good Luck
Steve Miles
www.groundbreak.com
23_skidoo wrote:
> hi,
>
> i've had my share of problems using matt's wwwboard script and after
> hanging round here long enough i kinda got the (slight) impression that
> no one really rated this script at all.
>
> i'm looking into using the ultimate bulletin board instead as it looks a
> tad more professionally done, has anyone else used this script? are
> there any noteable problems? basically i want to know if i'm going to
> re-experience the level of problems i had with wwwboard 'cos if i am, i
> might as well attempt to write a board script myself from scratch,
> however if this one will do the trick i'll be happy to shell out for a
> legit. version rather than re-invent the wheel. any comments anyone? i
> need to know how easy it is to modify the general layout, all of the
> versions i've seen online look very similar and it's the functionality
> i'm after, i intend to drastically modify the appearence.
>
> thanks to anyone who has used this script and takes the time to share
>
> -23
------------------------------
Date: Thu, 4 Feb 1999 13:03:07 -0800
From: "Jeff" <jeff909@hotmail.com>
Subject: can cgi(perl) do this?
Message-Id: <79d2au$lbp$1@remarQ.com>
When I want to display a confirmation message to the user after they submit
thier info on my email auto-responder script is it possible for the CGI
program to direct thier broswer to a specific html document rather than have
the html code hard-coded into the script? For instance if I want to have my
html pages on another server (to avoid the bothersome hypermart pop-ups) and
the cgi is on the hypermart server(since it is free and allows cgi), after
hypermart sends my email message for me is it possible for the "Thank You"
page to be a seperate html document or do I have to type the html code into
the cgi program? Because even if the page code is hardcoded into a cgi
program, the pop-up banner appears on any page displayed through hypermart.
I hope this makes sense.
Jeff
------------------------------
Date: Thu, 04 Feb 1999 13:59:04 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Jeff <jeff909@hotmail.com>
Subject: Re: can cgi(perl) do this?
Message-Id: <36BA1828.5309F02B@atrieva.com>
Jeff wrote:
>
> When I want to display a confirmation message to the user after they submit
> thier info on my email auto-responder script is it possible for the CGI
> program to direct thier broswer to a specific html document rather than have
> the html code hard-coded into the script?
Yes. You should look at RFC 2068, and pay close attention to section
14.30. Further inquiry into this topic should be directed to newsgroups
focused on CGI, browsers and other things webbish.
Good Luck!
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Fri, 05 Feb 1999 09:57:47 +1300
From: Arran Price <arranp@datamail.co.nz>
Subject: checking existance of subroutine
Message-Id: <36BA09CB.5E3C@datamail.co.nz>
Hi all,
Im using an eval statement such as
while ($CS<=$LS)
{
print"trying to run $STEP_SUB[$CS]\n";
eval ("$STEP_SUB[$CS]");
++$CS;
}
so basically it loops through a whole lot of subroutines whose names are
defined in @STEP_SUB. This works fine apart from when an entry in
@STEP_SUB is not a valid subroutine. It dosent fail, just continues onto
the next one.
How do I check to make sure the subroutine is valid?
Any help or pointers to help appreciated.
cheers
Arran
arranp@datamail.co.nz
My opinions are my own and do not reflect those of my employer.
------------------------------
Date: Thu, 04 Feb 1999 22:34:17 GMT
From: mwoog@pobox.ch (Marc-A. Woog)
Subject: Re: Checking for reachable URL
Message-Id: <36ba2011.1252610@news.datacomm.ch>
On Thu, 04 Feb 1999 17:19:48 GMT, mwoog@pobox.ch (Marc-A. Woog) wrote
in <36b9d3e1.119994@news.datacomm.ch>:
Found the answer myself:
>use IO::Socket;
>sub check_url {
> my ($remote);
> my ($host);
> my ($first_line);
> my ($document);
> $host = shift;
> $service = shift;
> $document = shift;
$document = "/" unless ($document);
$service = 80 unless ($service);
> $remote = IO::Socket::INET->new( Proto => "tcp",
> PeerAddr => $host,
> PeerPort => "http($service)",
> );
> if ($remote) {
> $remote->autoflush(1);
> print $remote "GET $document HTTP/1.0\n\n";
Change To:
print $remote "HEAD $document HTTP/1.0\n\n";
> chop ( $first_line = <$remote> );
> -close $remote;
> if ($first_line =~ /200/) { return (1);} else { return (0); }
> }
> else { return (0); }
>}
Sorry to bother!
Regards,
Marc
------------------------------
Date: Thu, 04 Feb 1999 22:00:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Comments in Perl code
Message-Id: <FLou2.35$fP3.3172@nsw.nnrp.telstra.net>
In article <36B9D562.1D65FEFB@perspex.com>,
Tripp Lilley <tripp.lilley@perspex.com> writes:
> Martien Verbruggen wrote:
>
>> I seriously doubt that you will be able to come up with one real life
>> example where code slows down the running of your perl program
>> noticeably.
> Oh, I suppose you meant examples where /comments/ slow down the running
> of my program. My bad :-)
yeah. I saw my typo after I posted, and decided to ignore it :)
Martien
--
Martien Verbruggen |
Interactive Media Division | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd. | reflects this.
NSW, Australia |
------------------------------
Date: Thu, 4 Feb 1999 19:05:07 GMT
From: "Ryan Bark" <ryan.h.bark@boeing.com>
Subject: compression in perl
Message-Id: <F6n976.271@news.boeing.com>
Is there a perl module out there that employs the same compression routine
as the unix compress command?
------------------------------
Date: Thu, 04 Feb 1999 13:53:11 -0800
From: Tony Sweeney <sweeney@informix.com>
Subject: Re: Error in mod_perl INSTALL.apaci file?
Message-Id: <36BA16C7.55E9A61D@informix.com>
Tony Sweeney wrote:
OK, I know it's bad form to follow up to your own post, but I thought I'd
add an update. Both of the problems with configuration files described
below did indeed disappear once I had remade Apache. However, 'make test'
still fails for mod_perl. It parses the configuration files correctly,
fires up the httpd on port 8529, and then loops trying to run a test called
'simple_test' on it. This fails repeatedly, even though I can see the
httpd with my browser. Any clues/pointers? 'Running truss -f make test'
suggests that it's hunting all over my perl hierarchy for
auto/URI/URL/http/path_query.al, without success
Tony Sweeney.
Informix, Oakland.
> On page three of the perldoc'ed INSTALL.apaci that ships with
> mod_perl-1.18, there are instructions for installing mod_perl using the
> APACI tools in Apache 1.3.4. They don't work, for me at least, viz:
>
> golem:/view/web_dev-> make test
> cp t/conf/mod_perl_srm.conf t/conf/srm.conf
> /local1/apache_1.3.4/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t
> &
> httpd listening on port 8529
> Syntax error on line 3 of
> /u/sweeney/mod_perl/mod_perl-1.18/t/conf/httpd.conf:
> Invalid command '=pod', perhaps mis-spelled or defined by a module not
> included in the server configuration
> will write error_log to: t/logs/error_log
> letting apache warm up...done
> /u/sweeney/perl/bin/perl t/TEST 0
> still waiting for server to warm up............not ok
> server failed to start! at t/TEST line 95.
> *** Error code 2
> make: Fatal error: Command failed for target `run_tests'
> golem:/view/web_dev->
>
> Nothing is written to t/logs/error_log. Subsituting an httpd from
> another machine, which already has mod_perl built into it gives me:
>
> golem:/view/web_dev-> !!
> /net/wombat/local1/apache_1.3.3/src/httpd -f `pwd`/t/conf/httpd.conf -X
> -d `pwd`/t
> Syntax error on line 3 of
> /u/sweeney/mod_perl/mod_perl-1.18/t/conf/srm.conf:
> Invalid command 'PerlTransHandler', perhaps mis-spelled or defined by a
> module not included in the server configuration
> golem:/view/web_dev->
>
> This suggests to me that:
>
> i) 'make test' will only work once I rebuild Apache
> ii) the second problem will go away once I 'make install' -- I'm using a
> private perl installation for this which doesn't (yet) have mod_perl in
> its lib directories.
>
> Does this sound reasonable?
>
> Tony Sweeney
> Web DataBlade Devt.
> Informix, Oakland
------------------------------
Date: Thu, 04 Feb 1999 17:09:08 -0500
From: Tripp Lilley <tripp.lilley@perspex.com>
Subject: Re: finding path to perl executable
Message-Id: <36BA1A84.DA702AB3@perspex.com>
gulam.faruque@csfp.co.uk wrote:
> In article <797l10$m48$1@nnrp1.dejanews.com>,
> mlevine@reshape.com wrote:
>
> > IE, from inside script foo, I'd like to be able to find out that it was run
> > from /usr/local/bin/perl.
>
[snip]
> print "$0\n";
> You'll see.
That it doesn't work. Consider:
[tlilley@mail attachments]$ cat - > foo
#!/usr/bin/perl -w
print "$0\n";
[tlilley@mail attachments]$ chmod 755 foo
[tlilley@mail attachments]$ ./foo
./foo
[tlilley@mail attachments]$
Looks to me like $0 contains the path to the /script/, not the /perl
executable/, which is what the original poster sought.
------------------------------
Date: Thu, 04 Feb 1999 22:12:43 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: finding path to perl executable
Message-Id: <vXou2.37$fP3.3172@nsw.nnrp.telstra.net>
In article <79cnim$u9i$1@nnrp1.dejanews.com>,
gulam.faruque@csfp.co.uk writes:
> In article <797l10$m48$1@nnrp1.dejanews.com>,
> mlevine@reshape.com wrote:
>> Can anyone tell me how to find the path to the perl executable I am running?
> print "$0\n";
Hmmm...
# perl -le 'print $0'
-e
Nope.. that's not the path to my perl binary. Lets try something else..
# cat foo
#!/usr/local/bin/perl
print "$0\n"
# perl foo
foo
# chmod 755 foo
# ./foo
./foo
> You'll see.
Nope. I seem to just be getting back the name of the script that is
being executed. What was being asked for is the name of the
perl binary itself.
Martien
--
Martien Verbruggen |
Interactive Media Division | 75% of the people make up 3/4 of the
Commercial Dynamics Pty. Ltd. | population.
NSW, Australia |
------------------------------
Date: Thu, 04 Feb 1999 20:30:02 GMT
From: droby@copyright.com
Subject: Re: How do I get local IP Address ?
Message-Id: <79cvvr$693$1@nnrp1.dejanews.com>
In article <79cm96$t3r$1@nnrp1.dejanews.com>,
darylh@trendwestresorts.com wrote:
> I have a program that uses sockets, but in order to open the socket my
> program needs to know the IP Address of the machine it is running on. Is
> there a function or system call that will get this address for me? I've
> looked through my perl books (which are both pretty useless) and can't find a
> thing. I guess I need to get a new Perl book.
>
This is answered in perlfaq9. Many other things about network programming are
explained there, too, so you might want to read the whole section.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 04 Feb 1999 16:16:27 -0500
From: John Chambers <jmc1@gte.com>
Subject: Re: How do I get local IP Address ?
Message-Id: <36BA0E2B.DEEAE794@gte.com>
droby@copyright.com wrote:
>
> In article <79cm96$t3r$1@nnrp1.dejanews.com>,
> darylh@trendwestresorts.com wrote:
> > I have a program that uses sockets, but in order to open the socket my
> > program needs to know the IP Address of the machine it is running on. Is
> > there a function or system call that will get this address for me? I've
> > looked through my perl books (which are both pretty useless) and can't find a
> > thing. I guess I need to get a new Perl book.
> >
>
> This is answered in perlfaq9. Many other things about network programming are
> explained there, too, so you might want to read the whole section.
Well, yes and no. In many cases that I've seen (mostly machines hooked
up to the Internet via a PPP link to an ISP), the code there just tells
you that your address is 127.0.0.1. This is about as useful as answering
"What directory am I in?" with ".". True, but possibly not the answer
that was wanted. And if DNS isn't working right, the code may just hang.
In general, it's more reliable to ask your local system for the addresses
bound to its interfaces. Unfortunately, no two systems seem to do this
the same way.
------------------------------
Date: Thu, 04 Feb 1999 15:31:46 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: How do I get local IP Address ?
Message-Id: <36BA11C2.C5C05953@us.ibm.com>
John Chambers wrote:
[snip - IP addresses and interfaces]
> The simplest way to find them is probably to run either or both
> of the commands `ifconfig -a` and `netstat -in`, and parse the
> output. Unfortunately, these commands are minimally portable,
> and give wildly different formats on different systems, so your
> perl program will need a list of REs to try on each command's
> output.
Agreed. I'm not sure which Unix variant you're using, but under Linux
the command would be `netstat -rn`. Your statement about "wildly
different formats" is very much true.
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: Thu, 04 Feb 1999 15:48:43 -0500
From: John Chambers <jmc1@gte.com>
Subject: Re: How do I get local IP Address ?
Message-Id: <36BA07AB.2A319B1@gte.com>
darylh@trendwestresorts.com wrote:
>
> I have a program that uses sockets, but in order to open the socket my
> program needs to know the IP Address of the machine it is running on. Is
> there a function or system call that will get this address for me? I've
> looked through my perl books (which are both pretty useless) and can't find a
> thing. I guess I need to get a new Perl book.
Nah; that probably won't help you. What might is to realize first
that, contrary to what common terminology implies, machines don't
have IP addresses; network interfaces do. In general, a machine
can have N interfaces, and each interface can have M addresses,
where N and M can be much greater than 1. Most Unix systems have
at least two IP addresses (one of which is 127.0.0.1), and many
have more than two.
So what you want is a way to find out all the addresses for all
the interfaces on your machine. You probably want to throw out
the 127.0.0.1 address, for the same reason that you wouldn't want
the `pwd` command to return ".". On many machines, there will
be only one address left, and you may think of that as "this
machine's IP address", but in fact you don't get it from "the
machine", but rather from "the interface".
The simplest way to find them is probably to run either or both
of the commands `ifconfig -a` and `netstat -in`, and parse the
output. Unfortunately, these commands are minimally portable,
and give wildly different formats on different systems, so your
perl program will need a list of REs to try on each command's
output.
But it isn't all that difficult; I've written a couple lines to
do this on numerous systems. In most cases, if either gives
you a line with four decimal numbers separated by three dots
and surrounded by spaces, then either the first or the second
such number in the line is one of your IP addresses.
Anyone know a usable solution on systems without ifconfig or
netstat? This poor guy could be on W95, for all we know ...
------------------------------
Date: 04 Feb 1999 16:54:36 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: How do I get local IP Address ?
Message-Id: <397ltxeswz.fsf@ibnets.com>
>>>>> "JL" == James Ludlow <ludlow@us.ibm.com> writes:
JL> John Chambers wrote:
JL> [snip - IP addresses and interfaces]
>> The simplest way to find them is probably to run either or both
>> of the commands `ifconfig -a` and `netstat -in`, and parse the
>> output. Unfortunately, these commands are minimally portable,
>> and give wildly different formats on different systems, so your
>> perl program will need a list of REs to try on each command's
>> output.
JL> Agreed. I'm not sure which Unix variant you're using, but under Linux
JL> the command would be `netstat -rn`. Your statement about "wildly
JL> different formats" is very much true.
and it would be hard to do a perl module (xs or pure perl) since the way
ifconfig and netstat get their info is also wildly system dependent.
there is another possibility which is to scan the rc.* files and their
config files. but again this is system dependent and may not reflect
manual changes. and god knows how to do that on redmondware (i sure
don't know or care).
uri
--
Uri Guttman Hacking Perl for Ironbridge Networks
uri@sysarch.com uri@ironbridgenetworks.com
------------------------------
Date: Thu, 04 Feb 1999 20:25:03 GMT
From: dhosek@webley.com
Subject: Re: Is perl a freeware?
Message-Id: <79cvmi$63l$1@nnrp1.dejanews.com>
In article <x3yk8xyp03r.fsf@tigre.matrox.com>,
Ala Qumsieh <aqumsieh@matrox.com> wrote:
> In addition, the latest issue of TPJ shows a Perl Atari cartridge. I
> always thought Perl was entertaining, but I don't suppose it's easy to
> write any useful code with a joystick!
But you would use the "keyboard" that came with the BASIC Programming
cartridge and that would solve the problem.
A friend actually had that cartridge when I was a kid. Your programs were
limited to 10 statements and the language was unable to parse I=I+1. Amazingly
feeble.
-dh
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 04 Feb 1999 21:21:21 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Is perl a freeware?
Message-Id: <lbou2.5618$Ge3.23043237@news.itd.umich.edu>
In article <79cvmi$63l$1@nnrp1.dejanews.com>, <dhosek@webley.com> wrote:
>In article <x3yk8xyp03r.fsf@tigre.matrox.com>,
> Ala Qumsieh <aqumsieh@matrox.com> wrote:
>> In addition, the latest issue of TPJ shows a Perl Atari cartridge. I
>> always thought Perl was entertaining, but I don't suppose it's easy to
>> write any useful code with a joystick!
>But you would use the "keyboard" that came with the BASIC Programming
>cartridge and that would solve the problem.
>A friend actually had that cartridge when I was a kid. Your programs were
>limited to 10 statements and the language was unable to parse I=I+1. Amazingly
>feeble.
Anyone else ever use the Odyssey 2 game system's "Machine Language
Programming" cartridge? It was also severely limited; you could only put
symbols onto the left half of one line on the screen. When I got it at age
ten or so, I thought it was one of the coolest things I'd ever seen,
but the novelty wore off quickly. I still pronounce some assembler opcodes
the way I guessed at that age that they should be pronounced (LDX =>
"loady x", LDA => "loady a", etc).
The Odyssey 2 didn't stack up well against the Atari, but some later games
like "UFO" and "Quest for the Rings" kicked some serious butt.
--
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
| tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu
------------------------------
Date: Thu, 04 Feb 1999 17:15:53 -0500
From: Tripp Lilley <tripp.lilley@perspex.com>
Subject: Re: Is perl a freeware?
Message-Id: <36BA1C19.D336D5DB@perspex.com>
Sean McAfee wrote:
> Anyone else ever use the Odyssey 2 game system's "Machine Language
> Programming" cartridge? It was also severely limited; you could only put
> symbols onto the left half of one line on the screen. When I got it at age
> ten or so, I thought it was one of the coolest things I'd ever seen,
> but the novelty wore off quickly. I still pronounce some assembler opcodes
> the way I guessed at that age that they should be pronounced (LDX =>
> "loady x", LDA => "loady a", etc).
YES!! I had one of those! Of course, somehow or another, I didn't manage
to truly "come out" as a geek until I got to college, so I never really
grokked what was going on with the damned thing. I kept entering the
stupid hex for the hand-assembled programs and never actually understood
what I was doing.
<sigh>. Those naive, innocent days :-)
A friend of mine recently picked up an Odyssey 2 at a garage sale, but
it was lacking the programming cartridge. I've secretly been hoping to
find one someday, just so I can vindicate myself by actually finally
being able to wrangle the damned thing! :-)
------------------------------
Date: Thu, 04 Feb 1999 22:46:44 GMT
From: mhamilton@bunge.com.au (Mab)
Subject: Re: Newbie question on regular expressions
Message-Id: <Yxou2.3$Zt1.2627@vic.nntp.telstra.net>
In article <36B52A9A.5EED2E93@michelob.wustl.edu>, someone calling themselves Fred Govier <govier@michelob.wustl.edu> wrote:
>Ulrich Petri wrote:
>> my code looks like:
>> if ("hTtP://www.blah.com" =~ /http:/i)
>> {
>> <do something>
>> }
>> that works quite nice
>> but actual i want to do the exact opposite
>> like:
>> if ("www.blah.com " !=~ /http:/i)
>> and now this doesn'T work
>Try
>if ( ! ("www.blah.com " =~ /http:/i) )
> { <do something> }
>-- Fred
Now _I'm_ confused. I'm probably more of a newbie than Ulrich (the
original poster)...
Can't you use this:
if ("www.blah.com" !~ /http:/i)
{ <do something> )
???
Mab
------------------------------
Date: Thu, 04 Feb 1999 22:04:53 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Newbie question on regular expressions
Message-Id: <9Qou2.36$fP3.3172@nsw.nnrp.telstra.net>
In article <Yxou2.3$Zt1.2627@vic.nntp.telstra.net>,
mhamilton@bunge.com.au (Mab) writes:
> In article <36B52A9A.5EED2E93@michelob.wustl.edu>, someone calling themselves Fred Govier <govier@michelob.wustl.edu> wrote:
>>Try
>
>>if ( ! ("www.blah.com " =~ /http:/i) )
>> { <do something> }
> Can't you use this:
>
> if ("www.blah.com" !~ /http:/i)
> { <do something> )
yep. In fact, that's what the !~ operator is for. Of course, you can also use other combinations of =~ or !~ with as many not (!, not) operators as you want. Using the !~ one here makes most sense, and would be preferable as far as I am concerned.
if ( not !! not 'www.blah.com' !~ /http:/i ) {}
Watch the precedence rules, though.
Martien
--
Martien Verbruggen |
Interactive Media Division | The number of the beast is not 666. Its
Commercial Dynamics Pty. Ltd. | number is 95, and it's awake.
NSW, Australia |
------------------------------
Date: 04 Feb 1999 17:46:53 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: Newbie question on regular expressions
Message-Id: <39679heqhu.fsf@ibnets.com>
>>>>> "MV" == Martien Verbruggen <mgjv@comdyn.com.au> writes:
MV> In article <Yxou2.3$Zt1.2627@vic.nntp.telstra.net>,
MV> mhamilton@bunge.com.au (Mab) writes:
>> Can't you use this:
>>
>> if ("www.blah.com" !~ /http:/i)
>> { <do something> )
of course the above wouldn't match ever. i assume you would have a full
url instead of www.blah.com.
MV> yep. In fact, that's what the !~ operator is for. Of course, you
MV> can also use other combinations of =~ or !~ with as many not (!,
MV> not) operators as you want. Using the !~ one here makes most
MV> sense, and would be preferable as far as I am concerned.
MV> if ( not !! not 'www.blah.com' !~ /http:/i ) {}
i don't recall ever having used !~. it just doesn't look good to my eyes.
i always prefer to use unless instead of if (!). it reads better. just
one nice little thing from the linguist background of larry.
uri
--
Uri Guttman Hacking Perl for Ironbridge Networks
uri@sysarch.com uri@ironbridgenetworks.com
------------------------------
Date: Thu, 04 Feb 1999 22:17:34 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl NT login scripts help...
Message-Id: <20pu2.38$fP3.3172@nsw.nnrp.telstra.net>
In article <c55_9902042146@hccfido.hcc.nl>,
UUCP@p1.f3.n500.z2.hccfido.hcc.nl (UUCP) writes:
> From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
> BEGIN {
> push @INC, 'p:/bin', 'p:/lib';
> }
Normally you would use unshift here, because most likely you want
those directories to appear before the other ones.
In that case just use the lib pragma, which was specifically created
for this:
use lib qw( p:/bin p:/lib );
Martien
--
Martien Verbruggen |
Interactive Media Division | I think there is a world market for
Commercial Dynamics Pty. Ltd. | maybe five computers. --Thomas Watson,
NSW, Australia | chairman IBM, 1943
------------------------------
Date: Thu, 04 Feb 1999 13:24:05 -0700
From: Steve Veloudos <zebra@cyberhighway.net>
Subject: Perl Programer Needed
Message-Id: <36BA01E5.B15FAC64@cyberhighway.net>
Hello,
I am of need of a Perl programer that can write a custom program for my web
site. My business is involved in the music business and I have a section called
Gigsharing where bands can enter their info and get info on other bands that are
willing to share gigs with them. I need a custom "guestbook" type of script that
can be searchable by state. I am willing to pay for this custom scripts please
mailto:zebra@cyberhighway.net if you are intrested in working with me.
Thanks!
--
The Musicians Tip Sheet
A free monthly newsletter for musicians which includes many industry contacts,
informative information and interviews with music business professionals.
To subscribe mailto:tip@zebramusic.com with the words "subscribe tip-00"
in the body of the message.
Zebra Music Web Site
http://www.zebramusic.com
An information depot for musicians featuring hundreds of Industry Contacts,
the Gig Sharing Network, archived issues of the Musicians Tip Sheet,
Music FAQ's, Music Chat, The Musician Discussion List and many Cool Links
to help your musical act.
Zebra Music
Helping Musicians Survive!
------------------------------
Date: Thu, 04 Feb 1999 22:56:57 GMT
From: mhamilton@bunge.com.au (Mab)
Subject: Perl, ISAPI and Personal Web Server?
Message-Id: <yHou2.4$Zt1.2351@vic.nntp.telstra.net>
Hi all,
I'm a hopeless newbie trying to work out ISAPI apps with perl. I have
installed MS Personal Web Server 4 on my machine, followed by
ActiveState's Perl for Win32 (allong with all the ISAPI stuff).
I then wrote a small perl proggie like this:
print 'Hello world!';
and saved it as test.plx in my cgi-bin directory. However, when I
browse to that file, IE4 tells me that "the script produced no
output"!
I've searched all thru the faqs but there doesn't seem to be anything
on how to write the scripts - just stuff on how to set up your web
server.
Any help (or URLs on how to do this) would be greatly appreciated.
Cheers,
Mab (Perl wannabe).
------------------------------
Date: 04 Feb 1999 14:43:07 PST
From: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net>
Subject: Re: Perl, ISAPI and Personal Web Server?
Message-Id: <79d7pr$qah@chronicle.concentric.net>
mhamilton@bunge.com.au (Mab) writes:
>Any help (or URLs on how to do this) would be greatly appreciated.
This has nothing to do with perl. This is an issue with PWS and its CGI
handling.
In a nutshell, all your CGI scripts in PWS are treated as NPH. That means
you need to set the HTTP return code and headers yourself. For starters,
add this to the beginning of your script:
print <<"EOF";
HTTP/1.0 200 OK
Content-type: text/plain
EOF
and then your code.
Again, this is an issue with PWS, not perl. This is better brought up in
the microsoft.* hierarchy.
--
Cameron Kaiser * cdkaiser.cris@com * powered by eight bits * operating on faith
-- supporting the Commodore 64/128: http://www.armory.com/~spectre/cwi/ --
head moderator comp.binaries.cbm * cbm special forces unit $ea31 (tincsf)
personal page http://calvin.ptloma.edu/~spectre/ * "when in doubt, take a pawn"
------------------------------
Date: Thu, 4 Feb 1999 13:04:51 -0800
From: "Jeff" <jeff909@hotmail.com>
Subject: Postifix?? What is it?
Message-Id: <79d2at$acb$1@remarQ.com>
Anyone here have any idea what postifix is? I made an inquiry to my regular
isp about using cgi on thier servers and they say sure but I have to do the
following:
"We are running linux and to do cgi, you would need to (the following came
from our programmer) create the file with execution
permssions set and .cgi postifix under the public_html directory."
I understand ALL of this except the bit about postifix. I did a search
through dejanews and several search engnies and I have seen 2 documents
mentioning this vague mystery term. One was a final exam cheat sheet that
had "C" as an answer to some postifix-machine code question (that in itself
told me nothing) Another was a resume that had a calculator that translates
"inifix" to "postifix" and still I know nothing >:) Any help would be
appreciated. I have tried contacting the isp again but they are currently
unavailible.
Jeff
------------------------------
Date: Thu, 4 Feb 1999 14:35:57 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Postifix?? What is it?
Message-Id: <MPG.1123c0ab9359c0cf989a06@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <79d2at$acb$1@remarQ.com> on Thu, 4 Feb 1999 13:04:51 -0800,
Jeff <jeff909@hotmail.com> says...
> Anyone here have any idea what postifix is? I made an inquiry to my regular
> isp about using cgi on thier servers and they say sure but I have to do the
> following:
> "We are running linux and to do cgi, you would need to (the following came
> from our programmer) create the file with execution
> permssions set and .cgi postifix under the public_html directory."
'postifix' eq 'postfix' eq 'filename extension' eq '.cgi'.
I never heard of such a word either!
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 4 Feb 1999 11:58:29 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Question: Arrays of associative arrays
Message-Id: <MPG.11239bbd6aa7a4a9989a05@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <36B9F39A.F2365854@synopsys.com> on Thu, 04 Feb 1999 14:23:07
-0500, Steve Chen <stevesc@synopsys.com> says...
> Are "arrays of associative arrays" useful in Perl? I seem to be able to
hashes
> construct it, but the problem
> is, how do I access the values of the associative arrays? Let's say I
> have an array:
>
> @Array = (%comp1, %comp2, ..., %compn);
>
> where
>
> %compn = (keys, values)
key0, value0, key1, value1, ...
You can't have an array of hashes. The elements of an array are
scalars, so they must be references to the hashes:
@Array = (\%comp1, \%comp2, ..., \%compn);
> To print all the values of the associative arrays, I tried
>
> (loop over $i)
> foreach $key (sort keys($Array[$i])) {
> print ....
> }
>
> But this won't fly with the compiler. The function "keys" doesn't seem
> to like things that begin with a "$". Any ideas?
Definitely! Read 'perldsc', several times if necessary.
foreach $key (sort keys %{$Array[$i]}) {
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 04 Feb 1999 20:03:09 GMT
From: panduh@eudoramail.com
Subject: Readdir gives me garbage...
Message-Id: <79cudl$4nu$1@nnrp1.dejanews.com>
Hi, I am trying to write a script that recursively runs through a
directory tree two levels and grab the first level of subdirectories of
a certain name and the files each subdirectory contains, of a certain
name. The code works, in general.. however for one particular directory
it gives a huge load of garbage along with the filenames( like a whole
bunch of /@/@/@/@/@/,misc. ASCII characters and filenames from other
directories... ) Just wondering if
anyone can help me out. By the way, I am running this on an IBM AIX machine
Heres the code:
$LOG_DIR = '/home/logs';
# Open up the directory handle first
opendir DIR, $LOG_DIR;
# Grab all the relevant subdirectories, then close the handle.
@firstgo = grep { !/^\./ && /^nyfxcom30.*/ } readdir DIR;
close DIR;
# Do a readdir from each subdirectory
foreach ( @firstgo )
{
$subdir = $subtree = $_;
# prepend the full path back on for the
# directory open and read.
$fullsub = $LOG_DIR . "/$subdir";
print "FullSubDir: $fullsub\n";
opendir NEXTDIR, $fullsub;
# Go thru and grab only the relevant
# files of the sub dir.
@secgo = grep
{
( !/^\./ && /.*log$/ )
}
readdir NEXTDIR;
close NEXTDIR;
# Run through and print each file
foreach ( @secgo )
{
print "Files: $_\n";
}
}
Thanks!!
--
PanDuh!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 04 Feb 1999 20:18:45 GMT
From: droby@copyright.com
Subject: Re: Reference Question....
Message-Id: <79cvao$5nj$1@nnrp1.dejanews.com>
In article <36B9CBD1.8CD64CF0@cedarnet.org>,
Steve Wells <wells@cedarnet.org> wrote:
>
> I have an object that returns an array.
>
> If I use:
> my @array = $obj->function;
> $hash{foo} = \@array;
>
> It works. But I wanted to get rid of the array and
> just have it point to the data so I tried:
>
> $hash{foo} = \@{$obj->function};
>
That would work if $obj->function returned an array reference. But then, so
would $hash{foo} = $obj->function; You're deferencing and referencing in
quick succession there.
It returns an array rather than an array reference, and you want $hash{foo} to
reference that array (that being how a hash of lists works...). I think the
neatest way is to dereference $hash{foo} in an array assignment:
@{$hash{foo}} = $obj->function;
It seems to work for me anyway.
If there's a clearer way, I hope someone else will post it.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 04 Feb 1999 15:34:14 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: Reference Question....
Message-Id: <3990edewmx.fsf@ibnets.com>
>>>>> "d" == droby <droby@copyright.com> writes:
d> In article <36B9CBD1.8CD64CF0@cedarnet.org>,
d> Steve Wells <wells@cedarnet.org> wrote:
>>
>> my @array = $obj->function;
>> $hash{foo} = \@array;
>>
>> It works. But I wanted to get rid of the array and
>> just have it point to the data so I tried:
>>
>> $hash{foo} = \@{$obj->function};
d> neatest way is to dereference $hash{foo} in an array assignment:
d> @{$hash{foo}} = $obj->function;
$hash{foo} = [$obj->function] ;
anon lists are your friend. this of course copies the list which is what
the original code seems to want.
uri
--
Uri Guttman Hacking Perl for Ironbridge Networks
uri@sysarch.com uri@ironbridgenetworks.com
------------------------------
Date: Thu, 04 Feb 1999 15:53:28 -0500
From: John Chambers <jmc1@gte.com>
Subject: Re: Sending Perl output to 2 diffent html frames
Message-Id: <36BA08C8.7D767019@gte.com>
Bob Van Der Ploeg wrote:
>
> How do I get perl to send output to 2 different html frames?
I've beat my head against this particular wall a number of times,
and it seems that the basic answer is: You can't. Or if there's
a way, you'll never understand the "explanations".
The problem is that you can't actually send anything to an
html frame. All you can legally do is create the frame with
a src="URL" attribute, and write the data to the files that
the frames' URLs point to. Actually, of course, you want to
write the data there first, and then send the frameset, to
make sure that the browser doesn't try to fetch the URLs too
soon.
It sure would be simpler if browsers would just display the
contents of a <FRAME> tag, so you could send everything in
one document. But the folks who foisted frames on us decided
to do it differently.
There are lots of tirades against frames lying about the net,
and this is one of the arguments against them.
(Now I'll sit back and let others do the flaming for a question
that really has nothing to do with perl. ;-)
------------------------------
Date: 04 Feb 1999 15:17:55 -0700
From: Eric The Read <emschwar@mail.uccs.edu>
Subject: Re: Sending Perl output to 2 diffent html frames
Message-Id: <xkfzp6thkz0.fsf@valdemar.col.hp.com>
"Bob Van Der Ploeg" <bob@worldparts.com> writes:
> How do I get perl to send output to 2 different html frames?
1) You mean browser frames
2) You can't do that in Perl.
3) You can't do that.
4) You should talk to people in comp.infosystems.www.authoring.cgi,
probably.
-=Eric
------------------------------
Date: Thu, 04 Feb 1999 13:57:12 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Unix Perl Debugger Question
Message-Id: <36B9FB98.D4A9B8CE@us.ibm.com>
Ban Spam Now wrote:
>
> Hi, using debugger for the first time and have set a conditional breakpoint.
>
> How do I tell it to continue execution until it reaches my breakpoint?
^^^^^^^^
(c)ontinue
perldoc perldebug
There is a complete list of commands near the top.
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: 4 Feb 1999 21:24:25 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Unix Perl Debugger Question
Message-Id: <79d369$lvh$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to James Ludlow
<ludlow@us.ibm.com>],
who wrote in article <36B9FB98.D4A9B8CE@us.ibm.com>:
> Ban Spam Now wrote:
> >
> > Hi, using debugger for the first time and have set a conditional breakpoint.
> >
> > How do I tell it to continue execution until it reaches my breakpoint?
> ^^^^^^^^
> (c)ontinue
>
> perldoc perldebug
>
> There is a complete list of commands near the top.
You do not *need* even this. Just do what the debugger advices you to
do: type `h h' or `h'.
Ilya
------------------------------
Date: Thu, 04 Feb 1999 22:23:39 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Unlink Symlink
Message-Id: <L5pu2.40$fP3.3172@nsw.nnrp.telstra.net>
In article <79c3is$ku0$1@plug.news.pipex.net>,
"Artoo" <r2-d2@REMOVEbigfoot.com> writes:
> I was doing if (-e "$symliked_file"){unlink ($symlinked_file);}
Now, this is a very good example of why you should always use -w, and
probably also always use strict. Both of those would have alerted you
to the fact that you have two different variables in the above piece
of code.
Read it again.
Besides that, you don't need double quotes around a variable.
(-e $symlinked_file) and
unlink($symlinked_file) ||
warn "Didn't unlink $symlinked_file: $!"
(Yes, I did mean 'and' and '||')
Martien
--
Martien Verbruggen |
Interactive Media Division | The number of the beast is not 666. Its
Commercial Dynamics Pty. Ltd. | number is 95, and it's awake.
NSW, Australia |
------------------------------
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 4827
**************************************