Bug#650518: (Fwd) Re: Bug#650518: libproc-processtable-perl: Module expects english locale
Wolfgang Wilhelm
wolfgang20121964 at yahoo.de
Fri Dec 16 21:05:59 UTC 2011
Hello Gregor,
> $p->{pid} and $p->{cmndline} is probably cleaner.
Agreed. Is it cleaner in the perldoc part, too?
> It seems we can close this bug :)
Duh! A brain bug...
Thanks
Wolfgang
________________________________
Von: gregor herrmann <gregoa at debian.org>
An: 650518 at bugs.debian.org; 650518-submitter at bugs.debian.org
Gesendet: 21:43 Freitag, 16.Dezember 2011
Betreff: Bug#650518: (Fwd) Re: Bug#650518: libproc-processtable-perl: Module expects english locale
tag 650518 - unreproducible moreinfo
thanks
On Fri, 16 Dec 2011 21:04:59 +0100, gregor herrmann wrote:
Hi Wolfgang,
please always keep 650518 at bugs.debian.org in the loop.
> So, first that what I started with:
Thanks for your info, I now can reproduce the problem:
> firma at nb000002:~$ uname -a
> Linux nb000002 2.6.32-5-amd64 #1 SMP Thu Nov 3 03:41:26 UTC 2011 x86_64 GNU/Linux
> firma at nb000002:~$ echo $LANG
> de_DE.UTF-8
> firma at nb000002:~$ ls file_does_not_exist
> ls: Zugriff auf file_does_not_exist nicht möglich: Datei oder Verzeichnis nicht gefunden
> firma at nb000002:~$ perl -e 'use Proc::ProcessTable; printf "%s\n",$Proc::ProcessTable::VERSION;'
> 0.45
> firma at nb000002:~$ nl -ba ~/bin/ff
> 1 #!/usr/bin/env perl
> 2
> 3 use Proc::ProcessTable;
> 4 use strict;
> 5 use warnings;
> 6
> 7 my $p = Proc::ProcessTable->new();
> 8 my ( $ref, $pid, $cmd );
> 9
> 10 foreach $ref ( @{ $p->table } ) {
> 11 $pid = $p->pid;
> 12 $cmd = $p->cmdline;
> 13 if ( $cmd =~ /firefox/ ) {
> 14 printf( "Found %d / %s\n", $pid, $cmd );
> 15 }
> 16 }
> 17
>
> firma at nb000002:~$ ~/bin/ff
> Your vendor has not defined Proc::ProcessTable macro pid at /home/firma/bin/ff line 11
> firma at nb000002:~$
gregoa at belanna:~$ echo $LANG
C
gregoa at belanna:~$ export LANG=de_AT.utf8
gregoa at belanna:~$ echo $LANG
de_AT.utf8
gregoa at belanna:~$ ls file_does_not_exist
ls: Zugriff auf file_does_not_exist nicht möglich: Datei oder Verzeichnis nicht gefunden
gregoa at belanna:~$ perl -e 'use Proc::ProcessTable; printf "%s\n",$Proc::ProcessTable::VERSION;'
0.45
gregoa at belanna:~$ nl -ba ff
1 #!/usr/bin/env perl
2
3 use Proc::ProcessTable;
4 use strict;
5 use warnings;
6
7 my $p = Proc::ProcessTable->new();
8 my ( $ref, $pid, $cmd );
9
10 foreach $ref ( @{ $p->table } ) {
11 $pid = $p->pid;
12 $cmd = $p->cmdline;
13 if ( $cmd =~ /firefox/ ) {
14 printf( "Found %d / %s\n", $pid, $cmd );
15 }
16 }
gregoa at belanna:~$ perl ff
Your vendor has not defined Proc::ProcessTable macro pid at ff line 11
gregoa at belanna:~$ export LANG=C
gregoa at belanna:~$ echo $LANG
C
gregoa at belanna:~$ ls file_does_not_exist
ls: cannot access file_does_not_exist: No such file or directory
gregoa at belanna:~$ perl ff
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
Interestingly the example script still works:
gregoa at belanna:~$ echo $LANG
C
gregoa at belanna:~$ /usr/share/doc/libproc-processtable-perl/examples/example.pl
[lots of output without errors]
gregoa at belanna:~$ export LANG=de_AT.utf8
gregoa at belanna:~$ echo $LANG
de_AT.utf8
gregoa at belanna:~$ /usr/share/doc/libproc-processtable-perl/examples/example.pl
[lots of output without errors]
Hm, so the example works both with C and de_AT.utf8, and your script
fails with both C and de_DE.UTF-8.
Some times later:
* It should be cmndline instead of cmdline.
* And then you want to use $ref and not $p in the loop.
* And $p->{pid} and $p->{cmndline} is probably cleaner.
The following works for me under C and under de_AT.utf8:
$ nl -ba ff
1 #!/usr/bin/env perl
2
3 use Proc::ProcessTable;
4 use strict;
5 use warnings;
6
7 my $p = Proc::ProcessTable->new();
8 my ( $ref, $pid, $cmd );
9
10 foreach $ref ( @{ $p->table } ) {
11 $pid = $ref->pid;
12 $cmd = $ref->cmndline;
13 if ( $cmd =~ /firefox/ ) {
14 printf( "Found %d / %s\n", $pid, $cmd );
15 }
16 }
It seems we can close this bug :)
Cheers,
gregor
--
.''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key ID: 0x8649AA06
: :' : Debian GNU/Linux user, admin, & developer - http://www.debian.org/
`. `' Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe
`- NP: Dire Straits: Sultans Of Swing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20111216/6a757a97/attachment.html>
More information about the pkg-perl-maintainers
mailing list