Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: changing a file name, extension not showing up

by kennethk (Abbot)
on Nov 27, 2012 at 21:32 UTC ( #1005925=note: print w/ replies, xml ) Need Help??


in reply to changing a file name, extension not showing up

Another possibility is you've got trailing whitespace on your name. What happens when you $serial =~ s/\s//g? You can also see what your variable literally contains by printing w/ delimiters, a la print "x${serial}x"

And ++ for rename and File::Copy.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


Comment on Re: changing a file name, extension not showing up
Select or Download Code
Replies are listed 'Best First'.
Re^2: changing a file name, extension not showing up
by mark4444az (Sexton) on Nov 27, 2012 at 22:19 UTC
    I did a length check and there's an extra character, presumably a newline, I didn't do a chomp on that <STDIN>. I added chomp and used "rename" and it works like a charm. Thanks very much!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2015-07-30 15:14 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 (271 votes), past polls