[13230] in Perl-Users-Digest
Perl-Users Digest, Issue: 640 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 25 15:16:44 1999
Date: Wed, 25 Aug 1999 12:10:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 25 Aug 1999 Volume: 9 Number: 640
Today's topics:
Re: Perl a Black Sheep? (Donovan Rebbechi)
Re: Perl a Black Sheep? (Donovan Rebbechi)
Re: Perl a Black Sheep? <madebeer@igc.apc.org>
Re: Perl a Black Sheep? <theglauber@my-deja.com>
Re: Perl a Black Sheep? siafhir2@my-deja.com
Re: Problem processing form variables in CGI siafhir2@my-deja.com
Re: puzzle <revjack@radix.net>
Re: Send to ICQ with perl (Tony Kennick)
Re: sub aliases <jerrad@networkengines.com>
subroutine and arrays <dirk@leonardo.uni-pc.gwdg.de>
Re: subroutine and arrays <jed@moose.chem.yale.edu>
test <jerrad@networkengines.com>
trouble using the Perl2exe aplication <baal@c2i.net>
Re: uploading files using multipart/form-data with NT <jerrad@networkengines.com>
Re: Win32::OLE to read Word file <cassell@mail.cor.epa.gov>
Re: writing formatted text to console on Win32 <jerrad@networkengines.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 25 Aug 1999 13:05:32 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: Perl a Black Sheep?
Message-Id: <slrn7s88ir.3sj.elflord@panix3.panix.com>
On Tue, 24 Aug 1999 22:59:17 -0400, joeyandsherry@mindspring.com wrote:
>Today I had an interview with an admissions counselor of a facility that
>offers training for the MCSE and the MCSD. I am hoping that this sort of
>certification may aid in my desire to change careers...
[snip]
>I told him of my learning of Perl and of how I used it, etc. As soon as I
>mentioned Perl and the UNIX server I use, he snarled. It was if I was
Hardly surprising. This guy is an MS droid, and Perl is a technology
that originated on UNIX, and was not invented by Microsoft.
The reason why I say "hardly surprising" is that after all, the place
is basically a Microsoft shop, and consequently, they're going to be
advocates of MS based technologies. As such, they might be a little biased.
But in all fairness, you'd quite possibly get a similar reaction if the place
offered Solaris certification training and you said that you were
a Visual Basic programmer.
>speaking of a plague...He commented that Perl was not a "real" programming
>language, it is a scripting language and offered his dissertation on
>programming and Unix and other such things.
What a jackass.
(a) I bet he doesn't know a thing about perl
(b) I bet that Visual Basic is a "real" programming language.
>Why is Perl treated with such disdain? I've found many occasions where Perl
It's a question of bias. You happened to step into a place where there
is a lot of pro MS ( and anti-UNIX ) bias. Walk into a UNIX shop and
you will see people showing much more respect for perl.
You get a lot of partisans on both sides: people who are UNIX zealots
and frown on anything Microsoft do, and Microsoft drones who believe
that everyone should just go out and get MCSEs and do everything the
Microsoft way (tm). You've been warned.
--
Donovan
------------------------------
Date: 25 Aug 1999 13:09:13 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: Perl a Black Sheep?
Message-Id: <slrn7s88pp.3sj.elflord@panix3.panix.com>
On Tue, 24 Aug 1999 22:17:44 -0700, Joe Schmoe wrote:
>Managers look down on Perl due to its being slower than compiled C.
If that was really the case, they'd also look down on VB and java
for the same reason. I think in this example, the reaction is not that
surprising : he walked into an MS indoctrination camp oops I mean
training center and they didn't like perl and UNIX.
--
Donovan
------------------------------
Date: Wed, 25 Aug 1999 08:28:35 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: Perl a Black Sheep?
Message-Id: <APC&1'0'50775d9a'723@igc.apc.org>
Perl and unix can be daunting to beginners -- they are terse.
Most people reject what they don't find friendly.
-Mike
------------------------------
Date: Wed, 25 Aug 1999 17:24:02 GMT
From: The Glauber <theglauber@my-deja.com>
Subject: Re: Perl a Black Sheep?
Message-Id: <7q18r0$3o3$1@nnrp1.deja.com>
Unfortunately, programming languages is one of the most "religious"
topics in computering (the other is: "what's the best text editor"?).
Perl is a real programming language, suitable for many different sorts
of tasks that I encounter daily in programming ans systems
administration. It's not slower than C (on the contrary, it's often
faster). One of the joys of Perl in Unix is that it opens up 90%+ of
the stuff you can do in C, but in an interpreted environment. There are
many other nice languages out there, but Perl gives you both the high
level and low level constructs you need to program efficiently. I think
the only other language that can compete with Perl is Python. However,
Python is more "high level". If Perl compares to C, Python compares to
Java.
Perl also inherits from C the possibility to write "read only" programs
that nobody else can understand. This is a problem with the programmer,
not with the language.
Do yourself (and us) a favor and "use strict", comment your programs
and include POD documentation in anything you install in a production
environment.
glauber
--
Glauber Ribeiro
theglauber@my-deja.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 25 Aug 1999 18:52:28 GMT
From: siafhir2@my-deja.com
Subject: Re: Perl a Black Sheep?
Message-Id: <7q1e17$81h$1@nnrp1.deja.com>
In article <37C3CC53.41AA7C0B@Mark.Com>,
Mark <Mark@Mark.Com> wrote:
>
>
> joeyandsherry@mindspring.com wrote:
>
> >
> >
> > I spoke to the admissions counselor and I questioned which training
program
> > would best enhance my limited exposure to NT. The Counselor
introduced me to
> > the Training Director, partly to answer my question and partly for
> > prequalification...He asked of my experience.
> >
> > I told him of my learning of Perl and of how I used it, etc. As soon
as I
> > mentioned Perl and the UNIX server I use, he snarled. It was if I
was
> > speaking of a plague...He commented that Perl was not a "real"
programming
> > language, it is a scripting language and offered his dissertation on
> > programming and Unix and other such things.
>
> It's simple really. Your training director is a complete gobsh**te. I
guess if I
> was trying to flog
> worthless Microsoft certifications, I would rubbish the opposition
too.
>
> I'd be interested in what his definition of a REAL PROGRAMMING
LANGUAGE is.
> Actually, I wouldn't, he probably thinks VB script is the sine qua non
of the
> programming world. Tosser!
>
>
Gotta hate those Bill Gates followers. To those people, Microsoft is
like a religion, and anything else is heresy.
I'm also new to Perl, and I'm working for a small company that has hired
me as their first Internet programmer. We focus on compatibility with
both IE and Netscape. There's probably an MS language that can be a
worthy competition to Perl, and easier to use, but there's a good chance
that not all of it's functions is compatible to Netscape. Since Java is
still young, and can't do a lot of the things Perl can, I'm stuck with
Perl, so I might as well try to make friends with it instead of
snarling.
That's my two cents,
SiaFhir
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 25 Aug 1999 17:05:47 GMT
From: siafhir2@my-deja.com
Subject: Re: Problem processing form variables in CGI
Message-Id: <7q17p0$31r$1@nnrp1.deja.com>
> it would seem that I need to see the code that creates this %form_data
> hash that you keep using .. I'd also like to see how the data gets
from
> that hash into this @fields array that you actually use in your code
>
> --
> jason - elephant@squirrelgroup.com -
>
A previous post actually helped fix the problem. I had the "+" changed
to a "%2B", then when I was about to print it on an html page, I added
the line "$form_data{'facility'}=~s/\+/ /;" to get rid of the "+".
But now I have another, similar problem. The above solution doesn't
help if the value has period as the last character (eg, if the value was
something like "Rink S.E.": note the very last character is a period
again), so my problem remains.
%form_data is created by cgi-lib.pl. At first I thought that library
was the problem. So I had Perl Builder create a standard form
processing subroutine. The result was the same.
Here's the code for $fields[$index]:
foreach $row (@database_rows)
{
@fields = split (/\|/, $row);
foreach $index (@db_index_for_display)
{
$fields[$index] =~ s/~p~/\|/g;
$fields[$index] =~ s/~nl~/\n/g;
@db_index_for_display is an environment array to tell the script what
fields are allowed to be displayed in an html table.
@database_rows is the result of a library file using the %form_data hash
as search criteria and retrieving rows from a flat file database that
match that criteria. The code for the retrieval is as follows:
#open a file or display an error message
open(DATAFILE, "<$data_file_path") ||
&file_open_error("$data_file_path",
"Read Database",__FILE__,__LINE__);
#process each line in the database
while(($line = <DATAFILE>))
{
#check if the line is a comment.
unless ($line =~ /^COMMENT:/)
{
chop($line); # Chop off extraneous newline
#put each line into an array.
@fields = split(/\|/, $line);
#the line below defines the criteria for a specific search field
#(put into a different file... it's here only to show you
#what's being broken up.)
@db_query_criteria = ("facility|1|=|string")
#the above code is broken up to its component parts
#to apply the criteria
($c_name, $c_fields, $c_op, $c_type) = split(/\|/, $criteria);
#$c_name is stored for comparison.
$form_value = $form_data{$c_name};
#if $c_type = "string", the following code is activated
#to compare strings (as opposed to numbers or dates)
@word_list = split(/\s+/,$form_value);
foreach $db_index (@criteria_fields)
{
$db_value = $fields[$db_index];
#$fields is a passed search criteria
if ($case_sensitive eq "on")
{
if ($exact_match eq "on")
#for my purposes both $exact_match and $case_sensitive
#are "on" to narrow the search
{
#whatever the problem might be,
#it would have to be in here somewhere
#(the code below goes beyond my knowledge of Perl).
for ($x = @word_list; $x > 0; $x--)
{
$match_word = $word_list[$x - 1];
# \b matches on word boundary
if ($db_value =~ /\b$match_word\b/)
{
splice(@word_list,$x - 1, 1);
}
}
}
}
If you need more to go on, you can go to www.extropia.com and download a
script called "DB_Search".
-The library file above is called "db-lib.pl", in the DB_search/Library/
directory.
-The library file is called from "db_search.cgi in the root of
DB_Search.
-The setup file that uses the results is address_book_setup.cgi is the
DB_Search/setup/ directory, though you may not find exactly the same
code as I showed in the previous postings, as I've done some
customizing.
Hope this helps.
SiaFhir
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 25 Aug 1999 17:52:44 GMT
From: revjack <revjack@radix.net>
Subject: Re: puzzle
Message-Id: <7q1ahc$i7c$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
Mark Grimshaw explains it all:
:P.S. I'm not into hacking and there's nothing illegal about hype!
That's an interesting notion. I just wrote a script that will e-mail the
music site administrator about a dozen times a day with a complaint about
your behavior. It munges the From: address, etc., so it looks like
hundreds of separate people are complaining about you. Nothing illegal,
just a little hype.
------------------------------
Date: Thu, 26 Aug 1999 17:34:51 GMT
From: tony@showroom.org.uk (Tony Kennick)
Subject: Re: Send to ICQ with perl
Message-Id: <37c57a09.34969931@missy.shef.ac.uk>
mgjv@comdyn.com.au (Martien Verbruggen) imparted the following:
:->In article <rs5cq56hdmc22@corp.supernews.com>,
:-> "Jim Karsten" <jimk@gate-way.net> writes:
:->> Is there a method of sending a message to an ICQ number via a perl script? I
:->> know that I can send an email to 12345678@pager.mirabilis.com, for example,
:->> where 12345678 is the ICQ number, but the message is full of garbly-gook. I
:->> would like the message to be like that received if I had typed it manually
:->> using my ICQ. Any ideas?
:->
:->Next time you have a question like this, please first go to CPAN:
if they did, they would find that the latest version of Net::ICQ is
0.08 and has the following at the top of the readme.
<copied text begins>
Net::ICQ
This is a really unfinished module for communicating with an ICQ
server.
*** YOU CAN'T USE IT YET. IT'S NOT FINISHED.
BUT IT'S GETTING THERE!!
It's here because others are helping me create it and this
is the easient way to share code :)
<copied text ends>
:->http://www.perl.com/CPAN
If you are going to be rude, be right.
--
From Tony Kennick aka Gonzo The Great
http://missy.shef.ac.uk/users/old-firm/
Gonzo: Slang for "the last man standing
at a drinking marathon"
------------------------------
Date: Wed, 25 Aug 1999 13:09:29 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: Re: sub aliases
Message-Id: <37C42349.8BBD1B0E@networkengines.com>
Thanks!
Sorry about posting it multiple times, couldn't see it..
Greg Bacon wrote:
>
> In article <7q16om$24n$1@nnrp1.deja.com>,
> belg4mit@mit.edu writes:
> : Is there a way to provide an alias for a sub?
> :
> : given sub foo{ ... }
> :
> : I'd like to call &bar and have it do the same thing as &foo
>
> *bar = \&foo;
>
> This makes &bar another name (aka an alias) for &foo.
>
> Greg
> --
> File names are infinite in length where infinity is set to 255 characters.
> -- Peter Collinson
------------------------------
Date: 25 Aug 1999 17:22:52 GMT
From: d!rk caspary <dirk@leonardo.uni-pc.gwdg.de>
Subject: subroutine and arrays
Message-Id: <7q18pc$1anq$1@gwdu67.gwdg.de>
Hello,
how can I send more then one array to an subroutine, e.g.
sub routine_1 (@A,@B) { ... }
...
&routine_1 (@X,@Y);
so that @A=@X and @B=@y?
thanks
d!rk
------------------------------
Date: Wed, 25 Aug 1999 14:55:22 -0400
From: john gehman <jed@moose.chem.yale.edu>
Subject: Re: subroutine and arrays
Message-Id: <37C43C19.BC221EC5@moose.chem.yale.edu>
d!rk caspary wrote:
> Hello,
> how can I send more then one array to an subroutine, e.g.
>
> sub routine_1 (@A,@B) { ... }
>
> ...
>
> &routine_1 (@X,@Y);
>
> so that @A=@X and @B=@y?
>
> thanks
>
> d!rk
Use references. Pass (\@X,\@Y) into the subroutine, which are passed
as scalars, essentially.
In the sub, my ($A, $B) = @_;
To dereference in the array, either dereference the entire array with
@A=@$A; @B=@$B;
Or extract a single value, say the fourth element of the array, with
$A->[3] ;
j. gehman
------------------------------
Date: Wed, 25 Aug 1999 10:47:06 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: test
Message-Id: <37C401EA.6B0511B1@networkengines.com>
harvard net sucks
------------------------------
Date: Wed, 25 Aug 1999 18:48:30 GMT
From: "[L] Vicious!" <baal@c2i.net>
Subject: trouble using the Perl2exe aplication
Message-Id: <2UWw3.318$c6.10923@juliett.dax.net>
I'm having some trouble using the Perl2exe aplication, I know this is not
related to Perl, but I recon some of you probably have used it.
Compiling my program goes fine, with no errormessages. But when I run my
EXE-file I get the errormessage:
Can't locate auto/Tk/autosplit.ix in @INC at PERL2EXE_STORAGE/AutoLoader.pm
line 127.
at PERL2EXE_STORAGE/Tk.pm line 13
Error: Parse exception
I run Win98 with the latest ActiveState Perl. If you would like to try the
Perl2exe program out, I found it on www.demobuilder.com
Apreciate anything which might help...
------------------------------
Date: Wed, 25 Aug 1999 10:04:52 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: Re: uploading files using multipart/form-data with NT
Message-Id: <37C3F804.1A9E438A@networkengines.com>
As long as your form is type="multipart/form-data"
that's all you need in the browser. and if you're managing to upload files it would seem that is set...?
------------------------------
Date: Wed, 25 Aug 1999 11:17:50 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Win32::OLE to read Word file
Message-Id: <37C4334E.34182B41@mail.cor.epa.gov>
Peter Wilkinson wrote:
>
> Oh! I think I have just re-invented the wheel, again. I needed
> to index a whole bunch of reports in Word so I figured out how
> to use the Word object model from Perl Win32::OLE so to as
> programmatically save them as .txt files to allow then to
> be indexed.
Well, try being Lazier in future. See Larry Wall's definition
of Laziness.
> I did not know there was an example.... By the way what is 'Active
> Perl'. I think I must have plain old, inactive, perl. It certainly
> does not have any menus!
ActiveState Perl is the win32 version available from
www.activestate.com . I was referring to the Start Menu of
the win32 OSes.
HAND,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 25 Aug 1999 13:24:34 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: Re: writing formatted text to console on Win32
Message-Id: <37C426D2.E70D7D25@networkengines.com>
I assume you're usaing ActiveState. It comes with WIN32::Console, whci also available on CPAN.
It has hooks into console settings and you are (in theory) supposed to be able to prevent wrapping
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 640
*************************************