<?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: Perl problem:  logical operators. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-logical-operators/m-p/3430291#M707380</link>
    <description>In fact, if either ( -e $file ) or ( -d $file ) is TRUE, the total outcome shut be TRUE. &lt;BR /&gt;&lt;BR /&gt;What if you use "or" instead of "||", i.e. &lt;BR /&gt;&lt;BR /&gt;if ( -e $file ) or ( -d $file )&lt;BR /&gt;&lt;BR /&gt;Also, does it help if you put some brackets around the condition, i.e.&lt;BR /&gt;&lt;BR /&gt;if ( ( -e $file ) || ( -d $file ) )&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 25 Nov 2004 05:21:06 GMT</pubDate>
    <dc:creator>Georg Tresselt</dc:creator>
    <dc:date>2004-11-25T05:21:06Z</dc:date>
    <item>
      <title>Perl problem:  logical operators.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-logical-operators/m-p/3430289#M707378</link>
      <description>&lt;BR /&gt;From a file, I read a list of files or directories.&lt;BR /&gt;&lt;BR /&gt;I must check if in my current subtree , it exists. The individual match&lt;BR /&gt;( if it is a file or it is a directory) is successful but it associate&lt;BR /&gt;both of them with the OR operator ,it fails.&lt;BR /&gt;&lt;BR /&gt;I mean :  if ( -e $file ) -&amp;gt; success&lt;BR /&gt;               if ( -d $file ) -&amp;gt; suc ess&lt;BR /&gt;               if ( -e $file )  || ( -d $file ) -&amp;gt; fails&lt;BR /&gt;               if ( ( -e $file)   || ( -d $file ) ) -&amp;gt; fails&lt;BR /&gt;&lt;BR /&gt;Can you help me with the correct synxtax?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;        Raul</description>
      <pubDate>Thu, 25 Nov 2004 04:42:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-logical-operators/m-p/3430289#M707378</guid>
      <dc:creator>Raul del Castillo_1</dc:creator>
      <dc:date>2004-11-25T04:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Perl problem:  logical operators.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-logical-operators/m-p/3430290#M707379</link>
      <description>if (-e $file || -d _) {&lt;BR /&gt; action&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn [ introducing the often forgotten shortcut and speedup _ for last used file in stat op ]</description>
      <pubDate>Thu, 25 Nov 2004 05:05:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-logical-operators/m-p/3430290#M707379</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-11-25T05:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Perl problem:  logical operators.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-logical-operators/m-p/3430291#M707380</link>
      <description>In fact, if either ( -e $file ) or ( -d $file ) is TRUE, the total outcome shut be TRUE. &lt;BR /&gt;&lt;BR /&gt;What if you use "or" instead of "||", i.e. &lt;BR /&gt;&lt;BR /&gt;if ( -e $file ) or ( -d $file )&lt;BR /&gt;&lt;BR /&gt;Also, does it help if you put some brackets around the condition, i.e.&lt;BR /&gt;&lt;BR /&gt;if ( ( -e $file ) || ( -d $file ) )&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Nov 2004 05:21:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-logical-operators/m-p/3430291#M707380</guid>
      <dc:creator>Georg Tresselt</dc:creator>
      <dc:date>2004-11-25T05:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Perl problem:  logical operators.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-logical-operators/m-p/3430292#M707381</link>
      <description>procura's suggestion is the preferred way,&lt;BR /&gt;because usage of the thingy '_' in the second test avoids another stat() syscall.&lt;BR /&gt;The difference between || and 'or' is that the latter has lesser precedence which can make a decisive difference but not in this case, so there should be no difference&lt;BR /&gt;  &lt;BR /&gt;For details please consult&lt;BR /&gt; &lt;BR /&gt;perldoc -f -x&lt;BR /&gt;perldoc perlop</description>
      <pubDate>Thu, 25 Nov 2004 05:27:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-logical-operators/m-p/3430292#M707381</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-11-25T05:27:51Z</dc:date>
    </item>
  </channel>
</rss>

