Using BBEdit 7.0.3 on MacOS X 10.2.6 -- I just spend about 5 minutes trying to figure out why this *very* basic Perl code wasn't working (kept reporting the same 4 hosts, without removing duplicates, which is what it should be doing) --
%seen = (); @uniq = (); @list = ();
while(<DATA>){
chomp;
push(@list,$_);
}foreach $item (@list) {
unless ($seen{$item}) {
# if we get here, we have not seen it before
$seen{$item} = 1;
push(@uniq, $item);
}
}# Print the results -
foreach $item (@uniq) {
print "<a href=\"http://$item/\">$item</a><br>\n";
}__END__ hostaaa hostaaa hostbbb hostbbb
### End of example code...
Come to find out that the *previous* session results (from another unrelated script) were stuck in memory; obviously an undocumented feature of the BBEdit Perl editor...
Cheers! -Sx- =)
http://insecurity.org/ _Sx____________________ ('> iudicium ferat //\ Have Computer - v_/_ Will Hack...
\|/ ____ \|/
"@'/ .. \`@"
/_| \__/ |_\
\__U_/
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
