Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Need to change directory string.

by 2teez (Priest)
on Jan 02, 2013 at 20:54 UTC ( #1011343=note: print w/replies, xml ) Need Help??


in reply to Need to change directory string.

"..Is there easier way to put this?.."

Another way is to use canonpath method from File::Spec like so:

use strict; use warnings; use File::Spec qw(canonpath); my $dir_str = "test/home/players/demo//thumbs/super.jpg"; print File::Spec->canonpath($dir_str);
Output:
test/home/players/demo/thumbs/super.jpg

NOTE:
No physical check on the filesystem, but a logical cleanup of a path.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011343]
help
Chatterbox?
[Your Mother]: I assume you should be ordering online so you don't have to deal with service people. :P
[LanX]: yeah... service people are like alligators.... ;)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2017-03-26 19:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (315 votes). Check out past polls.