From Peter at PSDT.com Wed Dec 1 15:56:05 2004 From: Peter at PSDT.com (Peter Scott) Date: Wed Dec 1 15:55:33 2004 Subject: [VPM] Perl Advent Calendar 2004 Message-ID: Festive Perl: >the 2004 version of the Perl Advent Calendar has come out: > >http://www.perladvent.org/2004/ > >This is one of the best ways to get to learn what CPAN modules are >*really* worthwhile. From plyuson at conceptsolutionsbc.com Thu Dec 2 17:54:46 2004 From: plyuson at conceptsolutionsbc.com (Philip Yuson) Date: Thu Dec 2 17:54:14 2004 Subject: [VPM] Help in reference Message-ID: <41AFAB46.9020807@conceptsolutionsbc.com> I am having a problem with a script. The script defines two instaces of a class ($o an $j of package parse) The parse package defines an array reference. For some reason, it defines the same reference address for both packages: Ex: package x_parse; sub new { ... } sub build { my $self = shift; my $a = (); return $a; } use strict; my $o = new x_parse; my $j = new x_parse; my $o_a = $o->build; my $j_a = $j->build; if you print $o_a and $j_a, they both have the same reference address: ex: ARRAY(0X94ce680) The build method is a lot complicated but I just shortened it. Is this a bug in Perl or is this a bug in my program? Thanks. -- ======================= Philip L. Yuson Senior Consultant Concept Solutions Corporation Phone: (250) 881-0049 Fax (250) 381-2425 From plyuson at conceptsolutionsbc.com Thu Dec 2 17:59:04 2004 From: plyuson at conceptsolutionsbc.com (Philip Yuson) Date: Thu Dec 2 17:58:27 2004 Subject: [VPM] Re: Help in reference In-Reply-To: <41AFAB46.9020807@conceptsolutionsbc.com> References: <41AFAB46.9020807@conceptsolutionsbc.com> Message-ID: <41AFAC48.4050201@conceptsolutionsbc.com> Sorry, build is: sub build { my $self = shift; my $a = []; # <-- This changed return $a; } Philip Yuson wrote: > I am having a problem with a script. > > The script defines two instaces of a class ($o an $j of package parse) > > The parse package defines an array reference. For some reason, it > defines the same reference address for both packages: > > Ex: > > package x_parse; > > sub new { > ... > } > > sub build { > my $self = shift; > my $a = (); > return $a; > } > > > > use strict; > > my $o = new x_parse; > my $j = new x_parse; > > my $o_a = $o->build; > my $j_a = $j->build; > > if you print $o_a and $j_a, they both have the same reference address: > ex: ARRAY(0X94ce680) > > The build method is a lot complicated but I just shortened it. > > Is this a bug in Perl or is this a bug in my program? > > Thanks. > > -- ======================= Philip L. Yuson Senior Consultant Concept Solutions Corporation Phone: (250) 881-0049 Fax (250) 381-2425 From darren at DarrenDuncan.net Thu Dec 2 19:32:47 2004 From: darren at DarrenDuncan.net (Darren Duncan) Date: Thu Dec 2 19:46:56 2004 Subject: [VPM] Help in reference In-Reply-To: <41AFAB46.9020807@conceptsolutionsbc.com> Message-ID: On Thu, 2 Dec 2004, Philip Yuson wrote: > I am having a problem with a script. > The script defines two instaces of a class ($o an $j of package parse) > The parse package defines an array reference. For some reason, it > defines the same reference address for both packages: > > sub build { > my $self = shift; > my $a = []; > return $a; > } > > my $o_a = $o->build; > my $j_a = $j->build; > > if you print $o_a and $j_a, they both have the same reference address: > ex: ARRAY(0X94ce680) > > The build method is a lot complicated but I just shortened it. > > Is this a bug in Perl or is this a bug in my program? Does this bug still occur in your shortened version? If it does, then... Try renaming $a to something else. The names $a and $b have special meanings to Perl, like $_ does, though possibly only in certain contexts like explicit sorting. See if it works with a name like $foo instead of $a. -- Darren Duncan From Peter at PSDT.com Fri Dec 3 13:18:56 2004 From: Peter at PSDT.com (Peter Scott) Date: Fri Dec 3 13:18:27 2004 Subject: [VPM] Help in reference In-Reply-To: References: Message-ID: At 5:32 PM -0800 12/2/04, Darren Duncan wrote: >On Thu, 2 Dec 2004, Philip Yuson wrote: >> I am having a problem with a script. >> The script defines two instaces of a class ($o an $j of package parse) >> The parse package defines an array reference. For some reason, it >> defines the same reference address for both packages: >> >> sub build { >> my $self = shift; >> my $a = []; >> return $a; >> } >> >> my $o_a = $o->build; >> my $j_a = $j->build; >> >> if you print $o_a and $j_a, they both have the same reference address: >> ex: ARRAY(0X94ce680) >> >> The build method is a lot complicated but I just shortened it. >> >> Is this a bug in Perl or is this a bug in my program? > >Does this bug still occur in your shortened version? If it does, >then... > >Try renaming $a to >something else. The names $a and $b have special meanings to Perl, like >$_ does, though possibly only in certain contexts like explicit sorting. >See if it works with a name like $foo instead of $a. The way it's written that isn't going to make any difference. Something got changed in the process of summarizing the problem for the list, 'cos what's shown can't cause the problem and I really doubt it's a bug in Perl. We need to see the shortest version of the code that actually demonstrates the problem. From plyuson at conceptsolutionsbc.com Fri Dec 3 14:55:35 2004 From: plyuson at conceptsolutionsbc.com (Philip Yuson) Date: Fri Dec 3 14:55:03 2004 Subject: [VPM] Help in reference In-Reply-To: References: Message-ID: <41B0D2C7.9020906@conceptsolutionsbc.com> I've found the problem, it is with the program itself. Thanks for your help... Peter Scott wrote: > At 5:32 PM -0800 12/2/04, Darren Duncan wrote: > >> On Thu, 2 Dec 2004, Philip Yuson wrote: >> >>> I am having a problem with a script. >>> The script defines two instaces of a class ($o an $j of package parse) >>> The parse package defines an array reference. For some reason, it >>> defines the same reference address for both packages: >>> >>> sub build { >>> my $self = shift; >>> my $a = []; >>> return $a; >>> } >>> >>> my $o_a = $o->build; >>> my $j_a = $j->build; >>> >>> if you print $o_a and $j_a, they both have the same reference address: >>> ex: ARRAY(0X94ce680) >>> >>> The build method is a lot complicated but I just shortened it. >>> >>> Is this a bug in Perl or is this a bug in my program? >> >> >> Does this bug still occur in your shortened version? If it does, >> then... >> >> Try renaming $a to >> something else. The names $a and $b have special meanings to Perl, like >> $_ does, though possibly only in certain contexts like explicit sorting. >> See if it works with a name like $foo instead of $a. > > > The way it's written that isn't going to make any difference. Something > got changed in the process of summarizing the problem for the list, 'cos > what's shown can't cause the problem and I really doubt it's a bug in Perl. > > We need to see the shortest version of the code that actually > demonstrates the problem. -- ======================= Philip L. Yuson Senior Consultant Concept Solutions Corporation Phone: (250) 881-0049 Fax (250) 381-2425 From darren at DarrenDuncan.net Sun Dec 5 20:36:21 2004 From: darren at DarrenDuncan.net (Darren Duncan) Date: Tue Dec 7 11:48:29 2004 Subject: [VPM] I'm hiring programmers for new high-impact project Message-ID: I'm planning to launch a new business by the end of February that develops its own new software applications and libraries for the mass market; around that time, I would like to hire several programmers to help this venture succeed (up until that time, I will be going it alone). For all around simplicity and fairness, I plan that all the early hires will be done on a contract basis, and paid by the hour at negotiable rates; I will have them when I need them, which can often be full time, and they will be free to do other projects on the side. Please contact me asap if my venture is something you have any amount of interest in working for (more details are below). While I won't be making any final decisions now, I would like to get to know any applicants better before bringing them in, and the intermediate few months should provide opportunities for that. Some desirable traits in applicants are also listed below. My new business venture is the culmination of about 6+ years of planning and design work plus research that I have been doing to date. I have a strong interest in the relevant subject matters and the real-world needs which this business and its products will serve; I will be doing whatever it takes (that remains ethical) to see that this venture succeeds, and continues to last for a long time. The core product of this new business is a system for managing and preserving all kinds of data in a way that is highly accurate and readily adaptable to changing times and circumstances, over a long period. One of the main goals is to empower people of today to keep records in such a fashion that they can be fully and un-ambiguously understood later on, whether in 5 years or 5000 years, despite the inevitable changes to a society's living context that lead them to make different assumptions than we do today, and despite the inevitable disasters that can wipe out civilizations or historical records alike. Similarly, this system should be a huge improvement over the tools that people have today for assembling and verifying the various patch-work of records we have about those people that came before us. The system is also not limited to handling records about people, but about anything else, such as natural history or scientific methods and discoveries. It can also handle not only large events but daily minutae such as inventory or financial transactions. The core product is technically a "database engine", but working on it or with it should not be boring or same-old by any means. The product core is a library that implements a particular database schema and takes care of issues such as internal consistency, security, and auditing. It is implemented as a layer on top of a traditional SQL database; users can typically chose any back-end database that they want, or one will be provided by default that hides any gory details behind the veneer of a typical point-and-click application. Said library is a platform upon which various user interface or bridge applications or plug-ins can be built, some of which I/we will provide, and others that can be made by third parties to solve particular needs. The whole system is designed to be portable and will run on any commonly used operating system. The system is also simultaneous-multi-user from the ground up. One of the main initial user groups of this application will be genealogists of all stripes, though it is the professionals that should be especially interested in what I bring to the table. My system will compete with the dozens of existing genealogy applications by being a lot more functional they are, but just as easy to use, providing all functionality they do plus a lot more that they couldn't hope to do without being rebuilt from scratch; it does this without being bloated. My prototype of this system is written in Perl 5, some parts of which are relatively generic and released free on CPAN (mainly the database portability ensuring components), and some parts of which will remain proprietary. While a few early customers may get this prototype version in exchange for valuable feedback, I plan to rewrite the system with the help of extra developers, using other tools, prior to it being released on the mass market. My current plan is to target the new bleeding edge Parrot virtual machine (http://www.parrotcode.org/) with the final version, which will be distributed mainly as Parrot bytecode. Parrot is the host for the new Perl 6 language, but many other languages target it too (and they can all talk to each other easily). I expect that all software dependencies of my core product will be Free (as in "liberty") and Open Source Software, so that we avoid being left high and dry like a share-cropper on the whims of some other vendor. These are some traits I find desirable in someone I would hire (there are many more, not listed); not all are essential: - Someone who enjoys writing software and does it in their spare time for fun; not someone whose sole reason to code is to earn a living. - Someone who has completed a formal education in writing software, such as from a college or university. - Someone who is good enough at writing software that they have been paid to do it, and a reasonable customer/client would be happy with the result. - Someone who has an eye to making their software components in an easily reusable fashion, such as by using functions or libraries or classes. - Someone who normally writes software in such a way that it can be easily maintained by most other people skilled in the art. - Someone that has worked in a team to develop software, and contributed to the team's success in making a working and maintainable product. - Someone who has good general written and verbal communication skills. - Someone who is good at listening to others. - Someone who is skilled in using the internet to communicate with others and to look up information. - Someone who can take the initiative and suggest logical improvements. - Someone who regularly makes self-documenting code and use consistent code styles. - Someone who is skilled at documenting and testing their software, or that of other people. - Someone who is comfortable with and/or prefers object-oriented design. - Someone who is experienced with SQL databases and knows about good database design, including how to normalize a schema. - Someone who understands the basics of how their computer hardware works and what the main parts are (especially inside the enclosures). - Someone who knows the basics of how computer operating systems work. - Someone who knows about the common issues concerned with multi-process and multi-threaded applications. - Someone who has considerable experience with multiple families of computer operating systems, including Macintosh, Windows, and Linux. - Someone who isn't in Microsoft's pocket. - Someone who knows good human computer interface design and makes applications with a good end-user experience in mind; especially applications that can be explored easily and used for basic tasks without the user having to look at a manual. - Someone who makes applications that have reasonable default settings, and doing simple or common tasks is quick and easy to a user, and where only complicated and uncommon tasks may require considerable user work. - Someone who designs applications with a foremost thought to reliability and security, that have safety mechanisms to isolate any small problems before they turn into big problems, and that expose the user's data to as little risk of loss as possible. - Someone who has worked on large applications and/or databases. - Someone who has used multiple vendors of SQL databases and/or non-SQL databases. - Someone who understands how to write effective SQL. - Someone who is proficient in multiple programming languages, both those that are statically typed and dynamically typed; someone who could learn and apply new languages easily. - Someone who is proficient with Perl 5. - Someone who enjoys using Perl, and promotes it to others. - Someone who is experienced with C. - Someone who is experienced with assembly languages, either hardware or virtual machine. - Someone who has used and/or studied Parrot. - Someone who is interested in the Parrot project and wants to work with it closely. - Someone who has written web-based applications, either as CGI or non-CGI programs. - Someone who has used multiple families of web servers, especially Apache. - Someone who has used multiple families of web browsers. - Someone who understands current web standards such as XHTML and CSS, and can write them by hand. - Someone who has written non-web GUI applications. - Someone who is experienced in windowing tool kits, such as TK. - Someone who has written command-line applications. - Someone who knows how to debug an application or library, both with an IDE debugger and without one. - Someone who has written image or graphic generating code, or graphical chart generating code. Even better if proficient with it. - Someone who appreciates free and open source software (FOSS), as well as their developer communities. - Someone who has written and released free software. - Someone who has a general interest in preservation or archiving or research or genealogy or science or education or data accuracy, etc. - Someone who has a working knowledge or fluency in a non-English human language, written and/or spoken. - Someone who cares about the well-being of others, and the world. - Someone who is open to learning or trying new things, and actively seeks out new knowledge and experiences. - Someone who is willing to search in books or the internet for answers to things they don't know. - Someone who is willing to ask for help from other people, rather than letting their pride keep them stumbling along on their own. - Someone who doesn't give up when there are setbacks. - Someone who lives in and/or can easily travel to the greater Victoria area on a daily basis. From darren at DarrenDuncan.net Mon Dec 6 19:58:28 2004 From: darren at DarrenDuncan.net (Darren Duncan) Date: Tue Dec 7 11:48:55 2004 Subject: [VPM] test message Message-ID: my previous message to VPM, about my wanting to hire people, didn't appear to come through - seeing if this one does -- Darren Duncan From Peter at PSDT.com Mon Dec 6 20:44:28 2004 From: Peter at PSDT.com (Peter Scott) Date: Tue Dec 7 11:48:55 2004 Subject: [VPM] Testing Message-ID: <6.1.2.0.2.20041206184255.02e99f68@shell2.webquarry.com> There seem to have been some problems with the list recently - Mark told me that a message I sent last week showed up dozens of times for him (I only saw it once) and Darren said he just posted two messages that didn't show up for him (or me). Lert's see if this gets through. ObVPMContent: The December meeting is cancelled. Happy Holidays. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ *** New! *** http://www.perlmedic.com/ From darren at DarrenDuncan.net Tue Dec 7 13:37:29 2004 From: darren at DarrenDuncan.net (Darren Duncan) Date: Tue Dec 7 13:52:59 2004 Subject: [VPM] Testing In-Reply-To: <6.1.2.0.2.20041206184255.02e99f68@shell2.webquarry.com> Message-ID: On Mon, 6 Dec 2004, Peter Scott wrote: > There seem to have been some problems with the list recently - Mark > told me that a message I sent last week showed up dozens of times for > him (I only saw it once) and Darren said he just posted two messages > that didn't show up for him (or me). Lert's see if this gets through. > ObVPMContent: The December meeting is cancelled. Happy Holidays. I received this message, and also my two previous postings came through just before it. -- Darren Duncan From plyuson at conceptsolutionsbc.com Wed Dec 8 14:12:37 2004 From: plyuson at conceptsolutionsbc.com (Philip Yuson) Date: Wed Dec 8 14:12:05 2004 Subject: [VPM] Comparing XML File Message-ID: <41B76035.6070205@conceptsolutionsbc.com> Anyone knows of a script that compares 2 xml files The tags will be in a different order. Thanks. -- ======================= Philip L. Yuson Senior Consultant Concept Solutions Corporation Phone: (250) 881-0049 Fax (250) 381-2425 From abez at abez.ca Wed Dec 8 14:36:02 2004 From: abez at abez.ca (abez) Date: Wed Dec 8 14:36:44 2004 Subject: [VPM] Comparing XML File In-Reply-To: <41B76035.6070205@conceptsolutionsbc.com> Message-ID: Parse the XML into a tree composed of arrays (because you have more than one subelement of the same type). Since I can't care less about XML I'll discuss the algorithm. You want to see if a is in b and b is in a (therefore they are equal). Foreach element in a that element should exist in b. You have a problem that references will not be equal. This is actually a graph isomorphism problem on a tree. Graph Isomorphisms tests are generally believed to be NP (Non-Polynomial Time (aka they take a LONG TIME to compute)). I would've rather written this in ML :( There are probably cases where the tests fail, and if you parsed XML you'd probably want to enforce the first element of the array be the tag name. my ($a,$b,$c) = qw(a b c); #true print isEqual( [ [qw(a b c)], [$a,[$b],$c], [[$a],$b,$c], [[[$a],$b],$c] ], [ [[$a],$b,$c], [[$b],$a,$c], [$c,[$b,[$a]]], [qw(a b c)], ] ),$/; #true print isEqual( [ [ [ [$a,$b], [$a,$b], [$a,$b], ] ], ], [ [ [ [$b,$a], [$b,$a], [$b,$a], ] ], ] ),$/; #false print isEqual( [ [ [ [$a,$b], [$a,$b], [$a,$b], ] ], ], [ [ [ [$b,$a], [$b,$a], ] ], ] ),$/; #false print isEqual( [ [ [ [$a,$b],[$c,$b],[$a,$b] ] ], ], [ [ [ [$b,$a],[$c,$a],[$b,$a] ] ], ] ),$/; #false print isEqual( [ [qw(a b c)], [qw(a b c)], [$a,[$b],$c], [[$a],$b,$c], [[[$a],$b],$c] ], [ [[$a],$b,$c], [[$b],$a,$c], [$c,[$b,[$a]]], [qw(a b c)], ] ),$/; sub isEqual { my ($a,$b) = @_; return contains($a,$b) && contains($b,$a); } sub notRefTest { my ($e,$list) = @_; foreach my $elm (@$list) { if ($elm eq $e) { return 1; } } return 0; } sub refTest { my ($ref,$list) = @_; foreach my $elm (@$list) { if (ref($elm) eq 'ARRAY') { if (contains($ref,$elm) && contains($elm,$ref)) { return 1; } } } return 0; } sub contains { my ($arra,$arrb) = @_; if (@$arra != @$arrb) { return 0; } foreach my $elm (@$arra) { my $ret = 0; if (ref($elm) eq 'ARRAY') { $ret = refTest($elm,$arrb); } else { $ret = notRefTest($elm,$arrb); } if (!$ret) { return 0; } } return 1; } On Wed, 8 Dec 2004, Philip Yuson wrote: > Anyone knows of a script that compares 2 xml files > The tags will be in a different order. > > Thanks. > > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From Peter at PSDT.com Wed Dec 8 14:50:27 2004 From: Peter at PSDT.com (Peter Scott) Date: Wed Dec 8 14:50:39 2004 Subject: [VPM] Comparing XML File In-Reply-To: References: <41B76035.6070205@conceptsolutionsbc.com> Message-ID: <6.1.2.0.2.20041208124645.0300a628@shell2.webquarry.com> At 12:36 PM 12/8/2004, abez wrote: >Parse the XML into a tree composed of arrays (because you have more than >one subelement of the same type). Since I can't care less about XML I'll >discuss the algorithm. > >You want to see if a is in b and b is in a (therefore they are equal). >Foreach element in a that element should exist in b. You have a problem >that references will not be equal. > >This is actually a graph isomorphism problem on a tree. Graph >Isomorphisms tests are generally believed to be NP (Non-Polynomial Time >(aka they take a LONG TIME to compute)). I would've rather written this >in ML :( [snip] >On Wed, 8 Dec 2004, Philip Yuson wrote: > > > Anyone knows of a script that compares 2 xml files > > The tags will be in a different order. Maybe I'm missing something, but this sounds more like a problem of converting the input to a canonical form with the tags in a sorted order and stringwise comparing serializations. I don't feel like plowing through the massive XML corpus on CPAN right now but there's got to be something there that would make that reasonably easy. There's XML::Canonical, but I don't know about the tag sorting. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ *** New! *** http://www.perlmedic.com/ From semaphore_2000 at yahoo.com Wed Dec 8 15:05:04 2004 From: semaphore_2000 at yahoo.com (Doug Snead) Date: Wed Dec 8 15:05:10 2004 Subject: [VPM] Comparing XML Files - XML::Simple is your friend In-Reply-To: Message-ID: <20041208210504.15750.qmail@web40908.mail.yahoo.com> --- abez wrote: > Parse the XML into a tree composed of arrays (because you > have more than one subelement of the same type). You might look at XML::Simple to slurp the xml into perl hashes/arrays for you. Try something like this on your XML, first. dumpxml.pl : #!/usr/bin/perl use XML::Simple; use LWP::Simple; use Data::Dumper; my $x0 = XMLIn(get($ARGV[0])); print Dumper($x0); Now test this on one of your XML files. $ perl dumpxml.pl file:something.xml | less That will give you a fast peek at how well XML::Simple can parse your particular XML. It should then also be (more) obvious how write a perl script to navigate and compare the trees. You'll get hashes of arrays, and arrays of hashes. So to compare two files you might try something like this. #!/usr/bin/perl use XML::Simple; use LWP::Simple; use Data::Dumper; my $x0 = XMLIn(get($ARGV[0])); my $x1 = XMLIn(get($ARGV[1])); # compare trees in $x1 and $x2 here : ... Hope that helps some. If you get stuck email small sample xml files to be compared and I'll take a look. Doug __________________________________ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 From jeremygwa at hotmail.com Wed Dec 8 16:32:23 2004 From: jeremygwa at hotmail.com (Jeremy Aiyadurai) Date: Wed Dec 8 16:33:21 2004 Subject: [VPM] Disable network source/dest. ports via perl....(a simple firewall) In-Reply-To: <41B76035.6070205@conceptsolutionsbc.com> Message-ID: hello all how do i prevent an application from connecting to the net. eg. suppose i want to prevent Internet Explorer from accessing the net. how do i block the ports that programs use, via perl. I am looking for a windows compatible solution. Thanks in advance for all your help -Jeremy A. From semaphore_2000 at yahoo.com Wed Dec 8 17:45:26 2004 From: semaphore_2000 at yahoo.com (Doug Snead) Date: Wed Dec 8 17:45:33 2004 Subject: [VPM] Disable network source/dest. ports via perl....(a simple firewall) In-Reply-To: Message-ID: <20041208234526.69541.qmail@web40910.mail.yahoo.com> --- Jeremy Aiyadurai wrote: > how do i prevent an application from connecting to the net. > eg. suppose i want to prevent Internet Explorer from > accessing the net. how do i block the ports that > programs use, via perl. I am looking for a windows > compatible solution. Hmmm ... Windows has a firewall API you might be able to access that would let you block ports under program control (this is what a firewall should let you do). http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ics/ics/about_windows_firewall.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ics/ics/windows_firewall_interfaces.asp And from perl ... In theory, you could access the windows firewall API, from perl using the Win32::API Win32 Perl extension. http://search.cpan.org/~acalpini/Win32-API-0.41/API.pm Not sure which Windows perl that is for (or if it matters which). I like the perl you may install with cygwin http://www.cygwin.com/ Win32::API::Prototype is a wrapper around Win32::API that is said to be easier to use. This one seems to use ActivePerl: http://www.roth.net/perl/prototype/ So, one way may be to poke around some and see how you can access the Windows firewall API from perl via Win32::API. Then you should be able to selectively block ports, including any ports that IE may be using. Doug __________________________________ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 From plyuson at conceptsolutionsbc.com Wed Dec 8 19:24:59 2004 From: plyuson at conceptsolutionsbc.com (Philip Yuson) Date: Wed Dec 8 19:24:23 2004 Subject: [VPM] Comparing XML Files - XML::Simple is your friend In-Reply-To: <20041208210504.15750.qmail@web40908.mail.yahoo.com> References: <20041208210504.15750.qmail@web40908.mail.yahoo.com> Message-ID: <41B7A96B.6000309@conceptsolutionsbc.com> Thanks for the inputs. I've finally decided to fix my own script and it is working fine. One question though. Attached is the script that extracts an XML file to a Perl hash->array->hash->array... object. The script actually parses two XML files (jrep and ora) Ran independently, the resulting object is correct. Ran together, seems like the object in jrep is attached to the object in ora. use xml_parse; my $oxml; my $jxml; my ($jrep, $orac) = (1, 1); if ($jrep) { open (JRE, "perl xml_jreport.pl jxml/$ARGV[0]\.txt | ") or die ("Cannot open jreport.pl"); while () { $jxml .= $_; } print '*'x50 . "JREPORTS\n"; print "$jxml\n"; close (JRE); my $jp = new xml_parse(debug=> 0); my $jbld = $jp->build($jxml); print_hash($jbld, 1); $jp = undef; $jbld = undef; } if ($orac) { open (ORA, "perl xml_oracle.pl oxml/$ARGV[0]\.xml | ") or die ("Cannot open oracle.pl"); while () { $oxml .= $_; } close (ORA); print '*'x50 . "ORACLE\n"; print "$oxml\n"; my $op = new xml_parse(debug=> 0); my $obld = $op->build($oxml); print_hash($obld, 1); $obld = undef; $op = undef; } print "ORACLE OBJECT: " . \%oracle . "\nJREPORT OBJECT: " . \%jrep . "\n"; sub print_array { my @array = @{$_[0]}; my $count = $_[1]; $count++; foreach (@array) { for (my $x = $count; $x > 1; $x--) { print "\t"; } print "Array: $count: $_" . ref($_) . "\n"; if (ref($_) eq 'HASH') { print_hash($_, $count); } } } sub print_hash { my %hash = %{$_[0]}; my $count = $_[1]; $count++; # print "$_[0]\n"; foreach (sort keys %hash) { next if ($_ eq 'prev'); for (my $x = $count; $x > 1; $x--) { print "\t"; } print "HASH: $count: KEY: $_ => $hash{$_}" . ref($hash{$_}) . "\n"; if (ref($hash{$_} ) eq 'ARRAY') { print_array($hash{$_}, $count); } elsif (ref($hash{$_} ) eq 'HASH') { print_hash($hash{$_}, $count); } } } If run independently jre and ora have this each: hash array hash hash hash array hash hash hash But run together it shows: hash array hash hash hash array hash hash hash array hash hash hash array hash hash hash hash <- other hash is included array hash hash hash array hash hash hash Thanks again. -- ======================= Philip L. Yuson Senior Consultant Concept Solutions Corporation Phone: (250) 881-0049 Fax (250) 381-2425 From Peter at PSDT.com Fri Dec 17 11:13:23 2004 From: Peter at PSDT.com (Peter Scott) Date: Fri Dec 17 11:13:55 2004 Subject: [VPM] Please save victoria.pm Message-ID: <6.1.2.0.2.20041217091106.01fe6318@shell2.webquarry.com> We're hosted there (i.e., http://victoria.pm.org/) and have the usual two mailing lists (AFAIK no one uses the digest form, so really just the one: victoria-pm@pm.org). Cc: to victoria.pm for information (mainly Darren's at that); VPM members please remove user_groups@pm.org if you reply. > -----Original Message----- > From: pm_groups-bounces@mail.pm.org > [mailto:pm_groups-bounces@mail.pm.org] On Behalf Of Dave Cross > Sent: Friday, December 17, 2004 10:03 AM > To: pm_groups@pm.org > Subject: [pm_groups] pm.org hosting changes > > For several years, the pm.org server has been hosted for free > by Rackspace and we're very grateful to them for the help > they've given us. > Unfortunately, that free service will be ending very early > next year and the pm.org server will be moving elsewhere. > > As part of the move we are going to have to scale down the > level of service that we provide for Perl Monger local > groups. Once the new server is established we will provide > the following for free: > > * Web sites with static content only. > * FTP and/or WebDAV access to maintain web sites. > * Mailing lists. > * DNS > > The major changes will be that no dynamic content will be > allowed and no group leaders will have shell access to the > server. We're sorry that we have to put this restrictions in > place, but the internet is a very different place to what is > was when we set the service up many years ago. If you want to > host your site on a less restrictive server that you have > more control over then we are, as always, happy to point the > DNS records at another server. > > Also, I'm concerned about the large number of dead groups > that we are hosting on the server. This is a particular > problem given the amount of spam that is sent to mailing > lists. As a result of this, we'll only be moving over web > sites and mailing lists if they are specifically requested. > > If you want your web site and/or mailing moved to the new > server, then please send an email with the subject 'Please > save [xxx].pm' (replacing [xxx] with the name of your group) > to user_groups@pm.org. Within the email, please list the url > of your site and the name of your mailing list(s). > > If you want your DNS pointed to another server, then please > send details of the change to support@pm.org. > > PLEASE DON'T SEND THESE REQUESTS BACK TO THIS LIST. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ *** New! *** http://www.perlmedic.com/ From plyuson at conceptsolutionsbc.com Fri Dec 17 12:01:30 2004 From: plyuson at conceptsolutionsbc.com (Philip Yuson) Date: Fri Dec 17 12:01:05 2004 Subject: [VPM] Please save victoria.pm In-Reply-To: <6.1.2.0.2.20041217091106.01fe6318@shell2.webquarry.com> References: <6.1.2.0.2.20041217091106.01fe6318@shell2.webquarry.com> Message-ID: <41C31EFA.3040103@conceptsolutionsbc.com> So Peter, How can we help? Peter Scott wrote: > We're hosted there (i.e., http://victoria.pm.org/) and have the usual > two mailing lists (AFAIK no one uses the digest form, so really just the > one: victoria-pm@pm.org). > > Cc: to victoria.pm for information (mainly Darren's at that); VPM > members please remove user_groups@pm.org if you reply. > > > -----Original Message----- > > From: pm_groups-bounces@mail.pm.org > > [mailto:pm_groups-bounces@mail.pm.org] On Behalf Of Dave Cross > > Sent: Friday, December 17, 2004 10:03 AM > > To: pm_groups@pm.org > > Subject: [pm_groups] pm.org hosting changes > > > > For several years, the pm.org server has been hosted for free > > by Rackspace and we're very grateful to them for the help > > they've given us. > > Unfortunately, that free service will be ending very early > > next year and the pm.org server will be moving elsewhere. > > > > As part of the move we are going to have to scale down the > > level of service that we provide for Perl Monger local > > groups. Once the new server is established we will provide > > the following for free: > > > > * Web sites with static content only. > > * FTP and/or WebDAV access to maintain web sites. > > * Mailing lists. > > * DNS > > > > The major changes will be that no dynamic content will be > > allowed and no group leaders will have shell access to the > > server. We're sorry that we have to put this restrictions in > > place, but the internet is a very different place to what is > > was when we set the service up many years ago. If you want to > > host your site on a less restrictive server that you have > > more control over then we are, as always, happy to point the > > DNS records at another server. > > > > Also, I'm concerned about the large number of dead groups > > that we are hosting on the server. This is a particular > > problem given the amount of spam that is sent to mailing > > lists. As a result of this, we'll only be moving over web > > sites and mailing lists if they are specifically requested. > > > > If you want your web site and/or mailing moved to the new > > server, then please send an email with the subject 'Please > > save [xxx].pm' (replacing [xxx] with the name of your group) > > to user_groups@pm.org. Within the email, please list the url > > of your site and the name of your mailing list(s). > > > > If you want your DNS pointed to another server, then please > > send details of the change to support@pm.org. > > > > PLEASE DON'T SEND THESE REQUESTS BACK TO THIS LIST. -- ======================= Philip L. Yuson Senior Consultant Concept Solutions Corporation Phone: (250) 881-0049 Fax (250) 381-2425 From Peter at PSDT.com Fri Dec 17 12:42:42 2004 From: Peter at PSDT.com (Peter Scott) Date: Fri Dec 17 12:43:00 2004 Subject: [VPM] Please save victoria.pm In-Reply-To: <41C31EFA.3040103@conceptsolutionsbc.com> References: <6.1.2.0.2.20041217091106.01fe6318@shell2.webquarry.com> <41C31EFA.3040103@conceptsolutionsbc.com> Message-ID: <6.1.2.0.2.20041217104135.01fe6318@shell2.webquarry.com> I don't think there's anything you can or should do; I was just passing on the info. Darren is the only one besides me who logs into the site and hopefully the only one who will notice. At 10:01 AM 12/17/2004, Philip Yuson wrote: >So Peter, >How can we help? > > > >Peter Scott wrote: >>We're hosted there (i.e., http://victoria.pm.org/) and have the usual >>two mailing lists (AFAIK no one uses the digest form, so really just >>the one: victoria-pm@pm.org). >>Cc: to victoria.pm for information (mainly Darren's at that); VPM >>members please remove user_groups@pm.org if you reply. >> > -----Original Message----- >> > From: pm_groups-bounces@mail.pm.org >> > [mailto:pm_groups-bounces@mail.pm.org] On Behalf Of Dave Cross >> > Sent: Friday, December 17, 2004 10:03 AM >> > To: pm_groups@pm.org >> > Subject: [pm_groups] pm.org hosting changes >> > >> > For several years, the pm.org server has been hosted for free >> > by Rackspace and we're very grateful to them for the help >> > they've given us. >> > Unfortunately, that free service will be ending very early >> > next year and the pm.org server will be moving elsewhere. >> > >> > As part of the move we are going to have to scale down the >> > level of service that we provide for Perl Monger local >> > groups. Once the new server is established we will provide >> > the following for free: >> > >> > * Web sites with static content only. >> > * FTP and/or WebDAV access to maintain web sites. >> > * Mailing lists. >> > * DNS >> > >> > The major changes will be that no dynamic content will be >> > allowed and no group leaders will have shell access to the >> > server. We're sorry that we have to put this restrictions in >> > place, but the internet is a very different place to what is >> > was when we set the service up many years ago. If you want to >> > host your site on a less restrictive server that you have >> > more control over then we are, as always, happy to point the >> > DNS records at another server. >> > >> > Also, I'm concerned about the large number of dead groups >> > that we are hosting on the server. This is a particular >> > problem given the amount of spam that is sent to mailing >> > lists. As a result of this, we'll only be moving over web >> > sites and mailing lists if they are specifically requested. >> > >> > If you want your web site and/or mailing moved to the new >> > server, then please send an email with the subject 'Please >> > save [xxx].pm' (replacing [xxx] with the name of your group) >> > to user_groups@pm.org. Within the email, please list the url >> > of your site and the name of your mailing list(s). >> > >> > If you want your DNS pointed to another server, then please >> > send details of the change to support@pm.org. >> > >> > PLEASE DON'T SEND THESE REQUESTS BACK TO THIS LIST. > > >-- >======================= >Philip L. Yuson >Senior Consultant >Concept Solutions Corporation >Phone: (250) 881-0049 >Fax (250) 381-2425 > -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ *** New! *** http://www.perlmedic.com/ From darren at DarrenDuncan.net Fri Dec 17 14:28:54 2004 From: darren at DarrenDuncan.net (Darren Duncan) Date: Fri Dec 17 14:29:04 2004 Subject: [VPM] Please save victoria.pm In-Reply-To: <6.1.2.0.2.20041217104135.01fe6318@shell2.webquarry.com> References: <6.1.2.0.2.20041217091106.01fe6318@shell2.webquarry.com> <41C31EFA.3040103@conceptsolutionsbc.com> <6.1.2.0.2.20041217104135.01fe6318@shell2.webquarry.com> Message-ID: At 10:42 AM -0800 12/17/04, Peter Scott wrote: >I don't think there's anything you can or should do; I was just >passing on the info. Darren is the only one besides me who logs >into the site and hopefully the only one who will notice. All 3 messages received. And yes, I may miss the shell access. Though I never used any dynamic content. -- Darren Duncan