Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: web-based installer wanderings

by sierpinski (Chaplain)
on Jul 19, 2010 at 19:16 UTC ( [id://850312]=note: print w/replies, xml ) Need Help??


in reply to web-based installer wanderings

I always thought that the major reason to use modules like File::Copy was to make the script as platform-independent as you could. I don't see anything wrong with using backticks for system commands. I mean to run something (natively) on the host OS, you need either system, exec, or backticks, and they each have different functionality, but which one to use depends on what you want to accomplish.

More than using backticks, I'd be concerned about the paths that you're using in the move and copy statements. Are you sure that the target directories will be there? Are you using mkdir -p where applicable? That kind of thing.

Regarding 'rm', Perl has an 'unlink' function that operates the same way as the system call, with probably less overhead of the backticks, though that's just a guess. I've never had to worry about performance at this point.

It sounds like you just need to do a bunch of idiot-checking before you execute certain lines of code, perhaps like checking to make sure $HOME is defined (or that your home directory exists) or whatever else before you proceed with your execute. In order to make any program work, you have to make some assumptions about the system it will be executed on. Even if you make an 'INSTALL' file that simply lists what the requirements are, if someone tries to use it that doesn't have suEXEC on, you can at least point out that it is a requirement, then at least they know what to ask for when they contact tech support (you?) for assistance.

Hope that helps.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-20 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found