in reply to Re: Formatting an array
in thread Formatting an array

Thanks for the reply, I like this. How would I get rid of the leading path to routernamex as I don't need it?

Replies are listed 'Best First'.
Re^3: Formatting an array
by roboticus (Chancellor) on Feb 08, 2018 at 14:46 UTC

    bartrad:

    Assuming that all your path components are separated by "/", then you would simply use split again, and take the final component(s):

    my @router_path_components = split qr{/}, $s_flds[0]; my $last_chunk = $router_path_components[-1];

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      Thank you