Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1081003]
help
Chatterbox?
[Discipulus]: silly one: can i dump all CORE functions?
[Corion]: Hmm - print for keys %CORE:: maybe?
[Corion]: Hm - nope, that only gives me GLOBAL:: as entry. Maybe you can't ...
[Discipulus]: just got GLOBAL::

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2017-05-23 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?