#perl - Sat 5 May 2007 between 11:07 and 11:14



jagermanZaba: If you're doing any array manipulation other than appending to the array, you'll need to switch to a C-style for loop
JuerdZaba: Will the array eventually be empty?
f00li5hZaba: iterate over a list of moudules to unload, you say
ZabaJuerd, probably, if none of the modules will fail to unload
JuerdZaba: So not definitely always empty?
f00li5hZaba: now about having the module names as the argument list to a sub
then you can unload each argument without changing the list
integralP5NCI considered harmful, my gcc just needed >1200MB of VM
Zabahm..
JuerdZaba: my @success; my @fail; while (@modules) { my $module = shift @modules; if (unload $module) { push @success, $module } else { push @fail, $module } }
Gives you free counters and diagnostics too.
Monieeval: my @success; my @fail; while (@modules) { my $module = shift @modules; if (unload $module) { push @success, $module } else { push @fail, $module } }
buubotMonie: 0
JuerdMonie: @modules is initially empty in this example :)
Monieok.
jagermanAre these Perl modules you're attempting to unload?
JuerdZaba: And if you need @modules to be @fail afterwards, @modules = @fail; is a great way to clearly document this.
jagerman: Let's hope not :)
Zabahm
Juerd, it dies at failture, so
f00li5hpush unload $module ? @success : @fail , $module ;
JuerdZaba: Then you can jush while over the loop, and not push things :)
f00li5hdeparse: sub unload; push unload $module ? @success : @fail , $module ;
ZabaJuerd, though i still need to track loaded modules
and hm
buubotKilling 1357 due to run time
f00li5hbuubot: meow?
buubotmeow is the sound cats make
Juerdf00li5h: Style depends on audience.
f00li5hJuerd: and if you're evil or not >;)
rindolfHi octagon
JuerdZaba: If you unload all, and failure will lead to death, then the array will always be empty at the end if it ever reaches that, right?
f00li5h: That too depends on audience.
f00li5hanyway, no, i'm evil either way
Juerdf00li5h: Even to your mom?
f00li5hnot really
rindolfoctagon: I went to the all-night caf yesterday's night. But they didn't have food - only drinks.
octagon: so I went back home, ate some pasta and went to sleep.
octagon: maybe today, I'll hit it earlier.
f00li5hperhaps i can write some kind of apache handler to populate my templates

Page: 4 11 18 25 32 39 46 53 60 67 74 81 88 95 102 

IrcArchive