in reply to Re: Tk::Image delete method
in thread Tk::Image delete method
I used File::Find because recursion is so easy, by removing the $dir constraint:use File::Spec::Functions; opendir (my $dh, $dir); @img = map { catfile($dir,$_) } grep /\.(jpe?g|gif|png|bmp)$/i, readdi +r $dh; closedir $dh; use Path::Tiny 'path'; @img = path( $dir )->children( qr/\.(jpe?g|gif|png|bmp)$/i ); use File::Find; find(sub { push @img, $File::Find::name if /\.(jpe?g|gif|png|bmp)$/i && $dir eq $File::Find::dir }, $dir);
Does Path::Tiny support such recursion? I can't figure it out from the doc. Thanx again.find(sub { push @img, $File::Find::name if /\.(jpe?g|gif|png|bmp)$/i }, $dir);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Tk::Image delete method
by choroba (Cardinal) on Jan 04, 2020 at 00:15 UTC | |
|
Re^3: Tk::Image delete method
by Anonymous Monk on Jan 01, 2020 at 13:08 UTC |