#perl - Tue 27 Mar 2007 between 09:35 and 09:45



masupsomian, yes it worked: perl -e 'my $cmd = "diff <(sort file1) <(sort file2)"; printf "[%s]...\n", $cmd; exec "/bin/bash -c \"$cmd\"";'
threat2ofer0: so I want to sort the value of the inner hash, if they are equal, I want to sort by the key of the outer hash
masupsomian: also for system
maukethreat2: that's the same as my %hash = (user1 => 'time', 3232 => 'user2', time => 1211);
there is no inner hash
threat2mauke: hmmm
somianAhh, specifying the shell explicitly, good.
loiicis there a way to say that you don't care that you re using an unitnitialized value in a concat and tell perl to process it as a ""?
ofer0threat2, you probably means { hash } ?
threat2mauke: my %hash = (); $hash{"user1"}{"time"} = 3232; $hash{"user2"}{"time"} = 3220;
ofer0: --^
maukethreat2: eww
Casanwhoever: your intuition was perfect it was an address problem, the user had entered their name instead of email address where appropriate.
threat2mauke: yeah yeah
maukethreat2: my %hash = (user1 => {time => 3232}, user2 => {time => 1211});
threat2mauke: like I said, a hash of a hash
mauke: ok thank you :)
whoeverCasan: usual bug, input is evil unless proven that it's valid ;)
ofer0threat2, now, what are you trying to do with the result ?
threat2, I mean, if you assign it to a hash, it will be unsorted once again.
masupsomian: I didn't tried yet the environment variable ENV{SHELL}.
somianIt doesn't work
threat2ofer0: after I have finished populating the hash I want to sort it then print it to stdout
masupsomian: still the same error?
somianYes
threat2ofer0: are there any docs that give examples of sorting a hash of a hash?
maukeyou don't sort hashes
threat2ofer0: or would you like to give me an example?
maukesort takes and returns a list
ofer0threat2, perldoc perldsc
threat2oh
ofer0: hmmmm, I will google for a html version of that ;)
ofer0http://perldoc.perl.org/perldsc.html
actionsomian got kicked from ##c ... Zhivago is verrrrry angery with us, precioussss
somiangot kicked from ##c ... Zhivago is verrrrry angery with us, precioussss
masupsomian: in my real case (and not the sample test), it didn't worked too. Let me see the differences...
threat2ofer0: yay
ofer0threat2, that's not what you want
you can write a function for this one
threat2ofer0: ok so I need to write a function to do it?
ofer0threat2, yes.

Page: 5 12 19 26 33 40 47 54 61 68 75 82 89 96 103 110 117 

IrcArchive