Pablo Fischer wrote:
>
> Hello Again!
Hello,
> I need to evaluate a lot of conditionals, and of course the use of a lot of
> if's its not the 'right' way, so Im using something like this:
>
> CASE: {
> ($string == "match1") && do {
^^^^^^^^^^^^^^^^^^^
> actions..
> last CASE;
> };
> ($string == "match2") && do {
^^^^^^^^^^^^^^^^^^^
You can't use the "==" operator to compare strings, you have to use the
"eq" operator instead.
> actions..
> last CASE;
> };
> and a lot more..
> }
>
> The question, where does the 'default' case starts?. The last 5 years I have
> been programming in C/C++/C#/Php.. C-styles languages, so in Perl, where does
> the 'default' case begins?
Have you read the FAQ entry on this?
perldoc -q "How do I create a switch or case statement"
Or read the "Basic BLOCKs and Switch Statements" section of perlsyn.pod?
perldoc perlsyn
Or had a look at the Switch module?
http://search.cpan.org/author/DCONWAY/Switch-2.09/Switch.pm
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]