[7141] in Perl-Users-Digest
Perl-Users Digest, Issue: 764 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 24 04:18:17 1997
Date: Thu, 24 Jul 97 01:01:02 -0700
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, 24 Jul 1997 Volume: 8 Number: 764
Today's topics:
Another Newbie question about s/// <kindel@sun-valley.Stanford.EDU>
Re: Arrays, FILEHANDLES, and Efficiency <sfairey@adc.metrica.co.uk>
Can't match = (Roberto L. Dorich)
Re: Can't match = (Tad McClellan)
Re: Cant seem to reset $1, $2 $3... <eike.grote@theo.phy.uni-bayreuth.de>
Re: Checking for valid Email... <rootbeer@teleport.com>
Confirmation messages & bogus email addresses. Help! (Robyn Wagner)
Re: Creating directories? <rootbeer@teleport.com>
Re: Creating directories? (Eric Bohlman)
Re: File permission in Perl (A. Deckers)
Re: Formating text: changing the \n to a <P> Steve_Kilbane@cegelecproj.co.uk
Frame Maker to html conversion <rodgeral@jmu.edu>
Re: function pointer dereferencing <merlyn@stonehenge.com>
HELP! Forking problem? <bi@inside.ch>
Re: HELP! Forking problem? <rootbeer@teleport.com>
Re: Help! How do I execute as another in perl? <rootbeer@teleport.com>
Help: Perl for Win32 source distribution compile error frank_ding@tooling1.global.ibmmail.com
Re: how to build database <kenlo@hk.super.net>
Re: HTTP SOCKET SUPPORT <merlyn@stonehenge.com>
if (defined( subroutine) )? <ceklof@vt.edu>
Re: if (defined( subroutine) )? <rootbeer@teleport.com>
ignore <dev@sgi.net>
Little problem with tr (J.Hernetkoski)
Re: Little problem with tr <rootbeer@teleport.com>
MD5 in PERL? <lmm@vasco.com>
Re: MD5 in PERL? <lmm@vasco.com>
Re: Mysterious new error? (Ilya Zakharevich)
Mysterious Sys::Hostname problem <garye@iname.com>
Re: newsgroup archives? lvirden@cas.org
Re: Null file handle: Is it the angle operator's ignora (Charles DeRykus)
Performance benefits for homogeneous structures? (dave)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 23 Jul 1997 17:52:42 -0700
From: Robert John Kindel <kindel@sun-valley.Stanford.EDU>
Subject: Another Newbie question about s///
Message-Id: <Pine.SOL.3.95.970723174725.22102A-100000@northstar.Stanford.EDU>
Howdy!
I am just starting to get a grasp on all the things that perl can do, and I
found an instance where I just can't get it to do quite what I think it
should. Basically, I want to set up an associative array where the key is a
regexp to match and the value is a regexp to change to. This has led to the
following code...
$Changes{'(\w+)->pr[[]([^\]]*)[\]]'} = '\1->El(\2)';
while(<INFILE>) {
foreach $key (keys %Changes) {
print STDOUT "$key $Changes{$key}\n";
s/$key/$Changes{$key}/g;
# s/(\w+)->pr[[]([^\]]*)[\]]/\1->El(\2)/g;
}
print OUTFILE $_;
}
Now the commented out line (which is the same as that which the print
statement says that I produce) does the right thing. however, the line
getting the line above that (which is the one that I want to use in general)
does not do the substitution for the \1 and \2.
any guesses as to what is wrong?
thanks,
Bob Kindel
------------------------------
Date: Wed, 23 Jul 1997 14:45:11 +0100
From: Simon Fairey <sfairey@adc.metrica.co.uk>
To: "J. Paul Reed" <preed@psd.k12.co.us>
Subject: Re: Arrays, FILEHANDLES, and Efficiency
Message-Id: <33D60AE5.DC89776@adc.metrica.co.uk>
J. Paul Reed wrote:
> That subject really doesn't do my question justice, but here it is
> anyway:
>
> I need to modify one line of a large file that has a format somewhat
> similar to /etc/passwd (i.e. fields separated by a separator
> character,
> one entry per line).
>
> I need to have the functionality of changing one line. Is there anyway
> to
> do this?
>
> Currently, I do this:
>
> 1. Open file, read it into an array, one entry per line.
> 2. Find what I want, modify it in the array.
> 3. Write the entire array back out to the file.
>
> But, this is memory and processor intensive and then people have to
> wait
> for this function to end before they can add entries to that file.
>
> Is there some kind of cool open() statment I can use to tell perl to
> both
> read in the file and write to it at the same time. I've looked in the
> perl
> faqs, specifically the "How do I" section and didn't find anything
> helpful.
>
> Your help would be appreciated.
>
> Thanks for your time!
>
> Later,
> Paul
> -------------------------------------------------------------------
>
> J. Paul Reed preed@psd.k12.co.us || paul@619pro.com
>
> Such a noble creature; a quality we sometimes lack...
> --Borg Queen; Star Trek: First Contact
>
> Geek Code and various other frivolities at www.psd.k12.co.us/~preed
Did you look in the FAQ for:
"How do I change one line in a file/delete a line in a file/insert"
The only thing required there is the disk space to do it.
Simon
------------------------------
Date: 22 Jul 1997 23:22:23 GMT
From: rdorich@allegro.cs.tufts.edu (Roberto L. Dorich)
Subject: Can't match =
Message-Id: <5r3fbf$mst$1@d2.tufts.edu>
Hi netters,
I'm trying to process all the lines in a file with the following format:
SOME_ID = some_num,
^--- the , is optional.
So I do:
while ($line = <file>)
{
next if ($line =~ /\w+\b*=/);
process($line);
}
Now the problem is that none of the lines get processed! If I get rid of
the '=' in the regexp then I do process the lines, but get a lot of
unwanted lines as well. Why is the '=' being so annoying?
Thanks,
Roberto
--
Roberto Dorich o SKI rdorich@jade.tufts.edu
Electrical Engineering /= EXTREME rdorich@athena.mit.edu
Tufts University __/__, uucp: roberto@kastle.ext.tufts.edu
----------------------------------------------------------------------------
------------------------------
Date: Tue, 22 Jul 1997 19:01:13 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Can't match =
Message-Id: <9kh3r5.5sa.ln@localhost>
Roberto L. Dorich (rdorich@allegro.cs.tufts.edu) wrote:
:
: I'm trying to process all the lines in a file with the following format:
:
: SOME_ID = some_num,
: ^--- the , is optional.
:
: So I do:
:
: while ($line = <file>)
: {
: next if ($line =~ /\w+\b*=/);
^^^
\b is a *zero width* assertion.
You allow zero or more of such zero width matches.
So, the underlined part above allows zero characters. Looks like you
have several space characters in your string though ;-)
I think you probably wanted \s to match white space, not \b
which only matches in between a \w and a \W (or vice versa).
:
: process($line);
: }
:
: Now the problem is that none of the lines get processed!
Because none of them matched the regex you wrote!
Darn computers. They only do what you tell them to do, not
what you want them to do ;-)
( the trick is, of course, to be sure and tell them to do the Right Thing )
: If I get rid of
: the '=' in the regexp then I do process the lines, but get a lot of
: unwanted lines as well. Why is the '=' being so annoying?
It isn't being annoying ;-)
You don't say what forms 'SOME_ID' might take. If 'SOME-ID' might
occur in your data, then matching with \w would be suboptimal. ;-)
I'd go with something like: /\S+\s*=/;
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Thu, 24 Jul 1997 08:55:57 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: Cant seem to reset $1, $2 $3...
Message-Id: <33D6FC7D.167E@theo.phy.uni-bayreuth.de>
Hi,
Kevin Swope wrote:
>
> $TheString="abc";
>
> $TheString=~ s/((a)(b)(c))/$1/x;
>
> print "\n\n$TheString\n\n";
> print "\n\n\$1=$1\n\n";
> print "\n\n\$2=$2\n\n";
> print "\n\n\$3=$3\n\n";
> print "\n\n\$4=$4\n\n";
>
> print "############################################";
>
> I want to reset here!!!!!!!!!!!!!!!
>
> $TheString="a---b---c";
>
Maybe you should better include an 'if (...) {...} '. In my opinion
it's more logical to first test if the pattern matches before
printing out anything.
if($TheString=~ s/((a)(b)(c))/$1/x)
{
...
}
else
{
print "No match ...\n";
}
> $TheString=~ s/((a)(b)(c))/$1/x;
>
> print "\n\n$TheString\n\n";
> print "\n\$1=$1\n\n";
> print "\n\$2=$2\n\n";
> print "\n\$3=$3\n\n";
> print "\n\$4=$4\n\n";
Bye, Eike
--
======================================================================
Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
----------------------------------------------------------------------
e-mail -> eike.grote@theo.phy.uni-bayreuth.de
WWW -> http://www.phy.uni-bayreuth.de/theo/tp4/members/grote.html
http://www.phy.uni-bayreuth.de/~btpa25/
======================================================================
------------------------------
Date: Wed, 23 Jul 1997 08:11:21 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: svert@upnway.com
Subject: Re: Checking for valid Email...
Message-Id: <Pine.GSO.3.96.970723080834.14902E-100000@kelly.teleport.com>
On Wed, 23 Jul 1997, Maelstrom wrote:
> My main complaint here was that I couldn't *do* the prior research due
> to bad design (IMO) of the faq
If you'd like to make suggestions to improve the FAQ, please send your
ideas to the submissions address listed in the FAQ. I know that the FAQ
maintainers want to make it the best that it can possibly be. Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 23 Jul 1997 01:22:35 -0600
From: robynn@vastnet.net(Robyn Wagner)
Subject: Confirmation messages & bogus email addresses. Help!
Message-Id: <869637799.27117@dejanews.com>
Hello,
I recently created an online Shop using Selena Sol's Web_store
Front and I have a question/problem concerning bounced email messages
using sendmail. You see, after a customer places an order at my
storefront, I've configured it so that Selena's Perl script sends a
copy of the order to the storefront owner (orders@orders.com) as well
as to the customer who actually placed the order using his/hers
submitted email address.
I was very suprised to find out that if customer submits a "bogus
email address" it does not return an error message appended to the
unsendable "Web Order Customer Copy" to the storefront adminastrator.
I assumed that all letters with incorrect/false email addresses were
returned to the sender (in this case orders@orders.com!But how come
this is not the outcome with an online form which sends a
confirmation message to the bogus email address submitted? Doesn't
sendmail always return a copy that says "undeliverable" to the FROM
address? If not, where does the message go?!?
I'm trying to figure out how I can notify the shop owner that the
customer who sent in the order did not have a real/correct email
address and therefore the order may be bogus....
Can someone *please* elaborate? :)
Thanks,
Robyn Wagner
robynn@vastnet.net
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Tue, 22 Jul 1997 16:25:42 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Mike Cloppert <mikec@dlpco.com>
Subject: Re: Creating directories?
Message-Id: <Pine.GSO.3.96.970722162407.28607C-100000@kelly.teleport.com>
On 22 Jul 1997, Mike Cloppert wrote:
> Rei Baker <rxt117@psu.edu> wrote in article <33B41ADA.48B4@psu.edu>...
> > Is there any way I can create new directories with Perl?
> You can do a
> $command="mkdir new_dir";
> system(command);
> if you're running under UNIX. Obviously, if you're under DOS,
> that command would be "md new_dir".
And, if you want something which works on either system (or on most
others) without starting up another process, the method documented in
perlfunc(1) under mkdir() would be recommended. :-) Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 23 Jul 1997 01:15:45 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Creating directories?
Message-Id: <ebohlmanEDqzI9.AAD@netcom.com>
Mike Cloppert (mikec@dlpco.com) wrote:
: Rei Baker <rxt117@psu.edu> wrote in article <33B41ADA.48B4@psu.edu>...
: > Is there any way I can create new directories with Perl?
: >
: > Rei
: >
: You can do a
: $command="mkdir new_dir";
: system(command);
: if you're running under UNIX. Obviously, if you're under DOS, that command
: would be "md new_dir".
And if you ask Mr. perlfunc for his advice, he'll tell you how to do it
without having to worry about what platform you're running under!
Anyone have any idea how much you'd have to pay to take a course that
would cover all the material that's available for *free* in the
documentation that comes with every Perl distribution? My guess is $1200
(US) or so.
------------------------------
Date: 22 Jul 1997 23:53:13 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: File permission in Perl
Message-Id: <slrn5tahv8.hcb.I-hate-cyber-promo@nessie.mcc.ac.uk>
In <33CA53F9.54A79065@clockwork.net>,
Dan Brian <dan@clockwork.net> wrote:
>Does someone know how to read a file owner in Perl? I am trying to
>compare the permissions of two files to one another. How can this be
>done? The executable is run as root.
my($mode, $uid, $gid) = (stat $file)[2,4,5];
Did you read the FAQ before posting?
HTH,
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
>>>>>>>> comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<
------------------------------
Date: Wed, 23 Jul 1997 09:07:07 GMT
From: Steve_Kilbane@cegelecproj.co.uk
To: Mark McDonald <mark@nhgir.nih.gov>
Subject: Re: Formating text: changing the \n to a <P>
Message-Id: <7177cd$977.155@news.cegelecproj.co.uk>
[ Copy mailed ]
In article <33D5307F.41C6@nhgir.nih.gov>, Mark McDonald <mark@nhgir.nih.gov> Here is a hard one that has me puzzled! I need to kake the text out of a
> textarea re-format it to put a <P> where there is a line break.
Refer to the Camel, under Special Variables. Looks to me like you
could do something like:
#!/usr/local/bin/perl -wlp
BEGIN{
$/ = ""; # Magic - treat groups of blank lines as a single delimiter
$\ = "\n<P>\n";
}
--
<Steve_Kilbane@cegelecproj.co.uk> - All opinions are mine alone.
Kilbane's law of integration: standardise on protocols and file
formats, and the applications take care of themselves.
------------------------------
Date: Wed, 23 Jul 1997 09:35:42 -0500
From: Angel Rodgers <rodgeral@jmu.edu>
Subject: Frame Maker to html conversion
Message-Id: <33D616BB.2523@jmu.edu>
Does anyone know of a script that converts Frame Maker Documents to
html? I have a program called Web Works which does this, but I am
looking for a way to convert a file as it is uploaded. Also, does
anyone know of a script which converts MS Word documents to Frame Maker?
------------------------------
Date: 22 Jul 1997 18:21:05 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: function pointer dereferencing
Message-Id: <8cu3hmo96m.fsf@gadget.cscaper.com>
>>>>> "Tom" == Tom Phoenix <rootbeer@teleport.com> writes:
Tom> There's a moral to this story: Never underestimate the effect Randal's
Tom> jokes can have. :-)
Hmm... maybe they just didn't get it when I had:
"Intel... putting the 'backward' in 'backward compatible.'"
in my .sig while posting from iWarp.intel.com?
:-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 405 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Wed, 23 Jul 1997 18:19:29 +0200
From: "Balthasar T. Indermuehle" <bi@inside.ch>
Subject: HELP! Forking problem?
Message-Id: <33D62F11.1FBA0CE5@inside.ch>
Hi all,
I have two perl scripts. a.cgi and b.
a.cgi is being called from the httpd (running as user wwwrun, nogroup),
and b is being called from a.cgi. b is supposed to return a long list of
data. Now, if I su to wwwrun and run a.cgi, it returns all data obtained
by calling b. If I do the same via httpd, b does not return anything.
b is being called like this:
open B, "b param1 |" || print "unable to fork";
while (<B>) {
$buf .= $_;
}
Please also respond via e-mail!
Thanks!
-Balt
--
--
+------------------------------------------------------------------+
| Balthasar T. Indermuehle, CEO INside Systems (Switzerland) GmbH |
| Gesellschaftsstrasse 73 |
| CH-3012 Bern |
| Switzerland |
| Phone: +41 (0)31 305 04 04 Fax: +41 (0)31 305 04 05 |
| Email: bi@inside.ch http://www.inside.ch |
+------------------------------------------------------------------+
------------------------------
Date: Wed, 23 Jul 1997 10:29:02 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "Balthasar T. Indermuehle" <bi@inside.ch>
Subject: Re: HELP! Forking problem?
Message-Id: <Pine.GSO.3.96.970723102219.23677D-100000@kelly.teleport.com>
On Wed, 23 Jul 1997, Balthasar T. Indermuehle wrote:
> b is being called like this:
>
> open B, "b param1 |" || print "unable to fork";
You don't want that. That's the same as this.
open B, ("b param1 |" || (print "unable to fork") );
...which, of course, is just this.
open B, "b param1 |";
You probably want something like one of these.
open B, "b param1 |"
or die "unable to fork: $!";
unless (open B, "b param1 |") {
print "unable to fork: $!";
exit;
}
But that may not be the problem. Could it be that the b can't be found
along the current PATH? I'd try using a full path to b and see whether
that makes a difference. Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 23 Jul 1997 08:46:24 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: James S White <whitej4@vetmed.auburn.edu>
Subject: Re: Help! How do I execute as another in perl?
Message-Id: <Pine.GSO.3.96.970723084515.14902N-100000@kelly.teleport.com>
On 23 Jul 1997, James S White wrote:
> I need to know how to make perl execute a script (as in a system call)
> as someone other than the one running the perl program. I'm pretty sure
> it can be done, I just dont know how.
Use a script which is setuid to root, or to the target uid. See perlsec(1)
for some security concerns with doing this, though. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 23 Jul 1997 10:12:57 -0600
From: frank_ding@tooling1.global.ibmmail.com
To: frank_ding@tooling1.global.ibmmail.com
Subject: Help: Perl for Win32 source distribution compile error
Message-Id: <869667928.11991@dejanews.com>
Hi there,
Has anyone successfully built perl for win32 from source distribution
Pw32s306.zip, and can you share your experience?
I got 5 errors from compiling ntole.cpp. I am running on Win95 using
vc++ 4.0.
TIA
Frank.
please reply to frank_ding@tooling1.global.ibmmail.com
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 23 Jul 1997 09:40:13 +0800
From: Kenneth LO <kenlo@hk.super.net>
To: Sanjeel Sheikh <ssheikh@netcomuk.co.uk>
Subject: Re: how to build database
Message-Id: <33D560FC.A93F6F16@hk.super.net>
Sanjeel Sheikh wrote:
> i am trying to build an online catalogue and i have been working with
> perl and cgi. i just wanted to know what database should i use and
> what
> lib file should i use. i know how to develop gateway between files.
> please mail reply
> thanx in advance
I suppose you're using unix. As a start you can try mSQL2 from
http://hughes.com.au/software/msql2/current.htm . The perl interface is
msqlperl that can be found in all CPAN sites. mSQL is simple to install
and use. There are a few good example perl scripts in the 'test'
directory. Another good database engine is mySQL from
http://www.tcx.se/ . The perl interface is mysqlperl. I found mySQL a
bit difficult to install but it is an extremely fast and good package.
------------------------------
Date: 22 Jul 1997 18:24:40 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Chris Hostetter <me@anon.com>
Subject: Re: HTTP SOCKET SUPPORT
Message-Id: <8cracqo90n.fsf@gadget.cscaper.com>
>>>>> "Chris" == Chris Hostetter <me@anon.com> writes:
Chris> PS: merlyn (and other newsgroup afficieanados)...
Chris> while i agree with the whole "don't reinvent the square" philosophy, i
Chris> think a lot of people are getting a little too zeleaous with the
Chris> expression "go use a module"...
[...]
Chris> besides: If every answer to every new users question is:
Chris> "go use the existing modules."
Chris> then who is going to write new modules?
Uh, the non-new-users. :-)
I'm really tired of seeing Yet Another (often Wrong) Implementation of
things like the URL-escaping and CGI-content parsing though.
Especially when it is trivial to get and install the module (thanks to
CPAN.pm).
Beginners should use libraries. Experts should write libraries. They
really both have their place.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 405 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Tue, 22 Jul 1997 15:20:48 -0700
From: Carl Eklof <ceklof@vt.edu>
Subject: if (defined( subroutine) )?
Message-Id: <33D53240.7A7B@vt.edu>
Does anyone know of a way of detecting if a subroutine is defined?
Thanks in advance,
-Carl
------------------------------
Date: Tue, 22 Jul 1997 16:46:42 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Carl Eklof <ceklof@vt.edu>
Subject: Re: if (defined( subroutine) )?
Message-Id: <Pine.GSO.3.96.970722164526.28607I-100000@kelly.teleport.com>
On Tue, 22 Jul 1997, Carl Eklof wrote:
> Subject: if (defined( subroutine) )?
>
> Does anyone know of a way of detecting if a subroutine is defined?
print "It's defined!\n" if defined(&subroutine);
You were so close! :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 23 Jul 1997 11:11:44 -0400
From: Devin Anderson <dev@sgi.net>
Subject: ignore
Message-Id: <33D61F30.2D15@sgi.net>
Ignore that last message about encryption...I messed up my code. :)
---
Devin P. Anderson
Webmaster, Systems Administrator
Stargate Industries, Inc.
http://www.sgi.net/
Phone: 412.930.STAR (7827) ext. 241
F a x: 412.930.7110
This should clear up any confusion:
anti-match - v. To reverse the match process. Show all patterns that
*DON'T* match.
-----PGP PUBLIC KEY AVAILABLE-----
------------------------------
Date: 23 Jul 1997 05:12:33 GMT
From: jjjj@zenith.yok.utu.fi (J.Hernetkoski)
Subject: Little problem with tr
Message-Id: <5r43s1$co7$1@news.utu.fi>
Situation:
I have to multiple two digits, followed by p, by eight.
Is it easiest to do with tr-operator (..of course, I don't have to multiple
that p ;) ?
There are also other digits, but none of them are followed by p, that makes it
easy (..?), see below:
2.5 12p
3.5 33p
4.5 09p
5.5 44p
6.5 43p
7.5 22p
8.5 43p
etc. etc.
Help would be appreciated...
--
Jukka
------------------------------
Date: Tue, 22 Jul 1997 23:48:16 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "J.Hernetkoski" <jjjj@zenith.yok.utu.fi>
Subject: Re: Little problem with tr
Message-Id: <Pine.GSO.3.96.970722234358.23134Q-100000@kelly.teleport.com>
On 23 Jul 1997, J.Hernetkoski wrote:
> I have to multiple two digits, followed by p, by eight.
I don't know what you mean by that. Do you mean that you need to multiply
those digits together? Or do you need to multiply those two digits by
eight?
> Is it easiest to do with tr-operator (..of course, I don't have to
> multiple that p ;) ?
The tr/// operator isn't used for multiplying, so at least one of us is on
the wrong track. :-)
> There are also other digits, but none of them are followed by p, that
> makes it easy (..?), see below:
>
> 2.5 12p
> 3.5 33p
> 4.5 09p
> 5.5 44p
> 6.5 43p
> 7.5 22p
> 8.5 43p
> etc. etc.
I can't see what's going on here. If the columns represent 'before' and
'after', I can't see what the transformation rule is. Maybe that's
because it's almost midnight here. :-) But I don't think it would be
obvious in the daytime either.
If you can tell a little more about what you need, that would help.
Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 22 Jul 1997 22:24:09 GMT
From: "lmm" <lmm@vasco.com>
Subject: MD5 in PERL?
Message-Id: <01bc96ed$f4153f60$b454f026@uslbpc80>
Has anyone come across MD5 implementes in PERL?
I know that there are modules you can compile for PERL written in C, but,
from my understanding, it is not transportable to different platforms
except by compiling.
With a PERL version of MD5, one could then use it on any platform that has
PERL.
Thank you in advance.
Leon.
------------------------------
Date: 23 Jul 1997 14:10:39 GMT
From: "lmm" <lmm@vasco.com>
Subject: Re: MD5 in PERL?
Message-Id: <01bc9772$2c405210$b454f026@uslbpc80>
Tom,
I thank you sincerely for your prompt response. Your information is
enlightening, but I still must continue my search for an implementation of
MD5 in PERL, so if anyone out there knows of somewhere I can obtain it, I
would be thankful
Leon.
Tom Phoenix <rootbeer@teleport.com> wrote in article
<Pine.GSO.3.96.970722164111.28607H-100000@kelly.teleport.com>...
> On 22 Jul 1997, lmm wrote:
>
> > Has anyone come across MD5 implementes in PERL?
> >
> > I know that there are modules you can compile for PERL written in C,
> > but, from my understanding, it is not transportable to different
> > platforms except by compiling.
>
> That's right. And you can't transport Perl itself to different platforms
> except by compiling, so that's not usually too onerous. :-)
>
> > With a PERL version of MD5, one could then use it on any platform that
> > has PERL.
>
> Yes, and terribly slowly. :-) That's why linkable modules were
developed,
> so that you could Perl for its strengths and not use it for its
> weaknesses.
>
> If you can't compile the existing module, it would be better to use one
of
> the standalone MD5 applications, and run that from Perl. Of course, you
> may need to compile one of those...
>
> Good luck!
>
> --
> Tom Phoenix http://www.teleport.com/~rootbeer/
> rootbeer@teleport.com PGP Skribu al mi per Esperanto!
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
>
------------------------------
Date: 23 Jul 1997 00:53:13 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Mysterious new error?
Message-Id: <5r3klp$bcp@agate.berkeley.edu>
X-Newsreader: TRN for OS/2
Cc:
In article <m7goh7urdzg.fsf@ux4.cso.uiuc.edu>,
gregory douglas fast <g-fast@ux4.cso.uiuc.edu> wrote:
> I'm much less confused now. I neglected to mention the helpful fact
> that I don't have any DESTROYs in the code, hence my inability to
> understand where the error was coming from (I was also unaware of that
> capability of the debugger, that's realy neat :).
>
> Now I've traced the problem to my AUTOLOAD routine, where I was doing
> Bad Things with my $self, and made the error go away, but I'm now curious
> as to the why of perl calling my AUTOLOAD routine for DESTROY. It
> doesn't get called for BEGIN or END... am I just not understanding
> something gutsy?
Oh, your code is _so_ broken! You answered your question yourself:
you do not have DESTROY, so the AUTOLOAD is called when a call to
DESTROY is performed.
Hope this helps,
Ilya
------------------------------
Date: Wed, 23 Jul 1997 20:25:25 -0400
From: Gary Ebert <garye@iname.com>
Subject: Mysterious Sys::Hostname problem
Message-Id: <33D6A0F5.522@iname.com>
Hello all:
I am using perl 5.002 precompiled binaries from the HP pubilc domain web
site for HP-UX 9.03
I am a fairly experienced perl programmer but I can not figure this one
out.
I have written the following script to illustrate my problem:
#!/usr/local/bin/perl
# file is named testhostname
use diagnostics;
use strict;
use Sys::Hostname;
print hostname(), "\n";
Here is the output I get:
stimpy:/usr/home/gary testhostname
Can't locate syscall.ph in @INC (did you run h2ph?) at
/opt/perl5/lib/Sys/Hostname.pm line 68 (#1)
stimpy
Does anybody know why I get this error??
I did notice that if I comment out the
use diagnostics;
line the error goes away.
I have used Sys:Hostname many times before today along with `use
strict;` and `use diagnostics;` and this is the first time I have seen
this error.
Thanks
Gary
--
Gary Ebert Operations Administrator
Voice: (301) 428-2115 Mobile Datacom Corporation
Fax: (301) 428-1004 19540 Amaranth Drive
Pager: (800) 490-7478 Germantown, MD 20875-2126
------------------------------
Date: 23 Jul 1997 15:41:24 GMT
From: lvirden@cas.org
Subject: Re: newsgroup archives?
Message-Id: <5r58n4$smi$1@cas.org>
Re: archives of comp.lang.perl.misc
I don't know of ftp'able archives, but you should be able to go to
<URL: http://www.dejanews.com/ > or <URL: http://www.reference.com/ > and
search thru the archives.
--
Larry W. Virden INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.
------------------------------
Date: Tue, 22 Jul 1997 17:29:00 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Null file handle: Is it the angle operator's ignorance or mine?
Message-Id: <EDqDwC.A7p@bcstec.ca.boeing.com>
In article <xz267uaumth.fsf@uebemc.siemens.de>,
Ronald Fischer <rovf@earthling.net> wrote:
> I use the following program 'cols' to compute the size of the longest
> line in a set of files:
> #!/bin/perl
> # cols [FILE...]
> $maxlen = 0;
> while (<>) {
> (length > $maxlen) && ($maxlen = length);
> }
> print "$maxlen\n"
> # end of cols
>
> This works fine as long as I do not supply a filename starting with a
> '+'. But when I write (for example)
> cols +foo
> I get the output
> Can't open +foo: No such file or directory
> although
> cols ./+foo
Er..., if there's no "." in your PATH, you'll get precisely
this type of error.
But, there's been some very interesting discussion about
this topic nevertheless :)
HTH,
--
Charles DeRykus
ced@carios2.ca.cut_it_out.boeing.com # cut out you know what
------------------------------
Date: Tue, 22 Jul 1997 22:27:58 GMT
From: over@the.net (dave)
Subject: Performance benefits for homogeneous structures?
Message-Id: <33d532d2.804651@news.one.net>
Hi,
With perl I can create a hash of hashes. Is there performance
benefits gained by making each hash within the hash have the same keys
(different values for each key)? How much?
Thanks,
Dave
|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, use:
| dlripber@one.net
|________
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". 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 764
*************************************