in reply to Re: Single Quotes - how to avoid any escape processing?
in thread Single Quotes - how to avoid any escape processing?

split does not take a string as its first argument, it takes a regular expression.

So the correct usage is

@SubDirs = split(/\\/, $PathOnly);

But maybe you want to use File::Spec instead, or Path::Tiny?

my @SubDirs = File::Spec->splitdir( $PathOnly );