Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Formatting an array

by bartrad (Acolyte)
on Feb 08, 2018 at 12:07 UTC ( #1208701=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1208701]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2018-02-25 22:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (315 votes). Check out past polls.

    Notices?