CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Post deleted by $_

 



$_
Novice

May 18, 2009, 11:11 AM

Post #1 of 5 (1748 views)
Post deleted by $_

 


FishMonger
Veteran / Moderator

May 18, 2009, 11:51 AM

Post #2 of 5 (1744 views)
Re: [$_] printf display order [In reply to] Can't Post

I'm unable to duplicate your issue.

Code
[root@fc4dev ~]# cat test.pl 
#!/usr/bin/perl

use strict;
use warnings;

my %resolved = ('device.netserv.ch' => 1,
'isp.belgacom.be' => 11,
);

$| = 1;

my $total = 0;

for (sort { $resolved{$b} <=> $resolved{$a} } keys(%resolved))
{
$total += $resolved{$_};
printf "%5d \t%s\n", $resolved{$_}, $_;
}

printf "-----\n%5d\n", $total;


Code
[root@fc4dev ~]# ./test.pl 
11 isp.belgacom.be
1 device.netserv.ch
-----
12
[root@fc4dev ~]# ./test.pl
11 isp.belgacom.be
1 device.netserv.ch
-----
12
[root@fc4dev ~]# ./test.pl
11 isp.belgacom.be
1 device.netserv.ch
-----
12
[root@fc4dev ~]# ./test.pl
11 isp.belgacom.be
1 device.netserv.ch
-----
12
[root@fc4dev ~]# ./test.pl
11 isp.belgacom.be
1 device.netserv.ch
-----
12
[root@fc4dev ~]# ./test.pl
11 isp.belgacom.be
1 device.netserv.ch
-----
12
[root@fc4dev ~]# ./test.pl
11 isp.belgacom.be
1 device.netserv.ch
-----
12


Can you post a complete example, as I did, of the issue?


KevinR
Veteran


May 18, 2009, 4:01 PM

Post #3 of 5 (1739 views)
Re: [$_] printf display order [In reply to] Can't Post


In Reply To
I know and used Perl for a long time - while I'm not a specialist.
Now, there is this behavior that I don't understand
.
.
.
I don't see any obvious reason. Thanks for helping.


I can't see any reason why that would happen either.
-------------------------------------------------


$_
Novice

May 18, 2009, 11:48 PM

Post #4 of 5 (1731 views)
Re: [FishMonger] printf display order [In reply to] Can't Post

No way to delete the whole thread :(
The output was actually piped to a sort through an alias...
Sorry didn't see that initially!


KevinR
Veteran


May 19, 2009, 9:37 AM

Post #5 of 5 (1727 views)
Re: [$_] printf display order [In reply to] Can't Post


In Reply To
No way to delete the whole thread :(
The output was actually piped to a sort through an alias...
Sorry didn't see that initially!


There is no reason to delete the thread. The problem you had and the eventual cause might help another person in the future that faces a similar situation.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives