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

Re: capturing terminal directory relative path?

by bichonfrise74 (Vicar)
on Mar 07, 2010 at 16:46 UTC ( #827254=note: print w/ replies, xml ) Need Help??


in reply to capturing terminal directory relative path?

I agree that File::Basename is the robust way to do what you need. But maybe the below code is something you might want to consider as well.

#!/usr/bin/perl use strict; while (<DATA>) { print + (split( /\// ))[-1] if /\d+/; } __DATA__ /home/BORK/work/test-backfills/cp_test /home/BORK/work/test-backfills/cp_test/82468 /home/BORK/work/test-backfills/cp_test /home/BORK/work/test-backfills/cp_test/82480 /home/BORK/work/test-backfills/cp_test /home/BORK/work/test-backfills/cp_test/82485 /home/BORK/work/test-backfills/cp_test /home/BORK/work/test-backfills/cp_test/82490 /home/BORK/work/test-backfills/cp_test /home/BORK/work/test-backfills/cp_test/82767 /home/BORK/work/test-backfills/cp_test /home/BORK/work/test-backfills/cp_test/82802 /home/BORK/work/test-backfills/cp_test


Comment on Re: capturing terminal directory relative path?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2014-08-21 14:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (136 votes), past polls