<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ifelse + perl in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ifelse-perl/m-p/3988273#M295265</link>
    <description>google, ask him "perl switch statement"</description>
    <pubDate>Wed, 25 Apr 2007 02:01:12 GMT</pubDate>
    <dc:creator>Maxim Yakimenko</dc:creator>
    <dc:date>2007-04-25T02:01:12Z</dc:date>
    <item>
      <title>ifelse + perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ifelse-perl/m-p/3988272#M295264</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am having a script where too many if else are using can any one advice how to use switch statement.&lt;BR /&gt;&lt;BR /&gt;Script is like this&lt;BR /&gt;&lt;BR /&gt;if (($var1 eq $var2)) &amp;amp;&amp;amp; ($op1 &amp;lt; $op2)) {&lt;BR /&gt;print "HI";&lt;BR /&gt;}&lt;BR /&gt;elsif (($var1 &amp;lt; $var2)) &amp;amp;&amp;amp; ($op1 &amp;gt; $op2)) {&lt;BR /&gt;print "OK";&lt;BR /&gt;}&lt;BR /&gt;elsif... and so on</description>
      <pubDate>Wed, 25 Apr 2007 01:34:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ifelse-perl/m-p/3988272#M295264</guid>
      <dc:creator>network_4</dc:creator>
      <dc:date>2007-04-25T01:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: ifelse + perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ifelse-perl/m-p/3988273#M295265</link>
      <description>google, ask him "perl switch statement"</description>
      <pubDate>Wed, 25 Apr 2007 02:01:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ifelse-perl/m-p/3988273#M295265</guid>
      <dc:creator>Maxim Yakimenko</dc:creator>
      <dc:date>2007-04-25T02:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: ifelse + perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ifelse-perl/m-p/3988274#M295266</link>
      <description>There is no real need in Perl for a switch statement, though many people accustomed to it from C etc. seem to miss this.&lt;BR /&gt;There are many ways to implement a switch with common Perl idioms.&lt;BR /&gt;Please, run "perldoc -q switch"&lt;BR /&gt;or see the "Basic BLOCKs and Switch Statements" section of "perldoc perlsyn".&lt;BR /&gt;Also may be found here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://perldoc.perl.org/perlsyn.html#Basic-BLOCKs-and-Switch-Statements" target="_blank"&gt;http://perldoc.perl.org/perlsyn.html#Basic-BLOCKs-and-Switch-Statements&lt;/A&gt;</description>
      <pubDate>Wed, 25 Apr 2007 03:42:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ifelse-perl/m-p/3988274#M295266</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-04-25T03:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: ifelse + perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ifelse-perl/m-p/3988275#M295267</link>
      <description>&lt;!--!*#--&gt;Drat, I'm sure I replied earlier.&lt;BR /&gt;perl up to and including 5.8.x does not have a switch statement, even though many people (think they) need it.&lt;BR /&gt;There is a switch statement in the upcoming 5.10 release, which also supports smart matching, but as long as that release is not yet available, it won't help you.&lt;BR /&gt;&lt;BR /&gt;On CPAN, there is a Switch module, but I strongly advice NOT using it, as it is based on source filtering, and wil;l defenitely bring more trouble than good in the longer scripts.&lt;BR /&gt;&lt;BR /&gt;You can make a dispatch table if that suits your needs, something like:&lt;BR /&gt;&lt;BR /&gt;my %dt = (&lt;BR /&gt;    "-1:-1" =&amp;gt; sub {&lt;BR /&gt;        print "var1 &amp;lt; var2 and op1 &amp;lt; op2\n";&lt;BR /&gt;        },&lt;BR /&gt;    :&lt;BR /&gt;    :&lt;BR /&gt;    "1:0"   =&amp;gt; sub {&lt;BR /&gt;        print "var1 &amp;gt; var 2 &amp;amp; op1 = op2\n";&lt;BR /&gt;        },&lt;BR /&gt;    "1:1"   =&amp;gt; sub {&lt;BR /&gt;        die "var2 &amp;gt; var1 &amp;amp; op2 &amp;gt; op1: should not happen\n";&lt;BR /&gt;        },&lt;BR /&gt;    );&lt;BR /&gt;&lt;BR /&gt;$dt{($var1 &amp;lt;=&amp;gt; $var2).":".($op1  &amp;lt;=&amp;gt; $op2)}-&amp;gt;();&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Wed, 25 Apr 2007 05:30:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ifelse-perl/m-p/3988275#M295267</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2007-04-25T05:30:03Z</dc:date>
    </item>
  </channel>
</rss>

