#!/usr/local/bin/perl -w use strict; opendir( DIR, './' ); my @files = readdir( DIR ); closedir( DIR ); my $i = scalar @files; foreach my $file ( @files ) { $i--; # do something with the items in list if ( $i == 0 ) { # do something special with last one. } }
Wonko
In reply to Re: Determine if item is last one
by Wonko the sane
in thread Determine if item is last one
by dgoins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |