<?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: Ghost in a PERL script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897446#M701432</link>
    <description>I don't know why you're seeing the errors;&lt;BR /&gt;however, you'd be better off using some of&lt;BR /&gt;Perl's built in operators instead of doing&lt;BR /&gt;a system("ls ...") and reading in the file:&lt;BR /&gt;&lt;BR /&gt;opendir(DIR, $buffer);&lt;BR /&gt;@files = sort(readdir(DIR));&lt;BR /&gt;closedir(DIR);&lt;BR /&gt;foreach $file (@files) {&lt;BR /&gt;  $filename = "$buffer/$file";&lt;BR /&gt;  next unless -T $filename;&lt;BR /&gt;  next unless -s $filename;&lt;BR /&gt;  next unless $filename =~ /\.ToBeCopied$/;&lt;BR /&gt;  print "process $$: processing $filename\n";&lt;BR /&gt;  ...&lt;BR /&gt;}&lt;BR /&gt;</description>
    <pubDate>Thu, 21 Apr 2005 12:08:58 GMT</pubDate>
    <dc:creator>Gregory Fruth</dc:creator>
    <dc:date>2005-04-21T12:08:58Z</dc:date>
    <item>
      <title>Ghost in a PERL script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897443#M701429</link>
      <description>Hello colleagues&lt;BR /&gt;&lt;BR /&gt;I'm running a simple PERL program which lists a directory content, then analyze each item of the directory, then lists again, and so on.&lt;BR /&gt;SOmetimes the lists loopbacks on itself.&lt;BR /&gt;See the program branch ...&lt;BR /&gt;&lt;BR /&gt;        system("ls -rt $buffer/*.ToBeCopied &amp;gt; $buffer/TBC 2&amp;gt;/dev/null"); &lt;BR /&gt;        if ( -T "$buffer/TBC" &amp;amp;&amp;amp; -s "$buffer/TBC" )  { &lt;BR /&gt;           open (FILE_LIST, "$buffer/TBC"); &lt;BR /&gt;           while (my $filename= &lt;FILE_LIST&gt;) { &lt;BR /&gt;              print "process $$: processing $filename\n";&lt;BR /&gt;}&lt;BR /&gt;...&lt;BR /&gt;There's a KSH script which is populating the directory.&lt;BR /&gt;It seems that the "$filename= &lt;FILE_LIST&gt;" doesn't increment the file handler, or at a certain point the condition doesn't return "NULL" but it starts again from the beginning ....&lt;BR /&gt;&lt;BR /&gt;any helps?&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;Enrico&lt;/FILE_LIST&gt;&lt;/FILE_LIST&gt;</description>
      <pubDate>Thu, 21 Apr 2005 05:11:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897443#M701429</guid>
      <dc:creator>Enrico Venturi</dc:creator>
      <dc:date>2005-04-21T05:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Ghost in a PERL script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897444#M701430</link>
      <description>Add this to your code:&lt;BR /&gt;&lt;BR /&gt;$n1 = 0;&lt;BR /&gt;&lt;BR /&gt;# your code&lt;BR /&gt;# Additional while condition&lt;BR /&gt;while($n1 eq 0){;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if(eof(FILE_LIST)){ $n1 = 1 } ;&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This way when you detect eof, end of file in your reading of the file list your program can terminate.&lt;BR /&gt;&lt;BR /&gt;Good Luck,&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Apr 2005 05:17:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897444#M701430</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-04-21T05:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ghost in a PERL script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897445#M701431</link>
      <description>Nothing changed :-(&lt;BR /&gt;&lt;BR /&gt;it seems EOF never detected.......</description>
      <pubDate>Thu, 21 Apr 2005 05:53:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897445#M701431</guid>
      <dc:creator>Enrico Venturi</dc:creator>
      <dc:date>2005-04-21T05:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Ghost in a PERL script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897446#M701432</link>
      <description>I don't know why you're seeing the errors;&lt;BR /&gt;however, you'd be better off using some of&lt;BR /&gt;Perl's built in operators instead of doing&lt;BR /&gt;a system("ls ...") and reading in the file:&lt;BR /&gt;&lt;BR /&gt;opendir(DIR, $buffer);&lt;BR /&gt;@files = sort(readdir(DIR));&lt;BR /&gt;closedir(DIR);&lt;BR /&gt;foreach $file (@files) {&lt;BR /&gt;  $filename = "$buffer/$file";&lt;BR /&gt;  next unless -T $filename;&lt;BR /&gt;  next unless -s $filename;&lt;BR /&gt;  next unless $filename =~ /\.ToBeCopied$/;&lt;BR /&gt;  print "process $$: processing $filename\n";&lt;BR /&gt;  ...&lt;BR /&gt;}&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Apr 2005 12:08:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897446#M701432</guid>
      <dc:creator>Gregory Fruth</dc:creator>
      <dc:date>2005-04-21T12:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Ghost in a PERL script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897447#M701433</link>
      <description>Hi Enrico,&lt;BR /&gt;&lt;BR /&gt;I have attached sample perl file to list directory recursively.&lt;BR /&gt;Please change your $root_dir variable.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Ganesha Sridhara&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Apr 2005 00:41:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897447#M701433</guid>
      <dc:creator>Ganesha Sridhara</dc:creator>
      <dc:date>2005-04-22T00:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ghost in a PERL script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897448#M701434</link>
      <description>I changed my code, now it works.</description>
      <pubDate>Fri, 22 Apr 2005 05:18:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ghost-in-a-perl-script/m-p/4897448#M701434</guid>
      <dc:creator>Enrico Venturi</dc:creator>
      <dc:date>2005-04-22T05:18:53Z</dc:date>
    </item>
  </channel>
</rss>

