From joel at fentin.com Wed Oct 6 05:45:57 2010 From: joel at fentin.com (Joel Fentin) Date: Wed, 06 Oct 2010 05:45:57 -0700 Subject: [San-Diego-pm] Running PHP slide show from Perl Message-ID: <4CAC6F85.7010701@fentin.com> I have been attempting to test/run a slideshow program. The program must be run from a Perl program. + First note that plant1.php works. See it here: http://calscape.com/Raja99/plant1.php + I wrote a Perl script to run plant1.php. You can run it at: http://www.calscape.com/cgi-bin/Admin/Raja99A.pl. It doesn't work. Note the error message. + The operative code lines: print "Content-type: text/html\n\n"; chdir '../../Raja99/'; system('./plant1.php'); I hope sombody knows what is happening and can help. Thank you. -- Joel Fentin tel: 760-749-8863 Biz Website: http://fentin.com Personal Website: http://fentin.com/me From xrz1138 at gmail.com Wed Oct 6 07:21:55 2010 From: xrz1138 at gmail.com (Christopher Hahn) Date: Wed, 6 Oct 2010 07:21:55 -0700 Subject: [San-Diego-pm] Running PHP slide show from Perl In-Reply-To: <4CAC6F85.7010701@fentin.com> References: <4CAC6F85.7010701@fentin.com> Message-ID: Hey, Just a quick one, but when I see: "No such file or directory ./plant1.php" I wonder if the problem is the cwd when running is not where this lives. Perhaps you can fuly qualify the reference to plant1.php? Good luck, Chris On Wed, Oct 6, 2010 at 5:45 AM, Joel Fentin wrote: > I have been attempting to test/run a slideshow program. The program must be > run from a Perl program. > > + First note that plant1.php works. See it here: > http://calscape.com/Raja99/plant1.php > > + I wrote a Perl script to run plant1.php. You can run it at: > http://www.calscape.com/cgi-bin/Admin/Raja99A.pl. > It doesn't work. Note the error message. > > + The operative code lines: > print "Content-type: text/html\n\n"; > chdir '../../Raja99/'; > system('./plant1.php'); > > > I hope sombody knows what is happening and can help. > Thank you. > > -- > Joel Fentin tel: 760-749-8863 > Biz Website: http://fentin.com > Personal Website: http://fentin.com/me > _______________________________________________ > San-Diego-pm mailing list > San-Diego-pm at pm.org > http://mail.pm.org/mailman/listinfo/san-diego-pm > -- Realisant mon espoir, je me lance vers la gloire. Christopher Hahn == xrz1138 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From pm at bionikchickens.com Wed Oct 6 10:17:53 2010 From: pm at bionikchickens.com (Nicholas Wehr) Date: Wed, 6 Oct 2010 10:17:53 -0700 Subject: [San-Diego-pm] Running PHP slide show from Perl In-Reply-To: <4CAC6F85.7010701@fentin.com> References: <4CAC6F85.7010701@fentin.com> Message-ID: any time I need to change directories for whatever reason - I've found that it's best practice to: use strict; use File::Basename; use File::Spec::Functions; use FindBin; also, keep in mind - you didn't check the return value from your chdir. I think you'd be better off with absolute paths if you could swing it. you also should assume your environment is blanked out, so your cgi will not have the environment that apache does, per se. with your system call, use absolute paths for the php program as well. AND make sure you can run php from the shell. eg. system(/usr/bin/php /path/to/file/plant1.php') good luck -nw On Wed, Oct 6, 2010 at 5:45 AM, Joel Fentin wrote: > I have been attempting to test/run a slideshow program. The program must be > run from a Perl program. > > + First note that plant1.php works. See it here: > http://calscape.com/Raja99/plant1.php > > + I wrote a Perl script to run plant1.php. You can run it at: > http://www.calscape.com/cgi-bin/Admin/Raja99A.pl. > It doesn't work. Note the error message. > > + The operative code lines: > print "Content-type: text/html\n\n"; > chdir '../../Raja99/'; > system('./plant1.php'); > > > I hope sombody knows what is happening and can help. > Thank you. > > -- > Joel Fentin tel: 760-749-8863 > Biz Website: http://fentin.com > Personal Website: http://fentin.com/me > _______________________________________________ > San-Diego-pm mailing list > San-Diego-pm at pm.org > http://mail.pm.org/mailman/listinfo/san-diego-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joel at fentin.com Wed Oct 6 10:29:26 2010 From: joel at fentin.com (Joel Fentin) Date: Wed, 06 Oct 2010 10:29:26 -0700 Subject: [San-Diego-pm] Running PHP slide show from Perl In-Reply-To: References: <4CAC6F85.7010701@fentin.com> Message-ID: <4CACB1F6.9030909@fentin.com> Thank you for getting back to me. On 10/6/2010 7:21 AM, Christopher Hahn wrote: > Hey, > > Just a quick one, but when I see: > > "No such file or directory ./plant1.php" I think that refers to the question mark in line one of plant1.php. There is also an error mentioned for line three. The .php program itself has been located and something is attempting to deal with it. I believe you can run commands like dir and xx.exe via system(). But can you run xxx.php? If not, how is it done? An experiment: system('dir'); This shows me the working directory is correct. > I wonder if the problem is the cwd when running is not where this > lives. I don't understand. > Perhaps you can fuly qualify the reference to plant1.php? If by fully qualify, you mean: system('http://calscape.com/Raja99/plant1.php'); system('/Raja99/plant1.php'); system('/home6/calscape/Raja99/plant1.php'); These are worse. The error is in Perl saying it can't find the file. > On Wed, Oct 6, 2010 at 5:45 AM, Joel Fentin > wrote: > > I have been attempting to test/run a slideshow program. The > program must be run from a Perl program. > > + First note that plant1.php works. See it here: > http://calscape.com/Raja99/plant1.php > > + I wrote a Perl script to run plant1.php. You can run it at: > http://www.calscape.com/cgi-bin/Admin/Raja99A.pl. > It doesn't work. Note the error message. > > + The operative code lines: > print "Content-type: text/html\n\n"; > chdir '../../Raja99/'; > system('./plant1.php'); > > > I hope sombody knows what is happening and can help. > Thank you. > > -- > Joel Fentin tel: 760-749-8863 > Biz Website: http://fentin.com > Personal Website: http://fentin.com/me > _______________________________________________ > San-Diego-pm mailing list > San-Diego-pm at pm.org > http://mail.pm.org/mailman/listinfo/san-diego-pm > > > > > -- > Realisant mon espoir, je me lance vers la gloire. > Christopher Hahn == xrz1138 at gmail.com -- Joel Fentin tel: 760-749-8863 Biz Website: http://fentin.com Personal Website: http://fentin.com/me From joel at fentin.com Wed Oct 6 10:35:15 2010 From: joel at fentin.com (Joel Fentin) Date: Wed, 06 Oct 2010 10:35:15 -0700 Subject: [San-Diego-pm] Running PHP slide show from Perl In-Reply-To: References: <4CAC6F85.7010701@fentin.com> Message-ID: <4CACB353.10103@fentin.com> On 10/6/2010 10:17 AM, Nicholas Wehr wrote: > any time I need to change directories for whatever reason - I've > found that it's best practice to: > > use strict; > use File::Basename; > use File::Spec::Functions; > use FindBin; > > also, keep in mind - you didn't check the return value from your > chdir. I think you'd be better off with absolute paths if you > could swing it. you also should assume your environment is blanked > out, so your cgi will not have the environment that apache does, > per se. with your system call, use absolute paths for the php > program as well. AND make sure you can run php from the shell. eg. > system(/usr/bin/php /path/to/file/plant1.php') > Thank you. Does the above assume the program was not found? The error messages (two) both refer to code inside plant1.php. A more fundamental question: Can you run php from system()? > > On Wed, Oct 6, 2010 at 5:45 AM, Joel Fentin > wrote: > > I have been attempting to test/run a slideshow program. The > program must be run from a Perl program. > > + First note that plant1.php works. See it here: > http://calscape.com/Raja99/plant1.php > > + I wrote a Perl script to run plant1.php. You can run it at: > http://www.calscape.com/cgi-bin/Admin/Raja99A.pl. > It doesn't work. Note the error message. > > + The operative code lines: > print "Content-type: text/html\n\n"; > chdir '../../Raja99/'; > system('./plant1.php'); > > > I hope sombody knows what is happening and can help. > Thank you. > > -- > Joel Fentin tel: 760-749-8863 > Biz Website: http://fentin.com > Personal Website: http://fentin.com/me > _______________________________________________ > San-Diego-pm mailing list > San-Diego-pm at pm.org > http://mail.pm.org/mailman/listinfo/san-diego-pm > > -- Joel Fentin tel: 760-749-8863 Biz Website: http://fentin.com Personal Website: http://fentin.com/me From pm at bionikchickens.com Wed Oct 6 10:46:38 2010 From: pm at bionikchickens.com (Nicholas Wehr) Date: Wed, 6 Oct 2010 10:46:38 -0700 Subject: [San-Diego-pm] Running PHP slide show from Perl In-Reply-To: <4CACB353.10103@fentin.com> References: <4CAC6F85.7010701@fentin.com> <4CACB353.10103@fentin.com> Message-ID: I'm thinking php doesn't run on the command line by default - what's your platform? On Wed, Oct 6, 2010 at 10:35 AM, Joel Fentin wrote: > On 10/6/2010 10:17 AM, Nicholas Wehr wrote: > > any time I need to change directories for whatever reason - I've > > found that it's best practice to: > > > > use strict; > > use File::Basename; > > use File::Spec::Functions; > > use FindBin; > > > > also, keep in mind - you didn't check the return value from your > > chdir. I think you'd be better off with absolute paths if you > > could swing it. you also should assume your environment is blanked > > out, so your cgi will not have the environment that apache does, > > per se. with your system call, use absolute paths for the php > > program as well. AND make sure you can run php from the shell. eg. > > system(/usr/bin/php /path/to/file/plant1.php') > > > > Thank you. > > Does the above assume the program was not found? > > The error messages (two) both refer to code inside plant1.php. > > A more fundamental question: Can you run php from system()? > > > > > > On Wed, Oct 6, 2010 at 5:45 AM, Joel Fentin > > wrote: > > > > I have been attempting to test/run a slideshow program. The > > program must be run from a Perl program. > > > > + First note that plant1.php works. See it here: > > http://calscape.com/Raja99/plant1.php > > > > + I wrote a Perl script to run plant1.php. You can run it at: > > http://www.calscape.com/cgi-bin/Admin/Raja99A.pl. > > It doesn't work. Note the error message. > > > > + The operative code lines: > > print "Content-type: text/html\n\n"; > > chdir '../../Raja99/'; > > system('./plant1.php'); > > > > > > I hope sombody knows what is happening and can help. > > Thank you. > > > > -- > > Joel Fentin tel: 760-749-8863 > > Biz Website: http://fentin.com > > Personal Website: http://fentin.com/me > > _______________________________________________ > > San-Diego-pm mailing list > > San-Diego-pm at pm.org > > > http://mail.pm.org/mailman/listinfo/san-diego-pm > > > > > > > -- > Joel Fentin tel: 760-749-8863 > Biz Website: http://fentin.com > Personal Website: http://fentin.com/me > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joel at fentin.com Wed Oct 6 11:14:08 2010 From: joel at fentin.com (Joel Fentin) Date: Wed, 06 Oct 2010 11:14:08 -0700 Subject: [San-Diego-pm] Running PHP slide show from Perl In-Reply-To: References: <4CAC6F85.7010701@fentin.com> <4CACB353.10103@fentin.com> Message-ID: <4CACBC70.1060704@fentin.com> On 10/6/2010 10:46 AM, Nicholas Wehr wrote: > I'm thinking php doesn't run on the command line by default - > what's your platform? I don't know. My client is hosted by Blue Host (http://www.bluehost.com/) and is probably on a shared server. > On Wed, Oct 6, 2010 at 10:35 AM, Joel Fentin > wrote: > > On 10/6/2010 10:17 AM, Nicholas Wehr wrote: > > any time I need to change directories for whatever reason - > I've > > found that it's best practice to: > > > > use strict; > > use File::Basename; > > use File::Spec::Functions; > > use FindBin; > > > > also, keep in mind - you didn't check the return value from > your > > chdir. I think you'd be better off with absolute paths if you > > could swing it. you also should assume your environment is > blanked > > out, so your cgi will not have the environment that apache > does, > > per se. with your system call, use absolute paths for the php > > program as well. AND make sure you can run php from the > shell. eg. > > system(/usr/bin/php /path/to/file/plant1.php') > > > > Thank you. > > Does the above assume the program was not found? > > The error messages (two) both refer to code inside plant1.php. > > A more fundamental question: Can you run php from system()? > > > > > > On Wed, Oct 6, 2010 at 5:45 AM, Joel Fentin > > > >> wrote: > > > > I have been attempting to test/run a slideshow program. The > > program must be run from a Perl program. > > > > + First note that plant1.php works. See it here: > > http://calscape.com/Raja99/plant1.php > > > > + I wrote a Perl script to run plant1.php. You can run > it at: > > http://www.calscape.com/cgi-bin/Admin/Raja99A.pl. > > It doesn't work. Note the error message. > > > > + The operative code lines: > > print "Content-type: text/html\n\n"; > > chdir '../../Raja99/'; > > system('./plant1.php'); > > > > > > I hope sombody knows what is happening and can help. > > Thank you. > > > > -- > > Joel Fentin tel: 760-749-8863 > > Biz Website: http://fentin.com > > Personal Website: http://fentin.com/me > > _______________________________________________ > > San-Diego-pm mailing list > > San-Diego-pm at pm.org > > > > > http://mail.pm.org/mailman/listinfo/san-diego-pm > > > > > > > -- > Joel Fentin tel: 760-749-8863 > Biz Website: http://fentin.com > Personal Website: http://fentin.com/me > > -- Joel Fentin tel: 760-749-8863 Biz Website: http://fentin.com Personal Website: http://fentin.com/me From joel at fentin.com Wed Oct 6 11:59:51 2010 From: joel at fentin.com (Joel Fentin) Date: Wed, 06 Oct 2010 11:59:51 -0700 Subject: [San-Diego-pm] Running PHP slide show from Perl In-Reply-To: References: <4CAC6F85.7010701@fentin.com> <4CACB353.10103@fentin.com> <4CACBC70.1060704@fentin.com> Message-ID: <4CACC727.8060102@fentin.com> On 10/6/2010 11:26 AM, Nicholas Wehr wrote: > hm, well I see how this can be challenging. > > is your goal to download a webpage and redisplay it with perl? or > do you just want the php web content? > > if so, I recommend WWW::Mechanize As brief as I can make it. + go to http://calscape.com/ + click the "Trees" dynamic link. You should see a list of trees. + click the thumbnail or common name of the first tree. A page is displayed specific to that tree. Note the slide show. + Click the 'Next Plant' link (near upper right corner). Another plant page is displayed. Note the slide show. + Click the browser back button. the prior plant data is displayed but not the prior slide show. =============== + I put that slide show into that page with an iframe. + I create the show on the fly per the specific plant we are looking at. + The slide show is an older version (also php) soon to be replaced by plant1.php or something very like it. + I was experimenting with system() as a means to solve the back button problem. =============== Is anybody still awake? -- Joel Fentin tel: 760-749-8863 Biz Website: http://fentin.com Personal Website: http://fentin.com/me From rkleeman at energoncube.net Wed Oct 6 12:33:37 2010 From: rkleeman at energoncube.net (Bob Kleemann) Date: Wed, 6 Oct 2010 12:33:37 -0700 Subject: [San-Diego-pm] San Diego Perl Mongers Present Damian Conway Message-ID: The San Diego Perl Mongers present Damian Conway. One night only, Monday, October 11, 7 PM at the offices of Knobbe Martens, 12790 El Camino Real, San Diego, CA 92130. Come and enjoy Damian Conway, Perl luminary and all around great guy, as he presents his seminar "The Missing Link" . The topic will be focused on Perl, but should be entertaining to all programmers. If there are any questions or other concerns, please contact me via my Gmail address, rkleemann. From pm at bionikchickens.com Wed Oct 6 17:15:56 2010 From: pm at bionikchickens.com (Nicholas Wehr) Date: Wed, 6 Oct 2010 17:15:56 -0700 Subject: [San-Diego-pm] Running PHP slide show from Perl In-Reply-To: <4CACC727.8060102@fentin.com> References: <4CAC6F85.7010701@fentin.com> <4CACB353.10103@fentin.com> <4CACBC70.1060704@fentin.com> <4CACC727.8060102@fentin.com> Message-ID: Joel, without knowing more about the details of your system - I would say that your solution strategy seems to be introducing a lot of complexity and indirection. If there is a problem with the php/javascript application, I think your time is best spent solving it within that environment. Alternately, php developers are plentiful for contract... -nw On Wed, Oct 6, 2010 at 11:59 AM, Joel Fentin wrote: > On 10/6/2010 11:26 AM, Nicholas Wehr wrote: > >> hm, well I see how this can be challenging. >> >> is your goal to download a webpage and redisplay it with perl? or >> do you just want the php web content? >> >> if so, I recommend WWW::Mechanize >> > > As brief as I can make it. > > + go to http://calscape.com/ > > + click the "Trees" dynamic link. You should see a list of trees. > > + click the thumbnail or common name of the first tree. A page is displayed > specific to that tree. Note the slide show. > > + Click the 'Next Plant' link (near upper right corner). Another plant page > is displayed. Note the slide show. > > + Click the browser back button. the prior plant data is displayed but not > the prior slide show. > > =============== > > + I put that slide show into that page with an iframe. > > + I create the show on the fly per the specific plant we are looking at. > > + The slide show is an older version (also php) soon to be replaced by > plant1.php or something very like it. > > + I was experimenting with system() as a means to solve the back button > problem. > > =============== > > Is anybody still awake? > > -- > Joel Fentin tel: 760-749-8863 > Biz Website: http://fentin.com > Personal Website: http://fentin.com/me > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joel at fentin.com Wed Oct 6 17:42:26 2010 From: joel at fentin.com (Joel Fentin) Date: Wed, 06 Oct 2010 17:42:26 -0700 Subject: [San-Diego-pm] Running PHP slide show from Perl In-Reply-To: References: <4CAC6F85.7010701@fentin.com> <4CACB353.10103@fentin.com> <4CACBC70.1060704@fentin.com> <4CACC727.8060102@fentin.com> Message-ID: <4CAD1772.3000407@fentin.com> On 10/6/2010 5:15 PM, Nicholas Wehr wrote: > Joel, without knowing more about the details of your system - I > would say that your solution strategy seems to be introducing a > lot of complexity and indirection. If there is a problem with the > php/javascript application, I think your time is best spent > solving it within that environment. Alternately, php developers > are plentiful for contract... I agree fully. Alternately I might be able to solve the problem by removing all page caching. Some of you have sent suggestions on how to do that, but I haven't gotten around to learning it. -- Joel Fentin tel: 760-749-8863 Biz Website: http://fentin.com Personal Website: http://fentin.com/me From xrz1138 at gmail.com Wed Oct 6 18:00:53 2010 From: xrz1138 at gmail.com (Christopher Hahn) Date: Wed, 6 Oct 2010 18:00:53 -0700 Subject: [San-Diego-pm] Running PHP slide show from Perl In-Reply-To: References: <4CAC6F85.7010701@fentin.com> <4CACB353.10103@fentin.com> <4CACBC70.1060704@fentin.com> <4CACC727.8060102@fentin.com> Message-ID: I have to add that anyone who can work with perl can hack php immediately. Developing from scratch might take a bit longer, but not much. Good luck! Chris 2010/10/6 Nicholas Wehr > Joel, without knowing more about the details of your system - I would say > that your solution strategy seems to be introducing a lot of complexity and > indirection. If there is a problem with the php/javascript application, I > think your time is best spent solving it within that environment. > Alternately, php developers are plentiful for contract... > > -nw > > > On Wed, Oct 6, 2010 at 11:59 AM, Joel Fentin wrote: > >> On 10/6/2010 11:26 AM, Nicholas Wehr wrote: >> >>> hm, well I see how this can be challenging. >>> >>> is your goal to download a webpage and redisplay it with perl? or >>> do you just want the php web content? >>> >>> if so, I recommend WWW::Mechanize >>> >> >> As brief as I can make it. >> >> + go to http://calscape.com/ >> >> + click the "Trees" dynamic link. You should see a list of trees. >> >> + click the thumbnail or common name of the first tree. A page is >> displayed specific to that tree. Note the slide show. >> >> + Click the 'Next Plant' link (near upper right corner). Another plant >> page is displayed. Note the slide show. >> >> + Click the browser back button. the prior plant data is displayed but not >> the prior slide show. >> >> =============== >> >> + I put that slide show into that page with an iframe. >> >> + I create the show on the fly per the specific plant we are looking at. >> >> + The slide show is an older version (also php) soon to be replaced by >> plant1.php or something very like it. >> >> + I was experimenting with system() as a means to solve the back button >> problem. >> >> =============== >> >> Is anybody still awake? >> >> -- >> Joel Fentin tel: 760-749-8863 >> Biz Website: http://fentin.com >> Personal Website: http://fentin.com/me >> > > > _______________________________________________ > San-Diego-pm mailing list > San-Diego-pm at pm.org > http://mail.pm.org/mailman/listinfo/san-diego-pm > -- Realisant mon espoir, je me lance vers la gloire. Christopher Hahn == xrz1138 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike.junk at nethere.com Thu Oct 7 10:40:43 2010 From: mike.junk at nethere.com (Mike McClain) Date: Thu, 7 Oct 2010 10:40:43 -0700 Subject: [San-Diego-pm] map HoAoA Message-ID: <20101007174042.GA7964@playground.mcclains.net> First let me say that this is self assigned homework just for my own education, I'm not in class. Reading perldsc and perllol I thought to pull the second item from each array of a HoAoA (hash of arrays of arrays) using a map statement but after several days of flailing still haven't found a solution nor do I even understand why I'm not getting what I want. Here's a code segment, strict and warnings are turned on just not shown. { my %HoAoA = ( a => [ [ qw / aa1 aa2 / ], [ qw / ab1 ab2 / ] ], b => [ [ qw / ba1 ba2 / ], [ qw / bb1 bb2 / ] ], c => [ [ qw / ca1 ca2 / ], [ qw / cb1 cb2 / ], [ qw / cc1 cc2 / ] ], ); # this gets refs to all arrays my @aRefs = map { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ] } keys %HoAoA ; # pull second entry from each array for my $a ( @aRefs ) { print "$a = $$a[1]\n"; } # This is the statement I'm having trouble with: # If you can explain why I'm only getting the second entry from the # last array of each hash entry then perhaps I can figure out how # to get the second entry from all arrays my @seconds = map { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ]->[1] } keys %HoAoA ; print "\@seconds = @seconds\n"; } Thanks, Mike McClain -- Satisfied user of Linux since 1997. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org From merlyn at stonehenge.com Thu Oct 7 10:44:56 2010 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Thu, 07 Oct 2010 10:44:56 -0700 Subject: [San-Diego-pm] map HoAoA In-Reply-To: <20101007174042.GA7964@playground.mcclains.net> (Mike McClain's message of "Thu, 7 Oct 2010 10:40:43 -0700") References: <20101007174042.GA7964@playground.mcclains.net> Message-ID: <86mxqpvqw7.fsf@red.stonehenge.com> >>>>> "Mike" == Mike McClain writes: Mike> First let me say that this is self assigned homework just for my Mike> own education, I'm not in class. Mike> Reading perldsc and perllol I thought to pull the second item from Mike> each array of a HoAoA (hash of arrays of arrays) using a map statement Mike> but after several days of flailing still haven't found a solution nor Mike> do I even understand why I'm not getting what I want. Mike> Here's a code segment, strict and warnings are turned on just not Mike> shown. Mike> { my %HoAoA = ( Mike> a => [ [ qw / aa1 aa2 / ], [ qw / ab1 ab2 / ] ], Mike> b => [ [ qw / ba1 ba2 / ], [ qw / bb1 bb2 / ] ], Mike> c => [ [ qw / ca1 ca2 / ], [ qw / cb1 cb2 / ], Mike> [ qw / cc1 cc2 / ] ], Mike> ); Mike> # this gets refs to all arrays Mike> my @aRefs = map { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ] } keys %HoAoA ; Mike> # pull second entry from each array Mike> for my $a ( @aRefs ) Mike> { print "$a = $$a[1]\n"; Mike> } Mike> # This is the statement I'm having trouble with: Mike> # If you can explain why I'm only getting the second entry from the Mike> # last array of each hash entry then perhaps I can figure out how Mike> # to get the second entry from all arrays Mike> my @seconds = map { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ]->[1] } Mike> keys %HoAoA ; Mike> print "\@seconds = @seconds\n"; Mike> } Start with the values, not the keys. You don't need the keys: my @first_level_array_refs = values %HoAoA; Now you want all the second-level array refs, in order: my @second_level_array_refs = map { @$_ } @first_level_array_refs; And then you want the second element of each: my @seconds = map { $_->[1] } @second_level_array_refs; Putting it all together: my @seconds = map { $_->[1] } map { @$_ } values %HoAoA; And no, you can't shortcut that very much more than that. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.posterous.com/ for Smalltalk discussion From rkleeman at energoncube.net Mon Oct 11 10:26:20 2010 From: rkleeman at energoncube.net (Bob Kleemann) Date: Mon, 11 Oct 2010 10:26:20 -0700 Subject: [San-Diego-pm] San Diego Perl Mongers Present Damian Conway In-Reply-To: References: Message-ID: Just a quick reminder about Damian Conway tonight. I look forward to seeing everybody there. On Wed, Oct 6, 2010 at 12:33 PM, Bob Kleemann wrote: > The San Diego Perl Mongers present Damian Conway. ?One night only, > Monday, October 11, 7 PM at the offices of Knobbe Martens, > 12790 El Camino Real, San Diego, CA 92130. > > Come and enjoy Damian Conway, Perl luminary and all around great guy, > as he presents his seminar "The Missing Link" > . ?The topic will > be focused on Perl, but should be entertaining to all programmers. > > If there are any questions or other concerns, please contact me via my > Gmail address, rkleemann. > From rkleeman at energoncube.net Tue Oct 19 10:21:45 2010 From: rkleeman at energoncube.net (Bob Kleemann) Date: Tue, 19 Oct 2010 10:21:45 -0700 Subject: [San-Diego-pm] Meeting this week! Message-ID: Perl Mongers, We have our monthly meeting this week: Thursday at the normal place (Anonymizer.com) and time (7 PM). We plan to talk about Damian's recent visit, as well as several other things. Bring your notes, ideas, thoughts, and imagination, and we'll chat about it all. Please give me a heads up if you plan to make it. Or just drop by if you feel the need to. I look forward to seeing you all there. From thierryv at abac.com Thu Oct 21 15:55:55 2010 From: thierryv at abac.com (Thierry de Villeneuve) Date: Fri, 22 Oct 2010 00:55:55 +0200 Subject: [San-Diego-pm] SOAP server in PERL In-Reply-To: References: <4CAC6F85.7010701@fentin.com> <4CACB353.10103@fentin.com> <4CACBC70.1060704@fentin.com> <4CACC727.8060102@fentin.com> Message-ID: <3281FA38-2C7E-414D-A93B-788FCCC6D5E5@abac.com> Dear Perl Mongers of San Diego, I very rarely post on the list since I've left San Diego in 2002. Few of you remember of me regularly attending the meetings ... that was some 10 years ago !!! I'm back to France now but have never unsubscribe from the list and long the days I was in SD. Well, this said, here is what brings me here today. I have this (big) project at the office where I'll need to build a SOAP server. The traffic is not expected to be very high: Something like a transaction every 10". All the business backend is already developed and I've started tinkering with SOAP::Lite a bit. I've never had to develop a server based on SOAP (HTTP-SOAP) before. So, it's a brand new situation for me. The XSD and WSDL is already developed, so far so good. If any one of you could shed some light on what are the "best practices", best options, best CPAN modules to consider looking at when to tackle this sort of project. The time to process one of the request will be important (around 10~20" ... creating a SQLite db file of a few thousand rows to hand over). I would rather consider an architecture where the server would fork a subprocess to take care of each request. This is this part I'm not feeling conformable with as of today. If someone could get me a few pointers where to start digging, that'll be awesome, specifically regarding the forking/threading issue. Otherwise, I'll have to turn this part of the project to someone else to develop it in C++ and gSOAP. I'd like prove PERL can do the job here too ;-) Thanks a lot, Thierry From pm at bionikchickens.com Thu Oct 21 16:21:59 2010 From: pm at bionikchickens.com (Nicholas Wehr) Date: Thu, 21 Oct 2010 16:21:59 -0700 Subject: [San-Diego-pm] SOAP server in PERL In-Reply-To: <3281FA38-2C7E-414D-A93B-788FCCC6D5E5@abac.com> References: <4CAC6F85.7010701@fentin.com> <4CACB353.10103@fentin.com> <4CACBC70.1060704@fentin.com> <4CACC727.8060102@fentin.com> <3281FA38-2C7E-414D-A93B-788FCCC6D5E5@abac.com> Message-ID: I've always opted for using XMLRPC instead as the WSDL support was shotty for many years. I'm interested to hear what others have done here. At this point - I'd be inclined to assert that Perl doesn't have great interoperability with other soap implementations (like interacting w/ java server/clients). this has been my experience in the past - I hope I'm wrong. On Thu, Oct 21, 2010 at 3:55 PM, Thierry de Villeneuve wrote: > Dear Perl Mongers of San Diego, > > I very rarely post on the list since I've left San Diego in 2002. Few of > you remember of me regularly attending the meetings ... that was some 10 > years ago !!! I'm back to France now but have never unsubscribe from the > list and long the days I was in SD. > > Well, this said, here is what brings me here today. > > I have this (big) project at the office where I'll need to build a SOAP > server. The traffic is not expected to be very high: Something like a > transaction every 10". > > All the business backend is already developed and I've started tinkering > with SOAP::Lite a bit. I've never had to develop a server based on SOAP > (HTTP-SOAP) before. So, it's a brand new situation for me. The XSD and WSDL > is already developed, so far so good. > > If any one of you could shed some light on what are the "best practices", > best options, best CPAN modules to consider looking at when to tackle this > sort of project. > > The time to process one of the request will be important (around 10~20" ... > creating a SQLite db file of a few thousand rows to hand over). I would > rather consider an architecture where the server would fork a subprocess to > take care of each request. This is this part I'm not feeling conformable > with as of today. > > If someone could get me a few pointers where to start digging, that'll be > awesome, specifically regarding the forking/threading issue. Otherwise, > I'll have to turn this part of the project to someone else to develop it in > C++ and gSOAP. I'd like prove PERL can do the job here too ;-) > > Thanks a lot, > > Thierry > > > > > > > _______________________________________________ > San-Diego-pm mailing list > San-Diego-pm at pm.org > http://mail.pm.org/mailman/listinfo/san-diego-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shlomif at iglu.org.il Fri Oct 22 01:38:00 2010 From: shlomif at iglu.org.il (Shlomi Fish) Date: Fri, 22 Oct 2010 10:38:00 +0200 Subject: [San-Diego-pm] SOAP server in PERL In-Reply-To: <3281FA38-2C7E-414D-A93B-788FCCC6D5E5@abac.com> References: <4CAC6F85.7010701@fentin.com> <3281FA38-2C7E-414D-A93B-788FCCC6D5E5@abac.com> Message-ID: <201010221038.01181.shlomif@iglu.org.il> Hi Thierry, first of all I should note that you shouldn't start a new topic by replying to an existing message, because threaded mailers will display it as inside the previous topic. Instead, send a new message to san-diego-pm at pm.org . On Friday 22 October 2010 00:55:55 Thierry de Villeneuve wrote: > Dear Perl Mongers of San Diego, > > I very rarely post on the list since I've left San Diego in 2002. Few > of you remember of me regularly attending the meetings ... that was > some 10 years ago !!! I'm back to France now but have never > unsubscribe from the list and long the days I was in SD. > > Well, this said, here is what brings me here today. > > I have this (big) project at the office where I'll need to build a > SOAP server. The traffic is not expected to be very high: Something > like a transaction every 10". > > All the business backend is already developed and I've started > tinkering with SOAP::Lite a bit. I've never had to develop a server > based on SOAP (HTTP-SOAP) before. So, it's a brand new situation for > me. The XSD and WSDL is already developed, so far so good. > > If any one of you could shed some light on what are the "best > practices", best options, best CPAN modules to consider looking at > when to tackle this sort of project. > According to perlbot on Freenode's #perl : {{{ Sep 22 20:51:12 rindolf: avoid SOAP::Lite, try SOAP::WSDL or XML::Compile::SOAP for more modern takes on the protocol }}} Note that I've never done any SOAP myself so I'm not speaking from experience. > The time to process one of the request will be important (around > 10~20" ... creating a SQLite db file of a few thousand rows to hand I've never seen someone mark seconds of time as ?"?, it seems highly unorthodox, and easily confused with minutes. > over). I would rather consider an architecture where the server would > fork a subprocess to take care of each request. This is this part I'm > not feeling conformable with as of today. > > If someone could get me a few pointers where to start digging, that'll > be awesome, specifically regarding the forking/threading issue. > Otherwise, I'll have to turn this part of the project to someone else > to develop it in C++ and gSOAP. I'd like prove PERL can do the job It's "Perl" or "perl" but never "PERL": http://perl.org.il/misc.html#pl_vs_pl Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ My Aphorisms - http://www.shlomifish.org/humour.html She's a hot chick. But she smokes. She can smoke as long as she's smokin'. Please reply to list if it's a mailing list post - http://shlom.in/reply .