Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: file name parsing to get the original file name

by rthawkcom (Novice)
on Jun 22, 2011 at 15:54 UTC ( #910922=note: print w/replies, xml ) Need Help??


in reply to Re: Re: file name parsing to get the original file name
in thread file name parsing to get the original file name

Wouldn't it be easier just to do:

$path=~/.*\/(.*)$/;$name=$1;

Basically nuke everything in the way and grab what's left??

  • Comment on Re^3: file name parsing to get the original file name

Replies are listed 'Best First'.
Re^4: file name parsing to get the original file name
by MarkM (Curate) on Dec 13, 2012 at 23:55 UTC
    The check:
    $path=~/.*\/(.*)$/;$name=$1; 
    
    Doesn't take into account that the path might *not* have a directory component...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://910922]
help
Chatterbox?
[shmem]: well finally.
[stevieb]: nice! I just finished a GPS "take me home" device last week, and did a bunch of software updates to it yesterday. I also created a pseudo chip with an Arduino to simulate an IC, where it responds to register read/writes over the I2C bus...
[stevieb]: ...from an I2C master. It's ugly and there are many changes I'm going to make, but I had not done anything like it before. It's designed for my RPi:: automated test platform; a system that does CI on *all* my RPi modules.
[shmem]: pseudo chip?
[stevieb]: well, what happens is the Arduino 'listens' for requests r/w, and does the appropriate thing when it's interrupted based on the 'register' address sent in. It's ugly as it was my first attempt, but I've got great new ideas I'm just sitting.
[stevieb]: ...down to implement now. Here's the sketch as it currently sits
[shmem]: well I use I2C and SPI and stuff, but creating a pseudo chip looks to me like lot of indirection and memory clutter... not?

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2017-06-25 22:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (572 votes). Check out past polls.