[16010] in Perl-Users-Digest
Perl-Users Digest, Issue: 3422 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 19 14:11:30 2000
Date: Mon, 19 Jun 2000 11:10:18 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961438218-v9-i3422@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 19 Jun 2000 Volume: 9 Number: 3422
Today's topics:
Perl Builder 2.0 for LINUX - Beta Available <marty@solutionsoft.com>
Re: perl vs python (Reini Urban)
Re: perl vs python <care227@attglobal.net>
Re: perlservices.com <care227@attglobal.net>
Re: question about flock. <rootbeer@redcat.com>
Re: reg expression question <care227@attglobal.net>
Re: Reintegrating win into CPAN (Was Re: What is the CP <randy@theoryx5.uwinnipeg.ca>
Re: Reintegrating win into CPAN (Was Re: What is the CP (Reini Urban)
Re: Returning a hash from XS <dan@tuatha.sidhe.org>
Re: Returning a hash from XS <cching@mqsoftware.com>
Re: Returning a hash from XS <dan@tuatha.sidhe.org>
Re: run script when i run other program? <rootbeer@redcat.com>
Re: run script when i run other program? nobull@mail.com
Re: starting default cgi file on server <rootbeer@redcat.com>
Re: system() in WinNT4-service <rootbeer@redcat.com>
URL Redirection <drak@tm.net.my>
Re: Use of split and join with special character (David Wall)
Re: What the... <altavistaNOalSPAM@agentkhaki.com.invalid>
Re: What the... <altavistaNOalSPAM@agentkhaki.com.invalid>
Re: What's the difference between a hash and an array? (David Bell)
Re: What's the difference between a hash and an array? <care227@attglobal.net>
Re: What's the difference between a hash and an array? <aqumsieh@hyperchip.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 19 Jun 2000 10:55:30 -0700
From: Marty Ford <marty@solutionsoft.com>
Subject: Perl Builder 2.0 for LINUX - Beta Available
Message-Id: <394E5E92.3C3D@solutionsoft.com>
We would like to invite everyone here try a pre-release copy of Perl
Builder 2.0 for Linux.
Perl Builder offers a complete IDE for Perl, including a powerful
programmer's editor integrated with a visual debugger, as well as a
number of other tools.
The software can be downloaded now at:
http://www.solutionsoft.com/pb2_linux.htm
Please send any Feedback and bug reports to perl@solutionsoft.com.
Perl Builder 2.0 is a major upgrade with a completely re-implemented
editor and debugger. Version 2.0 overcomes most of the limitations of
version 1.0 (which was available only on Windows) and adds dozens of new
features and refinements.
New Features in Perl Bulder 2.0 - Linux
Completely redesigned editing environment with a powerful and robust
programmer's editor:
* Unlimited Undo/Redo Levels.
* Improved performance/speed.
* Improved syntax highlighting allows use of bold and italic text as
well as colors.
* Find All and Highlight Feature.
* Control over background colors.
* Individual control over editor function keyboard assignments.
* Glitches in display, scrolling, etc. which some V 1.0 users
experienced have been eliminated.
* Copy highlighted text as formatted HTML or RTF and paste into other
applications in color.
* Code templates let you save snippets of frequently used code and
insert with a hotkey or menu selection.
* AutoReplace/AutoCorrect lets you specifiy strings so that the editor
automatically corrects errors or replaces abbreviations with the
full text. For example, you can set up one or two character
abbreviations for common Perl constructs and have the editor expand
them automatically.
* Mouse-over bracket matching. Just hold the mouse over a bracket {} to
highlight its partner.
Improved Navigation and Online Help
* Subroutine navigator lets you easily jump to any subroutine in the
current module.
* Improved bookmark system.
* Context sensitive help on core Perl functons--just click on a function
name in your code and press F1 to get help.
New Debugging Engine:
* Faster and higher fidelity.
* Includes all standard debugging features, including tooltip variable
inspection, watches, evaluate/modify, step, breakpoints, etc.
* Open multiple scripts in the IDE and select the active script for
debugging. (The standard version allows only one main script to be
open at a time. However, both versions support opening
modules/librarires).
* Enhanced support for debugging "daisy chained" scripts--where output
from a script calls the same or another script.
* New Dump feature lets you view complex/nested data.
* Pause/Reset buttons let you stop run-away scripts/infinite loops.
* Specify execution directory for scripts.
* Customizable HTML color syntax highlighting in the Output window.
Improved CGI Wizard
* Enhanced validation options.
* Support for saving data in a text file on the server.
------------------------------
Date: Mon, 19 Jun 2000 15:33:18 GMT
From: rurban@sbox.tu-graz.ac.at (Reini Urban)
Subject: Re: perl vs python
Message-Id: <394e3d1c.464467168@news>
Drew Simonis wrote:
>Python has a try: operator. I don't want my language to try:,
>I want it to do()
perl's try is eval {} not do().
--
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html
------------------------------
Date: Mon, 19 Jun 2000 12:00:58 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: perl vs python
Message-Id: <394E43BA.41DD9007@attglobal.net>
Reini Urban wrote:
>
> Drew Simonis wrote:
> >Python has a try: operator. I don't want my language to try:,
> >I want it to do()
>
> perl's try is eval {} not do().
I was making a play on words. Hence the smiley. I guess I should
have taken it all the way and made the requisite Yoda reference.
------------------------------
Date: Mon, 19 Jun 2000 12:21:26 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: perlservices.com
Message-Id: <394E4886.FF2279B1@attglobal.net>
Please don't SPAM me wrote:
>
Take your own advice and don't spam us.
------------------------------
Date: Mon, 19 Jun 2000 10:19:35 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: question about flock.
Message-Id: <Pine.GSO.4.10.10006191018400.29843-100000@user2.teleport.com>
On 19 Jun 2000 nobull@mail.com wrote:
> Perl's flock() is just an interface to Unix's flock().
Well... or lockf(), or fcntl(), or an error message. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 19 Jun 2000 11:39:13 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: reg expression question
Message-Id: <394E3EA1.1259FD9F@attglobal.net>
Jang Choe wrote:
>
> How do I determine that a string can be composed of any character on
> the key board, such as !,@,#,$,%,etc., Thanks
Organization: Georgia Institute of Technology
As a former student of this fine University, I am thunderstruck by
the lack of even an attempt to solve this porblem on your own.
§ ~ ? ä ² F µ ± <-- Look what I found on my keyboard!
Point here is, show what you want to accomplish, and how
you have tried to accomplish it, and people will help.
Your question is far too vague. ¦ <- found that too.
------------------------------
Date: 19 Jun 2000 15:20:18 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Reintegrating win into CPAN (Was Re: What is the CPAN module repository (url) name that can beused for PPM/VPM?)
Message-Id: <8ildni$1j5$1@canopus.cc.umanitoba.ca>
In comp.lang.perl.misc, Abe Timmerman <abe@ztreet.demon.nl> wrote:
> I think it would be nice if CPAN had a zip-repository, at least for the
> _pure perl_ modules, but that would require the module author to have a
> Win32 box with ActivePerl.
Jochen Wiedmann, in his Msql-Mysql-modules distribution, has
a very nice recipe in the README file for making up a ppd
distribution. It is true that you need tar, gzip, and nmake
for making up a "standard" ActiveState-compatible distribution,
but these tools are readily, and freely, available. For XS-based
modules, again to be compatible with ActiveState's Perl, you'd
also need VC++, and a Perl compiled with the same compile-time
flags ActiveState uses. CPAN does have a few ppd distributions -
search http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search by CPAN
file name for 'ppd'. These can be installed through
ppm install http://www.perl.com/CPAN-local/path/to/package.ppd.
best regards,
randy kobes
------------------------------
Date: Mon, 19 Jun 2000 15:41:46 GMT
From: rurban@sbox.tu-graz.ac.at (Reini Urban)
Subject: Re: Reintegrating win into CPAN (Was Re: What is the CPAN module repository (url) name that can beused for PPM/VPM?)
Message-Id: <394e3da0.464599989@news>
Elaine Ashton wrote:
>in article 394c60ac.3385464@news.ncf.carleton.ca, Steve A. Taylor at
>an400@freenet.carleton.ca quoth:
>> On 22 May 2000 19:04:17 -0500, Jeph <jeph@ucool.com> wrote:
>>>> http://www.bi.umist.ac.uk/packages. Simon's repository is listed on
>>>> www.perl.com, but not on CPAN, AFAIK. And if one uses cpan.search.org,
>>>> the .ppd files are, of course, not listed. So should CPAN itself
>>>> consider including .ppd files, allowing authors to upload them along
>>>> with the .gz files? Or even more radical -- should makeMaker or h2xs
>I don't know of any restrictions keeping authors from uploading packages
>to CPAN with the source, ...
aeh? you upload only sources. would should people do with binaries?
there's a huge number of perl binary combinations/platforms (even on
win32 only), so do you expect all these to be supported by the compiled
xs/ppd versions?
die all binary only modules up there.
--
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html
------------------------------
Date: Mon, 19 Jun 2000 15:47:00 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Returning a hash from XS
Message-Id: <Ufr35.3720$Zg4.17628@news1.rdc1.ct.home.com>
Craig L. Ching <cching@mqsoftware.com> wrote:
> Hi,
> I found the following XS code on the archives for this newsgroup:
> SV *
> test_hash()
> CODE:
> HV *msg_hash;
> msg_hash = newHV();
> hv_store(msg_hash, "code", 4, newSViv(42), 0);
> RETVAL = sv_2mortal(newRV_noinc((SV *)msg_hash));
> OUTPUT:
> RETVAL
> My question is, what does the Perl code that uses this look like?
Should look something like:
$ref = test_hash();
foreach (sort keys %$ref) {
print $_, ":\t", $ref->{$_}, "\n";
}
depending on what you want to do.
> The
> return is a reference, but I can't seem to make this work. Is there a
> better way to return a hash?
Returning a ref is the only way to return a hash. You can always return a
list of key/value pairs, but that's less efficient.
Dan
------------------------------
Date: Mon, 19 Jun 2000 11:15:36 -0500
From: "Craig L. Ching" <cching@mqsoftware.com>
Subject: Re: Returning a hash from XS
Message-Id: <8ilhhv$ah5$1@paxfeed.eni.net>
Excellent! Thanks for the answer to my question!
> Returning a ref is the only way to return a hash. You can always return a
> list of key/value pairs, but that's less efficient.
>
> Dan
Now, I really would like my data to be returned in a normal hash. Would it
be ok for my XS code to return a list of key/value pairs (as you suggest)
and then have a perl sub-routine that builds them into a hash that could
then be returned? I guess I'm trying to decide what the users of my module
will expect. I don't want it to be too complex for them to use, but I'm not
sure how usual it is for people to be using references to hashes. Thanks
for the help!
Cheers,
Craig
------------------------------
Date: Mon, 19 Jun 2000 17:26:23 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Returning a hash from XS
Message-Id: <3Js35.4050$Zg4.17910@news1.rdc1.ct.home.com>
Craig L. Ching <cching@mqsoftware.com> wrote:
> Excellent! Thanks for the answer to my question!
>> Returning a ref is the only way to return a hash. You can always return a
>> list of key/value pairs, but that's less efficient.
> Now, I really would like my data to be returned in a normal hash.
You can't--there's no way in perl to return a hash. You either return a
list of key/value pairs:
%hash = some_func();
or a ref to a hash:
$hashref = some_other_func();
There's no way to return a hash per se. (Remember, return returns either a
single scalar or a list of scalars, with hashes and arrays getting
flattened) If you want the first style, just return a list of key/value
pairs. If you've got a lot of pairs it's not paticularly efficient, though
if you've only got a few it's fine.
If you're feeling clever you can check the context your function was
called in and return either a list of scalars or a hash ref, though that
can be a bit confusing.
Dan
------------------------------
Date: Mon, 19 Jun 2000 10:17:27 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: run script when i run other program?
Message-Id: <Pine.GSO.4.10.10006191015520.29843-100000@user2.teleport.com>
On Sun, 18 Jun 2000, ian_campbell wrote:
> Newsgroups: comp.lang.perl.misc
> Subject: run script when i run other program?
Looks as if you posted this twice. Try not to do that.
> I'd like to run this script that uploads a text file to my homepage
> automatically every day. is there a way for it to run when i am
> online, or perhaps when i start netscape?
There might be. But wouldn't your question be the same if your program
were written in some other language than Perl? Maybe you want to search
for the docs, FAQs, and newsgroups about how to automatically make
programs run on your system. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 19 Jun 2000 18:07:02 +0100
From: nobull@mail.com
Subject: Re: run script when i run other program?
Message-Id: <u9wvjlfvm1.fsf@wcl-l.bham.ac.uk>
ian_campbell <ianc@islandnet.com> writes:
> I'd like to run this script that uploads a text file to my homepage
> automatically every day. is there a way for it to
> run when i am online, or perhaps when i start netscape? (using: win98 /
> dialup)
And your Perl question is...?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 19 Jun 2000 10:33:23 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: starting default cgi file on server
Message-Id: <Pine.GSO.4.10.10006191031250.29843-100000@user2.teleport.com>
On Mon, 19 Jun 2000, Daniel van den Oord wrote:
> I've got IIS4 with a directorie with standard opening file being server.cgi
> meaning I don't have to put that name in the bar what happens is that it
> does start
> the file but doesn't read the ?...... string anybody knows how to resolve
> this thing ???
I can't understand that sentence, but it sounds like it has to do with a
webserver. Perhaps you want to search for the docs, FAQs, and newsgroups
about webservers in general and yours in particular. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 19 Jun 2000 10:22:39 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: system() in WinNT4-service
Message-Id: <Pine.GSO.4.10.10006191021290.29843-100000@user2.teleport.com>
On Mon, 19 Jun 2000, Wolfgang Hielscher wrote:
> So, does anyone know under which circumstances the system()-function
> fails?
Sure; you can get the most accurate details by reading the source. Note
that it differs somewhat depending upon your OS. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 20 Jun 2000 01:19:27 +0800
From: "D-Rak" <drak@tm.net.my>
Subject: URL Redirection
Message-Id: <394e5547.0@news.tm.net.my>
Dear All,
I need help to script for url redirection. I need to know how to make this
type of redirection using perl or cgi.. http ://www.mycompany.com/?123456
If anyone of you happens to know the method,please let me know asap.
Thanks.
------------------------------
Date: 19 Jun 2000 11:34:57 -0400
From: darkon@one.net (David Wall)
Subject: Re: Use of split and join with special character
Message-Id: <8F5872679darkononenet@206.112.192.118>
pagirre@ada.ucin.com (Pablo Agirre) wrote in
<8il06q$ccq$1@reader1.fr.uu.net>:
> How could I use an special character in a split call ?
>
> I don't want to use "\\ |", because I need to use it also in a join
>expression.
>
> my $delim = '|';
>
> split (/$delim/, $line);
split /\Q$delim/, $line;
or
split quotemeta($delim), $line;
--
David Wall
darkon@one.net
------------------------------
Date: Mon, 19 Jun 2000 09:33:33 -0700
From: Agentkhaki <altavistaNOalSPAM@agentkhaki.com.invalid>
Subject: Re: What the...
Message-Id: <1d0398b0.6fca29ee@usw-ex0108-061.remarq.com>
I'm sorry, I feel like a complete moron / waste of
perfectly good space. I fixed those bloody links (not sure
where I put the files last time ::grin::
Here's the error I get when I submit the form (as so kindly
stated above in the first reply):
Script execution error
Unable to execute script due to a configuration problem.
Please notify the webmaster of this error.
exec() returned: 2: No such file or directory
Also, I have no idea why you would want to view the HTML
source. I'm open to everything, since, in short, I'm not
really sure what I'm doing right now. It's like playing a
video game for the first time and somehow getting farther
than you will get again for at least an hour... Beginners
luck sort of. But then you get stuck and you really have no
idea where you stand.
Anyway, please help if you can. Thanks.
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
------------------------------
Date: Mon, 19 Jun 2000 09:35:15 -0700
From: Agentkhaki <altavistaNOalSPAM@agentkhaki.com.invalid>
Subject: Re: What the...
Message-Id: <1a5a307d.703cbf4a@usw-ex0108-061.remarq.com>
One more thing. I made some modifications (so that the
script didn't require anything incoming from the browser to
run) and ran it on my system and it worked fine. So the
error lies somewhere in the transfer of data between
browser and script (?) but I'm too dumb to figure out
why...
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
------------------------------
Date: 19 Jun 2000 15:44:45 GMT
From: db7654321@aol.comspamsux (David Bell)
Subject: Re: What's the difference between a hash and an array?
Message-Id: <20000619114445.15845.00008491@ng-md1.aol.com>
>Data corruption. Loss of information.
Ok, I bet you couldn't see this one coming: How would I set up a lock file?
Thanks!
-------------------------
David Bell - Otherwise known as DB7654321
Remember to remove nospam, notrash or anything odd looking from my email
address. :)
------------------------------
Date: Mon, 19 Jun 2000 11:59:48 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: What's the difference between a hash and an array?
Message-Id: <394E4374.F292BAAA@attglobal.net>
David Bell wrote:
>
> >Data corruption. Loss of information.
>
> Ok, I bet you couldn't see this one coming: How would I set up a lock file?
> Thanks!
>
Check the perl docs for the flock() function.
$ perldoc -f flock
Or via the web at:
http://www.perl.com/pub/doc/manual/html/pod/perlfunc/flock.html
------------------------------
Date: Mon, 19 Jun 2000 16:07:40 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: What's the difference between a hash and an array?
Message-Id: <7abt0xy7qu.fsf@merlin.hyperchip.com>
db7654321@aol.comspamsux (David Bell) writes:
> >Data corruption. Loss of information.
>
> Ok, I bet you couldn't see this one coming: How would I set up a lock
> file?
Let me give you a tip, before you get killfiled.
People around here expect you to do some effort to try to find your own
solutions, before posting to this newsgroup. Posting should be your
absolute last resort, not your first.
Perl comes with a plethora of documentation (which admittedly can be
overwhelming for newbies). Familiarize yourself with perldoc: type
'perldoc perldoc' on your command line. You won't regret it.
As for your question, it's in the FAQs. Type:
perldoc -q lock
and read on.
--Ala
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 3422
**************************************