http://www.perlmonks.org?node_id=827247


in reply to capturing terminal directory relative path?

What you probably want is File::Basename.  It's in the core already (ie. no need to install it).

Try:

use strict; use warnings; use File::Basename; my $base = basename("/home/BORK/work/test-backfills/cp_test/82802"); # Note that $base is now '82802'

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/