Well you don't need a perl script for that...
perl -pi -e 's/ALTER SPROC/CREATE SPROC/g' *.sql
| [reply] [d/l] |
My understanding is that Perl is not quite as well suited to this kind of task as some other more modern languages, particularly PHP and Ruby. I'd suggest that you search resources related to those. (Unfortunately, I don't know the best places to point you for that. I'd probably start with wikipedia - PHP, Ruby - and see the "External links" at the bottom.)
Between the mind which plans and the hands which build, there must be a mediator... and this mediator must be the heart.
| [reply] |
Hmm, what features in particular do PHP and Ruby have that make them more suitable than Perl for the OP's task.
| [reply] |
| [reply] |
In general, searching for a script that completes the whole task you want done isn't going return results. Instead, I'd plan it out and focus on particular parts of the problem, and search on those. In your case you want to:
- Connect to your database
- Find files in several directories
- Open those files once found
- Perform a substitution
- And finally, execute the SQL statements found
My suggestion would be to start trying to build these pieces (maybe after searching on them as prepwork), and ask here about your specific roadblock if you encounter one. Provide code! Or, if you don't know where to start on a particular piece, say so here and I'm sure somebody will give you a jumping off point.
| [reply] |
start to build the pieces? He already has been given the pieces, see he past posts on stored pro cedures/sprocs
| [reply] |
Look at your posts history, people have given you code to do this before. Go read and stop wasting monks time to do your job for you | [reply] |