note
japhy
Here's mine. It's <i>très</i> cool.
<code>
# 37 chars (between the {...})
sub seq{shift=~join'.*',map"\Q$_",split//,pop}
</code>
<b>Update</b> -- after seeing [chipmunk]'s code, which beats mine, I offer one minor adjustment:
<code>
sub seq{($t=pop)=~s/./$&.*/sg;pop=~/$t/s}
</code>
Although, should the $t by <tt>my()</tt>ed? I'm all for strict-compliant golf. Anyway, I changed the <tt>@_</tt> access to <tt>pop</tt>, and added a needed <tt>/s</tt> modifier to both regexes. It makes it longer than [chipmunk]'s, but doesn't break on cases involving newlines.
<br><br>
<tt><font color="#0000ff">japhy</font></tt> --
<a href="/index.pl?node=japhy&lastnode_id=1072">Perl and Regex Hacker</a>
76083
76083