Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Formatting an array

by bartrad (Sexton)
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2018-08-21 14:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (200 votes). Check out past polls.

    Notices?