Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Formatting an array

by roboticus (Chancellor)
on Feb 08, 2018 at 14:46 UTC ( #1208718=note: print w/replies, xml ) Need Help??


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

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.

Replies are listed 'Best First'.
Re^4: Formatting an array
by bartrad (Sexton) on Feb 09, 2018 at 10:28 UTC

    Thank you

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1208718]
help
Chatterbox?
[Discipulus]: also good first day of summer!

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2018-06-21 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (117 votes). Check out past polls.

    Notices?