in reply to Edit array in place (was: Help)
You can find the line without splitting first:
The &no_match and &duped_ids subs are up to you, they would probably log the error.chomp @file; my @matches = grep { $file[$_] =~ /^\Q$storeline|\E/ } 0..$#file; no_match($storeline), return unless @matches; duped_ids($storeline), return if @matches > 1; my ($number, $image, $name, $text, $used) = split /\|/, $file[$matches +[0]]; # do what you do modifying those vars $file[$matches[0]] = join '|', $number, $image, $name, $text, $used; rename '/path/to/info/smileset.txt', '/path/to/info/smileset.bak' or d +ie $!; open FLE, '>', '/path/to/info/smileset.txt' or die $!; print FLE $_, $/ for @file; close FLE or die $!;
After Compline,
Zaxo
|
|---|