Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Parsing Pathnames

by toolic (Bishop)
on Apr 03, 2014 at 20:24 UTC ( #1081003=note: print w/ replies, xml ) Need Help??


in reply to Parsing Pathnames

File::Basename is one way...

use warnings; use strict; use File::Basename qw(basename); 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" ); print basename($_), "\n" for @file_name_array; __END__ cpuinfo meminfo fstab info boot.log ifcfg-eth0 ifcfg-eth1 ifcfg-eth2 ifcfg-eth3 ifcfg-eth4


Comment on Re: Parsing Pathnames
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1081003]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (16)
As of 2015-07-01 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (17 votes), past polls