Mike -- 

Can you explain this one a little?  I don't understand the example you gave in 
the comment.

Also, are you adding all the new funclets to the wiki documentation?



On Dec 29, 2010, at 3:52 AM, mi...@osl.iu.edu wrote:

> Author: miked
> Date: 2010-12-29 03:52:24 EST (Wed, 29 Dec 2010)
> New Revision: 1377
> URL: https://svn.open-mpi.org/trac/mtt/changeset/1377
> 
> Log:
> added mtt_switch to simplify if-then-else cases in ini files
> 
> Text files modified: 
>   trunk/lib/MTT/Values/Functions.pm |    21 +++++++++++++++++++++             
>       
>   1 files changed, 21 insertions(+), 0 deletions(-)
> 
> Modified: trunk/lib/MTT/Values/Functions.pm
> ==============================================================================
> --- trunk/lib/MTT/Values/Functions.pm (original)
> +++ trunk/lib/MTT/Values/Functions.pm 2010-12-29 03:52:24 EST (Wed, 29 Dec 
> 2010)
> @@ -3163,4 +3163,25 @@
>       return $x->{result_stdout};
> }
> 
> +#
> +# Poor man switch statement
> +# Example: mtt_switch(@np@, 9, "return1", 100, return2", "default", 0);
> +#
> +
> +sub mtt_switch
> +{
> +    my ($var, %cases) = @_;
> +
> +    if ($cases{$var}) {
> +        return $cases{$var};
> +    }
> +
> +    if ($cases{'default'}) {
> +        return $cases{'default'};
> +    }
> +
> +    Debug("ERROR: Not found case for $var\n");
> +}
> +
> +
> 1;
> _______________________________________________
> mtt-svn mailing list
> mtt-...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-svn


-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/


Reply via email to