[18240] in Perl-Users-Digest
Perl-Users Digest, Issue: 408 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 3 18:05:48 2001
Date: Sat, 3 Mar 2001 15:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <983660708-v10-i408@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 3 Mar 2001 Volume: 10 Number: 408
Today's topics:
ANNOUNCE: DDL::Oracle v1.04 <rvsutherland@yahoo.com>
Bijeenkomst Amsterdam Perl Mongers, Dinsdag 6 Maart 200 (Johan Vromans)
Re: Can't start new process from Perl CGI script <billk@cts.com>
Re: checkbox problem (Miguel Cruz)
Re: Convert dates in format "3/1/2001" to dd-Month-yy (Garry Williams)
Re: Customized Error Messages <wells@cedarnet.org>
Hash/array woes... <scott@scott.com>
Is Perl right for me? <maximom@mindspring.com>
Re: Is Perl right for me? <gtoomey@usa.net>
Re: Is Perl right for me? <maximom@mindspring.com>
Re: length op <bwalton@rochester.rr.com>
Mail::Send and invoking sendmail with -t -f me@here.com <saeed@nms-sys-ltd.demon.co.uk>
Re: Newbie - Perl for Win32 (Gasp!) <philipg@atl.mediaone.net>
Re: Parsing with Parse::RecDescent (Abigail)
Perl Internals <eg344@nyu.edu>
Re: Perl Internals <dan@tuatha.sidhe.org>
Re: Perl/HP-UX - Odd $ENV Behavior (Garry Williams)
REVISED: Hash/array woes... <scott@scott.com>
Re: use strict; (BUCK NAKED1)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 3 Mar 2001 15:05:58 -0500
From: "Richard Sutherland" <rvsutherland@yahoo.com>
Subject: ANNOUNCE: DDL::Oracle v1.04
Message-Id: <ta2k0doas6589a@corp.supernews.com>
===========================================================================
Release of DDL::Oracle, Version 1.03
===========================================================================
CHANGES
DDL::Oracle now facilitates use by users without SELECT privileges on V$
views by adding attributes to the 'configure' method. By setting the
'heading' attribute to "0" and supplying values for 'blksize' and 'version'
attributes, a non-privileged user will bypass the queries to V$DATABASE,
V$PARAMETER and V$VERSION, respectively.
Also fixed bug #404429, identified and fixed by Martin Drautzburg.
THANKS, Martin!
DESCRIPTION
Designed for Oracle DBA's and users, for Oracle versions 7.3, 8.0
and 8i. Reverse engineers database objects (tables, indexes, users,
profiles, tablespaces, roles, constraints, etc.). Generates DDL to
*resize* tables and indexes to the provided standard or to a user
defined standard. Can reorganize/defragment tablespaces.
SYNOPSIS
use DBI;
use DDL::Oracle;
my $dbh = DBI->connect(
"dbi:Oracle:dbname",
"username",
"password",
{
PrintError => 0,
RaiseError => 1
}
);
# Use default resizing and schema options.
# query default DBA_xxx tables (could use USER_xxx for non-DBA types)
DDL::Oracle->configure(
dbh => $dbh,
);
# Create a list of one or more objects
my $sth = $dbh->prepare(
"SELECT
owner
, name
FROM
dba_tables
WHERE
tablespace_name = 'MY_TBLSP' -- your millage may vary
"
);
$sth->execute;
my $list = $sth->fetchall_arrayref;
my $obj = DDL::Oracle->new(
type => "table",
list => $list, );
);
my $ddl = $obj->create; # or $obj->resize; or $obj->drop; etc.
print $ddl; # Use STDOUT so user can redirect to desired file.
AUTHOR
Richard V. Sutherland
rvsutherland@yahoo.com
COPYRIGHT
Copyright (c) 2000, 2001 Richard V. Sutherland. All rights reserved.
This module is free software. It may be used, redistributed, and/or
modified under the same terms as Perl itself. See:
http://www.perl.com/perl/misc/Artistic.html
===========================================================================
AVAILABILITY
===========================================================================
DDL::Oracle is available from the CPAN, and from:
http://sourceforge.net/projects/ddl-oracle/
------------------------------
Date: 03 Mar 2001 17:38:45 +0100
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: Bijeenkomst Amsterdam Perl Mongers, Dinsdag 6 Maart 2001
Message-Id: <m2d7byq02y.fsf@phoenix.squirrel.nl>
[English version follows the dutch text]
Amsterdam.pm staat voor de "Amsterdamse Perl Mongers", een groep van
gebruikers van Perl. In tegenstelling tot wat de naam suggereert is
Amsterdam.pm niet beperkt tot alleen Amsterdam, maar functioneert, tot
er meer gebruikersgroepen in Nederland zijn, als Nederlandse
gebruikersgroep.
Amsterdam.pm organiseert informele bijeenkomsten waar Perl gebruikers
kunnen samenkomen en informatie en gebruikservaringen met betrekking
tot Perl kunnen uitwisselen. Deze bijeenkomsten vinden normaliter
plaats op elke eerste dinsdag van de maand. De voertaal binnen
Amsterdam.pm is in pricipe Nederlands, maar indien nodig zal Engels
worden gebruikt, b.v. om te communiceren met niet-Nederlandssprekende
aanwezigen.
De eerstvolgende bijeenkomst vindt plaats op dinsdag 6 maart 2001 van
20:00 tot 22:00 uur op het (nieuwe!) kantoor van XS4All, Eekholt 42,
Diemen. Deze bijeenkomst onder meer:
- voortgang werkgroepen
- verslag German Perl Workshop
- Perl6 voortgang
- een lezing over DBI internals
- en een heleboel Perl gezelligheid
Voor meer details, waaronder een routebeschrijving, zie
http://www.amsterdam.pm.org/Meetings/next_meeting.html
Liefhebbers van een etentje vooraf kunnen tussen 17:45 en 18:15
verzamelen. Om 18:15 (écht om 18:15!) zoeken we een restaurantje in de
buurt om een hapje te eten.
Bezoek onze Web site http://www.Amsterdam.pm.org voor meer details.
[English version]
Amsterdam.pm stands for the Amsterdam Perl Mongers. We're basically a
Perl user group. Despite its name, it is not local to the Amsterdam
environment, but it welcomes Perl mongers from all over the
Netherlands.
Amsterdam.pm organises informal meetings where Perl users can meet,
and exchange information and experiences with regard to using Perl.
The meetings are normally held every first Tuesday of the month.
Although the preferred language for communication is Dutch, English
will be spoken if necessary.
Our next meeting is Tuesday Match 6th, from 20:00 till 22:00
at the (new!) office of XS4All, Eekholt 42, Diemen. This meeting
will have:
- progress working groups
- report from German Perl Workshop
- Perl6 progress
- a lecture about DBI internals
- and lots of Perl fun
See http://www.amsterdam.pm.org/Meetings/next_meeting.html for
more detail and the directions to get there.
Should you want to join some of us for dinner, please gather between
17:45 and 18:15. At 18:15 sharp we'll leave for a restaurant somewhere
nearby for dinner.
See http://www.Amsterdam.pm.org for more details.
------------------------------
Date: Sat, 03 Mar 2001 19:33:02 GMT
From: "Bill Kelly" <billk@cts.com>
Subject: Re: Can't start new process from Perl CGI script
Message-Id: <OFbo6.103155$GV2.23448142@typhoon.san.rr.com>
"Henrik Martensson" <henrik.martensson@swipnet.se> wrote:
> I have a Perl script that reads an XML file and converts it to FrameMaker
> MIF format. After the MIF conversion, the Perl script is supposed to start
> another program, DZBatcher, that in its turn runs FrameMaker and produces a
> Postscript file.
>
> The script runs very well when launched from the command line, but when I
> try to start the process from a CGI script, everything works to the point
> where the CGI script is supposed to start a new process. The new process is
> apparently launched, but nothing actually happens. DZBatcher never runs.
>
> I have tried launching the new process with system(), exec() and
> Win32::Process. I have run the the CGI script under both Apache and Internet
> Information Server.
>
> I have taken care to use full path names everywhere. I am aware that a CGI
> script does not know what directory it was started from.
>
> I have even tried using
>
> @command = ("start","anabsolutepath/ascript.pl");
> exec(@command);
Just a thought, how about something even more direct as a test,
like perhaps:
my $result = `anabsolutepath/perl -e "print 'hello'"`;
Or, possibly, like your exec above except invoking the perl
executable directly instead of via start? e.g.
@command = ("anabsolutepath/perl", "anabsolutepath/ascript.pl");
Wish I could offer more ideas . . .
Bill
------------------------------
Date: Sat, 03 Mar 2001 20:50:11 GMT
From: mnc@admin.u.nu (Miguel Cruz)
Subject: Re: checkbox problem
Message-Id: <7Oco6.1655$Sz1.580611@typhoon2.ba-dsg.net>
Alan Hood <gi59@dial.pipex.com> wrote:
> I seem to have a problem passing a check box value to a CGI script.
> If the box is NOT checked then the script returns an error.
> If it is all seems OK.
> Can anybody help?
There is probably a bug in your script.
Is that helpful?
You probably need to provide more information before anyone can help you
much further. What does the relevant code look like? What is the error?
miguel
------------------------------
Date: Sat, 03 Mar 2001 19:09:57 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Convert dates in format "3/1/2001" to dd-Month-yy
Message-Id: <9kbo6.118$mU5.3097@eagle.america.net>
On Thu, 1 Mar 2001 21:01:36 -0600, John Smith <creafin1998@yahoo.com> wrote:
>Does anyone know the most efficient way to convert dates in the format
>"m/d/yyyy" to dd-Month-yy using pattern matching?
Don't know about efficiency, but this is short:
my @m = qw(January February March April
May June July August September
October November December);
s!(\d+)/(\d+)/\d\d(\d\d)!$2-$m[$1-1]-$3!;
--
Garry Williams
------------------------------
Date: Sat, 03 Mar 2001 15:53:50 -0600
From: Steve Wells <wells@cedarnet.org>
Subject: Re: Customized Error Messages
Message-Id: <3AA167EE.962B996E@cedarnet.org>
Godzilla:
> TEST SCRIPT:
> ____________
>
> #!perl
>
> print "Content-type: text/plain\n\n";
Why on earth do I need this line?
No place in my script did I write anything
about using the web for my program. This
language has been around long before the
web.
> ## TEST ONE
>
> print "TEST ONE:\n\n";
>
> $attributes = "true";
Observe that in my example:
($ret, $values) = subroutine({ attributes });
that the attributes are part of an anonymous hash.
ie: ($ret, $values) =
subroutine( { 'attributes' => 'true' });
[rest deleted due to misunderstanding the concept]
[ Please note:
I have no idea how you could extrapolate my one
line of code into suddenly feeling that I have
no understanding of how to use subroutines and
next you're going to tell me I need to grasp the
complexities of variables. I'm honestly dismayed
at this response. ]
Since you seem to be having trouble understanding
the concept of using such a subroutine I've
provided you with an example. As far as syntax
errors are concerned I can't see how they fit into
this situation. I'm certainly not talking about
compilation errors rather execution errors but I seem
to need to spell that out for you.
Here is how to write a subroutine that conforms to
the idea of:
($ret, $values) = subroutine ( { attributes });
(of course $values could be a reference to any data
type)
ie:
-----------
#!perl
my($ret, $values) =
subroutine( { 'attrib' => 't' } );
error( "$values $!" ) unless defined $ret;
print $val ."$_\n" foreach @$values;
sub subroutine {
my ($hash) = shift;
return (undef, "error: should be 't'")
unless $hash->{attrib} eq "t";
return (1, [$hash->{attrib}]);
}
sub error {
my $error = shift;
print $error, "\n";
exit 1;
}
-----------
Actually now that we've covered all this I
would like to point out that you missed the
very essence of my question. I would like a
way to customize the error messages that are
displayed back to the user through a
configuration file while saving the specifics
for an error log file. I was looking for
interesting techniques to do just that. Not
having someone tell me I need to work on the
concept of functions.
Thanks,
STEVE
---------------------------------
CNN News Flash: Tokyo Fights Back
------------------------------
Date: Sat, 03 Mar 2001 15:50:23 -0800
From: scott <scott@scott.com>
Subject: Hash/array woes...
Message-Id: <3AA1833F.A305260B@scott.com>
I have an interesting problem (well, interesting to me!). :-)
Consider the following three columns plucked from a database
ID, CATEGORY, PARENT_ID
The ID is a unique alphanumeric key for each row, the CATEGORY is a
description or name of the entry, and the PARENT_ID represents the ID of
another row. The idea here is that each CATEGORY can have a parent
category, as denoted by the contents of the PARENT_ID field.
What I am trying to do is build an HTML select list using this data,
where the output might look like:
CATEGORY 1
Subcategory 1
Subcategory 2
CATEGORY 2
Subcategory 1
Subcategory 2
CATEGORY 3
CATEGORY 4
Above, categories 1 and 2 have subcategories associated with them, while
categories 3 and 4 have no child categories at all.
I have tried reading in the table into an array of hashes, and modifying
as such, but I think my brain is fried at this point. I need some fresh
eyes! I know there has to be a simple way to do this in perl ...
Thanks in advance to all those who respond.
Cheers.
Scott
------------------------------
Date: Sat, 3 Mar 2001 17:17:37 -0500
From: "Holly Bortfeld" <maximom@mindspring.com>
Subject: Is Perl right for me?
Message-Id: <97rqaj$qfl$1@nntp9.atl.mindspring.net>
Hi, I am trying to create a website that would need scripting and was told
to learn Perl by a young man at the book store. I was looking for a piece
of software that might help me first, then if not, I will learn to program
Perl, if that is the right language to do what I need. I can write HTML
from scratch without an editor.
I want to create a website for parents of kids with multiple food allergies
that allows users to click boxes as to what thier child cannot have in a
recipe, then the search engine or script would sort through the 25,000+
tagged recipes to show the site user only the recipes that fit their entered
criteria in a particular category.
The site does not need to be fancy with pictures or Java, just efficient to
sort through the vast amounts of recipe files in a short amount of time. At
CompUSA, a young man suggested DreamWeaver but the description on the site
does not look like that will fit my needs. Do you know of a software that
would?
Any help you can give me would be appreciated. Thanks in advance.
Holly, maximom@mindspring.com
------------------------------
Date: Sun, 4 Mar 2001 08:28:01 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: Is Perl right for me?
Message-Id: <C%do6.7414$v5.28387@newsfeeds.bigpond.com>
Options you might like to consider are Perl, PHP, Active Server Pages and
Cold Fusion.
If you are hosting your site on in ISP, they may have these already.
For searching, I think Cold fusion has searching functions built in.
Otherwise, a site like www.atomz.com will allow an external search engine
to do the searching for you?
gtoomey
------------------
"Holly Bortfeld" <maximom@mindspring.com> wrote in message
news:97rqaj$qfl$1@nntp9.atl.mindspring.net...
> Hi, I am trying to create a website that would need scripting and was told
> to learn Perl by a young man at the book store. I was looking for a piece
> of software that might help me first, then if not, I will learn to program
> Perl, if that is the right language to do what I need. I can write HTML
> from scratch without an editor.
>
> I want to create a website for parents of kids with multiple food
allergies
> that allows users to click boxes as to what thier child cannot have in a
> recipe, then the search engine or script would sort through the 25,000+
> tagged recipes to show the site user only the recipes that fit their
entered
> criteria in a particular category.
>
> The site does not need to be fancy with pictures or Java, just efficient
to
> sort through the vast amounts of recipe files in a short amount of time.
At
> CompUSA, a young man suggested DreamWeaver but the description on the site
> does not look like that will fit my needs. Do you know of a software that
> would?
>
> Any help you can give me would be appreciated. Thanks in advance.
>
> Holly, maximom@mindspring.com
>
>
>
------------------------------
Date: Sat, 3 Mar 2001 17:40:45 -0500
From: "Holly Bortfeld" <maximom@mindspring.com>
Subject: Re: Is Perl right for me?
Message-Id: <97rrq2$89h$1@slb7.atl.mindspring.net>
Hi, thanks for your post. I went to the Atomz site but they want $5000 just
to start. This website will be free to all users as we are all parents of
disabled children so we cannot afford that.
I don't mind doing the work or buying a piece of software but want to do all
the work ourselves as far as tagging all the recipe files and being able to
update them at any time as well as designing the webpage and search engine.
We have been offered space on someone's server for free to hold the data as
well.
I will go check out Cold Fusion and if you can think of anything else,
please let me know.
Thank you
Holly
"Gregory Toomey" <gtoomey@usa.net> wrote in message
news:C%do6.7414$v5.28387@newsfeeds.bigpond.com...
> Options you might like to consider are Perl, PHP, Active Server Pages and
> Cold Fusion.
> If you are hosting your site on in ISP, they may have these already.
>
> For searching, I think Cold fusion has searching functions built in.
> Otherwise, a site like www.atomz.com will allow an external search engine
> to do the searching for you?
>
> gtoomey
> ------------------
------------------------------
Date: Sat, 03 Mar 2001 20:02:16 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: length op
Message-Id: <3AA14E21.A7D4EE7C@rochester.rr.com>
Eduard Grinvald wrote:
...
> Am i correct in assuming that length, given a pointer, only returns the size
> of the pointer in bytes, an not the actual object referenced? Also, is there
> any place on the web or is there a book that gives a listing of what the
> sizes of different data types are (int,strings, arrays, arrayrefs, etc).
...
> eduard grinvald
No, that is not a correct assumption. The thing you are calling a
pointer is, I assume, a Perl reference. If, for example, a reference
like:
$a=\%h;
is presented to the length function as, for example:
print length $a;
it is stringified, and length will return the length of the
stringification. The stringification might look something like:
HASH(0x17653d8)
which has a length of 15 characters.
If the reference refers to a string, you could find its length with:
print length $$a;
Note that length generates the length of an expression in characters.
See:
perldoc -f length
HTH.
--
Bob Walton
------------------------------
Date: Sat, 3 Mar 2001 19:59:06 +0000
From: Saeed Rana <saeed@nms-sys-ltd.demon.co.uk>
Subject: Mail::Send and invoking sendmail with -t -f me@here.com
Message-Id: <VkwJ5AAK0Uo6EwRL@nms-sys-ltd.demon.co.uk>
Hi,
We have a web app that offers email. It has been written using
Mail::Send to send emails. The MTA is sendmail. The mails are sent
virtual domains, and we want the virtual domain names to be shown in the
return path. To do this, sendmail offers the -f command line flag. Now,
the question is, how can we, when calling Mail:Send to open up a new
sendmail object, tell it to invoke sendmail with -f <from_address>.
I fear if this cannot be done, then we will have to re-write this using
direct pipe to sendmail.
Regards,
Saeed Rana
------------------------------
Date: Sat, 03 Mar 2001 19:07:49 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: Newbie - Perl for Win32 (Gasp!)
Message-Id: <9ibo6.26555$Z8.4526724@typhoon.southeast.rr.com>
<rfield@best.com> wrote in message news:97rctd$2jtk$1@nntp1.ba.best.com...
>
> >TJ Pontious wrote:
> >>
> >> I have Perl 5.6.0 installed on Windows 2000 server, and the command
line
> >> runs scripts perfectly. However, when I submit a form from a web page,
it
> >> displays the perl script instead of running the script. Did I miss a
> >> setting I'm supposed to use somewhere in NT or IIS5 ?
> >>
> >> [Yes, I know that Win32 thing makes me the oddball in a Unix/Linux
world,
> >> but hey, somebody has to do it, right?] Thanks.
>
> Under Win32 a script is not a "first class object", you may need to wrap
> each and every script in its own executable wrapper. If your script is
> named "foo", you would have a "foo.exe" which, somewhere, would contain
> code somewhat like
>
> spawnv(P_WAIT, "\\somewhere\\perl.exe", arglist);
>
> where arglist is something like
>
> char * arglist [] = { "perl.exe", "foo.pl", <args from command line>, 0};
This is not necessary. ActivePerl will automatically associate itself with
.pl and .plx file extensions within IIS when it is installed on a server
running IIS. .pl files will be compiled every time, just like standard CGI.
.plx files remain resident via ISAPI. If you're not using ActivePerl, you
really should. If you installed IIS after ActivePerl, I'm pretty sure you
can go back to the ActivePerl*.msi installer and it will fix these things
for you.
Good luck,
Philip Garrett
------------------------------
Date: 3 Mar 2001 22:29:07 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Parsing with Parse::RecDescent
Message-Id: <slrn9a2s1j.n5f.abigail@tsathoggua.rlyeh.net>
Andrew Zhilenko (andrew@nextra.com) wrote on MMDCCXLI September MCMXCIII
in <URL:news:3AA12DFF.4CFFE8DD@nextra.com>:
)) Hello!
))
)) I'm trying tow rite a parser for orders for Atlantis (PBEM game).
)) Syntax is pretty simple: one line per command, each command
)) starts with name, followed by list of parameters. Basically it's
)) something like this (grammar for parsing one line):
))
)) Statement: Comment | Command Comment(?)
)) Comment: /;.*/
)) Command: '#atlantis' <commit> FactionID String
)) Command: 'attack' <commit> Number(s)
)) ....
))
)) However I have problems to make it work as I want:
))
)) 1) In case of failed parsing (syntax error, not allowey keyword, ...)
)) I want to store error messages in variable (not to be
)) just printed), so I can process them later.
I don't think Parse::RecDescent has a hook for that (Damian, something
for the todo list?), but you can always install a $SIG {__WARN__}
handler and process the generated warnings.
)) 2) In case if user types "attack bastards" I want to give him
)) error message that "list of numbers expected" instead
)) of just saying the "cannot parse this line". The only
)) thing that I came up with now was defining every command
)) like this:
)) Command: Attack
)) Attack: 'attack' AttackParams
)) AttackParams: Number(s) | <error>
)) ...
)) Any better solutions?
You can just do:
Command: '#atlantis' <commit> FactionID String
| 'attack' <commit> Number(s)
| <error>
and when you try to parse "attack bastards", you will get:
ERROR (line 1): Invalid Command: Was expecting Number but found
"bastards" instead
You might want to use <error?>, which will only print the error when
it saw '#atlantis' or 'attack' (because then you are committed).
Abigail
--
$_ = "\nrekcaH lreP rehtona tsuJ"; my $chop; $chop = sub {print chop; $chop};
$chop -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
-> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
------------------------------
Date: Sat, 3 Mar 2001 16:17:45 -0500
From: "Eduard Grinvald" <eg344@nyu.edu>
Subject: Perl Internals
Message-Id: <e9do6.12$K9.275@typhoon.nyu.edu>
Hello All!!
Is there any place where i can determine how perl internally represents data
types and objects. Mostly, i need to know the level of number precision and
how many bytes do references, ints, hashes, etc take up.
Thank You.
Eduard Grinvald
------------------------------
Date: Sat, 03 Mar 2001 22:47:36 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Perl Internals
Message-Id: <cweo6.7696$Ok4.1160170@news1.rdc1.ct.home.com>
Eduard Grinvald <eg344@nyu.edu> wrote:
> Hello All!!
> Is there any place where i can determine how perl internally represents data
> types and objects. Mostly, i need to know the level of number precision and
> how many bytes do references, ints, hashes, etc take up.
You can check out sv.h, av.h, and hv.h for the gory details. The general
answer to "how much memory" is "lots". Integral precision is generally
the number of bits your platform native float can hold (typically 53)
though in some case it's the number of bits the platform int can hold
(typically 31).
Scalars can range in size from 16 to severa hundred bytes not counting
string content size, arrays take up about 4 bytes per entry plus some
constant overhead (though perl often preallocates in larger chunks)
hashes take up 8 bytes per entry IIRC, but I may be off by 4 or so
bytes per entry. That also depends on how the hashing function
collides when hashing keys.
Dan
------------------------------
Date: Sat, 03 Mar 2001 20:01:19 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Perl/HP-UX - Odd $ENV Behavior
Message-Id: <j4co6.129$mU5.3761@eagle.america.net>
On Mon, 26 Feb 2001 19:33:38 -0700, Bill Border <bb22@uswest.net>
wrote:
>This is a multi-part message in MIME format.
Don't do this. Post in plain text.
> There is a server where I have seen some STRANGE behavior
>with what I would consider pretty basic environment setting logic.
[snip]
>$os =3D $ENV{"ORACLE_SID"};
>
>On most servers, this works OK. However, I
>have found a server where apparently the env
>does not get set by the $ENV{'ORACLE_SID'} =3D "SID1";
>and when I try the $os =3D $ENV{"ORACLE_SID"}; I get=20
>the error message:
>
>Can't locate object method "ENV" via package "ORACLE_SID" at =
>/opt/dbamon/bin/dbamon_ora_sumupdate.pl line 18.
You are not showing the actual code. The actual code has `ENV{...}'
instead of `$ENV{...}'.
>Huh??? What is happening. Could this be that the Perl on this server
>where it does not work does not recognize the $ENV associate array
>name for the ENV? I'm corn-fused.
Nope. Look at the line in the error message and correct it.
[snipped duplicate of entire post in HTML]
--
Garry Williams
------------------------------
Date: Sat, 03 Mar 2001 15:55:31 -0800
From: scott <scott@scott.com>
Subject: REVISED: Hash/array woes...
Message-Id: <3AA18473.851A44BF@scott.com>
I have an interesting problem (well, interesting to me!). :-)
Consider the following three columns plucked from a database
ID, CATEGORY, PARENT_ID
The ID is a unique alphanumeric key for each row, the CATEGORY is a
description or name of the entry, and the PARENT_ID represents the ID of
another row. The idea here is that each CATEGORY can have a parent
category, as denoted by the contents of the PARENT_ID field.
What I am trying to do is build an HTML select list using this data,
where the output might look like:
CATEGORY 1
Subcategory 1
Subcategory 2
Sub-Subcategory 1
Sub-Subcategory 2
CATEGORY 2
Subcategory 1
Subcategory 2
CATEGORY 3
CATEGORY 4
Above, categories 1 and 2 have subcategories associated with them, while
categories 3 and 4 have no child categories at all. Also, category 1's
subcategory 2 has 2 sub-subcategories. Basically, I want to have unlimited
levels of subcategories.
I have tried reading in the table into an array of hashes, and modifying
as such, but I think my brain is fried at this point. I need some fresh
eyes! I know there has to be a simple way to do this in perl ...
Thanks in advance to all those who respond.
Cheers.
Scott
------------------------------
Date: Sat, 3 Mar 2001 13:03:23 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: use strict;
Message-Id: <7205-3AA13FFB-126@storefull-242.iap.bryant.webtv.net>
> I don't think you can use "use strict" with > some modules, though...
such
> as CGI.pm.
> --Dennis
I retract that statement on the grounds it might disemminate me. :)
--Dennis
------------------------------
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 V10 Issue 408
**************************************