#!/usr/bin/env perl use File::Find; find({ wanted => \&process, }, split /:/, $ENV{'PATH'}); sub process { -f && -x && $ARGV[0] eq $_ && print $File::Find::name, "\n"; } #### { $a->{b} = $b || last } #### package Tie::Hash::OnlyIf; sub STORE { my $self = shift; my ($key, $val) = @_; if ( $val ) { $self->{$key} = $val; } } package main; tie my %data, Tie::Hash::OnlyIf; $data{b} = $b; #### use strict; use warnings; use Test::More qw(no_plan); ok( "1A" =~ /[\w\d]{2,}/ ); ok( "A1" =~ /[\w\d]{2,}/ ); ok( "56429K01B" =~ /[\w\d]{2,}/ ); ok( "1132086" =~ /[\w\d]{2,}/ );