[25199] in Perl-Users-Digest
Perl-Users Digest, Issue: 7445 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 25 03:05:46 2004
Date: Thu, 25 Nov 2004 00:05:07 -0800 (PST)
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, 25 Nov 2004 Volume: 10 Number: 7445
Today's topics:
*HELP* please: how to dupe STDIN in an IO::Scalar? <jkrugman345@yahbitoo.com>
Re: *HELP* please: how to dupe STDIN in an IO::Scalar? <karlUNDERSCOREkramsch@yahooPERIODcom.invalid>
Re: Any RT users (Sara)
CGI.PM not setting HTTP header <nospam@thanksanyway.org>
Re: CGI.PM not setting HTTP header <toreau@gmail.com>
Re: CGI.PM not setting HTTP header <postmaster@castleamber.com>
FAQ 3.17: How can I make my Perl program take less memo <comdog@panix.com>
Help: separate difference length of spaces between wor <david@NoSpam.com>
Re: Help: separate difference length of spaces between <jkeen_via_google@yahoo.com>
Re: Help: separate difference length of spaces between <someone@example.com>
Re: Managing PERL5LIB with multiple perl installation <FILTERjvsSPAM@india.ti.com>
no acceptable C compiler (Marcus)
Re: no acceptable C compiler <tony_curtis32@yahoo.com>
Re: parent of an orphaned process madhav_a_kelkar@hotmail.com
Perl 6 <toreau@gmail.com>
Re: Perl 6 <postmaster@castleamber.com>
Re: Perl opendir with spaces in directory names <josef.moellers@fujitsu-siemens.com>
Perl Project (Ratnakar Pedagani)
Re: redirect question <matthew.garrish@sympatico.ca>
Re: redirect question <nospam@nospam.com>
Re: Using embedded PERL with commercial applications? <chppxf1@No_SPAMozemail.com.au>
Re: Using embedded PERL with commercial applications? (Patrick Finnegan)
YAHP - Ref to a hash via xml::simple prob. (Ian Pellew)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 25 Nov 2004 00:19:31 +0000 (UTC)
From: J Krugman <jkrugman345@yahbitoo.com>
Subject: *HELP* please: how to dupe STDIN in an IO::Scalar?
Message-Id: <co38ej$2ak$1@reader1.panix.com>
Please *HELP*!!! (I'm desperate. I can't leave the office and join
my family for the holiday until I get this to work. I'll be up
all night at best...)
I need to redirect STDIN so that it reads from a string. I tried
my $string = IO::Scalar->new(\"some string");
open(STDIN, "<&$string") || die "Duping didn't work\n";
which fails. I get the same bad results if I use IO::String instead
of IO::Scalar.
What am I doing wrong????????
TIA,
jill
--
To s&e^n]d me m~a}i]l r%e*m?o\v[e bit from my a|d)d:r{e:s]s.
------------------------------
Date: Thu, 25 Nov 2004 01:53:25 +0000 (UTC)
From: KKramsch <karlUNDERSCOREkramsch@yahooPERIODcom.invalid>
Subject: Re: *HELP* please: how to dupe STDIN in an IO::Scalar?
Message-Id: <co3dul$40p$1@reader1.panix.com>
In <co38ej$2ak$1@reader1.panix.com> J Krugman <jkrugman345@yahbitoo.com> writes:
>Please *HELP*!!! (I'm desperate. I can't leave the office and join
>my family for the holiday until I get this to work. I'll be up
>all night at best...)
>I need to redirect STDIN so that it reads from a string. I tried
> my $string = IO::Scalar->new(\"some string");
> open(STDIN, "<&$string") || die "Duping didn't work\n";
>which fails. I get the same bad results if I use IO::String instead
>of IO::Scalar.
>What am I doing wrong????????
I'll readily admit that I have no clue about what you're doing
wrong; file handles and globs belong to one of those areas where
I see very little difference between Perl and voodoo. The
documentation on this is piss-poor, because, after all, it's all
"*magic*". As the saying goes "always keep 'em guessin'".
Anyway, if you don't care so much about what's wrong with your
code, and just want something that works, try this:
tie *STDIN, 'IO::Scalar', \$string;
Hope you make it to Turkey Dinner.
Karl
--
Sent from a spam-bucket account; I check it once in a blue moon. If
you still want to e-mail me, cut out the extension from my address,
and make the obvious substitutions on what's left.
------------------------------
Date: 24 Nov 2004 21:07:09 -0800
From: sa_ravenone@yahoo.com (Sara)
Subject: Re: Any RT users
Message-Id: <8e3b2dfa.0411242107.5aa04b0d@posting.google.com>
> sa_ravenone@yahoo.com (Sara) wrote in message news:<8e3b2dfa.0411232111.4e57a436@posting.google.com>...
> > Hi all,
> > ...
> > I am looking for some help/pointers to get started with RT
> > customization (objects and HTML Mason).
>
Thanks to everyone.
I have now joined RT mailing list, but I'll be back here if I still
have Perl doubts which need clarification :-)
------------------------------
Date: Wed, 24 Nov 2004 21:12:45 -0800
From: "Mark" <nospam@thanksanyway.org>
Subject: CGI.PM not setting HTTP header
Message-Id: <uNydnZNf0cBb9DjcRVn-uA@speakeasy.net>
My Perl CGI script is producing valid HTML (as far as I can tell,)
but the server is returning a MIME type of 'text/plain'. I have tried
using the CGI.PM module to set the MIME type in the header,
but this merely adds a _second_ header to the output stream,
and this second header ends up displaying as text in the browser
window! The actual HTTp header is unaffected, still returning the
'text/plain' MIME type.
Any suggestions?
Thanks
-Mark
------------------------------
Date: Thu, 25 Nov 2004 07:10:38 +0100
From: Tore Aursand <toreau@gmail.com>
Subject: Re: CGI.PM not setting HTTP header
Message-Id: <pan.2004.11.25.06.10.38.802917@gmail.com>
On Wed, 24 Nov 2004 21:12:45 -0800, Mark wrote:
> My Perl CGI script is producing valid HTML (as far as I can tell,)
> but the server is returning a MIME type of 'text/plain'.
^^^^^^^^^^
Is the server written in Perl?
--
Tore Aursand <toreau@gmail.com>
"A car is not the only thing that can be recalled by its maker."
(Unknown)
------------------------------
Date: 25 Nov 2004 07:18:24 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: CGI.PM not setting HTTP header
Message-Id: <Xns95ACD4AA75B7castleamber@130.133.1.4>
Mark wrote:
> My Perl CGI script is producing valid HTML (as far as I can tell,)
Don't tell, check. Run your script from the CLI, or connect to the
webserver using telnet port 80. Nowadays you often have to include a host
header when you use telnet (since many virtual hosts share one ip)
> but the server is returning a MIME type of 'text/plain'.
Uhmmm... maybe the server is confused about the default "XHTML" header?
> I have tried
> using the CGI.PM module to set the MIME type in the header,
> but this merely adds a _second_ header to the output stream,
> and this second header ends up displaying as text in the browser
> window! The actual HTTp header is unaffected, still returning the
> 'text/plain' MIME type.
>
> Any suggestions?
Reduce your script to the bare minimum that shows this result, and post it
(in this thread, don't start a new one)
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Thu, 25 Nov 2004 05:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 3.17: How can I make my Perl program take less memory?
Message-Id: <co3p25$743$1@reader1.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
3.17: How can I make my Perl program take less memory?
When it comes to time-space tradeoffs, Perl nearly always prefers to
throw memory at a problem. Scalars in Perl use more memory than strings
in C, arrays take more than that, and hashes use even more. While
there's still a lot to be done, recent releases have been addressing
these issues. For example, as of 5.004, duplicate hash keys are shared
amongst all hashes using them, so require no reallocation.
In some cases, using substr() or vec() to simulate arrays can be highly
beneficial. For example, an array of a thousand booleans will take at
least 20,000 bytes of space, but it can be turned into one 125-byte bit
vector--a considerable memory savings. The standard Tie::SubstrHash
module can also help for certain types of data structure. If you're
working with specialist data structures (matrices, for instance) modules
that implement these in C may use less memory than equivalent Perl
modules.
Another thing to try is learning whether your Perl was compiled with the
system malloc or with Perl's builtin malloc. Whichever one it is, try
using the other one and see whether this makes a difference. Information
about malloc is in the INSTALL file in the source distribution. You can
find out whether you are using perl's malloc by typing "perl
-V:usemymalloc".
Of course, the best way to save memory is to not do anything to waste it
in the first place. Good programming practices can go a long way toward
this:
* Don't slurp!
Don't read an entire file into memory if you can process it line by
line. Or more concretely, use a loop like this:
#
# Good Idea
#
while (<FILE>) {
# ...
}
instead of this:
#
# Bad Idea
#
@data = <FILE>;
foreach (@data) {
# ...
}
When the files you're processing are small, it doesn't much matter
which way you do it, but it makes a huge difference when they start
getting larger.
* Use map and grep selectively
Remember that both map and grep expect a LIST argument, so doing
this:
@wanted = grep {/pattern/} <FILE>;
will cause the entire file to be slurped. For large files, it's
better to loop:
while (<FILE>) {
push(@wanted, $_) if /pattern/;
}
* Avoid unnecessary quotes and stringification
Don't quote large strings unless absolutely necessary:
my $copy = "$large_string";
makes 2 copies of $large_string (one for $copy and another for the
quotes), whereas
my $copy = $large_string;
only makes one copy.
Ditto for stringifying large arrays:
{
local $, = "\n";
print @big_array;
}
is much more memory-efficient than either
print join "\n", @big_array;
or
{
local $" = "\n";
print "@big_array";
}
* Pass by reference
Pass arrays and hashes by reference, not by value. For one thing,
it's the only way to pass multiple lists or hashes (or both) in a
single call/return. It also avoids creating a copy of all the
contents. This requires some judgment, however, because any changes
will be propagated back to the original data. If you really want to
mangle (er, modify) a copy, you'll have to sacrifice the memory
needed to make one.
* Tie large variables to disk.
For "big" data stores (i.e. ones that exceed available memory)
consider using one of the DB modules to store it on disk instead of
in RAM. This will incur a penalty in access time, but that's
probably better than causing your hard disk to thrash due to massive
swapping.
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: Wed, 24 Nov 2004 22:19:18 -0500
From: "Lei" <david@NoSpam.com>
Subject: Help: separate difference length of spaces between words
Message-Id: <co3ivn$3gq$1@zcars0v6.ca.nortel.com>
Greetings
I have a file "file.txt"which look like this:
aaaaaaa 11111 XXXX
bbbbb 222222 YYYYYY
....
The number of spaces between words are not fixed.
If I want to get $D = "first column word" $E = "second column word"
and discard the last word of the row.
Then continue get DATA from the second row.
What will be syntax be?
I am confused on how to use split and pattern in this case. Thanks a lot
------------------------------
Date: Thu, 25 Nov 2004 03:34:08 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: Help: separate difference length of spaces between words
Message-Id: <Qocpd.4948$356.296@trndny04>
Lei wrote:
> Greetings
>
> I have a file "file.txt"which look like this:
>
> aaaaaaa 11111 XXXX
> bbbbb 222222 YYYYYY
> ....
>
>
> The number of spaces between words are not fixed.
>
> If I want to get $D = "first column word" $E = "second column word"
> and discard the last word of the row.
>
> Then continue get DATA from the second row.
>
> What will be syntax be?
>
> I am confused on how to use split and pattern in this case. Thanks a lot
>
>
perldoc -f split
# rough code: untested
my (@data);
while (<FH>) {
my @temp = split(/\s+/, $_);
push(@data, [@temp[0..1]);
}
Jim Keenan
------------------------------
Date: Thu, 25 Nov 2004 07:13:57 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Help: separate difference length of spaces between words
Message-Id: <VCfpd.1668$VL6.630@clgrps13>
Lei wrote:
>
> I have a file "file.txt"which look like this:
>
> aaaaaaa 11111 XXXX
> bbbbb 222222 YYYYYY
> ....
>
>
> The number of spaces between words are not fixed.
>
> If I want to get $D = "first column word" $E = "second column word"
> and discard the last word of the row.
>
> Then continue get DATA from the second row.
>
> What will be syntax be?
>
> I am confused on how to use split and pattern in this case. Thanks a lot
Assuming that the current row is in $_ then:
my ( $D, $E ) = split;
Which is short for:
my ( $D, $E ) = split ' ', $_;
John
--
use Perl;
program
fulfillment
------------------------------
Date: 25 Nov 2004 06:40:19 GMT
From: Jahagirdar Vijayvithal S <FILTERjvsSPAM@india.ti.com>
Subject: Re: Managing PERL5LIB with multiple perl installation
Message-Id: <co3uoj$hgq$1@home.itg.ti.com>
* Ben Morrow <usenet@morrow.me.uk>:
>> I am not sure what an interlude is. can you please elaborate on it?
>
> A more usual (or perhaps simply more modern?) term would be 'shell
> script' or 'batch file', depending on OS.
>
> Ben
>
Thanks, shell scripts and wrappers I am familiar with.
Regards
Jahagirdar Vijayvithal S
------------------------------
Date: 24 Nov 2004 16:24:33 -0800
From: mygooglegroupsaccount@yahoo.com (Marcus)
Subject: no acceptable C compiler
Message-Id: <6fc26ca7.0411241624.6654863d@posting.google.com>
hi
when trying to install image::magick perl module I get the following:
error: no acceptable C compiler found in $PATH
what c compiler should I install on my server? is there a module?
thanks!
------------------------------
Date: Wed, 24 Nov 2004 18:25:59 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: no acceptable C compiler
Message-Id: <87653udbag.fsf@limey.hpcc.uh.edu>
>> On 24 Nov 2004 16:24:33 -0800,
>> mygooglegroupsaccount@yahoo.com (Marcus) said:
> hi when trying to install image::magick perl module I get
> the following:
> error: no acceptable C compiler found in $PATH
> what c compiler should I install on my server? is there a
> module?
You need to ask this question in a group related to your OS.
------------------------------
Date: 24 Nov 2004 22:04:22 -0800
From: madhav_a_kelkar@hotmail.com
Subject: Re: parent of an orphaned process
Message-Id: <338e571.0411242204.4192de62@posting.google.com>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<co1nur$5ea$1@mamenchi.zrz.TU-Berlin.DE>...
> <madhav_a_kelkar@hotmail.com> wrote in comp.lang.perl.misc:
> > hi all,
> >
> > i was doing the following program in perl
> >
> > #!/usr/bin/perl
> > 2
> > 3 main();
> > 4
> > 5 sub main
> > 6 {
> > 7 my $id;
> > 8 if(($id=fork())==0)
> > 9 {
> > 10 print("in child process, id=$$!\n");
> > 11 sleep 5;
> > 12 $i=getppid;
> > 13
> > 14
> > 15 if(kill 0,$i)
> > 16 {
> > 17 print("signal sent\n");
> > 18 }
> > 19 else
> > 20 {
> > 21 print("parent died pid=$i\n");
> > 22 }
> > 23
> > 24 exit;
> > 25 }
> > 26 else{
> > 27 print("parent terminated\n");
> > 28 exit(0);
> > 29 }
> >
> > note that i am taking the parent pid after the
> > parent has exited.
>
> You are taking it after sleeping for five seconds. Presumably the parent
> process had time to terminate, but we don't *know* this.
>
> > according to std unix idiom,
>
> Idioms are part of languages (including computer languages). What
> you are describing is the behavior of an OS, not an idiom.
>
> > the init process (with
> > pid =1) should be the parent of the orphaned child process in this
> > example. but when i executed the code, this was the output:
> >
> > [madhav@madhav perl]$ perl child.pl
> > in child process, id=13235!
> > parent terminated
> > [madhav@madhav perl]$ parent died pid=13234
> >
> > this indicates that the parent of the orphaned child process is not
> > the init process as it should be. please tell me what is means. i did
> > the same program in C and got the parent id as 1. cant it be the same
> > with perl?
>
> It is, for me. When I run your program, I see
>
> [anno4000@lublin ~/clpm]$ perl ttt
> parent terminated
> in child process, id=13690!
> [anno4000@lublin ~/clpm]$ parent died pid=1
>
>
*but it doesn't look like Perl is responsible.*
i have checked the parent of the process by running the ps -ax command
in another console while the child process was sleeping, and it is
reporting me that the parent of this process is indeed the init
process as it should be.
this was the output when i checked it again:
[madhav@madhav perl]$ perl child.pl
in child process, id=4256!
parent terminated
[madhav@madhav perl]$ parent died pid=4255
[root@madhav bin]# ps -lax | grep perl
1 1104 4256 1 21 0 5308 1376 schedu S pts/0 0:00
perl child.pl
0 0 4258 2341 15 0 3572 624 pipe_w S pts/2 0:00
grep perl
this clearly shows that the init has clearly became the parent of the
process.
------------------------------
Date: Thu, 25 Nov 2004 07:17:45 +0100
From: Tore Aursand <toreau@gmail.com>
Subject: Perl 6
Message-Id: <pan.2004.11.25.06.17.45.123779@gmail.com>
I found this image quite entertaining;
<http://otierney.net/images/perl6.gif>
Let's just hope it'll not become a reality. :)
--
Tore Aursand <toreau@gmail.com>
"It's not so much what you have to learn if you accept weird theories,
it's what you have to unlearn." (Isaac Asimov)
------------------------------
Date: 25 Nov 2004 07:18:55 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Perl 6
Message-Id: <Xns95ACD613843Bcastleamber@130.133.1.4>
Tore Aursand wrote:
> I found this image quite entertaining;
>
> <http://otierney.net/images/perl6.gif>
Yeah me too :-) ./;-)
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Thu, 25 Nov 2004 09:06:02 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Perl opendir with spaces in directory names
Message-Id: <co43kg$7uq$1@nntp.fujitsu-siemens.com>
JJ wrote:
> Hi all,
>=20
> I'm using opendir(dirhandle, expr), but perl seems te be unable to open=
the
> dir specified in the expr. My expression is "C:\\My Documents\\My
> Pictures\\". When I use C:\\Windows\\System32\\ it works fine, but I gu=
ess
> spaces aren't alowed here. How can I solve this problem without renamin=
g my
> directory?
What error message do you get ($!)?
I checked on a W2k machine and there wasn't a "C:\My Documents" folder,=20
there was a "C:\Documents and Settings\josef\My Documents\My Pictures",=20
though.
(Blimey! Here I am, answering a Windows question, maybe even answering=20
it. Sure hope no colleague reads this. B-{)
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: 25 Nov 2004 00:00:13 -0800
From: ratnakarp2002@yahoo.co.in (Ratnakar Pedagani)
Subject: Perl Project
Message-Id: <5b0601e5.0411250000.3016e2af@posting.google.com>
Hi,
I'm looking for a project in perl and oracle. This project should
focus on Internet database applications, such as technics for
improving response time, security, user-friendliness, and other
innovative ideas. Any help or references would be appreciated.
Thanks & Regards,
Ratnakar Pedagani.
------------------------------
Date: Wed, 24 Nov 2004 22:00:15 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: redirect question
Message-Id: <%Ubpd.38299$Ro.1651657@news20.bellglobal.com>
"daniel kaplan" <nospam@nospam.com> wrote in message
news:1101310668.166613@nntp.acecape.com...
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrncq8a10.516.tadmc@magna.augustmail.com...
>>
>>
>> LOL!
>
> talk about creating unnecessary noise in a group
>
Your wit continues to impress all. Please try and grow up a little now and
appreciate what a twat you're being.
Matt
------------------------------
Date: Thu, 25 Nov 2004 01:05:13 -0500
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: redirect question
Message-Id: <1101362801.519443@nntp.acecape.com>
"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message
news:%Ubpd.38299
> Your wit continues to impress all. Please try and grow up a little now and
> appreciate what a twat you're being.
>
> Matt
>
>
you see matt, while you continue to throw out "noise" posts that have zero
to do with the OP, i would recommend you look deeply at yourself to see who
needs to grow up...
speaking of twat, how is your mom doing? and what are her rates?
if you would like to conitnue throwing insults back and forth, my perosnal
email is T AB L E C L O C K at A O L dot C O M...if you insist to keep doing
it here, then we know who needs to grow up....since i am offering it to take
it offline, and away from anyone else....
------------------------------
Date: Thu, 25 Nov 2004 08:03:15 +0800
From: "Patrick" <chppxf1@No_SPAMozemail.com.au>
Subject: Re: Using embedded PERL with commercial applications?
Message-Id: <ij9pd.22$Mp6.1182@nnrp1.ozemail.com.au>
"Cameron Laird" <claird@lairds.us> wrote in message
news:0nee72-p48.ln1@lairds.us...
> In article <a1538a71.0411232156.69cbeabd@posting.google.com>,
> Patrick Finnegan <chppxf1@yahoo.com.au> wrote:
>>We just had a discussion in the Office about the use of embedded Perl
>>with commercial applications. Three of the server applications used
>>in the corporate environment, WebSphere, Control SA and Cisco
>>Networks, use Tcl or a Tcl derivative as the embedded scripting
>>interface. Is there a licensing limitation on the use of embedded
>>PERL with commercial applications?
>
> I'll answer a different question, leaving yours about licensing
> to others: Perl is *technically* more difficult to embed, and
> even more so in the past. Also, Tcl's event constructs and
> reduced syntax are handy for the supervisory applications Oracle,
> IBM, et al., require.
>
> I like your LDAP contributions, by the way.
Thanks for the complement.
The scripts are not particularly sophisticated but fully worked simple
examples are useful for beginners like most of the admins on our site who
work primarily in a Windows environment and have zeroish scripting
experience.
I checked out the Perl licensing issue with a contact at IBM. Perl is owned
by Larry Wall who deals with applications by Vendors to use embedded Perl in
commercial applications on a case by case basis. There is no guarantee that
future Perl distros will be "free" and there may be limits on the ability of
Vendors to write proprietary custom extensions for Perl and package those
extensions as part of a commercial application. These types of restrictions
don't seem to apply to other scripting languages such as Tcl and Python.
The IBM rep also acknowledged that since Java is owned by Sun there is no
guarantee that Java will never be a proprietary language.
------------------------------
Date: 24 Nov 2004 23:44:59 -0800
From: chppxf1@yahoo.com.au (Patrick Finnegan)
Subject: Re: Using embedded PERL with commercial applications?
Message-Id: <a1538a71.0411242344.6806e712@posting.google.com>
> I checked out the Perl licensing issue with a contact at IBM. Perl is owned
> by Larry Wall who deals with applications by Vendors to use embedded Perl in
> commercial applications on a case by case basis. There is no guarantee that
> future Perl distros will be "free" and there may be limits on the ability of
> Vendors to write proprietary custom extensions for Perl and package those
> extensions as part of a commercial application. These types of restrictions
> don't seem to apply to other scripting languages such as Tcl and Python.
>
> The IBM rep also acknowledged that since Java is owned by Sun there is no
> guarantee that Java will never be a proprietary language.
On second thoughts I think Python is maintained by Guido van Rossum.
------------------------------
Date: 24 Nov 2004 15:54:38 -0800
From: ipellew@pipemedia.co.uk (Ian Pellew)
Subject: YAHP - Ref to a hash via xml::simple prob.
Message-Id: <30875970.0411241554.5cc4f7ef@posting.google.com>
Hi all;
Yet another array/hash problem.
From this Google list this is a common problem that the Perlphiliacs
tell
us to perldoc whatever,
BUT
I am trying to get to grips with a fragment of an XMLin structure
which dumps to :-
{'Others...',
'our_tags' => { <=== $p
'idx_serno' => '10001',
'set' => [ <--- $$m
{ 'dscn' => 'Development set',
'serno' => [
{ 'value' => 'General Header',
'sdate' => '0310251502',
'name' => 'ph_',
'content' => '10003'
},
{ 'value' => 'Devs page footer',
'sdate' => '0310251502',
'name' => 'pt_',
'content' => '10004'
}
],
'content' => 1 <+++ Want to select set on this.
},
{ 'dscn' => 'Testers set',
'serno' => [
{ 'value' => 'Testers oage Header',
'sdate' => '0310251502',
'name' => 'ph_',
'content' => '10076'
},
{ 'value' => 'test footer',
'sdate' => '0310251502',
'name' => 'pt_',
'content' => '10104'
}
],
'content' => '2' <+++ Or this
}
]
}
};
I think I am right in saying this is a
our_tag=Hash # Ignoring idx_serno
Set=Array of Hashes
Serno=Array of Hashes
When I crack the ability to choose the key, values set from
{set->content=>$users_set}
then the rest of my problems will become clearer.
If I make {set} a hash by having only one set I have no problems
and can work out what I want, but the array Ummmm.
I am not keen to change XMLin as I have several other child tags of
'our_tags' all
running OK as these are all Hashes, besides, cracking this will give a
deeper insight
to a gang of hashes array mixers. Bit like being at a wild party.
Code fragments:-
my $p = XMLin(undef, keyattr=>[], forcearray=>0, normalisespace=>2);
my $m = \%$p->{our_tags}->{set};
Dumping $m shows both set->contents, but
Dumping $m->{set} shows
$VAR1 = { # HASH
'dscn' => 'Testers set',
'serno' => [ # Array
{ 'value' => 'Testers oage Header',
'sdate' => '0310251502',
'name' => 'ph_',
'content' => '10003' },
{ 'value' => 'test footer',
'sdate' => '0310251502',
'name' => 'pt_',
'content' => '10004' } ],
'content' => '2'};
Which is the second {set}, Only to be expected as this is probaly the
array
(list) thats in the Dumper buffer.
print ref($$m) . "\n"; # yeilds an ARRAY
How do I get something like:-
my $ls = $$m->{set}->???????? to give a reference to the array for set
1.
By tweeking XMLin $m drops nicely to
my $m = \%$p->{our_tags}->{set}->{1}->{serno}->{ph_}->{value}; #
Cheating.
Regards
Ian
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 7445
***************************************