in reply to one-line split file sequence checker

With files :
file.1 file.02 file.003 file.5 file.00007 file.011
perl -e '/\.0*(\d+)$/and$t[$1]=1for<*>;map{$t[$c]?1:print"$c ";$c++}@t'
Output :
4 6 8 9 10

HTH,

PooLpi

'Ebry haffa hoe hab im tik a bush'.  Jamaican proverb

Replies are listed 'Best First'.
Re^2: one-line split file sequence checker
by wdef2 (Acolyte) on Jan 24, 2008 at 15:43 UTC
    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?

      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'