version 1.6, 2007/01/26 23:37:51
|
version 1.7, 2007/07/12 01:04:32
|
Line 245 sub attemptread {
|
Line 245 sub attemptread {
|
# ------------------------------------- Revive zombie idx or get unused number |
# ------------------------------------- Revive zombie idx or get unused number |
|
|
sub getresidx { |
sub getresidx { |
my $url=shift; |
my ($url,$residx)= @_; |
my $max=1+($#resources>$#zombies?$#resources:$#zombies); |
my $max=1+($#resources>$#zombies?$#resources:$#zombies); |
unless ($url) { return $max; } |
unless ($url) { return $max; } |
for (my $i=0; $i<=$#zombies; $i++) { |
for (my $i=0; $i<=$#zombies; $i++) { |
my ($title,$src,$ext,$type)=split(/\:/,$zombies[$i]); |
my ($title,$src,$ext,$type)=split(/\:/,$zombies[$i]); |
if ($src eq $url) { |
if ($src eq $url) { |
undef($zombies[$i]); |
if ($residx) { |
return $i; |
if ($i == $residx) { |
|
undef($zombies[$i]); |
|
return $i; |
|
} |
|
} else { |
|
undef($zombies[$i]); |
|
return $i; |
|
} |
} |
} |
} |
} |
return $max; |
return $max; |