in reply to find the last lexical entry in a dir without using @ls=readdir

Sure. This method applies to any list, not just readdir.
my $max; while( my $file = readdir(DIR) ) { $max = $file if $file gt $max; } print $max;
Note: I used "unless" and "gt" rather than "if" and "le" because everything compares greater than undef, whereas nothing compares less than undef. If you want to use the latter instead of the former, you'll have to do a priming read (i.e. $min = readdir();) before the while loop.

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

Update: changed code to fix a logic error. Now finds max instead of min.