>>ビギナー
ならこうしてみ。試したら出来た。

# パスワードを暗号化
if ($in{'pwd'} ne "") { $ango = &encrypt($in{'pwd'}); }

if($in{'icon'} eq 'rand.gif'){
$rand_icon = 1;#フラグを立てる
$in{'icon'} = $icon1[int(rand( $#icon1))];
}else{$rand_icon = 0;}




書き込み処理




if($rand_icon){$in{icon} = 'rand.gif';}#書き込み終わったので戻す

# ロック解除
if ($lockkey) { &unlock; }