|
Home | Switchboard | Unix Administration | Red Hat | TCP/IP Networks | Neoliberalism | Toxic Managers |
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and bastardization of classic Unix |
|
|
Great tools will never convert a bad programmer into a good programmer, but they will certainly make a good programmer better and they can make a bad language acceptable (Java is one such example).
A good, modern IDE should include interface to the following components:
There are two ways of approaching Perl IDE question
Integrated products. This is the modern way of solving this problem pioneered by Borland and now exemplified by Eclipse and Visual Studio. The problem here is that the integrated editor is typically weak and hamper programmer productivity. But integration with the debugger is a big plus. One nuance here is that Perl now is mostly used in Linux/Unix environment, while code development typically is performed on Windows. While Perl is now not fashionable as Python is taught as the first language in universities and due to this got great popularity the situation on the ground is different from described in fashion magazines. Python proved to have its own set of warts, is slow and generally is overhyped, especially OO model used in it (which is inferior to the model used in JavaScript) That's why some popular Python IDE have Perl support and can be used with Perl.
Personal assembly of key IDE components. This gives you an ability to select the editor of your liking and integrate the rest via some additional component, for example OFM (Windows Commander is a good choice here). Please note that the ability to use the same programming editor for all your career is of huge importance as only this way you can develop and accumulate set of useful macros. Editors with REXX support as a macrolanguage (so called orthodox editors) allowed such a possibility since late 60 and there are people who used them for more then 30 years. That same is true with Emacs users and VI/VIM users (actually GVIM is not programmer editor)
All language have quirks, and all inflict a lot of pain before one can adapt to them. Once learned, the quirks become incorporated into your understanding of the language. But there is no royal way to mastering the language. The more different is one's background is, more one needs to suffer. Generally good environment can compensate for some pitfalls of the language. Syntax highlighting is one such feature.
When mastering a new language first you face a level of "cognitive overload" until the quirks of the language become easily handled by your unconscious mind. At that point, all of the sudden the quirky interaction becomes a "standard" way of performing the task. For example regular expression syntax seems to be a weird base for serious programs, fraught with pitfalls, a big semantic mess as a result of outgrowing its primary purpose. On the other hand, in skilled hands its a very powerful tool that can serve as a parser for complex data and a substitute for string functions.
There are three notable steps in adaptation to Perl idiosyncrasies for programmers who got used to other languages:
With Perl very limited financial support from big corporations (support that both PHP and Python enjoy) it is unrealistic to expect that there will be many offerings. Even open open source offering has little chances to survive in such an environment, as there not much volunteers and money to provide support for the commercial version of IDE. The initial enthusiasm seldom last more the three-five years and after that the product is typically abandoned by the author. Source code remains but 10K of more of source code is in its level of in-comprehensibility as close to binary format as you can get ;-)
Also Perl now is out of fashion. So commercial versions tend to die like files on the frost. No surprise that Microsoft does not support Perl in Visual Studio.
That's why many promising projects of Perl IDE are stalled or became abandonware. Here I would like to warn you: a danger of choosing an IDE (or editor) that goes nowhere is real and is one of the most painful mistakes programmer can make. So the key in choosing here is stability and longevity.
that's why I generally recommend to opt for a separate editor, not the editor integrated into IDE. It takes a couple of years to master any editor with macrolanguage (editor without macrolanguage can't be viewed as a programmer editor anyways) and this investment should pay dividends the rest of your career. That essentially makes using IDE more risky that integrating your favorite editor into some framework with IDE features.
For windows products a simple check is to see if the web page discusses compatibility of the product with 64-bit versions of Windows helps to determine if the development is continued. If not, then chances are that the development stopped a long time ago. Two products that are still maintained and updated are Komodo and Perl builder. Komodo has "cut down" free variant called Komodo Editorwhich probably can be viewed as a mininmally feature rish editor for any competent programmer. It does not have XEDIT-style folding but you can write plug-ins for it.
It looks like others are in various stages of abandonment. For open source products this is less critical as there is always a forum and most critical problems eventually get fixed. But if the user community is small, this can be painfully slow and even trivial fixes might not be implemented for years. Of course, if you love particular product so much that you are ready to invest time is studying its codebase, you can fix it yourself (this is a somewhat realistic possibility if the IDE is written in Perl like Padre (http://padre.perlide.org/).
One interesting finding during writing of this article is that there is still a variety of products that can be used as Perl IDE. In this sense my findings actually surprised me. Not only there are some choices, but some reasonably good choices do exist. Among them:
- Syntax highlighting
- Configurable coloring of syntactic elements
- On-the-fly syntax check
- Syntax errors detected and explained as you type or upon saving a file
- Content assist
- Autocompletion for subroutine and variable names
- Quick reference feature
- Documentation tooltips for built-in Perl functions
- Outline view
- Displays used modules and subroutines contained in the edited file
- Source formatter
- Integrated perltidy and HTML export feature
- Perldoc support
- Integrated perldoc for quick acccess to documentation
- Templating support
- Create a library of code snippets to save typing
- Persistent breakpoints
- Breakpoints stay set between IDE restarts
- Single Step/Step Into/Step Over
- Tried and true execution control features
- Global and local variables inspection
- Displays contents of variables (PadWalker module required)
- Expression evaluation
- Execute user-defined expressions while debugger is paused
- RegExp Plug-in
- Multiline/ignorecase support
Subexpression highlighting
Single step for debugging
- Perl::Critic integration
- Helps keep your coding style nice and tidy
- ...and more!
??? Perl Builder for Solutionsoft (now defunct company) -- Perl Builder 2.0 (formerly low cost commercial software($99), now available "for free" from apponic.com; It runs on any 32 or 64 bit version of Microsoft Windows ( aha -- those guys are talking about 64 bit Windows ;-) and combines a Perl editor, a debugger, and other tools. Features (from the web site):
Formatting with Perltidy. If this module is not installed, you will be provided with instructions how to do it.
Integrated debugger with following functionality (only Professional version)
- Setting unconditional and conditional breakpoints
- Stepwise execution
- Execution of separate functions
- Pausing and continuing of the execution
- Synchronous output of the results to STDOUT
- Error analysis with highlighting the error containing lines
A detailed feature comparison is available here.
cpan Padre
command and the application can be launched by typing padre
on the command line. Last updated 2016-02-26.
Originally written by Gabor Szabo - a great Perl trainer and "contract bug
killer", so the code is really worth studying. So there is less risk in its adoption and you can learn a couple of thing about
Perl from its codebase. See http://padre.perlide.org/. Among features:
What I like:
- good syntax highlighter for Perl
- brace/bracket/parens balance matching
- invoking external tools (i.e. perl) and capturing its STDOUT and STDERR
- block folding
What I miss:
- Sticky indents, I prefer the next line to automatically indent on the same column position as the previous line. A tab entry should indent one more position, a backspace should outdent to the previous indentation level. Just for clarity: it doesn't do that.
- block indent and outdent: select multiple lines and indent/outdent them with one button or menu click
There probably are more points worthy to be added, but I haven't noticed them yet. After all, I've only been using this editor on and off for a few weeks.
One thing's for sure: it doesn't bond with the Perl debugger, so if that's a make or break point for you, you can safely skip this editor.
See also:
There are quality components that constitute IDE and another approach is to integrated them in "poor man IDE" using some suitable approach. there are two simple possibilities:
You can use the programmable editor as the integration framework (most programmable editors allow to invoke external programs as macros and even allow redirecting output of the program into editor windows. SlickEdit, Kedit, Gvim and Emacs are good examples of editors with those capabilities.
Advanced users of Emacs typically use this approach. Execution of script of a selection or total editing buffer is another powerful instrument of creating your own IDE. Both vim and Komodo editor 6 (unfortunately it was removed in Komodo editor 7) permit this. This way it is easy to implement brace counter, simple beautifier, etc. Also if you assemble your own IDE from components you can use the editor you already know and use. Actually the quality of editor is a very important consideration here. If should support syntax highlighting, split view of editing buffer, ability to execute scripting on editor buffer (like !! in vi. see Piping Vim Buffer Through Unix Filters: ! and !! Commands).
I would like to stress that the choice of editor is critical: many programmers are crippled by betting used to a simplistic editor that does not provide enough power for productive development (some pretty gifted programmers use Pico or Notepad or a similar light-weight editor without folding, split screen support, syntax highlighting and checking, ability to execute scripts on the buffer, etc.
Like Talleyrand used to say this is worse that a crime, this is a blunder ;-). And while features listed above are a must, generally a good editor for developer should be able to do more. See below description of SlickEdit and Gvim -- two prominent representatives of families of editors tuned to developers needs.
Perl developers have several options none of which is perfect. Beware guys who advocate primitive lightweight editors. As editor is such an important tool it makes perfect sense to pay a small amount of money for it. But you need to be sure about the longevity of the vendor. Switching editors is a very painful process. That means that free editors do not have an inherent advantage over commercial for developers as long as the price is not too steep, say, less then $100 or $200 depending on the country in which you work. Open source editors do have some advantage because of better staying power, but you can benefit from availability of open source only if you know well the language in which the editor is written and have time to tweak or debug it. Few people do. The real problem is the quality, features, longevity and portability of the editor.
I personally prefer editors that support command line command set. I call this class of editors "orthodox editors" and it has two prominent branches -- eastern (XEDIT, Kedit, THE, SlickEdit, etc, see Eastern Orthodox Editors) and western (vi, vim, gvim, etc). See Orthodox Editors for discussion of this class of editors.
As for longevity here for both free and commercial editors there no guarantee with the possible exception of VIM and THE which have established user populations and most probably will survive another 50 years. Here are some selections that can at least be tried:
For the minimalist programmer, there's vim. For everybody else, there's SlickEdit.
I fell in love with SlickEdit a few years ago when I noticed its ads on our Web site. Although most companies use the sort of Web ads you'd expect in the tech industry, I took a second look when LOLCat images appeared in the place of our regular ads. Admittedly, for a moment I thought perhaps we'd been hacked, but when I realized I was looking at a clever marketing campaign, I decided the folks at SlickEdit were okay in my book. I recently had the chance to review SlickEdit, and although my programming skills are fairly novice, SlickEdit made me feel right at home.
It is a derivative of a classic IBM Xedit editor (belonging to the class of "orthodox editors") and has perfect folding capability as well as powerful built-in macro language. The problem with SlickEdit is that macro language is proprietary "vendorspeak" and as such is not that attractive for writing macros as it adds another language to the set you already need to know. The editor is available in three versions:
The main disadvantage is that it costs three time more ($300) then our estimate of reasonable cost of the commercial editor ($100-$200). So it is OK if the company pays for it but less so it this is your own money. Longevity is not given but it has user base that probably can support the company. And the company is in business for more then a decade. Starting from version 10 this is an excellent, very stable and powerful editor. Here is some additional information from SlickEdit 10 Cool Features
We are no longer actively working on major "new feature" releases of KEDIT, and are in the process of gradually winding down Mansfield Software Group. As discussed below in more detail, we currently plan to continue selling KEDIT for Windows 1.6 through our web site until at least December 2012, and to provide e-mail support on a part-time basis until at least June 2013.
See Eastern Orthodox Editors for discussion. The current version for Windows (1.6) has many advanced features making better use of GUI (initial XEDIT was command line only editor) and useful extensions of command-line functionality.
One possible "poor man IDE" is VIM and, especially GVIM. VIM has a macro language so it definitely qualities. The key advantage that system administrators already know it, although typically just small, very restricted subset. There are several Youtube presentation on how to use VIM with Perl.
Vim is not as great as specialized IDS but as most system admin know well you can achieve quite a lot by careful customarization. VIM provides syntax highlighting coding for Perl. The most important thing to learn are first additional ctags.
Vim has the following important features:
When using tags it is nice to have two windows split horizontally. Vim supports both vertical and horizontal window splitting. To
split current window horizontally execute ":split
" while in the normal mode. To split current window vertically, use ":vsplit
"
instead. If you don't provide any filename as argument to split/vsplit then current filename is used. You further split resulting windows
as much as you like. Use Ctrl-w w
to cycle through the windows. ":close
" will close the current windows. ":only
"
will close all windows except the current one.
vimdiff main.pl main2.pl
" (or "vim -d main.pl
main2.pl
") from the command line to see difference made to file main.pl in file main2.pl.Vim will show both files in vertical
split window mode. When you will scroll in one window, Vim will automatically scroll another window for you. You can patch the individual
differences using do
and dp
commands. do
will get the patch from the neighbor window and apply
it to the current buffer, while dp
will apply the difference from the current buffer to the neighbor window. If you need
more information on this topic, read file /usr/share/doc/vim-common-6.1/docs/diff.txt
.
Here is an excellent article of Leonid Mamchenkov Vim for Perl developers (May.10, 2004). Although written more then 5 years ago it is still the best intro into VIM facilities for Perl users. Below is an abbreviated version with some updates:
Text wrapping
As you code, sometimes text flows further than the width of the editor window. Some people like long lines to be wrapped (in other words, continued on the other line), while others prefer them unwrapped. You can configure Vim to behave according to your liking by adding "
set wrap
" or "set nowrap
" to your.vimrc
configuration file.Flexible tabs
Tabulation is one of the hottest topics in programmers discussions when it comes to style. A very nice explanation of what is the problem with tabulations and spaces can be read at http://www.jwz.org/doc/tabs-vs-spaces.html. I must say though, that I don't agree with author's position on the subject. The article does provide you with several options for vi/Vim configuration to control the behavior of the tabs. I will just add/repeat the ones I consider important.
- Add "
set tabstop=4
" to your.vimrc
to display all occurrences of Tab character (ASCII #9) as 4 spaces. This option will not change the text, it will only change the displaying of the text.- Add "
set autoindent
" to your.vimrc
for Vim to automatically position the cursor with appropriate indentation level when you press Enter and want to write the next line of code. This is very useful when you are indenting your code in structures like loops and procedures.- Vim allows you to select a block of code and change it's indentation level (either increase or decrease the level). Control the width of the indentation level with "
set shiftwidth=4
" in your.vimrc
configuration file.If you need more information on this topic, read file
/usr/share/doc/vim-common-6.1/docs/indent.txt
.Line numbering
While Vim always displays your current position in the status line, you might also want to see all lines numbered. To do that, you will need to add "
set number
" to your.vimrc
.If you need more information on this topic, read file
/usr/share/doc/vim-common-6.1/docs/usr_03.txt
.Syntax highlighting
The first thing any developer will notice in Vim is excellent syntax highlighting. All popular languages are supported. Syntax files for less popular are available from Vim web site. Perl is supported out of the box.
Vim identifies keywords, comments, variables, strings, in-line POD and other standard parts of the program and highlights them. Vim supports two color modes: one for terminals with dark background color and another one for terminals with light background color. You can control these modes by specifying command "
set bg=dark
" and "set bg=light
" in your.vimrc
.If you still don't like the appearance of the code, stay tuned until "Color schemes" discussion.
If you need more information on this topic, read file
/usr/share/doc/vim-common-6.1/docs/syntax.txt
.Text completion
One of Vim's features I cannot live without is text completion. When editing, press
Ctrl-n
/Ctrl-p
to cycle through the current word completion suggestions. Vim generates suggest list based on the words in the current file. If you need key completion to make suggestions from other files, then Vim by default understand thectags
file. Simply run "ctags *.p?
" to generate ctags for all Perl files and modules in the current directory (assuming you are using ".pl
" extension for Perl scripts and ".pm
" extension for Perl modules). This Vim's feature not only saves a tonne of time on typing, but greatly decreases the error rate, especially with long variable and procedure names in the code.If you need more information on this topic, read file
/usr/share/doc/vim-common-6.1/docs/usr_24.txt
.File Completion
While you are in the command mode, Vim can complete the names of files and directories in case you want to open or save a file. In order to complete a file or a directory name you should start typing it's name on the command prompt and then press the completion key. You can change the completion key to be almost anything you want with "
set wildchar=
" line in your.vimrc
file.Window splitting
Sometimes I need to see two or more files simultaneously. While I can always start another Vim session in a separate terminal, it is not as comfortable at times as Vim's window splitting feature.
Vim supports both vertical and horizontal window splitting. To split current window horizontally execute "
:split
" while in the normal mode. To split current window vertically, use ":vsplit
" instead. If you don't provide any filename as argument to split/vsplit then current filename is used. You further split resulting windows as much as you like. UseCtrl-w w
to cycle through the windows. ":close
" will close the current windows. ":only
" will close all windows except the current one.If you need more information on this topic, read file
/usr/share/doc/vim-common-6.1/docs/usr_08.txt
.Diff mode
Vim provides excellent facilities for checking and editing differences between two or more files. Execute "
vimdiff main.pl main2.pl
" (or "vim -d main.pl main2.pl
") from the command line to see difference made to file main.pl in file main2.pl.Vim will show both files in vertical split window mode. When you will scroll in one window, Vim will automatically scroll another window for you. You can patch the individual differences using
do
anddp
commands.do
will get the patch from the neighbor window and apply it to the current buffer, whiledp
will apply the difference from the current buffer to the neighbor window.If you need more information on this topic, read file
/usr/share/doc/vim-common-6.1/docs/diff.txt
.Text folding
Yet another popular feature found in popular editors and IDEs is text folding. I think that folding is easier shown then explained. Vim supports six folding methods: by indent, by expression, by syntax, by changes in the text, by marker, and manual folding. For the sake of the example, I will show how to configure folding by marker.
In order to tell Vim to use folding by marker add the following lines to your
.vimrc
:" Folding configuration set foldmethod=marker " Edit and uncomment next line if you want non-default marker "set foldmarker="{{{,}}}"If you need more information on this topic, read files
/usr/share/doc/vim-common-6.1/docs/usr_28.txt
and/usr/share/doc/vim-common-6.1/docs/fold.txt
.Marks
One of Vim's features that speeds up navigation is – marks. You can set a mark anywhere in the text and then quickly jump back to it. You can set several marks. You can set marks in several files and then quickly switch between them. I find myself set mark on the place I am currently working at with
mc
(m
is for "mark",c
I use for "current") and then quickly returning to the same place with'c
.If you need more information on this topic, read file
/usr/share/doc/vim-common-6.1/docs/motion.txt
.Vertical Indent Display
For some people indenting text horizontally is not enough. They need some kind of vertical indentation to help them see corresponding parts of the code. While I am not one of those people, I've seen this feature around so often that I decided to add it codemonkey's
.vimrc
.All you need to do to have vertical indent display with pipe ("|") character is to add the following two lines to your
.vimrc
." This is for vertical indenting set list set listchars=tab:| " NOTE the space char after last backslash."
:set list
" forces Vim to show hidden characters like tabulations, ends of lines, and ends of files. ":set listchars=tab:|
" asks Vim to show only tab characters and use a pipe ("|") with a space (" ") to do so, instead of usual "^I" thing that Vim likes to show.Color schemes
Robert (MetaCosm) downloaded all color schemes and put them into a single archive file which he uploaded back to Vim's web site (http://www.vim.org/scripts/script.php?script_id=625.).
You will most likely notice that some color schemes do not change much colors in your console
vim
. That is because they are most probably designed for GUI version of Vim, calledgvim
.Try executing "
gvim +'colorscheme peachpuff' main.pl
" to see how gvim looks with selected color scheme.Now you can try all those color schemes one by one with "
:colorscheme something
" and choose the one you like best. When you are done choosing, add line "colorscheme something
" to your.vimrc
.If you need more information on this topic, read file
/usr/share/doc/vim-common-6.1/docs/usr_06.txt
.Block commenting
It is an often need to comment or uncomment blocks of code during the development cycle. While there is a way to do it in Vim without any additional configuration, I try to make life as easy as possible and install the BlockComment plug-in by Chris Russell.
Let's download BlockComment.vim from http://www.vim.org/scripts/script.php?script_id=473 and copy it into
.vim/plugin/
directory. This plug-in automatically provides us with two mappings: ".c
" for commenting code and ".C
" for uncommenting code back.File and buffer browser
Vim supports editing of several files simultaneously. One can start Vim as "
vim main.pl main2.pl
" and then use ":next
" and ":previous
" to navigate through open files (called "buffers"). It is also possible to open files for editing without quiting Vim every time. For that, one should use simple ":e main2.pl
" command, where main2.pl is the name of needed file.There are, as usual, better (more convenient) ways to work with files and buffers. Vim website lists few plug-ins which can handle only files, or only buffers, or both at the same time. One of those plug-ins is winmanager by Srinath Avadhanula. Let's grab winmanager from http://www.vim.org/scripts/script.php?script_id=95.
Vim's winmanager plug-in can make use of bufexplorer plug-in by jeff lanzarotta availalbe from http://www.vim.org/scripts/script.php?script_id=42.
Installation is as usual – saving, unziping, and dos2unixing. Since we don't want to always have file/directory browser turned on, lets add a mapping line to our
.vimrc
to ":WMToggle
" byF2
." This is for winmanager map <F2> :WMToggle<CR>If you need more information on this topic, read file
/usr/share/doc/vim-common-6.1/docs/usr_23.txt
.Tag explorer
If you ask me, I am almost happy. The last thing that I am missing is something that will ease up my code browsing. I need a fast way of switching between different parts of my code and hierarchical view of it. Once again I go fishing to Vim web site and get myself a nice looking taglist plug-in by Yegappan Lakshmanan from http://www.vim.org/scripts/script.php?script_id=273. This one is not even an archive! You just need to copy it into your
.vim/plug-in
directory. Let's map ":Tlist
" command toF3
key." This is for taglist map <F3> :Tlist<CR>One annoying thing that I find about taglist is that it resizes the terminal window when possible. I prefer to switch this feature off by add modifying my
.vimrc
in the following way." This is for taglist let Tlist_Inc_Winwidth = 0 map <F3> :Tlist<CR>If you need more information on this topic, read file
/usr/share/doc/vim-common-6.1/docs/tagsrch.txt
...copy
perl.vim
(developed by Lukas Zapletal) into your.vim/compiler/
directory. Now we need to specify for which files we want Vim to use our new perl compiler scripts. This is easily done by adding the following lines to.vimrc
." Use perl compiler for all *.pl and *.pm files. autocmd BufNewFile,BufRead *.p? compiler perlNow you can use "
:make
" to check your code for errors. If you do have problems in your code, then Vim will position the cursor on the line with the first problem. You can use ":cnext
" and ":cprevious
" to go through other error messages. ":clist
" will show a list of all errors.If you need more information on this topic, read file
/usr/share/doc/vim-common-6.1/docs/usr_30.txt
.You can also check perl syntax in VIM on each save
au BufWritePost *.pl,*.pm !perl -c %With this macro every time you save a .pl or .pm file, it executes perl -c and shows you the output.
Perldoc integration
Yet another feature provided in most IDEs is on-line documentation. Vim helps developers even with that. By default, Vim comes with system manual support on all UNIX boxes. This comes very handy when you use system commands in your scripts and need to check command line parameters. Just position the cursor on the word that you are interested in and press
K
. Vim will execute "man word
", where "word" is the word under the cursor. This is helpful but not as much as we need it.Let's visit Vim site again and download Perldoc plug-in (developed by Colin Keith) from http://www.vim.org/scripts/script.php?script_id=209.
unzip perldoc.zip
and run all extracted files throughdos2unix
. It's a good idea to add aF1
mapping to ":Perldoc
" in your.vimrc
." This is for perldoc.vim autocmd BufNewFile,BufRead *.p? map <F1> :Perldoc<cword><CR> autocmd BufNewFile,BufRead *.p? setf perl autocmd BufNewFile,BufRead *.p? let g:perldoc_program='/usr/bin/perldoc' autocmd BufNewFile,BufRead *.p? source /home/codemonkey/.vim/ftplugin/perl_doc.vimIf you are using a newer version then I do, then you skip the last line.
Now, whenever you hit
F1
while in the perl file, ":Perldoc
" will get executed for the word that you have under the cursor, your current window will split horizontally and you'll see appropriate perldoc page.After installation of this plug-in I have noticed that syntax highlighting in few of my programs broke. After a quick look, I understood that that happened because of my extensive usage of underscore ("_") character in procedure names. I had to fix it by simply adding underscore ("_") character to the list of keyword characters on line 14 in file
.vim/ftplugin/perl_doc.vim
." Adds / and . as used in requires. " setlocal iskeyword=a-z,A-Z,48-57,:,/,. " Adds / and . as used in requires. Also adds _ as used in procedure names. setlocal iskeyword=a-z,A-Z,48-57,:,/,.,_
Komodo editor does not have built-in macro language but other then that it is a average editor
The key features include:
Find & Replace. Adequate find & replace. It supports Perl regular expressions syntax (with Rx integration), Find/Replace in Files (with confirmation), Find/Replace in Project, multiline search and Unicode support.
Notepad++ is a free simple editor which provides Perl syntax highlighting and basic editing features. I use it personally and its OK for small scripts. For larger scripts you might need more full-fledged editor like SlickEditor.
For Perl Notepad++ provides some useful features:
DzSoft Perl Editor ($49) is a good editor for Perl. It has built-in debugging features, a simple editor with syntax highlighting, a syntax check feature that finds errors in your script. Here is the list of features from the site:
Another simple way to integrate those components is to use orthodox file manager (OFM) such as Midnight commander in Linux, Far and Total Commander in Windows. Detail depends on capability of particular OFM and your imagination. You can also write you own plug-ins for the purpose. Here is some ideas from my own experience:
With OFMs it is possible to run Perl in diagnostic mode (options -cw) with one keystroke. You can bind this command to letter c in user menu. For example for FAR the command would be something like:
c:\cygwin\bin\perl -cw !.!
c:\cygwin\bin\perl -d !.!
Perl has one good beautifier (perltidy). Also Code2HTML can convert a program source code to syntax highlighted HTML.
Invocation of OFM is simlar to examples above.Although this is not well known, but Perl interpreter has lint module and can produce cross reference table of all variables used. Here is what authors of Programming Perl wrote about this rarely used capability:
18.6. Code Development ToolsThis shows that the parse_argv subroutine had four lexical variables of its own; it also accessed global identifiers from both the main package and from Getopt::Long. The numbers are the lines where that item was used: a leading i indicates that the item was first introduced at the following line number, and a leading & means a subroutine was called there. Dereferences are listed separately, which is why both $Options and %$Options are shown.The O module has many interesting Modi Operandi beyond feeding the exasperatingly experimental code generators. By providing relatively painless access to the Perl compiler's output, this module makes it easy to build other tools that need to know everything about a Perl program.
The B::Lint module is named after lint(1), the C program verifier. It inspects programs for questionable constructs that often trip up beginners but don't normally trigger warnings. Call the module directly:
perl -MO=Lint,all myprogOnly a few checks are currently defined, such as using an array in an implicit scalar context, relying on default variables, and accessing another package's (nominally private) identifiers that start with _. See B::Lint(3) for details.The B::Xref module generates cross-reference listings of the declaration and use of all variables (both global and lexically scoped), subroutines, and formats in a program, broken down by file and subroutine. Call the module this way:
perl -MO=Xref myprog > myprof.pxrefFor instance, here's a partial report:Subroutine parse_argv Package (lexical) $on i113, 114 $opt i113, 114 %getopt_cfg i107, 113 @cfg_args i112, 114, 116, 116 Package Getopt::Long $ignorecase 101 &GetOptions &124 Package main $Options 123, 124, 141, 150, 165, 169 %$Options 141, 150, 165, 169 &check_read &167 @ARGV 121, 157, 157, 162, 166, 166
The B::Deparse is a pretty printer that can demystify Perl code and help you understand what transformations the optimizer has taken with your code. For example, this shows what defaults Perl uses for various constructs:
The -p switch adds parentheses so you can see Perl's idea of precedence:% perl -MO=Deparse -ne 'for (1 .. 10) { print if -t }' LINE: while (defined($_ = <ARGV>)) { foreach $_ (1 .. 10) { print $_ if -t STDIN; } }
You can use -q to see what primitives interpolated strings are compiled into:% perl -MO=Deparse,-p -e 'print $a ** 3 + sqrt(2) / 10 ** -2 ** $c' print((($a ** 3) + (1.4142135623731 / (10 ** (-(2 ** $c))))));
And this shows how Perl really compiles a three-part for loop into a while loop:% perl -MO=Deparse,-q -e '"A $name and some @ARGV\n"' 'A ' . $name . ' and some ' . join($", @ARGV) . "\n";
You could even call B::Deparse on a Perl bytecode file produced by perlcc -b, and have it decompile that binary file for you. Perl opcodes may be a tough read, but when necessary it can be helpful.% perl -MO=Deparse -e 'for ($i=0;$i<10;$i++) { $x++ }' $i = 0; while ($i < 10) { ++$x; } continue { ++$i }
There are half dozen of key components of any IDE each of which exist as high quality independent component that can be integrated (with weaker or stronger level of integration, depending on the capabilities of particular IDE) into your own framework.
Perl has one good beautifier (perltidy). The problem with writing a good Perl beautifier is the complexity of lexical structure of the language with such elements as qw, qq, etc.
I wrote my own simple Perl pretty printer called neatperl for use with my custom OFM-based Perl IDE.
Perltidy is an OK choice as it is well debugged and has little chances to mangle your script:
Perltidy is a Perl script which indents and reformats Perl scripts to make them easier to read. If you write Perl scripts, or spend much time reading them, you will probably find it useful.Here are a few examples of reformatted code snippets:
The formatting can be controlled with command line parameters. The default parameter settings approximately follow the suggestions in the Perl Style Guide.Perltidy can also output html of both pod and source code. For example, the link below is an html version of the module Conf.pm from SpamAssassin.
Besides reformatting scripts, Perltidy can be a great help in tracking down errors with missing or extra braces, parentheses, and square brackets because it is very good at localizing errors.
Also Code2HTML can convert Perl source code to syntax highlighted HTML. Some Perl editors has this capability too.
Perl has a very useful but almost unknown and very rarely used by developers lint module (you may need to install the B::lint module)
18.6. Code Development Tools
The O module has many interesting Modi Operandi beyond feeding the exasperatingly experimental code generators. By providing relatively painless access to the Perl compiler's output, this module makes it easy to build other tools that need to know everything about a Perl program.
The B::Lint module is named after lint(1), the C program verifier. It inspects programs for questionable constructs that often trip up beginners but don't normally trigger warnings. Call the module directly:
Only a few checks are currently defined, such as using an array in an implicit scalar context, relying on default variables, and accessing another package's (nominally private) identifiers that start with _. See B::Lint(3) for details.% perl -MO=Lint,all myprog
The B::Deparse is a pretty printer that can demystify Perl code and help you understand what transformations the optimizer has taken with your code. For example, this shows what defaults Perl uses for various constructs:
The -p switch adds parentheses so you can see Perl's idea of precedence:% perl -MO=Deparse -ne 'for (1 .. 10) { print if -t }' LINE: while (defined($_ = <ARGV>)) { foreach $_ (1 .. 10) { print $_ if -t STDIN; } }You can use -q to see what primitives interpolated strings are compiled into:% perl -MO=Deparse,-p -e 'print $a ** 3 + sqrt(2) / 10 ** -2 ** $c' print((($a ** 3) + (1.4142135623731 / (10 ** (-(2 ** $c))))));And this shows how Perl really compiles a three-part for loop into a while loop:% perl -MO=Deparse,-q -e '"A $name and some @ARGV\n"' 'A ' . $name . ' and some ' . join($", @ARGV) . "\n";You could even call B::Deparse on a Perl bytecode file produced by perlcc -b, and have it decompile that binary file for you. Serialized Perl opcodes may be a tad tough to read, but strong encryption they are not.% perl -MO=Deparse -e 'for ($i=0;$i<10;$i++) { $x++ }' $i = 0; while ($i < 10) { ++$x; } continue { ++$i }
From PerlCritic - Wikipedia, the free encyclopedia
Perl::Critic is a static code analysis system for the Perl programming language. Perl::Critic is available as a source-code distribution on CPAN. It comes with a commandline tool, perlcritic, which can check Perl source code files and report on the code quality therein. Perl::Critic has an extensible architecture that allows the programmer to choose from many "policies" which enforce different Perl programming styles and tastes. The default policy is largely based on the recommendations in the book Perl Best Practices by Damian Conway.
Perl::Critic is based on the PPI parsing library. For safety, PPI does not execute any code while parsing, unlike the Perl compiler, so it is a close approximation of the real parser rather than an exact representation.
Some new alternatives include Perl::Lint and B::Lint.
Typically documentation now is viewed via web using web browser. So there is not real need in separate component here for viewing standard Perl documentation. You can view it via IE of Firefox or whatever browser you prefer.
Perl has another type of documentation that resembles somewhat "literary programming" paradigm. It is called POD. You can incorporate POD into your script text and extract it using POD viewer. So POD viewer here is the just regular viewer and it can added to OFM as such. With editor it is just a special macro.
|
Switchboard | ||||
Latest | |||||
Past week | |||||
Past month |
Oct 01, 2009 | perlide.org
In October 2009 we ran a poll asking people Which editor(s) or IDE(s) are you using for Perl development? . The poll was promoted via the blog of Gabor Szabo which is syndicated in several Perl related sites such as the Iron Man Challenge , Perlshpere and Planet Perl . It was also promoted via Twitter , the Perl group in Reddit , the Perl Mongers group in LinkedIn and the Perl Community Adserver to get more people to cast their vote. Request was also sent to the Perl Monger group leaders. Some of them have forwarded the request to their respective groups.
The list of editors was taken from the Perl Development Tools page on Perlmonks and the "randomize answers" checkbox was clicked after filling in the data. No idea if that really randomized the answers. During the poll people could mark other editors and type in the name of and editor. Some of these editors were added to the list of possible answers during the poll. In addition there were people who typed in the name of the editor in the other field even though the name appeared on the list.
At the begining we set the poll to allow multiple choice with up to 3 answers per person but later on we noticed that at one of the updates it became multiple choice unlimited answers. Unfortunatelly the free polling system we used gave details only on the number of answers and not the number of people who answered.
The poll ran between 21-24 October 2009 for about 72 hours. There were 3,234 answers when it was closed.
The results are as follows.
Vim (or vi or gvim) 1097 34% Emacs (or xemacs, with or without extensions) 430 13% Ultra Edit (plain or Studio) 224 7% Eclipse EPIC 210 6% Other answer... 143 4% Notepad++ 142 4% Komodo IDE 128 4% Komodo Edit 105 3% TextMate 105 3% Padre 101 3% Kate 56 2% Gedit 55 2% TextPad 49 2% nano 40 1% SciTE 38 1% Geany 36 1% NEdit 27 1% mcedit 26 1% EditPlus 26 1% BBEdit 25 1% JEdit 23 1% Joe 20 1% Smultron 16 0% TextWrangler 14 0% PSPad 12 0% Notepad2 12 0% Open Perl IDE 10 0% OptiPerl 9 0% Pico 7 0% Jed 6 0% Kephra 6 0% SlickEdit 6 0% KDevelop 6 0% Notepad 5 0% Crimson 4 0% Anjuta 3 0% EngInSite-Perl 3 0% KEdit 3 0% Perl Express 2 0% DzSoft Perl 2 0% PerlWiz 1 0% Far 1 0% Perl Studio 0 0% Perl Builder 0 0% Editeur 0 0% Perl Code Editor 0 0% ED for Windows 0 0% PerlEdit 0 0% FTE 0 0% visiPerl+ 0 0% Prof. Notepad 0 0% Perl Scripting Tool 0 0%
Mar 13, 2007 | cs.rpi.edu
On this page, I will post aides and tools that Perl provides which allow you to more efficently debug your Perl code. I will post updates as we cover material necessary for understanding the tools mentioned.
- CGI::Dump
- Dump is one of the functions exported in CGI.pm's :standard set. It's functionality is similar to that of Data::Dumper . Rather than pretty-printing a complex data structure, however, this module pretty-prints all of the parameters passed to your CGI script. That is to say that when called, it generates an HTML list of each parameter's name and value, so that you can see exactly what parameters were passed to your script. Don't forget that you must print the return value of this function - it doesn't do any printing on its own.
use CGI qw/:standard/; print Dump;- Benchmark
- As you know by now, one of Perl's mottos is "There's More Than One Way To Do It" (TMTOWTDI ©). This is usually a Good Thing, but can occasionally lead to confusion. One of the most common forms of confusion that Perl's verstaility causes is wondering which of multiple ways one should use to get the job done most quickly.
Analyzing two or more chunks of code to see how they compare time-wise is known as "Benchmarking". Perl provides a standard module that will Benchmark your code for you. It is named, unsurprisingly, Benchmark . Benchmark provides several helpful subroutines, but the most common is called cmpthese() . This subroutine takes two arguments: The number of iterations to run each method, and a hashref containing the code blocks (subroutines) you want to compare, keyed by a label for each block. It will run each subroutine the number of times specified, and then print out statistics telling you how they compare.
For example, my solution to ICA5 contained three different ways of creating a two dimensional array. Which one of these ways is "best"? Let's have Benchmark tell us:
#!/usr/bin/perl use strict; use warnings; use Benchmark 'cmpthese'; sub explicit { my @two_d = ([ ('x') x 10 ], [ ('x') x 10 ], [ ('x') x 10 ], [ ('x') x 10 ], [ ('x') x 10 ]); } sub new_per_loop { my @two_d; for (0..4){ my @inner = ('x') x 10; push @two_d, \@inner; } } sub anon_ref_per_loop { my @two_d; for (0..4){ push @two_d, [ ('x') x 10 ]; } } sub nested { my @two_d; for my $i (0..4){ for my $j (0..9){ $two_d[$i][$j] = 'x'; } } } cmpthese (10_000, { 'Explicit' => \&explicit, 'New Array Per Loop' => \&new_per_loop, 'Anon. Ref Per Loop' => \&anon_ref_per_loop, 'Nested Loops' => \&nested, } );The above code will print out the following statistics (numbers may be slightly off, of course):Benchmark: timing 10000 iterations of Anon. Ref Per Loop, Explicit, Nested Loops, New Array Per Loop... Anon. Ref Per Loop: 2 wallclock secs ( 1.53 usr + 0.00 sys = 1.53 CPU) @ 6535.95/s (n=10000) Explicit: 1 wallclock secs ( 1.24 usr + 0.00 sys = 1.24 CPU) @ 8064.52/s (n=10000) Nested Loops: 4 wallclock secs ( 4.01 usr + 0.00 sys = 4.01 CPU) @ 2493.77/s (n=10000) New Array Per Loop: 2 wallclock secs ( 1.76 usr + 0.00 sys = 1.76 CPU) @ 5681.82/s (n=10000) Rate Nested Loops New Array Per Loop Anon. Ref Per Loop Explicit Nested Loops 2494/s -- -56% -62% -69% New Array Per Loop 5682/s 128% -- -13% -30% Anon. Ref Per Loop 6536/s 162% 15% -- -19% Explicit 8065/s 223% 42% 23% --The benchmark first tells us how many iterations of which subroutines it's running. It then tells us how long each method took to run the given number of iterations. Finally, it prints out the statistics table, sorted from slowest to fastest. The Rate column tells us how many iterations each subroutine was able to perform per second. The remaining colums tells us how fast each method was in comparison to each of the other methods. (For example, 'Explicit' was 223% faster than 'Nested Loops', while 'New Array Per Loop' is 13% slower than 'Anon. Ref Per Loop'). From the above, we can see that 'Explicit' is by far the fastest of the four methods. It is, however, only 23% faster than 'Ref Per Loop', which requires far less typing and is much more easily maintainable (if your boss suddenly tells you he'd rather have the two-d array be 20x17, and each cell init'ed to 'X' rather than 'x', which of the two would you rather had been used?).
You can, of course, read more about this module, and see its other options, by reading: perldoc Benchmark
- Command-line options
- Perl provides several command-line options which make it possible to write very quick and very useful "one-liners". For more information on all the options available, refer to perldoc perlrun
- -e
- This option takes a string and evaluates the Perl code within. This is the primary means of executing a one-liner
perl -e'print qq{Hello World\n};'(In windows, you may have to use double-quotes rather than single. Either way, it's probably better to use q// and qq// within your one liner, rather than remembering to escape the quotes).- -l
- This option has two distinct effects that work in conjunction. First, it sets $\ (the output record terminator) to the current value of $/ (the input record separator). In effect, this means that every print statement will automatically have a newline appended. Secondly, it auto-chomps any input read via the <> operator, saving you the typing necessary to do it.
perl -le 'while (<>){ $_ .= q{testing}; print; }'The above would automatically chomp $_, and then add the newline back on at the print statement, so that "testing" appears on the same line as the entered string.- -w
- This is the standard way to enable warnings in your one liners. This saves you from having to type use warnings;
- -M
- This option auto- use s a given module.
perl -MData::Dumper -le'my @foo=(1..10); print Dumper(\@foo);'- -n
- This disturbingly powerful option wraps your entire one-liner in a while (<>) { ... } loop. That is, your one-liner will be executed once for each line of each file specified on the command line, each time setting $_ to the current line and $. to current line number.
perl -ne 'print if /^\d/' foo.txt beta.txtThe above one-line of code would loop through foo.txt and beta.txt, printing out all the lines that start with a digit. ($_ is assigned via the implicit while (<>) loop, and both print and m// operate on $_ if an explict argument isn't given).- -p
- This is essentially the same thing as -n , except that it places a continue { print; } block after the while (<>) { ... } loop in which your code is wrapped. This is useful for reading through a list of files, making some sort of modification, and printing the results.
perl -pe 's/Paul/John/' email.txtOpen the file email.txt, loop through each line, replacing any instance of "Paul" with "John", and print every line (modified or not) to STDOUT- -i
- This one sometimes astounds people that such a thing is possible with so little typing. -i is used in conjunction with either -n or -p. It causes the files specified on the command line to be edited "in-place", meaning that while you're looping through the lines of the files, all print statements are directed back to the original files. (That goes for both explicit print s, as well as the print in the continue block added by -p.)
If you give -i a string, this string will be used to create a back-up copy of the original file. Like so:
perl -pi.bkp -e's/Paul/John/' email.txt msg.txtThe above opens email.txt, replaces each line's instance of "Paul" with "John", and prints the results back to email.txt. The original email.txt is saved as email.txt.bkp. The same is then done for msg.txtRemember that any of the command-line options listed here can also be given at the end of the shebang in non-one-liners. (But please do not start using -w in your real programs - use warnings; is still preferred because of its lexical scope and configurability).
- Data::Dumper
- The standard Data::Dumper module is very useful for examining exactly what is contained in your data structure (be it hash, array, or object (when we come to them) ). When you use this module, it exports one function, named Dumper . This function takes a reference to a data structure and returns a nicely formatted description of what that structure contains.
#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my @foo = (5..10); #add one element to the end of the array #do you see the error? $foo[@foo+1] = 'last'; print Dumper(\@foo);When run, this program shows you exactly what is inside @foo:
$VAR1 = [ 5, 6, 7, 8, 9, 10, undef, 'last' ];(I know we haven't covered references yet. For now, just accept my assertion that you create a reference by prepending the variable name with a backslash...)
- __DATA__ & <DATA>
- Perl uses the __DATA__ marker as a pseudo-datafile. You can use this marker to write quick tests which would involve finding a file name, opening that file, and reading from that file. If you just want to test a piece of code that requires a file to be read (but don't want to test the actual file opening and reading), place the data that would be in the input file under the __DATA__ marker. You can then read from this pseudo-file using <DATA>, without bothering to open an actual file:
#!/usr/bin/env perl use strict; use warnings; while (my $line = <DATA>) { chomp $line; print "Size of line $.: ", length $line, "\n"; } __DATA__ hello world 42 abcdeThe above program would print:
Size of line 1: 11 Size of line 2: 2 Size of line 3: 5- $.
- The $. variable keeps track of the line numbers of the file currently being processed via a while (<$fh>) { ... } loop. More explicitly, it is the number of the last line read of the last file read.
- __FILE__ & __LINE__
- These are two special markers that return, respectively, the name of the file Perl is currently executing, and the Line number where it resides. These can be used in your own debugging statements, to remind yourself where your outputs were in the source code:
print "On line " . __LINE__ . " of file " . __FILE__ . ", \$foo = $foo\n";Note that neither of these markers are variables, so they cannot be interpolated in a double-quoted string
- warn() & die()
- These are the most basic of all debugging techniques. warn() takes a list of strings, and prints them to STDERR. If the last element of the list does not end in a newline, warn() will also print the current filename and line number on which the warning occurred. Execution then proceeds as normal.
die() is identical to warn() , with one major exception - the program exits after printing the list of strings.
All debugging statements should make use of either warn() or die() rather than print() . This will insure you see your debugging output even if STDOUT has been redirected, and will give you the helpful clues of exactly where in your code the warning occurred.
Dec 19, 2017 | open-perl-ide.sourceforge.net
This section explains how to use Open Perl IDE for debugging.
Important: Open Perl IDE is not able to debug any scripts, if it does not know a path to "perl.exe". If the PATH environment variable contains a valid location, then "perl.exe" will be detected automatically. Otherwise it is necessary to enter a valid location into
the "Preferences | General | Directories | Path to perl.exe" field.
There are two methods to debug a script:After execution is stopped, it is possible to analyse the actual state of the script by
- Set one or more breakpoints (as explained in section 5.1 Breakpoints) and run the script, which is executed until a breakpoint is reached.
- Choose Step Over from the Run Menu. After the script and all required modules are loaded and initalized, the execution stops on the first line of non-initialization code.
Furthermore, it is possible to set/delete breakpoints (see section 5.1 Breakpoints) or to continue/abort the execution of the script. The following table shows the different navigation possibilities:
- Viewing Console Output, see section 4.2 Compile and Run a script
- Evaluating some variables, see section 5.2 Variable Evaluation
- Viewing the list of loaded modules, see section 5.3 Other debug windows
- Viewing the callstack, see section 5.3 Other debug windows
Table: Debug Navigation
Name Shortcut Description Run F9 Start/Continue script execution until next breakpoint is reached. Step Over F8 Execute the current script line, not tracing into subroutines. Step Into F7 Execute the next command in the current script line, tracing into subroutines. Abort CTRL-F2 Request termination of debug session. Force Termination CTRL-ALT-F12 Immediately terminate debug session.
You should only use "Force Termination" if you see no other way to stop script execution. Dont't expect Open Perl IDE to work correctly after using forced termination !
If script execution has finished, then Open Perl IDE automatically switches back from debug mode to edit mode.
EPIC is an open source Perl IDE (including editor and debugger) based on the Eclipse platform, compatible with Windows, Linux and Mac OS X. Whether you are into CGI scripting or full-fledged Perl projects with hundreds of modules, EPIC is the most feature-rich and extensible free Perl IDE available today, thanks to a seamless integration with all the major features and GUI conventions of Eclipse.
- Syntax highlighting
- Configurable coloring of syntactic elements
- On-the-fly syntax check
- Syntax errors detected and explained as you type or upon saving a file
- Content assist
- Autocompletion for subroutine and variable names
- Quick reference feature
- Documentation tooltips for built-in Perl functions
- Outline view
- Displays used modules and subroutines contained in the edited file
- Source formatter
- Integrated perltidy and HTML export feature
- Perldoc support
- Integrated perldoc for quick acccess to documentation
- Templating support
- Create a library of code snippets to save typing
- Persistent breakpoints
- Breakpoints stay set between IDE restarts
- Single Step/Step Into/Step Over
- Tried and true execution control features
- Global and local variables inspection
- Displays contents of variables (PadWalker module required)
- Expression evaluation
- Execute user-defined expressions while debugger is paused
- RegExp Plug-in
- Multiline/ignorecase support
Subexpression highlighting
Single step for debugging
- Perl::Critic integration
- Helps keep your coding style nice and tidy
- ...and more!
Open Perl IDE is a visual, integrated development environment for writing and debugging Perl scripts with any standard Perl distribution under Windows 95/98/NT/2000.
Open Perl IDE is an integrated development environment for writing and debugging Perl scripts with any standard perl distribution under Windows 95/98/NT/2000. This software is written in Delphi 5 Object Pascal and Perl and it is OpenSource, distributed under Mozilla Public Licence 1.1 and hosted by SourceForge. Please visit our project page to get further information.
Now, take a look at some screenshots, read the User Manual to get a more detailed description of Open Perl IDE or download the latest release (Version 1.0).
The new release 1.0 is the first non-beta version of Open Perl IDE and fixes most of the bugs reported for previous releases. However, some of the changes are much more than simple bugfixes:
- Better syntax coloring by using a new highlighter component.
- Important debugger improvements, including better support for huge arrays.
- Previous instance detection on program start.
- Several minor HelpViewer and Configuration enhancements.
For any information, questions, remarks or bug reports, please send a message to Jürgen Güntherodt.
Sep 17, 2007 | PerlMonks
I wish vi fanbois and emacs die-hards stopped recommending them as Perl IDEs. They are editors, as much as you love them. They don't have debuggers, stack tracers, variable watching, breakpoints, regexp builders, or anything that makes up a real Perl IDE.
That said, Perl IDEs are listed at perlide.org.
There are two serious paid Perl IDEs:
- Komodo IDE. I've been using it and it works. Debugging is slower than in Eclipse+EPIC, but it does remote debugging. Development on Komodo is clunky (they still haven't implemented basic features like moving panes around, or tooltip variable evaluation, although users have been begging for them for years).
- Optiperl - I used it in 2006 and it was pretty good. I liked the tooltip evaluations and the cool background highlight of the blocks. But displaying complex data structures in the Watches pane was a mess: hashrefs can't be expanded and some display "REUSED_ADDRESS" instead of the actual hash; arrays of hashrefs were numbered in a totally idiotic way. For that reason, I stuck with Komodo. However, it's been 4 years since. Optiperl does remote debugging too, albeit with some issues. Its latest version, however, dates from February 2008, and it doesn't do Unicode. Komodo, by contrast, releases new betas all the time.
The two serious free Perl IDEs are Padre and Eclipse + the EPIC plugin.
I compared Komodo vs. Eclipse and stuck with Komodo because of its remote debugging capabilities.
Padre is still immature but the good part is that you can improve it, since it's written in Perl, unlike EPIC (written in Java).
Perltidy is a Perl script which indents and reformats Perl scripts to make them easier to read. If you write Perl scripts, or spend much time reading them, you will probably find it useful.Here are a few examples of reformatted code snippets:
The formatting can be controlled with command line parameters. The default parameter settings approximately follow the suggestions in the Perl Style Guide.Perltidy can also output html of both pod and source code. For example, the link below is an html version of the module Conf.pm from SpamAssassin.
Besides reformatting scripts, Perltidy can be a great help in tracking down errors with missing or extra braces, parentheses, and square brackets because it is very good at localizing errors.
This is a Web-based source code beautifier (source code formatter), similiar to indent. Please make a backup before you replace your code!
#!/usr/bin/perl # 'pb' Perl Beautifier # Written by P. Lutus Ashland, Oregon [email protected] 5/20/96 # This script processes Perl scripts, cleans up and indents, like cb does for C # Be careful with this script - it accepts wildcards and processes every text file # that meets the wildcard criteria. This could be a catastrophe in the hands of the unwary. $tabstring = " "; # You may place any tab-stop characters you want here if($ARGV[0] eq "") { print "usage: file1 file2 etc. or wildcards (replaces originals in place)\n"; } else { foreach $filename (@ARGV) { if(-T $filename) { &process($filename); } } } sub process { $fn = $_[0]; undef $/; # so we can grab the entire file at once undef @infa; # prevent left-overs print STDERR "$fn"; open (INFILE,$fn); @infa = split(/\n/,<INFILE>); close INFILE; $/ = "\n"; # restore default open (OUTFILE,">$fn"); $tabtotal = 0; for (@infa) { s/^\s*(.*?)\s*$/$1/; # strip leading and trailing spaces $a = $_; # copy original string $q = $a; # i plan to modify this copy for testing $q =~ s/\\\#//g; # remove escaped comment tokens $q =~ s/\#.*?$//g; # remove Perl-style comments $q =~ s{/\*.*?\*/} []gsx; # remove C-style comments $q =~ s/\\\{//g; # remove escaped left braces $q =~ s/\\\}//g; # remove escaped right braces $q =~ s/\\\(//g; # remove escaped left parentheses $q =~ s/\\\)//g; # remove escaped right parentheses $q =~ s/\'.*?\'//g; # remove single-quoted lines # now the remaining braces/parentheses should be structural $delta = -($q =~ s/\}/\}/g); # subtract closing braces $delta += ($q =~ s/\{/\{/g); # add opening braces $delta -= ($q =~ s/\)/\)/g); # subtract closing parens $delta += ($q =~ s/\(/\(/g); # add opening parens $tabtotal += ($delta < 0)?$delta:0; # subtract closing braces/parentheses $i = ($tabtotal > 0)?$tabtotal:0; # create tab index $tabtotal += ($delta>0)?$delta:0; # add opening braces/parentheses for next print if(substr($a,0,1) ne "#") { # don't tab comments print OUTFILE $tabstring x $i; # "tab" out to position } print OUTFILE "$a\n"; # print original line } # -- for (@infa) close OUTFILE; if($tabtotal != 0) { print STDERR " Indentation error: $tabtotal\n"; } else { print STDERR "\n"; } } # sub process
Beautifier (previously known as PSH, the PHP Syntax Highlighter) highlights and indents source code using highlight configuration files which are similar to Ultraedit highlighting files. It supports C, C#, Java, Perl, PHP, Pascal, Lisp, Mumps, Eiffel, Euphoria, and x86 Assembler, amongst others. It handles line/block comments, keyword highlighting, correct indentation, string highlighting, language contexts (allowing embedded languages), and selection highlighting. It is available in PHP and Perl versions.
SciTE is a SCIntilla based Text Editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building and running programs. It is best used for jobs with simple configurations - I use it for building test and demonstration programs as well as SciTE and Scintilla, themselves.SciTE is currently available for Intel Win32 and Linux compatible operating syshttp://www.scintilla.org/SciTEImage.html">Here is a screenshot of SciTE.
On Windows, there is a companion application Filerx which provides project management and macro features to SciTE.
You can download Scintilla and SciTE.
There are some extra configuration files that can enhance SciTE for various languages and APIs.
The scite-interest mailing list has moved from lyra.org to Google Groups. Questions and comments about SciTE should be directed to the scite-interest mailing list, which is for discussion of SciTE and related projects, their bugs and future features. This is a low traffic list, averaging less than 50 messages per week. To avoid spam, only list members can write to the list. New versions of SciTE are announced on scite-interest and may also be received by SourceForge members by clicking on the Monitor column icon for "scite" on the downloads page. Messages sent to my personal email address that could have been sent to the list may receive no response.
There is a Scintilla project page
why don't you try Eclipse with Epic (an eclipse perl plug in) ;)Check out Padre, http://padre.perlide.org/
Ulrich Habel wroteon June 17, 2009 at 5:05pmPersonally I like SciTE which is more an editor which is customizable. You can have your own menu entries which might use tools or even Perl scripts in the background. It's very small and very fast.
In order to fulfill the request for the IDE I would suggest looking into Padre. It has some great features like lexical replacement with refactoring, it reads your code and assists you. You'll end up installing full CPAN if you build it on your own.
Syntax Highlighting for HTML, C/C++, Perl, Java, Matlab and LaTeX. Also, it can be extended for other programming languages based on custom syntax files.
A Perl code editor for Windows. Allows Perl programmers to develop and edit scripts with a more advanced editor compared to the standard notepad that comes with Windows. Features include: Syntax Coloring, Bookmarks, Auto Indenting, Line Ending Conversion (Unix to Windows), Drag and Drop Support, Goto Line by Line Number, and Handles .pl and .cgi files. Also includes a context/right click menu for fast access to the most commonly used features.
Perl Editor 2005 is a feature-packed Integrated Development Environment for Perl programmers. Why do Perl coders need it? Here is an analogy - you probably have both Notepad and MS Word on your PC. Both are text-editors or word processors. Which tool do you think professional writers prefer?
... Since the program was created by an experienced team of Perl programmers, Perl Editor has every feature Perl coder could possible need and does not have any extraneous options that would make the program complicated, hard to learn or difficult to use.
http://www.perleditor.net/download/SannySoftPerlEditor.zip - 3Mb - Download - Screenshot
DzSoft Perl Editor is a tool for writing, editing, and debugging Perl/CGI scripts. It has a comfortable and intuitive interface both for beginners and advanced programmers. DzSoft Perl Editor is deceptively simple, but it is really a very powerful tool. ... With DzSoft Perl Editor you can run a script and see the result immediately in just one click (you dont even have to run a web server to test a CGI script in the browser)! ... Features Code Explorer, very comfortable editor with syntax highlighting, syntax check, easy debugging of command line and CGI scripts with breakpoints and...
http://www.dzsoft.com/download/dzperl57.exe - 2Mb - Download - Screenshot
Top Perl Studio is an Integrated Development Environment for Perl, providing comprehensive and easy-to-use solution for editing, testing and deploying CGI/Perl based web applications. Top Perl Studio includes a built-in HTTP server which directly runs CGI/Perl code and an internal web browser... Top Perl Studio's powerful code editor supports configurable syntax highlighting for Perl, HTML, XML, SQL... ... Other major features are: built-in FTP client, file/server explorer, syntax checking for Perl code, visual file comparison utility, code snippets for CSS and HTML tags, automatic...
http://www.top-systems.net/Top-Perl-Studio/tperlstudio-trial-en.zip - 2Mb - Download - Screenshot
A free integrated development environment (IDE) for Perl with multiple tools for writing and debugging your scripts. It features multiple CGI scripts for editing, running, and debugging; multiple input files; full server simulation; queries created from an internal Web browser or query editor;... It has a customizable code editor with syntax highlighting, unlimited text size, printing, line numbering, bookmarks, column selection, a search-and-replace engine, multilevel undo/redo operations, and so on.
http://www.perl-express.com/PeSetup25.exe - 3Mb - Download - Screenshot
Perl Builder is a complete integrated development environment (IDE) for Perl. Key features include a visual editor/debugger that is similar to products such as Visual Basic and Delphi. The CGI Wizard component lets both novices and experienced programmers create powerful scripts visually,... The Perl Builder IDE includes all the features you expect in a professional development tool, including color syntax highlighting, automatic indentation, a full-featured debugger with mouseover variable inspection, single step, watches, and data structure dump.
DzSoft Perl Editor has debugging features, a very comfortable editor with syntax highlighting, a syntax check feature that finds errors in your script, and many other features for easy and comfortable Perl development.
Customizable Syntax Highlighting
Perl is in danger of becoming a fading language--new programmers are learning Java and Python in college, and companies like Google hardly use Perl at all. If you are afraid that Perl may be in danger of becoming irrelevant for medium-to-large projects, then read on.
The Scary Part
I have discussed the future of Perl with managers from companies that currently use it and find that they worry about the future of Perl. One company I spoke with here in San Francisco is rewriting their core application in Java. Another company worries they will not be able to find new Perl programmers down the road. Yet another uses Perl for major projects, but suffers from difficulty in refactoring their extensive code base.
There are many reasons why companies care about the future of Perl. I offer a part of a solution: better tools for Perl can be a major part of keeping Perl relevant and effective as the primary language for medium and large projects.
Related Reading
Perl Best Practices
Table of Contents
By Damian Conway
Index
Sample ChapterWhen measuring the effectiveness of a development environment (people, language, tools, processes, etc.), a key measure is how expensive and painful it is to make changes to existing code. Once a project or system has grown to thousands of lines of code in dozens (or hundreds) of modules, the cost of making changes can escalate to the point where the team is afraid to make any significant change. Excellent tools are one of the ways to avoid this unhappy situation, or at least reduce its impact. Other factors are excellent processes and, of course, excellent people.
21st-Century Integrated Development Environments for Perl
I propose that more, high-quality development tools will help keep Perl relevant and alive in medium and large project environments. My focus in this article is on IDEs, or Integrated Development Environments, and primarily those with a graphical interface.
An IDE is an integrated set of tools for programming, combining a source code editor with a variety of other tools into a single package. Common features of modern IDEs include refactoring support, version control, real-time syntax checking, and auto-completion of code while typing.
I want to make it clear right at the outset that a team of highly skilled Perl programmers, using only tools that have been around for years (such as
emacs
,vi
,cvs
, andmake
) can and do build large, sophisticated, and successful projects. I am not worried about those programmers. I am worried about the larger population of programmers with one to five years of experience, and those who have not yet begun to program: the next generation of Perl programmers.Great tools will not make a bad programmer into a good programmer, but they will certainly make a good programmer better. Unfortunately, the tools for Perl are years behind what is available for other languages, particularly Java.
One powerful example is the lack of graphical IDEs for Perl with excellent support for refactoring. Several IDEs for Java have extensive refactoring support. Only one for Perl, the EPIC plugin for Eclipse, supports even a single refactoring action.
For an example of how good IDEs have inspired at least one Perl developer, see Adam Kennedy's Perl.com article on his new PPI module and Scott Sotka's Devel::Refactor module (used in EPIC).
I acknowledge that a graphical IDE is not the be-all of good tools. Just as some writers reject word processors in favor of typewriters or hand-written manuscripts, some programmers reject graphical IDEs and would refuse a job that required them to use one. Not everyone has (nor should have) the same tool set, and there are things a pencil can do that
vi
andemacs
will never do. That said, IDEs have wide use in businesses doing larger projects, and for many programmers and teams they provide major increases in productivity.Another important point is that while this article discusses over a dozen specific tools or features, having all the tools in a single package produces the biggest value. An IDE that provides all of these features in a single package that people can easily install, easily extend, and easily maintain across an entire development team has far more value than the sum of its parts.
There is a big win when the features provided by an IDE immediately upon installation include all or almost all of the tools and features discussed here and where the features "know" about each other. For example, it is good if you enter the name of a non-existent subroutine and the real-time syntax checker catches this. It is much better if the code-assist feature then pops up a context menu offering to create a stub for the subroutine or to correct the name to that of an existing similar subroutine or method from another class that is available to the current file. (This is standard behavior for some Java IDEs.)
What Would a 21st-Century Perl Tool Set Contain?
Perl needs a few great IDEs--not just one, but more than one so that people have a diverse set to choose from. Perl deserves and needs a few great IDEs that lead the pack and set the standard for IDEs in other languages.
I am well aware that the dynamic nature of Perl makes it harder to have a program that can read and understand a Perl program, especially a large and complex one, but the difficulty in comprehending a Perl program makes the value of such a tool all the greater, and I have faith that the Perl community can overcome some of the built-in challenges of Perl. Indeed, it is among the greatest strengths of Perl that Perl users can adapt the language to their needs.
A great Perl IDE will contain at least the following, plus other features I haven't thought of. (And, of course, there must be many of those!)
- A syntax-coloring text editor.
- Real-time syntax-checking to catch and display syntax errors as you type.
- Version control integration to check out and compare code using CVS, Subversion, etc.
- A code-assist editor, to provide a list of methods when you type in an object reference, for example.
- Excellent refactoring support.
- A tree view of source files and resources.
- Support for creating and running unit tests.
- Language-specific help.
- Real-time display of debugging results.
- Automatic code reformatting.
- Seamless handling of multiple languages (such as Perl and C, Perl and Java, Perl and PHP, or Perl and Python).
- Automated build and test support.
Most of the screen shot examples in this article use the EPIC Perl IDE. At present, it has the largest amount of the features on my list (although it certainly doesn't have all of them).
Syntax-Coloring Text Editor
Most of you have probably seen this. It is available under
vim
,emacs
, BBEdit, and TextPad. Just about every decent text editor will colorize source code so that keywords, operators, variables, etc., each have their own color, making it easier to spot syntax errors such as forgetting to close a quote pair.Real-Time Syntax Checking
Figure 1. Real-time syntax checkingThe IDE in Figure 1 shows that line 4 has an error because of the missing
)
and that line 5 has an error because there is no declaration of$naame
(anduse strict
is in effect).A key point here is that the IDE shows these errors right away, before you save and compile the code. (In this example, the EPIC IDE lets you specify how often to run the syntax check, from 0.01 to 10.00 seconds of idle time, or only on demand.)
As nice as this is, it would be even better if the IDE also offered ways to fix the problem, for example, offering to change
$naame
to$name
. Figure 2 shows an IDE that does exactly that; unfortunately, for Java, not Perl.
Figure 2. Syntax help from the IDEIt would be great if Perl IDEs offered this kind of help.
Version Control Integration
All non-insane large projects use version control software. The most common version control software systems are probably CVS, Perforce, Subversion, and Visual SourceSafe. Figure 3 shows an IDE comparing the local version of a file to an older version from the CVS repository.
Figure 3. Comparing a local file to an older version in CVS--click image for full-size screen shotCVS integration is available in many modern code editors, including
emacs
,vim
, and BBEdit, as well as graphical IDEs such as Eclipse and Komodo Pro. Subversion integration is available as a plugin for Eclipse; Komodo Pro supports Perforce and Subversion.A Code-Assist Editor
Suppose that you have just typed in an object reference and want to call a method on the object, but you are not sure what the method name is. Wouldn't it be nice if the editor popped up a menu listing all of the methods available for that object? It might look something like Figure 4.
Figure 4. Automatic code completionIn this example, the IDE is able to figure out which class the object
$q
is an instance of and lists the names of the available methods. If you type ap
, then the list shows only the method names beginning withp
. If you typepa
, then the list shows only theparam()
andparse_params()
methods.Excellent Refactoring Support
The easier it is to do refactoring, the more often people will do it. The following list contains the most common refactorings. Your personal list will probably be a little different. All of these are things you can do "manually," but the idea is to make them into one or two-click operations so that you will do them much more often. (For a extensive list of refactoring operations, see Martin Fowler's alphabetical list of refactorings.)
Extract Subroutine/Method
The IDE should create a new subroutine using the selected code and replace the selected code with a call to the new subroutine, with the proper parameters. Here's an example of using the Extract Subroutine refactoring from Eclipse/EPIC (which uses the Devel::Refactor module).
First, you select a chunk of code to turn into a new subroutine, and then select Extract Subroutine from a context menu. You then get the a dialog box asking for the name of the new subroutine (shown in Figure 5).
Figure 5. Code before Extract Subroutine refactoringThe IDE replaces the selected code with a call to the new subroutine, making reasonable guesses about the parameters and return values (Figure 6). You may need to clean up the result manually.
Figure 6. Code after Extract SubroutineFigure 7 shows the new subroutine created by the IDE. In this case, it needs no changes, but sometimes you will need to adjust the parameters and/or return value(s).
Figure 7. The new subroutine created by Extract SubroutineIdeally, the editor should prompt you to replace similar chunks of code with calls to the new subroutine.
Rename Subroutine/Method
The IDE should find all the calls to the subroutine throughout your project and offer to change them for you. You should be able to see a preview of all of the places a change could occur, and to accept or reject each one on a case-by-case basis. The action should be undoable.
Rename Variable
Like Rename Subroutine, this feature should find all occurrences throughout the project and offer to make the changes for you.
Change Subroutine/Method Signature
The IDE should be able to make reasonable guesses about whether each subroutine or method call is supplying the proper parameters. Partly this is to enable the real-time syntax checking mentioned above, and partly this is to enable you to select a subroutine declaration and tell the IDE you want to refactor it by adding or removing a parameter. The IDE should then prompt you for the change(s) you want to make, do its best to find all of the existing calls to the subroutine, and offer to correct the subroutine calls to supply the new parameters.
Obviously, this is an especially tricky thing to do in Perl, where subroutines fish their parameters out of
@_
. So the IDE would have to look carefully at how the code usesshift
,@_
, and$_[]
in order to have a reasonable guess about the parameters the subroutine is expecting. In many common cases, though, a Perl IDE could make a reasonable guess about the parameters, such as in the following two examples, so that if you added or removed one, it could immediately prompt you about making corrections throughout the project:sub doSomething { my $gender = shift; my $age = shift; # Not too terribly hard to guess that $gender and $age are params } sub anotherThing { my ($speed,$direction) = @_; # No magic needed to guess $speed and $direction are params. }
Move Subroutine/Method
This refactoring operation should give you a list or dialog box to choose the destination file in your project. The IDE should allow you to preview all of the changes that it would make to accomplish the move, which will include updating a call to the subroutine/method to use the proper class. At a minimum, the IDE should show you or list all of the calls to the subroutine so you can make the appropriate changes yourself. Ideally, the IDE should make a guess about possible destinations; for example, if
$self
is a parameter to the method being moved, then the IDE might try assuming the method is an object (instance) method and initially only list destination classes that inherit from the source class, or from which the source class inherits.Change a Package Name
As with Rename Subroutine and Rename Variable, when changing a package name, the IDE should offer to update all existing references throughout your project.
[Jan 2, 2005] ExecPerl - Utilities for executing perl scripts vim online
Provides the following commands:
:ExecPerl script_name
This will execute script_name using the perl
interpreter.:ExecPerlMore
This will execute script_name using the perl
interpreter. If the output would scroll past the end
of the screen, execution pauses and waits for a
keystroke before continuing.:ExecPerlDump
This will ask you for an output file and then
execute script_name using the perl interpreter. The
output from the script is dumped to the file that you
entered when you were prompted. You may press enter
instead of entering a file name to accept the default
filename.Also, The following keys are mapped by default. You'll have to
comment them if you don't want this behavior:<F5>: ExecPerl the current file being edited
<C-F5>: ExecPerlMore the current file being edited
<S-F5>: ExecPerlDump the current file being edited
[Jan 2, 2005] perl_synwrite.vim - checks Perl syntax before allowing file write vim online
This plugin causes write attempts to fail if the contents of the buffer produce an error when run through "perl -c" The plugin uses can use autocommands for the BufWriteCmd and FileWriteCmd events, but by default only provides a :Write command to check-then-write.
install details Put this file in one of the locations described in :help ftplugin such as "~/.vim/after/ftplugin"; if you want autocommands, which are quirky, define perl_synwrite_au = 1
[Jan 2, 2005] perl.vim - Perl compiler script vim online
This is compiler script that runs perl -Wc and parses all error and warnings. For more information how to use compilers in VIM read help. This version has workaround with redirecting stderr on windows platform so it can run either on unixes or windows.
Enjoy. Lukas
install details Just put in the $VIMRUNTIME/compiler directory and run :make.
[Dec 26, 2004] http://ppt.perl.org/ Do you know about the Perl Power Tools, at and mirrored various other places?
It is a great project to implement versions of standard Unix tools in pure Perl, so that they can run anywhere Perl does. Those utilities might be perfect for those who like me I prefer Unix/Linux as the development platforms, but Windows for my desktop. They also might be an alternative to the Cygwin stuff even for those who do not use Perl for own scripting. They should be the alternative for those who does use Perl. Once Perl has been installed the PPT stuff only needs to be copied somewhere and that directory added to the PATH. You can also learn some great Perl coding tricks by reading the PPT utilities. Thanks for the anonymous feedback to the Softpanorama for this info.
perl.com Perl Command-Line Options
Perl has a large number of command-line options that can help to make your programs more concise and open up many new possibilities for one-off command-line scripts using Perl. In this article we'll look at some of the most useful of these.
Which Open Source Wiki Works For You
ONLamp.com
Kwiki
The Kwiki motto is a "A Quickie Wiki that's not Tricky." Installing it is pretty straightforward for a site you admin: just install the Perl package (from CPAN or elsewhere), and then type
kwiki-install
in a CGI-served directory to create an instance. Installing Kwiki on a server you are not an admin of is more complicated but doable.I found the Kwiki markup not powerful. Some things are impossible with it, such as hyperlinking an arbitrary piece of text to an email address (mail fooish). I also could not find how to link a Wiki page with a text link different from the Wiki page name (like this link to LinkedWikiWikiPage). There is also no support for attachments, HTML markup as an alternative to the Wiki markup, etc. It is disappointing.
Kwiki can use either RCS or Subversion for version control. (Those who wish to use Subversion should check out the corrected Kwiki version as the CPAN Kwiki does not work with the up-to-date Subversion.) Kwiki is easily customizable and has several Kwiki enhancements available. Generally, however, they are less powerful than TWiki's.
All in all, Kwiki is easy to install and customize, but its formatting rules are lacking.
... ... ...
UseModWiki
UseModWiki is a Wiki engine written in Perl. Anecdotally, Wikipedia used this first before re-implementing their current engine. Other sites also use UseModWiki.
UseModWiki is very simple to set up and upgrade. It has a rich syntax, and allows for arbitrary characters in page names. It also supports using some HTML tags instead of the WikiWiki markup. It has other nice features, including search, a list of recent changes, and page history.
For simple Wikis, UseModWiki is a very good choice. I recommend choosing between it and PmWiki based on the feature list of both Wikis.
Recommended Links
Xref Tools
The B::Xref module generates cross-reference listings of the declaration and use of all variables (both global and lexically scoped), subroutines, and formats in a program, broken down by file and subroutine. Call the module this way:
% perl -MO=Xref myprog > myprof.pxrefFor instance, here's a partial report:
Subroutine parse_argv Package (lexical) $on i113, 114 $opt i113, 114 %getopt_cfg i107, 113 @cfg_args i112, 114, 116, 116 Package Getopt::Long $ignorecase 101 &GetOptions &124 Package main $Options 123, 124, 141, 150, 165, 169 %$Options 141, 150, 165, 169 &check_read &167 @ARGV 121, 157, 157, 162, 166, 166This shows that the parse_argv subroutine had four lexical variables of its own; it also accessed global identifiers from both the main package and from Getopt::Long. The numbers are the lines where that item was used: a leading i indicates that the item was first introduced at the following line number, and a leading & means a subroutine was called there. Dereferences are listed separately, which is why both $Options and %$Options are shown.
[Jul 1, 2005] Perl 5.8 Documentation - BXref - Generates cross reference reports for Perl programs
The B::Xref module is used to generate a cross reference listing of all definitions and uses of variables, subroutines and formats in a Perl program. It is implemented as a backend for the Perl compiler.The report generated is in the following format:
File filename1 Subroutine subname1 Package package1 object1 line numbers object2 line numbers ... Package package2 ...Each File section reports on a single file. Each Subroutine section reports on a single subroutine apart from the special cases "(definitions)" and "(main)". These report, respectively, on subroutine definitions found by the initial symbol table walk and on the main part of the program or module external to all subroutines.
The report is then grouped by the Package of each variable, subroutine or format with the special case "(lexicals)" meaning lexical variables. Each object name (implicitly qualified by its containing Package) includes its type character(s) at the beginning where possible. Lexical variables are easier to track and even included dereferencing information where possible.
The
line numbers
are a comma separated list of line numbers (some preceded by code letters) where that object is used in some way. Simple uses aren't preceded by a code letter. Introductions (such as where a lexical is first defined withmy
) are indicated with the letter "i". Subroutine and method calls are indicated by the character "&". Subroutine definitions are indicated by "s" and format definitions by "f".Option words are separated by commas (not whitespace) and follow the usual conventions of compiler backend options.
-oFILENAME
- Directs output to
FILENAME
instead of standard output.-r
- Raw output. Instead of producing a human-readable report, outputs a line in machine-readable form for each definition/use of a variable/sub/format.
-d
- Don't output the "(definitions)" sections.
-D[tO]
- (Internal) debug options, probably only useful if
-r
included. Thet
option prints the objl&HTML converters
GNU Source-highlight - GNU Project - Free Software Foundation (FSF) v1.6 by Lorenzo Bettini
This program, given a source file, produces a document with syntax highlighting.
At the moment this package can handle
- Java
- C/C++
- Prolog
- Perl
- Php3
- Python
- Flex
- ChangeLog
as source languages, and
- HTML
- XHTML
as output format.
NOTICE: now the name of the program is source-highlight: there are no two separate programs, namely java2html and cpp2html, anymore. However there are two shell scripts with the same name in order to facilitate the migration (however their use is not advised).
GNU Source-highlight is free software. Please see the file COPYING for details. For documentation, please read this file.
GNU Source-highlight is a GNU program and its main home page is at GNU site:
http://www.gnu.org/software/src-highlite/source-highlight.htmlYou can download it from GNU's ftp site:
ftp://ftp.gnu.org/gnu/source-highlight/ or from one of its mirrors (see http://www.gnu.org/prep/ftp.html).I do not distribute Windows binaries anymore; since, they can be easily built by using Cygnus C/C++ compiler, available at http://www.cygwin.com/. However, if you don't feel like downloading such compiler, you can request such binaries directly to me, by e-mail ([email protected]) and I can send them to you.
An MS-Windows port of Source-highlight is available from http://gnuwin32.sourceforge.net/.You may also want to check the md5sum of the archives, which are also digitally signed by me (Lorenzo Bettini) with GNU gpg (http://www.gnupg.org). My GPG public key can be found at my home page (see at the end of this doc).
You can also get the patches, if they are available for a particular release (see below for patching from a previous version).
code2html
code2html by Peter Palfrader (Weasel) is a perlscript which converts a program source code to syntax highlighted HTML. It may be called from the command line or as a CGI script. It can also handle include commands in HTML files. Currently supports: Ada 95, C, C++, HTML, Java, JavaScript, Makefile, Pascal, Perl, SQL, AWK, M4, and Groff.
Homepage: http://www.palfrader.org/code2html
Freshmeat page: http://freshmeat.net/projects/code2html/
code2html is a perlscript which converts a program source code to syntax highlighted HTML. It may be called from the command line or as a CGI script. It can also handle include commands in HTML files. It really should be rewitten eventually since the code is so ugly.
License: MIT
This project has the following developers:
- weasel is a Lead Developer.
Download: http://www.giga.or.at/~weasel/pub/code2html/latest/ (1637 hits) Alternate Download: http://www.cosy.sbg.ac.at/~ppalfrad/code2html/code2html.pl.gz (193 hits) Homepage: http://www.cosy.sbg.ac.at/~ppalfrad/code2html/ (2653 hits) Changelog: http://www.cosy.sbg.ac.at/~ppalfrad/code2html/history.html (97 hits)
Editors
VIM has (limited) support of Perl. See Softpanorama VI Editor Links
***** DzSoft Perl Editor 3.1 Very decent shareware editor with elements of Integrated environment. Contains built-in beautifier ! by Sergey Dzyubenko, Alexander Dzyubenko, DzSoft Ltd.
- Fully customizable Syntax Highlighting!
- Run the script with any parameters and see the result in the internal browser.
- All features are available offline.
- No need to run a web server on your computer to test the script!
- Syntax Check feature.
- Multi-line quick insert feature.
- NEW:STDIN support.
- Simple FTP client included to upload and chmod your script.
- HTML Export with syntax highlighting.
- Super comfortable editor with bookmarks.
- SDI interface that supports multiple instances.
- Print feature with Syntax Highlighting.
- Windows/Unix/Mac line endings support.
- Complete Perl Help included to browse offline.
- Windows 2000 100% compatible.
- Script parameters editor.
- Environment Variables Editor.
Perl Scripting Tool PRO Perl Made Easy Win32 editor.
NOTE: This is beta software. If you are not entirely comfortable using beta software, DO NOT install this version on your PC. We strongly recommend that BEFORE you install this software, you make a backup copy of your existing PST folder and put that copy in a separate area. Do not be alarmed if there is a big jump in beta build numbers; gaps exists because we create frequent internal builds. This is one of a series of beta releases of Perl Scripting Tool 2.00. As with any beta software, some features may not be fully implemented. If you find any problems with this software, please send us a bug report to: [email protected] .
ped A text editor with an emacs/vi-like user interface written in perl.[July 17, 1999]
Jul 08th 1999, 21:24 stable: none - devel: 0.1.2 license: ArtisticPerl::Tk
ptkpad.0.6.5.tar.gz
This is an implementation of my Tk NotePad only it is done in Perl::Tk. The implementation is progressing quite fast and most of the features have been implemented. Currently the only features that have not been implemented are some keystroke bindings.
Unfortunately there are a few bugs and is considered a beta release now, so please do not complain about bugs> I will welcome bug fixes. It originaly started out as a line by line conversion, but as I learn more about perl I am starting to optimize as well but this is a low priority.
Some features that have been added in addition to what is in my original TkNotePad are the New Window Menu item, as well as a line and column indicator to tell the position of the cursor, and a goto line. I have also added an Options menu for changing a few things like the fonts. Many more features are planned. screenshot
EDITOR COST REVIEWS From PBML Posters Perl Code Editor
from PerlVisionFree After Wordpad, this was my first Perl editor. Syntax highlighting and line numbering is definitely a step up.
Favorite feature: line numbering.
Submitted by: Bompa
[read more reviews]Open Perl IDE
by Jürgen GüntherodtFree A big step up, yet still light on your cpu. This is the one I use now because it's free and runs nicely even on my 122Mhz laptop.
Favorite feature: A "run" button that runs the script and shows errors in a box at the bottom of the screen, this saves a bunch of testing time.
Submitted by: Bompa
UltraEdit
IDM Computer Solutions, Inc$35 Full featured, tons of options, settings, and features.
Favorite feature: being able to "'comment out" whatever code I highlight with just one click, (and the reverse), great for troubleshooting. I loved it and might still cough up the 35 bucks.
Submitted by: BompaOptiPerl
Xarka Software$59 Full featured, tons of options, settings, and features, but more money than I want to spend at this time.
Submitted by: Bompa
Perl Builder 2.0
from Solutionsoft$149 Submit a review. visiPerl+
from Softpile$59 Submit a review. Komodo
from ActiveState$295 Submit a review. DzSoft Perl Editor
by DzSoft$59 Like OptiPerl, full featured, tons of options, settings, and features, but more money than I want to spend at this time.
Submitted by: Bompa
EditPlus
by ES Computing$30 Submit a review.
SciTE
Free source project.
Project Admin:Neil HodgsonFree Syntax highlighting for many languages, output pane, C-like macros (via FilerX), quick, small and mighty :-)
Submitted by: Jenda
VIM
Bram MoolenaarFree Vi and emacs, the great unix editor debate. Personally I like vim, it's quick, works great over slow links and has more features than you can shake a stick at. Once you've grokked enough of the commands to make this little baby run you'll never want to go back. mouse? mouse? i don't want no steeenking mouse. You windows types can even join in the fun too.
Submitted by: Daniel Gardner
Networking
[Oct. 07, 2000] A special module IPC-Run by Barrie Slaymaker([email protected]). After a user's spun up on bash/ksh, it provides useful piping constructs, subprocesses, and either expect-like or event loop oriented I/O capabilities.
www.perl.com Perl Reference/Networking
[Feb 20, 2000] pftp pFtp is a ftp client written in perl. It uses the Perl/Tk and Libnet libraries, both available from the CPAN FTP site. Download: pFtp 0.05
[Jan 28, 2000] DDJ EXAMINING PERLDAP by Troy Neeriemer
Netscape's PerLDAP is an important tool for both programmers and administrators because it provides a mechanism for accessing directory information from Perl. Troy presents a high-level overview of PerLDAP, along with details of how you can use it. Additional resources include perldap.txt (listings) and perldap.zip (source code).
File managers
Paw (Perl ASCII Widgets) is a widgetset for generating a GUI on ASCII based terminals. It contains button, radiobutton, label, line, listbox, text_entry, pull-down-menu, filedialog, popup-box and more. Examples are included. This
software requires Perl::Curses.[Apr 18, 2001] Drall -- Stable version 1.4.0.0. Much better that it was and now supports authentication using the same author's Averist module. Written in Perl (GNU license) Screenshots:
Here is the quote from the author page:
If you like Drall, please express your satisfaction with a donation: send me what you feel Drall has been worth to you. If you are glad that I developed Drall and distribute it as free software, rather than following the obstructive and antisocial practices typical of software developers, reward me. If you would like me to develop more free software, contribute.
Scripts Archives
CPAN
US Mirrors Europe Mirrors CPAN [Texas] CPAN [funet.fi] CPAN [California] cdrom.com CPAN [ruhr-uni-bochum.de] CPAN [New York] CPAN [pasteur.fr] CPAN [Massachusetts] CPAN [ruu.nl] CPAN [sunet.se] CPAN [sunsite.auc.dk]
- Programmers Heaven - Perl & PHP & Python Zone - Perl files files
- About Slasht -- old slashdot source. http://www.slashdot.org/code.shtml -- Slashdot site code(outdated, buggy, but still useful). There is also Freshmeat site code.
- Cool Modules List
- www.metronet.com Bill Middleton archive -- contain a lot of useful scripts, including:
- Matt's Script Archive
- perlWWW -- a (personal) attempt to index (free) Perl programs, and libraries, related to the World Wide Web.
- Perl Scripts -- some file processing cripts, etc.
- Abigail's Perl stuff -- some interesting algorithms
- Dale Bewley's Perl Scripts and Links -- contains an impressive collection of links
- Software Composition Group Archive -- htgrep
- My little world in Perl Examples
Etc
CGI Scripts
- Lincoln Stein's Home Page CGI and Perl scripts from the author of cgi.pm
- Free-Scripts.Net -- big and pretty decent archive
- http://www.metronet.com/1/perlinfo/scripts/
- Scriptsearch THE WORLD'S LARGEST CGI LIBRARY searchable archive (both Perl and shell,…)
- Matt's Script Archive Huge page.
- Perl tools for download
- Shell Script of the Month many good examples.
- The Perl Oasis all around Perl.
- John Cameron scripts
- Perl Scripts and Links by Dale Bewley
Other IDEs
The listed IDEs support Perl. The list is undoubtedly incomplete, but should form a good starting point for anyone wishing to look into this further.
- [Jul 29, 2005] Open Perl IDE is an integrated development environment for writing and debugging Perl scripts with any standard perl distribution under Windows 95/98/NT/2000.
This software is written in Delphi 5 Object Pascal and Perl and it is OpenSource, distributed under Mozilla Public Licence 1.1 and hosted by SourceForge.
Please visit our project page to get further information.
Now, take a look at some screenshots, read the User Manual to get a more detailed description of Open Perl IDE or download the latest release (Version 1.0).
The new release 1.0 is the first non-beta version of Open Perl IDE and fixes most of the bugs reported for previous releases. However, some of the changes are much more than simple bugfixes:
- Better syntax coloring by using a new highlighter component.
- Important debugger improvements, including better support for huge arrays.
- Previous instance detection on program start.
- Several minor HelpViewer and Configuration enhancements.
For any information, questions, remarks or bug reports, please send a message to Jürgen Güntherodt.
- Eclipse/EPIC
EPIC is a plugin for the Eclipse platform. Eclipse is open-source and cross platform (Windows/Mac/Linux/Solaris, etc.). Once you have Eclipse installed, install the EPIC plugin from within the Eclipse application using the EPIC update URL. Eclipse supports Java, and with plugins, C/C++, COBOL, Perl, PHP, UML2, Python, Ruby, XML, and more. There is a large and active community around Eclipse.
- Emacs is the mother of all text-editor/development-environment/adventure-game/all-in-one tools. Expert programmers use it widely and there are numerous enhancements for working with particular languages, including, of course, Perl. Emacs, with CPerlMode, is a richly featured IDE for Perl, albeit a non-GUI IDE (which, for some people, makes it even better). A set of extensions for CPerlMode are available but you need to join the Yahoo Extreme Perl group to get to them.
- PAGE
PAGE runs only on Windows (9x/ME/NT/2000/XP). It is a Rapid Application Development tool for Perl and comes in three versions: Free, Standard ($10), and Enterprise ($50). PAGE provides a several "wizards" for creating scripts, modules (packages), web forms, and even database applications.
- DZsoft Perl Editor shareware $49. DzSoft Perl Editor has debugging features, a very comfortable editor with syntax highlighting, a syntax check feature that finds errors in your script, and many other features for easy and comfortable Perl development.
Customizable Syntax Highlighting
- Run the script and see the result immediately in the internal browser without a web server
- Syntax Check
- Collapsible subroutines
- Customizable code snippets
- Full server simulation
- Full control of the environment variables and input data
- Code Explorer
- Can upload the script to FTP
- HTML export and print with syntax highlighting
- Super comfortable editor with savable bookmarks
- SDI interface that supports multiple instances
- Windows/Unix/Mac line breaks formats support
- OfficeXP-styled menus and toolbars
- "Run in Command Prompt" feature (with debugging)
- Built-in POD viewer with automatic detection
vim
The well-known descendent of
vi
is a powerful and flexible text editor with many plugins and extensions. Have a look at thevim
scripts ; for example, vim.sourceforge.net/scripts/script.php?script_id=556 and vim.sourceforge.net/scripts/script.php?script_id=281.
- visiPerl
This is a closed source application that runs on Win9x/NT/2000. It handles Perl and HTML and has code templates, being designed for website building. visiPerl includes a built-in web server for testing and an FTP client for code deployment. There is a free demo, or you can purchase it for $59.
Related Topics
- A conversation about Test-Driven Development
- "Automated Testing With Perl," Andy Lester's presentation on doing automated testing in Perl
- Extreme Perl book
- Extreme Perl mailing list
- eXtreme Programming FAQ
- Manifesto for Agile Software Development
- "Parse Perl Independently," an article about Adam Kennedy's PPI module
- testdriven.com
- JUnit
- Jon Udell's article on "Tools for Dynamic Languages"
- Refactoring home page
- XProgramming.com: Resources for and about Agile Software Development
Random Findings
Etc
Society
Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers : Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism : The Iron Law of Oligarchy : Libertarian Philosophy
Quotes
War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda : SE quotes : Language Design and Programming Quotes : Random IT-related quotes : Somerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose Bierce : Bernard Shaw : Mark Twain Quotes
Bulletin:
Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 : Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law
History:
Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds : Larry Wall : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOS : Programming Languages History : PL/1 : Simula 67 : C : History of GCC development : Scripting Languages : Perl history : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history
Classic books:
The Peter Principle : Parkinson Law : 1984 : The Mythical Man-Month : How to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite
Most popular humor pages:
Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor
The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D
Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...
You can use PayPal to to buy a cup of coffee for authors of this site Disclaimer:
The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.
Last updated: March 04, 2020