From robert.l.harris at gmail.com Fri Apr 4 13:27:22 2014 From: robert.l.harris at gmail.com (Robert L. Harris) Date: Fri, 4 Apr 2014 14:27:22 -0600 Subject: [Denver-pm] short circuiting a loop from a sub? Message-ID: Given this (go for the process flow, not the actual code ) : $Var[0]="Foo"; $Var[1]="Bar"; $Var[2]="Baz"; foreach $Loop ( @Var ) { &CheckOne if ( $Loop =~ /Test1/ ); &CheckTwo if ( $Loop =~ /Foo/ ); &CheckThree if ( $Loop =~ /Test3/ ); &CheckFour if ( $Loop =~ /Test4/ ); &CheckFive if ( $Loop =~ /Test5/ ); &CheckSix if ( $Loop =~ /Test6/ ); } sub CheckTwo { # Do some work } There are currently about 15 "Check" sub routines with unique matches (One $Var will no match multiple sub-procs. Is there a way so that if I match on CheckTwo, it will do the equivalent of "next" and go to the next iteration of the loop instead of walking through the rest of the tests? It doesn't seem like much but I'm parsing almost a gig of data regularly and every check I can skip, the better. Robert -- :wq! --------------------------------------------------------------------------- Robert L. Harris DISCLAIMER: These are MY OPINIONS With Dreams To Be A King, ALONE. I speak for First One Should Be A Man no-one else. - Manowar -------------- next part -------------- An HTML attachment was scrubbed... URL: From saj at thecommune.net Fri Apr 4 13:34:13 2014 From: saj at thecommune.net (Stuart A Johnston) Date: Fri, 04 Apr 2014 14:34:13 -0600 Subject: [Denver-pm] short circuiting a loop from a sub? In-Reply-To: References: Message-ID: <533F1745.8060607@thecommune.net> if ( $Loop =~ /Foo/ ) { &CheckTwo ; next } You are essentially doing a switch statement. There are a few other styles to consider: http://perldoc.perl.org/perlfaq7.html#How-do-I-create-a-switch-or-case-statement%3F On 04/04/2014 02:27 PM, Robert L. Harris wrote: > > Given this (go for the process flow, not the actual code ) : > > $Var[0]="Foo"; > $Var[1]="Bar"; > $Var[2]="Baz"; > > foreach $Loop ( @Var ) { > &CheckOne if ( $Loop =~ /Test1/ ); > &CheckTwo if ( $Loop =~ /Foo/ ); > &CheckThree if ( $Loop =~ /Test3/ ); > &CheckFour if ( $Loop =~ /Test4/ ); > &CheckFive if ( $Loop =~ /Test5/ ); > &CheckSix if ( $Loop =~ /Test6/ ); > } > > sub CheckTwo { > # Do some work > } > > > There are currently about 15 "Check" sub routines with unique matches > (One $Var will no match multiple sub-procs. Is there a way so that if I > match on CheckTwo, it will do the equivalent of "next" and go to the > next iteration of the loop instead of walking through the rest of the tests? > > It doesn't seem like much but I'm parsing almost a gig of data > regularly and every check I can skip, the better. > > Robert > > > -- > :wq! > --------------------------------------------------------------------------- > Robert L. Harris > > DISCLAIMER: > These are MY OPINIONS With Dreams To Be A King, > ALONE. I speak for First One Should Be A Man > no-one else. - Manowar > > > _______________________________________________ > Denver-pm mailing list > Denver-pm at pm.org > http://mail.pm.org/mailman/listinfo/denver-pm > From saj at thecommune.net Fri Apr 4 13:39:16 2014 From: saj at thecommune.net (Stuart A Johnston) Date: Fri, 04 Apr 2014 14:39:16 -0600 Subject: [Denver-pm] short circuiting a loop from a sub? In-Reply-To: References: Message-ID: <533F1874.8090709@thecommune.net> If all of your tests are exact and unique, I would use a dispatch table: my %dispatch => { Foo => \&CheckTwo, Test1 => \&CheckOne, } foreach $Loop ( @Var ) { $dispatch{ $Loop }->(@_); } On 04/04/2014 02:27 PM, Robert L. Harris wrote: > > Given this (go for the process flow, not the actual code ) : > > $Var[0]="Foo"; > $Var[1]="Bar"; > $Var[2]="Baz"; > > foreach $Loop ( @Var ) { > &CheckOne if ( $Loop =~ /Test1/ ); > &CheckTwo if ( $Loop =~ /Foo/ ); > &CheckThree if ( $Loop =~ /Test3/ ); > &CheckFour if ( $Loop =~ /Test4/ ); > &CheckFive if ( $Loop =~ /Test5/ ); > &CheckSix if ( $Loop =~ /Test6/ ); > } > > sub CheckTwo { > # Do some work > } > > > There are currently about 15 "Check" sub routines with unique matches > (One $Var will no match multiple sub-procs. Is there a way so that if I > match on CheckTwo, it will do the equivalent of "next" and go to the > next iteration of the loop instead of walking through the rest of the tests? > > It doesn't seem like much but I'm parsing almost a gig of data > regularly and every check I can skip, the better. > > Robert > > > -- > :wq! > --------------------------------------------------------------------------- > Robert L. Harris > > DISCLAIMER: > These are MY OPINIONS With Dreams To Be A King, > ALONE. I speak for First One Should Be A Man > no-one else. - Manowar > > > _______________________________________________ > Denver-pm mailing list > Denver-pm at pm.org > http://mail.pm.org/mailman/listinfo/denver-pm > From robert.l.harris at gmail.com Fri Apr 18 13:38:34 2014 From: robert.l.harris at gmail.com (Robert L. Harris) Date: Fri, 18 Apr 2014 14:38:34 -0600 Subject: [Denver-pm] Perl SOAP::Lite Message-ID: I'm about to try and tackle a Soap::Lite script. I've never done soap at all so this will be fun. I have an XML "Project" they use in the windows tool I'll be ripping apart. I do have some docs and examples I've googled I'll be reading this weekend, but any helpful advice, example scripts, etc would be most welcom. Thank you, Robert -- :wq! --------------------------------------------------------------------------- Robert L. Harris DISCLAIMER: These are MY OPINIONS With Dreams To Be A King, ALONE. I speak for First One Should Be A Man no-one else. - Manowar -------------- next part -------------- An HTML attachment was scrubbed... URL: From saj at thecommune.net Fri Apr 18 13:46:43 2014 From: saj at thecommune.net (Stuart A Johnston) Date: Fri, 18 Apr 2014 14:46:43 -0600 Subject: [Denver-pm] Perl SOAP::Lite In-Reply-To: References: Message-ID: <53518F33.4020503@thecommune.net> My advice would be: Don't. SOAP is a PITA; SOAP::Lite doubly so. That being said, SOAP::Lite has seen some development lately so it might not be as bad. Another module to consider is XML::Compile::SOAP. On 04/18/2014 02:38 PM, Robert L. Harris wrote: > > I'm about to try and tackle a Soap::Lite script. I've never done soap > at all so this will be fun. I have an XML "Project" they use in the > windows tool I'll be ripping apart. I do have some docs and examples > I've googled I'll be reading this weekend, but any helpful advice, > example scripts, etc would be most welcom. > > Thank you, > Robert > > > -- > :wq! > --------------------------------------------------------------------------- > Robert L. Harris > > DISCLAIMER: > These are MY OPINIONS With Dreams To Be A King, > ALONE. I speak for First One Should Be A Man > no-one else. - Manowar > > > _______________________________________________ > Denver-pm mailing list > Denver-pm at pm.org > http://mail.pm.org/mailman/listinfo/denver-pm > From robert.l.harris at gmail.com Fri Apr 18 14:49:06 2014 From: robert.l.harris at gmail.com (Robert L. Harris) Date: Fri, 18 Apr 2014 15:49:06 -0600 Subject: [Denver-pm] Perl SOAP::Lite In-Reply-To: <53518F33.4020503@thecommune.net> References: <53518F33.4020503@thecommune.net> Message-ID: Unfortunately I need some data and the only method to get to it is the SOAP interface. Part of why I'm writing the script is the current group using the interface the most is actually manually editing the project file and running the gui in windows. Typo's are common... Trying to give them something to make it easier as well as getting my team access to the data. On Fri, Apr 18, 2014 at 2:46 PM, Stuart A Johnston wrote: > My advice would be: Don't. > > SOAP is a PITA; SOAP::Lite doubly so. That being said, SOAP::Lite has seen > some development lately so it might not be as bad. Another module to > consider is XML::Compile::SOAP. > > > > On 04/18/2014 02:38 PM, Robert L. Harris wrote: > >> >> I'm about to try and tackle a Soap::Lite script. I've never done soap >> at all so this will be fun. I have an XML "Project" they use in the >> windows tool I'll be ripping apart. I do have some docs and examples >> I've googled I'll be reading this weekend, but any helpful advice, >> example scripts, etc would be most welcom. >> >> Thank you, >> Robert >> >> >> -- >> :wq! >> ------------------------------------------------------------ >> --------------- >> Robert L. Harris >> >> DISCLAIMER: >> These are MY OPINIONS With Dreams To Be A King, >> ALONE. I speak for First One Should Be A Man >> no-one else. - Manowar >> >> >> _______________________________________________ >> Denver-pm mailing list >> Denver-pm at pm.org >> http://mail.pm.org/mailman/listinfo/denver-pm >> >> > _______________________________________________ > Denver-pm mailing list > Denver-pm at pm.org > http://mail.pm.org/mailman/listinfo/denver-pm > -- :wq! --------------------------------------------------------------------------- Robert L. Harris DISCLAIMER: These are MY OPINIONS With Dreams To Be A King, ALONE. I speak for First One Should Be A Man no-one else. - Manowar -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at fedde.us Sat Apr 19 19:45:07 2014 From: chris at fedde.us (Chris Fedde) Date: Sat, 19 Apr 2014 20:45:07 -0600 Subject: [Denver-pm] Perl SOAP::Lite In-Reply-To: References: Message-ID: Lately I've done quite a bit with SOAP but I've kind of ignored the actual SOAP. I've fallen into a bad habit of using Mojolicilus' Mojo::DOM class to fiddle around with xml documents and Mojo::UI to ship them around. Of course part of this might be that the main target of my SOAP interactions use SOAP as a wrapper around a legacy XML format so adding a soap envelope wrapper is a tiny part of the problem domain for this app. I have used SOAP::Lite in simple cases in the past and it has worked out ok. Recently I've received what I consider trustable advice to use Mark Overmeer's *XML::Compile::SOAP11 *and related classes. They look very complete but I have not succeeded with them though others I trust have. Mark and a few others do hang out in irc.perl.org#xml-compile. Mark tends to be active European working hours. Good Luck! chris On Fri, Apr 18, 2014 at 2:38 PM, Robert L. Harris wrote: > > I'm about to try and tackle a Soap::Lite script. I've never done soap at > all so this will be fun. I have an XML "Project" they use in the windows > tool I'll be ripping apart. I do have some docs and examples I've googled > I'll be reading this weekend, but any helpful advice, example scripts, etc > would be most welcom. > > Thank you, > Robert > > > -- > :wq! > --------------------------------------------------------------------------- > Robert L. Harris > > DISCLAIMER: > These are MY OPINIONS With Dreams To Be A King, > ALONE. I speak for First One Should Be A Man > no-one else. - Manowar > > _______________________________________________ > Denver-pm mailing list > Denver-pm at pm.org > http://mail.pm.org/mailman/listinfo/denver-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: