in reply to Re: one-line split file sequence checker
in thread one-line split file sequence checker

Nice, thx. Could golf slightly further I suppose to:

perl -e '/(\d+)$/and$t[$1]=1for<*>;while($c<$#t){$t[++$c]||print "$c "}'

I like that since it seems quite readable as well (at least for me) Though is map more efficient than while?

Replies are listed 'Best First'.
Re^3: one-line split file sequence checker
by kyle (Abbot) on Jan 24, 2008 at 16:48 UTC

    map may or may not be more efficient, but it's certainly shorter:

    perl -le '/(\d+)$/and$t[$1]=1for<*>;map$t[$_]||print,1..$#t'