<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>Hello Gregor,</span></div><div><br><span></span></div><div><span>> </span>$p->{pid} and $p->{cmndline} is probably cleaner.</div><div><br></div><div>Agreed. Is it cleaner in the perldoc part, too?</div><div><br></div><div>> It seems we can close this bug :)</div><div><br></div><div>Duh! A brain bug...</div><div><br></div><div>Thanks</div><div>Wolfgang<br></div><div><br></div><div><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">Von:</span></b> gregor herrmann <gregoa@debian.org><br> <b><span style="font-weight: bold;">An:</span></b> 650518@bugs.debian.org; 650518-submitter@bugs.debian.org <br> <b><span
 style="font-weight: bold;">Gesendet:</span></b> 21:43 Freitag, 16.Dezember 2011<br> <b><span style="font-weight: bold;">Betreff:</span></b> Bug#650518: (Fwd) Re: Bug#650518: libproc-processtable-perl: Module expects english locale<br> </font> <br>tag 650518 - unreproducible moreinfo<br>thanks<br><br>On Fri, 16 Dec 2011 21:04:59 +0100, gregor herrmann wrote:<br><br>Hi Wolfgang,<br><br>please always keep <a ymailto="mailto:650518@bugs.debian.org" href="mailto:650518@bugs.debian.org">650518@bugs.debian.org</a> in the loop.<br><br>> So, first that what I started with:<br><br>Thanks for your info, I now can reproduce the problem:<br> <br>> firma@nb000002:~$ uname -a<br>> Linux nb000002 2.6.32-5-amd64 #1 SMP Thu Nov 3 03:41:26 UTC 2011 x86_64 GNU/Linux<br>> firma@nb000002:~$ echo $LANG<br>> de_DE.UTF-8<br>> firma@nb000002:~$ ls file_does_not_exist<br>> ls: Zugriff auf file_does_not_exist nicht möglich: Datei oder Verzeichnis nicht
 gefunden<br>> firma@nb000002:~$ perl -e 'use Proc::ProcessTable; printf "%s\n",$Proc::ProcessTable::VERSION;'<br>> 0.45<br>> firma@nb000002:~$ nl -ba ~/bin/ff<br>>      1  #!/usr/bin/env perl<br>>      2<br>>      3  use Proc::ProcessTable;<br>>      4  use strict;<br>>      5  use warnings;<br>>      6<br>>      7  my $p = Proc::ProcessTable->new();<br>>      8  my ( $ref, $pid, $cmd );<br>>      9<br>>     10  foreach $ref ( @{ $p->table } ) {<br>>     11      $pid = $p->pid;<br>>     12      $cmd = $p->cmdline;<br>>     13      if ( $cmd =~
 /firefox/ ) {<br>>     14          printf( "Found %d / %s\n", $pid, $cmd );<br>>     15      }<br>>     16  }<br>>     17<br>> <br>> firma@nb000002:~$ ~/bin/ff<br>> Your vendor has not defined Proc::ProcessTable macro pid at /home/firma/bin/ff line 11<br>> firma@nb000002:~$ <br><br>gregoa@belanna:~$ echo $LANG<br>C<br>gregoa@belanna:~$ export LANG=de_AT.utf8<br>gregoa@belanna:~$ echo $LANG<br>de_AT.utf8<br>gregoa@belanna:~$ ls file_does_not_exist<br>ls: Zugriff auf file_does_not_exist nicht möglich: Datei oder Verzeichnis nicht gefunden<br>gregoa@belanna:~$ perl -e 'use Proc::ProcessTable; printf "%s\n",$Proc::ProcessTable::VERSION;'<br>0.45<br>gregoa@belanna:~$ nl -ba ff<br>     1  #!/usr/bin/env perl<br>     2  <br>     3  use
 Proc::ProcessTable;<br>     4  use strict;<br>     5  use warnings;<br>     6  <br>     7  my $p = Proc::ProcessTable->new();<br>     8  my ( $ref, $pid, $cmd );<br>     9  <br>    10  foreach $ref ( @{ $p->table } ) {<br>    11      $pid = $p->pid;<br>    12      $cmd = $p->cmdline;<br>    13      if ( $cmd =~ /firefox/ ) {<br>    14          printf( "Found %d / %s\n", $pid, $cmd );<br>    15      }<br>    16  }<br>gregoa@belanna:~$ perl ff<br>Your vendor has not defined Proc::ProcessTable macro pid at ff line 11<br>gregoa@belanna:~$ export LANG=C<br>gregoa@belanna:~$ echo $LANG<br>C<br>gregoa@belanna:~$ ls file_does_not_exist<br>ls: cannot access file_does_not_exist: No such file or
 directory<br>gregoa@belanna:~$ perl ff<br>Can't locate auto/Proc/ProcessTable/pid.al in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ff line 11<br><br>Interestingly the example script still works:<br><br>gregoa@belanna:~$ echo $LANG<br>C<br>gregoa@belanna:~$ /usr/share/doc/libproc-processtable-perl/examples/example.pl<br>[lots of output without errors]<br>gregoa@belanna:~$ export LANG=de_AT.utf8<br>gregoa@belanna:~$ echo $LANG<br>de_AT.utf8<br>gregoa@belanna:~$ /usr/share/doc/libproc-processtable-perl/examples/example.pl<br>[lots of output without errors]<br><br>Hm, so the example works both with C and de_AT.utf8, and your script<br>fails with both C and de_DE.UTF-8.<br><br>Some times later:<br><br>* It should be cmndline instead of cmdline.<br>* And then you want to use $ref and not $p in the loop.<br>* And
 $p->{pid} and $p->{cmndline} is probably cleaner.<br><br><br>The following works for me under C and under de_AT.utf8:<br><br>$ nl -ba ff<br>     1  #!/usr/bin/env perl<br>     2  <br>     3  use Proc::ProcessTable;<br>     4  use strict;<br>     5  use warnings;<br>     6  <br>     7  my $p = Proc::ProcessTable->new();<br>     8  my ( $ref, $pid, $cmd );<br>     9  <br>    10  foreach $ref ( @{ $p->table } ) {<br>    11      $pid = $ref->pid;<br>    12      $cmd = $ref->cmndline;<br>    13      if ( $cmd =~ /firefox/ ) {<br>    14          printf( "Found %d / %s\n", $pid, $cmd );<br>    15      }<br>    16  }<br><br>It seems we can close
 this bug :)<br><br><br>Cheers,<br>gregor<br> <br>-- <br> .''`.   Homepage: <a href="http://info.comodo.priv.at/" target="_blank">http://info.comodo.priv.at/</a> - OpenPGP key ID: 0x8649AA06<br> : :' :  Debian GNU/Linux user, admin, & developer - <a href="http://www.debian.org/" target="_blank">http://www.debian.org/</a><br> `. `'   Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe<br>   `-    NP: Dire Straits: Sultans Of Swing<br><br><br> </div> </div>  </div></body></html>