carlriz has asked for the wisdom of the Perl Monks concerning the following question:
I have been having trouble parsing out these pathnames. What I want to do is to extract the name of the last file in the pathname. What is the best way to do this?
my @file_name_array = ( "/proc/cpuinfo", "/proc/meminfo", "/etc/fstab", "/proc/net/pf_ring/info", "/var/log/boot.log", "/etc/sysconfig/network-scripts/ifcfg-eth0", "/etc/sysconfig/network-scripts/ifcfg-eth1", "/etc/sysconfig/network-scripts/ifcfg-eth2", "/etc/sysconfig/network-scripts/ifcfg-eth3", "/etc/sysconfig/network-scripts/ifcfg-eth4", "/etc/udev/rules.d/70-persistent-net.rules" );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing Pathnames
by toolic (Bishop) on Apr 03, 2014 at 20:24 UTC | |
|
Re: Parsing Pathnames ( Path::Tiny )
by Anonymous Monk on Apr 03, 2014 at 23:04 UTC |