in reply to Yet Another "Matching over a list of conditions"-like technique

#!/usr/bin/perl -li.bak use strict; use warnings; my @pre=map "../../pics/$_/", '00'..'16'; while (<>) { chomp; my $cnt; for my $p (@pre) { local $_ = $p . $_; if (-e) { print; push @pre, splice @pre, 0, $cnt if $cnt; last; } $cnt++; } } __END__
  • Comment on Original snippet (Re: Yet Another "Matching over a list of conditions"-like technique)
  • Download Code