running perl script with os x

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

Hello,
basically this is what I got, about 20 text files formatted as databases and about 5,000 images. What I want to do is write a perl script that will parse all the databases and make an array of one of the fields. Then for each item in that array go through the images and see if there is an image with the same name, if so, move it to a new folder. Or vice-versa where it deletes images that have no association.

Seems simple to me. I used basic unix/perl syntax like I would when i write scripts for *nix servers but it doesn't work for me. Seems like the opening of the file fails. Could it be my permissions? Should I log in as root within terminal or something? Totally lost.

Thx for the help.
webG

Pimpin like a pimp with an electrofied pimpin machine!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

I haven't used Perl in OSX, only PHP -- but I've found that I'm not knowledgeable enough to do what I want to do sometimes (I'm no server admin). Assuming all the files are in the sites folder, you should be able to do it? However, if you're trying to move files elsewhere on the server, I can't help you. I would think that would be Cocoa or AppleScripting that would handle that?

Have you checked the development forums at Apple? They seem to be a good resource (as far as I've used them in my limited knowledge of all things OS).

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.