in reply to Perl/MySQL Development Environment

I'd recommend using vim. It takes some getting used to, but offers great syntax highlighting, folding, auto-indenting and a lot of other features that coders like. I prefer using multiple terminals: one to code with, one to test with, one to have a permanent mysql command line client on, but you could configure vim to pipe your script through perl or even the perl debugger to test/debug it.

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Replies are listed 'Best First'.
Re: Re: Perl/MySQL Development Environment
by cLive ;-) (Prior) on May 26, 2002 at 22:43 UTC

    Let me second that, and explain why.

    When debugging, I bet your routine is something like this:

    • make changes and save
    • upload with FTP client (maybe have to reconnect first)
    • reload web page that calls scripts

    Now, if it's a big change you may not mind, but what if all you're doing is changing the odd word? It gets a bit tedious.

    Editing in vi/vim can speed this up considerably. It's on the server, so you don't have to worry about editing stuff from another machine that doesn't have UltraEdit on it if your away from yours (only ssh client - you do use ssh, don't you:).

    It's easy to get overwhelmed though with vim's features, so to begin with, I suggest you learn the following:

    • / followed by term - find
    • n - find next of last term entered
    • x - delete char
    • r char - replace character with char
    • dd - delete line
    • ^ - go to beginning of line
    • $ - go to end of line
    • i - switch to insert mode
    • o - insert line and switch to insert mode
    • ESC - return from insert mode to command mode
    • :w - save file
    • ZZ (in caps) - save and exit

    Typing a number before most of the commands above duplicates the action that many times.

    If you take it slowly and just learn a few commands at a time, it's easier to learn.

    After that, I'd move onto keyboard movement (hjkl), marking and yanking (copying), eg m'a, followed by y'a to mark and copy. p is put (paste).

    Finally, this is a good book to get you going.


    cLive ;-)


      WARNING: Incoming OT post......
      When debugging, I bet your routine is something like this:
          * make changes and save
          * upload with FTP client (maybe have to reconnect first)
          + reload web page that calls scripts

      If he's using Samba, he probably doesn't have to resort to FTP. Just click the Save icon. He's going to have to hit Reload one way or the other, and he's going to have to make changes as well. Using vi/vim, he has to open a telnet (no no) or ssh (that's the ticket) session. So using vi/vim actually involves an extra step that he currently doesn't have to go through with other Windows-based editors.

      I'm not slamming you, cLive ;-). I ++'d the node. I just wanted to make it obvious to everyone that what you are recommending (which is the process I use) involves a step that is not necessary due to the use of Samba.

      All of the above is based on the assumption that I have not missed something glaringly obvious, which is highly likely and - sadly - becoming the norm for my life.

      If things get any worse, I'll have to ask you to stop helping me.

      One thing to watch out for when editing over a remote connection: lag. If it's a fast connection, the lag probably wouldn't cause any problems, but if it's over a dialup or anything else that's slow, you could end up waiting a "long" period of time for your keystrokes to get through, and things can get messy. That's a pain to deal with.

      My 3.14 cents. (Inflation, ya know...)


      There are 10 kinds of people -- those that understand binary, and those that don't.

      As a sidenote: UltraEdit can edit files over FTP, downloading and uploading when necessary (when opening and saving).
Re: Re: Perl/MySQL Development Environment
by kappa (Chaplain) on May 26, 2002 at 14:17 UTC
    Oh, Juerd, what are your impressions from vim6 folding when used against Perl code? Do you manually create folds or use indent auto-folding? I see this feature as extremely useful but cannot configure it properly :)) auto-folding seems awkward and manual folding consumes much time.

      set smartindent set tabstop=8 set shiftwidth=4 set softtabstop=4 let perl_want_scope_in_variables=1 let perl_extended_vars=1 let perl_include_pod=1 let perl_fold=1 colorscheme elflord syntax on hi Folded ctermfg=red
      The folding is defined in the syntax file, so you must enable perl_fold before turning on syntax. I dislike the yellow folding (I want the folds to be very visible) that is default in elflord, so I use the "highlight" (hi) command to change it to red.

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.

Re: Re: Perl/MySQL Development Environment
by Tomek (Initiate) on May 27, 2002 at 03:04 UTC
    Thanks everybody for your responses - I will definitely try out some of the editors you've mentioned. vim seems to do some of the functions that I'm looking for - to be able to use multiple coding and testing terminals and even to be able to run command lines directly. I'm used to vi so the keyboard commands shouldn't be a big problem. However, it seems like configuring vim for perl could be tricky.. Emacs seems to be an option as well so might give it a go.

    At the moment I use samba so I can save the output from Ultraedit directly to my linux box (don't have to use ftp) and run/test the scripts - but the major problem is that I have to reload the webpage that calls the script so this testing is not very efficient.

    I would also like to try out Komodo for windows (I run my linux server on an old Pentium 133 so I don't really want to use demanding editors on it) but I'm not sure how well will it integrate to do the remote debugging..

    Visual Studio with Visual Perl seems a bit of an overkill for medium sized projects... does anybody have any views on that?