If you use perl you could do the whole thing in it and not bother with sed, cut, bash, whatever. 
Those programs are standard in every linux system, so I don't see it like a problem but like good use of features.
I don't know perl and don't have the time to learn it. I use it in one line because after googling, i found that it was the easiet way for me (copy, paste and test) to transform the %xy used by firefox for the links into somethings that the script can use and get the real filenames.
Feel free to make a perl version if you want to.
About perl, I want to make a sound related real time program that only C/C++ can be able to do. And I already have to fight in order to get enough time to seriously learn those languages and the libs I will use for that program. So, I will not learn perl at that time.
I found a small bug. In move(), the files with name beginning with a "-" was not moved. The new version is the attachment.