This chain could be better structured, to avoid repeated checking of $command: <code>
if ($command eq 'initialize') { die "repetition" if $have_initialize; $have_initialize = 1; print stuff; }
elsif (!$have_initialize) { die "aargh"; }
<code>