in reply to Driving the Engine right off the road

I'll explain in english what I need.

That can be useful but it's fuzzy. Far better to write tests which may or may not work. See How to ask better questions using Test::More and sample data

If you can negate the logic then (from your fuzzy description) I think it should be quite simple:

use strict; use warnings; use Test::More; my @good = qw/PKG_CONFIG_PATH XDG_DATA_DIRS/; my @bad = qw/XDG_SEAT_PATH XDG_SESSION_PATH/; plan tests => @good + @bad; my $re = qr/^XDG.*PATH$/; for my $str (@good) { unlike $str, $re, "good $str does not match"; } for my $str (@bad) { like $str, $re, "bad $str matches"; }

🦛

Replies are listed 'Best First'.
Re^2: Driving the Engine right off the road
by Intrepid (Curate) on Aug 22, 2025 at 20:42 UTC
    hippo suggested:
    See How to ask better questions using Test::More and sample data

    Huh, I never thought of anything like that for writing-up questions for PMo. Very good suggestion, I'll try that mode in the future.

        – Soren

    Aug 22, 2025 at 20:41 UTC