[13188] in Perl-Users-Digest
Perl-Users Digest, Issue: 598 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 20 05:07:10 1999
Date: Fri, 20 Aug 1999 02:05:10 -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 Fri, 20 Aug 1999 Volume: 9 Number: 598
Today's topics:
$8.99 NT/UNIX HOST, 100 megs, UNLIM HITS! CHEAP! Just f designdood@my-deja.com
Re: adding 30 days (elephant)
Re: Attn: CRAP (was Re: voting system pealse advise) (Larry Rosler)
Re: Attn: CRAP (was Re: voting system pealse advise) (Sam Holden)
Re: Behold-Software? <jpeterson@office.colt.net>
Re: DBD with several databases - is it possible? (brian d foy)
execute a perl-script out of js <koenig@privat.toplink.de>
Re: How to use perlcc? Need your help fellas~! vishalb@my-deja.com
Re: Newbie : tr/// question (elephant)
Re: newbie CGI question re CGI.pm (Larry Rosler)
Re: Newbie: How to direct STDOUT & STDERR to file AND t <lars@thegler.dk>
Parse conf file <horaceho@geocities.com>
Re: Parse conf file (elephant)
Re: Parse conf file (Sam Holden)
PERL EDITOR <webmaster@compre-ya.com>
Re: PERL EDITOR <computer_guy@hotmail.com>
Re: Perl Exam Beta Testers Required (Michel Dalle)
Re: Question about date (I.J. Garlick)
Re: Question about date (I.J. Garlick)
Re: Referring to "my" variables (Larry Rosler)
Re: regular expressions in Perl and Oracle/SQL <Philippe.Emeriau@infineon.com>
Re: Request for Comments: www.perl.com <jpeterson@office.colt.net>
Re: returning a ref to a hash from a different module.. <hookman@cwnet.com>
Re: returning a ref to a hash from a different module.. (Larry Rosler)
Re: what does eq do on lists? <nospam.newton@gmx.net>
What vendors include Perl with their boxes? <tchrist@mox.perl.com>
Re: Why $|++ (was: Re: perl system()) (elephant)
Re: Win32::OLE + Word/Excel (Michel Dalle)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 20 Aug 1999 07:17:06 GMT
From: designdood@my-deja.com
Subject: $8.99 NT/UNIX HOST, 100 megs, UNLIM HITS! CHEAP! Just found it!
Message-Id: <7pivdc$84b$1@nnrp1.deja.com>
Hey, just looked for a new host and founda new one, there sweet, offers
everything I want for real cheap, and has good suppor too!
Check them out, I highly recomend them.
http://www.telaweb.com
HOPE YOU LIKE THEM, IDO!
fronpage 2k also, and FULL ASP and database!
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 20 Aug 1999 17:31:40 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: adding 30 days
Message-Id: <MPG.1227af66ba6fa8ad989c69@news-server>
Abigail writes ..
> sleep $number_of_days *
> $hours_in_a_day *
> $minutes_in_an_hour *
> $seconds_in_a_minute;
*8^) .. another brilliant classic (we really should be archiving these)
- you should teach kids - I think you've got a lot to give to
impressionable minds
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Fri, 20 Aug 1999 00:49:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Attn: CRAP (was Re: voting system pealse advise)
Message-Id: <MPG.1226a861bd749e95989e7b@nntp.hpl.hp.com>
In article <x7pv0jv3e5.fsf@home.sysarch.com> on 19 Aug 1999 17:58:42 -
0400, Uri Guttman <uri@sysarch.com> says...
> >>>>> "c" == collinf <collinf@moscow.com> writes:
...
> c> Could you explain what a 'dispatch hash' is?
>
> %form_action = (
> 'add_topic' => \&add_topic,
> 'showvote' => \&showvote,
> 'others' => \&others,
> 'vote' => \&vote,
> 'results' => \&results,
> 'delete' => \&delete,
> ) ;
>
> $form_action{$FORM{'action'}}->() ;
Don't need any variables, and don't need any single-quotes. Score a
birdie for me! :-)
({
add_topic => \&add_topic,
showvote => \&showvote,
others => \&others,
vote => \&vote,
results => \&results,
delete => \&delete,
}->{$FORM{action})->();
Actually, fewer characters like this (which scores an eagle):
&{{
...
...
}->{$FORM{action}};
But the ->() form is more elegant, or at least more modern.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 20 Aug 1999 08:08:55 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Attn: CRAP (was Re: voting system pealse advise)
Message-Id: <slrn7rq39p.qhr.sholden@pgrad.cs.usyd.edu.au>
On Fri, 20 Aug 1999 00:49:36 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
>In article <x7pv0jv3e5.fsf@home.sysarch.com> on 19 Aug 1999 17:58:42 -
>0400, Uri Guttman <uri@sysarch.com> says...
>> >>>>> "c" == collinf <collinf@moscow.com> writes:
>...
>> c> Could you explain what a 'dispatch hash' is?
<snip>
>
>Don't need any variables, and don't need any single-quotes. Score a
>birdie for me! :-)
>
> ({
> add_topic => \&add_topic,
> showvote => \&showvote,
> others => \&others,
> vote => \&vote,
> results => \&results,
> delete => \&delete,
> }->{$FORM{action})->();
eval "&$FORM{action}()";
Why use a hash when you have got the symbol table I say ;)
--
Sam
Some of you know what the Perl slogan on Windows is, and you can say it
with me: "It's a good thing there's more than one way to do it, because
most of them don't work." --Larry Wall
------------------------------
Date: Fri, 20 Aug 1999 07:50:40 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: Behold-Software?
Message-Id: <kN7v3.191$u07.1540@news.colt.net>
Cut and Paste Scripts <cutandpastescripts@exl.co.uk> wrote:
> Hi,
> **** PLEASE don't morn or have a go, but this question is related to
> perl/cgi but isn't a programming question, but please could any one help
> me!!! *****
You question is NOT related to perl OR cgi, and we all have far better things
to do than be your personal file retrieval assistant.
Do you think that just because some bit of software is written in perl means
that all discussion of that software is relevant to this newsgroup? Do you
think then that all discussion of Adobe Photoshop is relevant to a C++
newsgroup?
------------------------------
Date: Fri, 20 Aug 1999 00:13:58 -0700
From: brian@pm.org (brian d foy)
Subject: Re: DBD with several databases - is it possible?
Message-Id: <brian-2008990013580001@28.sanjose-08-09rs16rt.ca.dial-access.att.net>
In article <7piqt6$iqe1@SGI3651ef0>, "Juan Riera" <jriera@retemail.es> wrote:
>I am just new to DBI/DBD. I have sucessfully configured my access to MySQL
>(thanks to several comp.lang.perl.misc posts helping me). As I must actually
>use Sybase, I would like to know if can I have several DBD accesses
>simultaneoulsy configured and open on Perl, reading from one Sybase table
>and writing on MySQL.
sure. just use separate database handles for each one.
--
brian d foy
------------------------------
Date: Fri, 20 Aug 1999 10:53:14 +0200
From: Hartmut =?iso-8859-1?Q?K=F6nig?= <koenig@privat.toplink.de>
Subject: execute a perl-script out of js
Message-Id: <37BD177A.4549A12C@privat.toplink.de>
Hi there,
just ask: is it possible to fill a js-variable with the return-code of a
perl-script in js-script ?
Thanks for any help
Hartmut König
------------------------------
Date: Fri, 20 Aug 1999 07:27:29 GMT
From: vishalb@my-deja.com
To: jasper75@chollian.net
Subject: Re: How to use perlcc? Need your help fellas~!
Message-Id: <7pj00q$9hn$1@nnrp1.deja.com>
what version of perl are you using?
vishal
In article <37BC4DFE.A89D6863@chollian.net>,
"Kang, Tae-jin" <jasper75@chollian.net> wrote:
> I tried to compile my perl scripts with perlcc.
>
> A simple script was compiled well. But when I compiled the scripts
that
> contains perl modules and my library files, there were several
errors!!!
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 20 Aug 1999 17:28:38 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Newbie : tr/// question
Message-Id: <MPG.1227aeb4bd84c018989c68@news-server>
JustYaz writes ..
> tr/\s+/\|/s; # does not accept \s as a space
-
>I am hoping that someone could possibly explain to me why this
>is so. It would be much preferred however if you could point me
>to a location in the FAQ that explains this, IMO, inconsistency.
>I had assumed that it would work similar to the s// function but
>it does not so would appreciate any insight to what I am
>misinterpretting
sounds like you actually want the substitution operator .. check out
your ActiveState "Core Perl Docs" documentation (the HTML stuff - from
the ActiveState shortcut in your Start > Programs menu) and click on the
link to 'perlop' .. then look up the tr operator .. it's a
transliteration operator .. doesn't do variable ranges of things
it works very differently to the s/// operator - they just have similar
syntax .. basically - to try and get you thinking the right way
tr/abc/XYZ/;
is the same as doing these three substitutions
s/a/X/g;
s/b/Y/g;
s/c/Z/g;
get it ? (don't answer until you've read perlop)
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Fri, 20 Aug 1999 01:21:46 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: newbie CGI question re CGI.pm
Message-Id: <MPG.1226aff4f7912276989e7d@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <37bcc218.63184824@nntp.ix.netcom.com> on Fri, 20 Aug 1999
03:02:41 GMT, either Jana or John <quikscor@ix.netcom.com> says...
...
> Premature end of script headers:
> /home/users/u/me/public_html/cgi-bin/echo.cgi
>
> It looks to me like the message is saying the headers are wrong. The
> CGI.pm module is supposed to take care of that, right? Maybe this
> server doesn't have the module installed......(?) Here's the
> code. The script is receiving input from a text field in an HTML
> form. The script should just echo back what was input.
>
> #!/user/bin/perl -w
|
Is that really where 'perl' is on the server??? More likely a typo.
If you have shell access, type 'which perl' at the command line.
> use CGI qw(:standard);
> my $echoline = param("anecho");
> print header, start_html("Yes, there is an echo!"), h1("You typed");
> if ($echoline) {
> print q($echoline);
Though you didn't actually get to execute the program, when you do, you
will discover that q() does single-quoting, so the value of the variable
won't be interpolated. Just don't quote it:
print $echoline;
> } else {
> print q("You didn't type anything.");
similar problem -- the double-quotes will be part of the output. Leave
out the q().
...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 20 Aug 1999 09:09:11 +0200
From: Lars Thegler <lars@thegler.dk>
Subject: Re: Newbie: How to direct STDOUT & STDERR to file AND terminal
Message-Id: <37BCFF17.BC16232E@thegler.dk>
This isn't really a perl question, so I suppose I shouldn't answer you
here, but...
'tee' is your friend:
prog 2>&1 | tee file
This will make stdout+stderr from 'prog' go your normal stdout
(terminal), with a copy to 'file'.
"Henry I. Widman" wrote:
>
> archives. So it now falls onto your shoulders. How does one in PERL
> have the STDOUT and STDERR data streams simultaneously directed to the
> terminal and a file (both data streams to the same file). I know how to
>
> Henry
/Lars
------------------------------
Date: Fri, 20 Aug 1999 07:17:47 GMT
From: Horace Ho <horaceho@geocities.com>
Subject: Parse conf file
Message-Id: <37BD00F5.ABE4D4F6@geocities.com>
To parse simple config file and retrive the key and value:
# config file of blah blah..
Priority=High
Hint=On
I use the following code:
while (<>) {
next if /^#/;
chomp $_;
$map_key = $_;
$map_val = $_;
$map_key =~ s/=.*$//;
$map_val =~ s/^.*=//;
}
Is there is better (shorter) way to do it?
Thanks
horace
------------------------------
Date: Fri, 20 Aug 1999 17:38:31 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Parse conf file
Message-Id: <MPG.1227b0f3ae79ae3d989c6a@news-server>
Horace Ho writes ..
>To parse simple config file and retrive the key and value:
>
>I use the following code:
> while (<>) {
> next if /^#/;
> chomp $_;
< yucky code deleted - it was hurting my eyes >
> }
>
>Is there is better (shorter) way to do it?
learn how to do the splits .. from a command prompt type
perldoc -f split
it'll cure what ails yer .. lots of lovely examples
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: 20 Aug 1999 07:51:55 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Parse conf file
Message-Id: <slrn7rq29s.qhr.sholden@pgrad.cs.usyd.edu.au>
On Fri, 20 Aug 1999 07:17:47 GMT, Horace Ho <horaceho@geocities.com> wrote:
>To parse simple config file and retrive the key and value:
>
># config file of blah blah..
>Priority=High
>Hint=On
>
>I use the following code:
>
> while (<>) {
> next if /^#/;
> chomp $_;
> $map_key = $_;
> $map_val = $_;
> $map_key =~ s/=.*$//;
> $map_val =~ s/^.*=//;
> }
>
>Is there is better (shorter) way to do it?
while (<>) {
next if /^\s*#/;
chomp;
$config{$1} = $2 if /^\s*([^=]+)=(.+)/;
}
or
while (<>) {
next if /^\s*#/;
chomp;
push(@config, split /=/, $_, 2);
}
%config = @config;
Another way is to change the config file to look like :
Priority => 'High',
Hint => 'On',
And use :
{
local $/ = undef;
my $config_file = <>;
$config = eval "{$config_file}";
}
--
Sam
Perl is the Cliff Notes of Unix.
--Tom Christiansen
------------------------------
Date: Thu, 19 Aug 1999 15:03:32 -0300
From: "Webmaster" <webmaster@compre-ya.com>
Subject: PERL EDITOR
Message-Id: <7pgrhk$rmu$1@vnews.prima.com.ar>
Does anyone of you know an good and nice editor for writting perl code?
I´m getting tired of notepad
------------------------------
Date: Fri, 20 Aug 1999 16:23:13 +0800
From: Funny Guy <computer_guy@hotmail.com>
Subject: Re: PERL EDITOR
Message-Id: <37BD1071.43C45195@hotmail.com>
I think you are using windows platform. The Ultraedit for windows is nice
editor for writting perl, it have a syntax highlight with the perl keyword.
http://www.ultraedit.com
Webmaster wrote:
> Does anyone of you know an good and nice editor for writting perl code?
>
> I´m getting tired of notepad
------------------------------
Date: Fri, 20 Aug 1999 08:22:05 GMT
From: michel.dalle@sni.be (Michel Dalle)
Subject: Re: Perl Exam Beta Testers Required
Message-Id: <7pj35k$r6j$2@news.mch.sbs.de>
In article <rroqeequboh63@corp.supernews.com>, "Stephen Collins" <scollins@co-active.com> wrote:
>Would anyone like to beta test the Perl exam in a shortly-to-be-released
>online technical screening system?
Why don't you post the URL ? Someone might want to increase his
collection of Perl "certificates" :-)
Michel.
------------------------------
Date: Fri, 20 Aug 1999 08:12:46 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: Question about date
Message-Id: <FGr85A.Kx1@csc.liv.ac.uk>
In article <MPG.1225b61b4615e097989e75@nntp.hpl.hp.com>,
lr@hpl.hp.com (Larry Rosler) writes:
> In article <FGpqBL.FHq@csc.liv.ac.uk> on Thu, 19 Aug 1999 12:50:09 GMT,
> I.J. Garlick <ijg@connect.org.uk> says...
> ...
>> No. Use the -M unary operator (somewhere in the perlfunc man page, but I
>> can't get perldoc -f to find them)
>
> We discovered this recently:
>
> On Unix: perldoc -f -- -X
I did try that but just got a perldoc usage message, (this is perl
5.004_04, which probably explains it).
Once you have been bitten by the '-' at the front of a filename problem
you never forget about the -- option :-) In my case I was trying to help
some one who had reversed the arguments on split in someway and ended up
with a file named -
Took me 15 minutes to get rid of it, eneded up disecting the rm man page
to find out how to do it. Boy did I look foolish. Thankfully it was
sometime ago, so the embarrasment has receeded with memory somewhat. :-)
--
Ian J. Garlick
ijg@csc.liv.ac.uk
"When in doubt, tell the truth."
-- Mark Twain
------------------------------
Date: Fri, 20 Aug 1999 08:14:24 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: Question about date
Message-Id: <FGr880.KxM@csc.liv.ac.uk>
In article <7phj46$c9k$1@xmission.xmission.com>,
fozz@xmission.xmission.com (Doran L. Barton) writes:
> Seth David Johnson <sjohns17@uic.edu> writes:
>
>>On 19 Aug 1999, Jimtaylor5 wrote:
>
> I would strongly suggest the use of Date::Manip here. Use the
> ParseDateDelta() sub to find the distance (in time) between two time/date
> values. Very very helpful indeed.
No. Read my answer to this on the other thread of this post. Date::Manip
and localtime are red herrings here.
--
Ian J. Garlick
ijg@csc.liv.ac.uk
"When in doubt, tell the truth."
-- Mark Twain
------------------------------
Date: Fri, 20 Aug 1999 01:03:25 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Referring to "my" variables
Message-Id: <MPG.1226aba896dc456b989e7c@nntp.hpl.hp.com>
In article <37BC6DE4.1B79475C@cisco.com> on Thu, 19 Aug 1999 13:49:40 -
0700, Makarand Kulkarni <makkulka@cisco.com> says...
> [ willow wrote:
> > After the subroutines execute, I would like to
> > compare the values of my $sum from each subroutine. How can I reference
> > those?
>
> Return refs to these my variables -
>
> $sum1 = sum1 ( 20, 30) ;
> $sum2 = sum1 ( 20, 30) ;
> print " sum1 = $$sum1 \n" ;
> print " sum2 = $$sum2 \n" ;
> exit ;
> sub sum1 { my $sum = $_[0] + $_[1] ; return \$sum ; }
> sub sum2 { my $sum = $_[0] + $_[1] ; return \$sum ; }
Why return refs, when simply returning the (scalar) values would do it
more simply? Taking refs of scalars is seldom warranted.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 20 Aug 1999 09:53:21 +0200
From: Philippe Emeriau <Philippe.Emeriau@infineon.com>
To: SZEKERES Istvan <szekeres@sysdata.siemens.hu>
Subject: Re: regular expressions in Perl and Oracle/SQL
Message-Id: <37BD0971.B8A5CEED@infineon.com>
SZEKERES Istvan wrote:
> In article <37BC1D7B.3F854DDB@infineon.com>, Philippe Emeriau wrote:
> >I would like to know if there is somewhere in Perl a function that
> >computes a regular expression and gives the result stored inside a
> >string ?
> >Example : the regexp is "foo[1-6]", and I would like to store the result
> >"foo1 foo2 foo3 foo4 foo5 foo6" in a variable.
>
> Tell me please what value do you expect for the regexp "a.*b" :-)
>
> Pista
Well, I have to give you more details on my requirements, so that you can
understand now why I have asked such question that seems to be so silly … ;-)
In fact, I have to provide to a given user (who is an Electronic Design
Automation engineer) a Perl API (a Perl package) that will provide a full
interface to data stored inside Oracle.
The user doesn’t care about Oracle, SQL, and all that software stuff, what he
only knows is a file, with a given grammar, where he provides some data to be
stored in the DB (through another piece of software not mentionned here !).
This grammar uses some keywords to define some kind of sections and
attributes, and the user provides some values for each attribute, and these
sections, attributes and values are mapped in the DB via tables and views.
So, with the Perl API, the user wants to retrieve the stored data, by
providing for example the name of a section and a regular expression defining
a set of attributes. I believe Oracle does not handle correctly such regexps
(I was not able to find anything on the subject). That’s why I would like to
process inside the Perl API the provided regexp to compute the full list of
required attributes, and then build an SQL query with all these attribute
names (after maybe a mapping to real names of tables, views, …). The query is
then sent to the Oracle server through the Perl DBI/DBD packages, I get in
return a specific result, and I have just after to create a specific Perl
hash map that is used by the final user …
I hope I was clear in my explaination …
Maybe you could suggest me some other way to do it, because I’m really stuck
with this problem !!!
Thanks in advance
Philippe
Philippe EMERIAU
Senior Software Engineer
Infineon Technologies Sophia Antipolis
Gaïa, 2600 Route des Crêtes
F-06560 Sophia Antipolis – FRANCE
WARNING : NEW EMAIL !!!
Email: Philippe.Emeriau@infineon.com
Tel: (+33)(0)4 92 38 37 21
Fax: (+33)(0)4 92 38 37 99
------------------------------
Date: Fri, 20 Aug 1999 08:20:26 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: Request for Comments: www.perl.com
Message-Id: <ed8v3.192$u07.1477@news.colt.net>
In comp.lang.perl.misc Tom Christiansen <tchrist@mox.perl.com> wrote:
> What you like at www.perl.com
* I like the fact that the primary navigation on the homepage includes:
Documentation
FAQ
CPAN
Reference
Search
Download
All of them exactly what _should_ be the primary navigation of a site devoted
to a programming language.
* I like the fact that I have twice submitted bug reports to the site and
twice received prompt courteous responses, followed by the bugs being fixed.
* I like the fact that the names 'Tim Bunce' 'Tom Christiansen' 'Larry Wall'
'Gurusamy Sarathy' all appear on the home page. This seems sympathetic to the
perl culture.
* I like the fact that the graphic design aids use of the site more than it
hinders it. Intelligent use of colours, fonts and layout is in evidence.
> What you don't like at www.perl.com
* It is a little too portal like. There is some information overload on the
front page.
* It is too isolated, with no links to, for instance, the perl mongers, the
apache perl project, or other perl-related parts of the world. Despite a
portal like front page it turns out to be a very shallow tree, rather than
an interface to a wealth of information. Come to think of it most portals
are like this :-)
* Advertising is tolerable, but the 'oblong banner at the top' is a weary
format that eats into first glance screen space. ('first glance' being what
you can see without any interaction (such as using a scroll bar)).
> What you would like to see at www.perl.com
I would like to see the negative points in the section above addressed :-)
I would like to see more blatant advocacy (case studies, the names of large
companies using perl, etc, etc), but then I am keen on perl advocacy, I
understand others find it annoying. I see a link between perl advocacy and
me not having to retrain in inferior languages :-|
I would like to see the, errr, CPAN search interface incorporated :)
> What you might like to help with at www.perl.com
I appear to have an unusual appetite for exhaustive user interface critiques.
If someone would like me to click on every link in the site and say why some of
them are in the wrong place or why the structure is wrong or right, I'll
be happy to oblige.
> double value; /* or your money back! */
> short changed; /* so triple your money back! */
giggle.
------------------------------
Date: Fri, 20 Aug 1999 00:51:58 -0700
From: hookman <hookman@cwnet.com>
To: priced@doctor.chem.yale.edu
Subject: Re: returning a ref to a hash from a different module...
Message-Id: <37BD091E.4FA2470F@cwnet.com>
why don't you use pointers...
i.e.
my %settings;
&get_settings(\%settings);
sub get_settings {
my ($Hash_settings) = @_;
$Hash_settings->{'a'} = 1;
$Hash_settings->{'b'} = 3;
foreach (keys %{$Hash_settings}) {
print "$_ $Hash_settings->{$_}\n";
}
}
then you won't need a return..
works for me every time.
Dan Price wrote:
>
> Thanks in advance to any suggestions.
>
> I have a routine within a separate package/module from which I would
> like to return a reference to a hash. I've used code similar to what is
> found in 'man perlmod':
>
> use my_module;
>
> %settings = ( );
> *settings = &get_settings;
>
> Within my_module:
> sub get_settings {
> my %what_is_set;
>
> # some code here to fill in %what_is_set
> return \%what_is_set;
> }
>
> This works correctly, except I get a warning:
> Array found where operator expected at (eval 2) line 1 of line
> (Missing operator after ?)
>
> I've also used a scalar as opposed to a glob and dereferenced it with
> identical results:
> $settings=&get_settings();
> print "$$settings{on}\n";
>
> Getting the warning is not clean. Is their a way I can quell this
> message and/or use another syntactic approach to avoid the warning
> altogether?
>
> thanks,
>
> Dan
> priced@doctor.chem.yale.edu
------------------------------
Date: Fri, 20 Aug 1999 01:27:29 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: returning a ref to a hash from a different module...
Message-Id: <MPG.1226b14699b65044989e7e@nntp.hpl.hp.com>
In article <37BD091E.4FA2470F@cwnet.com> on Fri, 20 Aug 1999 00:51:58 -
0700, hookman <hookman@cwnet.com> says...
> why don't you use pointers...
Because Perl has no pointers?
> i.e.
> my %settings;
> &get_settings(\%settings);
Oh, you mean references, as in the original Subject.
...
> Dan Price wrote:
Blah, blah, blah...
Why do you quote the entire article, and why *after* your response?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 20 Aug 1999 09:31:09 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: what does eq do on lists?
Message-Id: <37BD043D.7B7112F9@gmx.net>
Sam Holden wrote:
>
> Makes sense now. You can't add, remove, or move elements in the list,
> but you can do whatever you normally could do to those elements. So if
> they are variables you can assign to them, if they are constants like
> 1, you can't.
Except, of course, for undef, which you can "assign" to when it's in a
list -- the assigned value goes into the garbage bin. So I guess undef
is a sort of "assignable constant" (?). It just doesn't change its value
on assignment :).
Silly example:
($one, undef, undef, $two, $three, undef) = localtime;
Will capture seconds into $one, day-of-month into $two, month
(zero-based) into $three, while chucking away minutes and hours and year
(and everything after that: wday, yday, isdst, because there aren't that
many elements in the LHS list).
Cheers,
Philip
------------------------------
Date: 20 Aug 1999 01:54:05 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: What vendors include Perl with their boxes?
Message-Id: <37bd099d@cs.colorado.edu>
I think this is exciting. We're pretty darned popular. It's been a hard
uphill battle, and there's still a lot of lobby for inclusion to be done,
but we're much further than we were ten years ago.
Please send me more entries in the format that follows at the bottom.
thanks,
--tom
Summary:
Apple Computer, Inc.
BSDI
Be, Inc.
Compaq Computer Corporation
Data General
Debian Project
FreeBSD, Inc.
Hewlett-Packard
IBM
Microsoft Corporation
Novell
OpenBSD Project
Rebel(?) (formerly Corel Computer)
Red Hat
SCO
SGI
Sequent Computer Systems
Siemens Nixdorf Informationssysteme AG
Silicon Graphics
Slackware
Stratus Computer
Sun Microsystems
(some of those are not in the same class, e.g. optional versus
standard versus third-party)
Details:
(some redundancy in raw data)
Vendor Name: Apple Computer, Inc.
OS Name/Version: Mac OS X Server 1.0 and greater
Perl version: 5.005_03
Status: Standard part of installed system utility set
Since when: Spring 1999
Notes: http://www.apple.com/macosx/server/ Perl sharedlib
and headers are installed in the Perlframework; a
framework being a collection ofheaders, binaries,
and related other resources.I'm working to over
time have the main Perldistribution install
appropriately on Mac OSX Server.
Vendor Name: Be, Inc.
OS Name/Version: BeOS 4.5
Perl version: 5.005_03 (I think. might be 5.005_02)
Status: part of "optional" software set
Since when: June 1999
Vendor Name: BSDI
OS Name/Version: BSDI 4.0
Perl version: perl4.036 as perl, perl5.004_02 as perl5.
Status: standard part of installed system utility set
Since when: forever
Notes: In the next release (4.1), the current perl release
will ship as perl not perl5, and theold release
will now ship as perl4.
Vendor Name: Compaq Computer Corporation
OS Name/Version: OpenVMS VAX all versions, OpenVMS Alpha all
versions,Windows NT x86, Windows NT Alpha, Windows
98, Tru64 Unix
Perl version: perl5.003, 5.003_05, current versions, CPAN mirror
Status: Available on a Freeware CD that ships with OS
(VMS/T64Unix) as well as from a few web/ftp
sites:http://www.openvms.digital.com/freeware/PERL5
/ftp://www.openvms.digital.com/freeware/PERL5/ftp:/
/ftp.digital.com/pub/plan/perl/CPAN/
Since when: several years now
Vendor Name: Compaq Computer Corporation
OS Name/Version: Tru64 UNIX V5.0
Perl version: 5.004_04 (as of V5.0--will change with time)
Status: /usr/bin/perl is standard, but all run-timesupport
(modules and documentation) is part ofan optional
subset in the main distribution.
Since when: Summer 1999
Vendor Name: Compaq Computer Corporation
OS Name/Version: VMS 6.2
Perl version: 5.004_03
Status: On Freeware CD included as part of OS
distributionkit. Also included as part of the
Netscape FastTrackserver install kit distributed
with VMS 7.2.
Since when: 1995
Vendor Name: Data General
OS Name/Version: dgux/R4.20MU04 generic AViiON PentiumPro
Perl version: 5.x ships with OS.
Status: NIS on OS depends on a dgadm.pl library, oneneeds
to be careful before overwriting /usr/bin/perlwith
an update.
Since when: several years
Vendor Name: Debian Project
OS Name/Version: Debian GNU/Linux 2.1 (our stable release)Debian
GNU/Linux 2.2 (our unstable release)
Perl version: perl5.004_04 (in 2.1),perl5.005_03 (in 2.2)
Status: standard part of installed system utility set
Since when: Perl has been a standard component since the
project inceptionin 1993.
Notes: Lists latest installed version as "perl", others as
perl-ver;both threaded and non-threaded versions
supplied.
Vendor Name: DG
OS Name/Version: DG/UX R4.11MU04, DG/UX 5.4R3.10
Perl version: perl4.036
Status: UNKNOWN
Since when: UNKNOWN
Vendor Name: FreeBSD, Inc.
OS Name/Version: FreeBSD >=3.2 (see history)
Perl version: perl5.005_03
Status: standard part of installed system utility set
Since when: May 5, 1999
Notes: Since September 1998 FreeBSD has perl5 as a
standard part ofinstalled system utility set
(/usr/bin/perl). Before FreeBSDhad perl4 as its
/usr/bin/perl - since September 1994, version4.046.
Perl5 was available as a ``port''.
Vendor Name: Hewlett-Packard
OS Name/Version: HP-UX 10.X and 11.X
Perl version: perl4.036
Status: Part of USER-CONTRIB bundle
Since when: HP-UX 10.00
Notes: HP does not formally support Perl, except when
q4,the kernel debugger, is concerned.
Vendor Name: Hewlett-Packard
OS Name/Version: HP-UX 11.00
Perl version: perl4.036
Status: part of standard fileset OS-Core.Q4 (Crash Dump
Debugger)installed as /usr/contrib/bin/perl
Since when: November 1997
Notes: No man pages or docs except for some references
in/usr/contrib/doc/Q4Docs.tar.Z
Vendor Name: IBM
OS Name/Version: OS/390 R2.3 and later, OS/400 (version?), AIX SP/2
Perl version: perl5.001e last time I tried an SP/2.perl5.003
(OS/400) binary on $CPAN/ports/as400, 5.004_03
(OS/390 binary)
Status: The one for AIX on the SP/2 ships with the OS.
Theothers are available from ibm.com ftp servers
(that Icannot find right now) as well as
http://www.mks.com/.The as400 binaries in
CPAN/ports/ are from IBM Rochester, Minnesota.
Since when: several years for AIX SP/2 and OS/400, since fall
98 for OS/390
Vendor Name: Microsoft Corporation
OS Name/Version: Windows NT (recent versions)
Perl version: latest (or recent) activestate build.
Status: Ships with the "NT Resource Kit" (CD) not the OS.
Since when: several years
Vendor Name: Novell
OS Name/Version: Netware
Perl version: 5.003_07 (from Activestate NT Perl of October
1996).
Status: Ships with special "webified" version of OS +
packaging on CD.
Since when: UNKNOWN
Vendor Name: OpenBSD Project
OS Name/Version: OpenBSD 2.0
Perl version: perl5.003
Status: standard part of installed system utility set
Since when: Every formal OpenBSD release has included perl
Vendor Name: OpenBSD Project
OS Name/Version: OpenBSD 2.1
Perl version: perl5.003
Status: standard part of installed system utility set
Since when: Every formal OpenBSD release has included perl
Vendor Name: OpenBSD Project
OS Name/Version: OpenBSD 2.2
Perl version: perl5.003
Status: standard part of installed system utility set
Since when: Every formal OpenBSD release has included perl
Vendor Name: OpenBSD Project
OS Name/Version: OpenBSD 2.3
Perl version: perl5.003
Status: standard part of installed system utility set
Since when: Every formal OpenBSD release has included perl
Vendor Name: OpenBSD Project
OS Name/Version: OpenBSD 2.4
Perl version: perl5.00404
Status: standard part of installed system utility set
Since when: Every formal OpenBSD release has included perl
Vendor Name: OpenBSD Project
OS Name/Version: OpenBSD 2.5
Perl version: perl5.00404
Status: standard part of installed system utility set
Since when: Every formal OpenBSD release has included perl
Vendor Name: OpenBSD Project
OS Name/Version: OpenBSD 2.6
Perl version: perl5.00503
Status: standard part of installed system utility set
Since when: Every formal OpenBSD release has included perl
Notes: OpenBSD 2.6 has not been released yet but thisis
the perl version in the source tree.
Vendor Name: Rebel(?) (formerly Corel Computer)
OS Name/Version: arm Linux (based on Redhat 5.x)
Perl version: 5.004_01 ships with Netwinder DM machines.
Status: see http://www.rebel.com/ for more info.
Since when: at least since Fall 1998 (DM), July 1999 "Office
Netwinder"
Vendor Name: Red Hat
OS Name/Version: Red Hat Linux 5.2
Perl version: perl5.004_04-m4
Status: standard part of installed system utility set
Since when: Oct. 14, 1998 (final build date before release)
Notes: Installed as /usr/bin/perl
Vendor Name: Red Hat
OS Name/Version: Red Hat Linux 6.0
Perl version: perl5.005_03
Status: standard part of installed system utility set
Since when: Apr 19, 1999 (final build date before release)
Notes: Installed as /usr/bin/perl
Vendor Name: SCO
OS Name/Version: Unixware 2.1/2.1.1/2.1.2/2.1.3
Perl version: perl4.036
Status: Installed in /usr/gnu/bin and probably unsupported
- infact it may be part of an optional package but
as theUnixware package manager can't tell you what
filesbelong to what package I can't check.
Since when: Release
Vendor Name: SCO
OS Name/Version: Unixware 7
Perl version: perl5.? (machine not bootable ATM so I can't check)
Status: UNKNOWN
Since when: Release
Vendor Name: Sequent Computer Systems
OS Name/Version: DYNIX/ptx 4.5.0 onwards
Perl version: perl5.005_03
Status: standard part of installed system utility set
Since when: September 1999
Notes: perl5.005_03 is also available for, but not
suppliedwith earlier versions (unsupported).
Vendor Name: SGI
OS Name/Version: IRIX 6.5.x
Perl version: perl 5.004_04
Status: standard part of installed system utility set
(/usr/sbin)
Since when: Since I've had IRIX, spring '98 (obviously, before
that)
Vendor Name: Siemens Nixdorf Informationssysteme AG
OS Name/Version: SINIX-N/Release 5.43 Version B0050 and Release 5.43
Version C4001
Perl version: 5.003 ships with stated OS versions.
Status: More recent versions seem to build fine on this
SysVR4platform.
Since when: at least since 1997
Vendor Name: Silicon Graphics
OS Name/Version: IRIX 6.5
Perl version: perl5.004_04
Status: UNKNOWN
Since when: summer 1999
Notes: SGI also has a contrib CD that usually has more
recent stuff on it.
Vendor Name: Slackware
OS Name/Version: Slackware Linux 3.5
Perl version: 5.00404
Status: 5.00404 binary and libraries as an optionally
installable standard package
Since when: June 1998
Notes: The "zipslack" sub-distribution - a prefab job
designed toinstall on top of a Dosish system and
fit on a 'zip'drive (77MB size) - also contains the
perl package.
Vendor Name: Stratus Computer
OS Name/Version: Stratus VOS; any y2k-compliant version
Perl version: perl5.005_03
Status: available for download from
ftp://ftp.stratus.com/pub/vos/alpha/alpha.html
Since when: April 1999
Notes: Runs on XA2000, XA/R or Continuum models
Vendor Name: Sun Microsystems
OS Name/Version: Solaris 8 Beta
Perl version: 5.005_03
Status: standard part of installed system utility set
Since when: July 1999
Notes: Engineering support for Perl as an accepted
developmentlanguage within the Solaris product is
being developed,with full support being available
for the releasefollowing Solaris 8. An early
utility (that will shipin /usr/bin), based on Alan
Burlison's Kstat module,should be included in the
final version of Solaris 8.
--
"We are starting a movement in the state legislatures...to forbid the
installation of clinics that dispense contraceptives."
--Phyllis Schlafly, President, Eagle Forum
------------------------------
Date: Fri, 20 Aug 1999 17:21:20 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Why $|++ (was: Re: perl system())
Message-Id: <MPG.1227acff7ec3d1989c67@news-server>
Abigail writes ..
>David Cassell (cassell@mail.cor.epa.gov) wrote on MMCLXXX September
>MCMXCIII in <URL:news:37BC9BE1.C225EA2D@mail.cor.epa.gov>:
>##
>## $|++;
>
>
>Why "$|++;"? I've seen this before, and frankly, it baffles me why
>someone would want to use this instead of "$| = 1;".
thank god I'm not the only one (just didn't want to say anything because
a lot of the people who I respect seem to do it) .. the first time I saw
this syntax - I double-checked my perlvar just in case there were other
values of $| of which I was unaware
>Would it be faster? No... a simple benchmark shows it's slower,
>by almost a factor of 2.5:
even if it were faster - there could never be significant enough
difference in speed between such similar integer operations to make the
obscurity worth it
>Is it that "$| = 1;" isn't always correct? Well, in fact, "$| = 1;" will
>*always* turn of buffering, while "$| ++;" would enable buffering if, for
>whatever reason, "$| == -1;".
I prefer to use
$ |=
$ |==
$ |;
although sometimes - instead of going down that long-winded 'local' path
- I'll intermix
$|--;
and
$|++;
and when they get out of synch - it's a big ball of fun *8^)
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Fri, 20 Aug 1999 08:08:33 GMT
From: michel.dalle@sni.be (Michel Dalle)
Subject: Re: Win32::OLE + Word/Excel
Message-Id: <7pj2c8$r6j$1@news.mch.sbs.de>
In article <+QhwxAAHTGv3Ewbh@beausys.freeserve.co.uk>, Andrew Fry <andrewf@beausys.freeserve.co.uk> wrote:
>Well, I have next to no experience of VBA, but I dont see how
>writing VBA macros and reading the Word helpfile is going to
>help me understand what it is I have to write in Perl to do
>precisely what I want to do.
>
Because once you cross the barrier of Win32::OLE, the available methods
and properties do not depend on Perl anymore, but on the OLE object itself,
i.e. Word, Excel etc. And documentation for these objects can be found in
the VBA helpfile, not in the Perl documentation...
You might for instance use Document->Content, but how do you know what
this will give you if you don't look in the VBA helpfile for Word ?
Michel.
------------------------------
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 598
*************************************