#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use Path::Tiny; my $path = 'Path::Tiny'->cwd; $path = path("$path/..")->realpath until -e "$path/.marker" || '/' eq $path; say -e "$path/.marker" ? 'F' : 'Not f', 'ound';