Perl Environment Configuration and Eclipse installation Perl development Plugin

Source: Internet
Author: User



Summary: This article will detail the installation of EPIC components, the epic editing environment, debugging the operating environment, highlighting how to use EPIC to quickly, easily and accurately debug Perl language programs, including single-step execution of Perl programs, breakpoint usage, local, Global variable real-time monitoring, sub-function execution monitoring, error and warning information real-time display and so on. With EPIC's powerful editing and debugging capabilities, the Perl language can be adapted to the features of a short time-to-complete program, providing a more user-friendly design and commissioning environment for tester's automated test scripts.



Pre-Installation Preparation



Several important components need to be prepared before installation:


  1. Perl language Compiler
  2. The version requirement is 5.8.X or above, most Unix/linux installation packages include the Perl language compiler's optional package, and for the Windows platform, you can go to the specified website to download the appropriate installation package.

  3. Download and install the Perl environment under Windows: Acitveperl for Windows
  4. http://www.activestate.com/activeperl/downloads

  5.  After installation, enter "Perl-v" in CMD to see if the installation is successful.
  6. Eclipse

  7. before installing the EPIC plugin, it is an essential step to select an up-to-date version of Eclipse for installation . version 3.1 is the minimum requirement for Eclipse and can be used from [http://www.eclipse.org] Download the Eclipse installation package.
  8. since the Eclipse installation package does not include the Java Runtime Environment (JRE), we also need to install Java 1.4.1 or a later version of Java.

  9. Padwalker (global variable Tracker)
  10. This module is not required, and its function is to monitor the value of the global variable during the Debug Perl program. What do you think? The value of global variables cannot be monitored in real time is a ' mismatch ' that no programmer can tolerate, so do not pull this module down in order to play EPIC's more complete debug function. This package can be downloaded from CPAN (Padwalker 0.10), if it is on the window platform, the installation method is as follows.

  11. Installation method: Start-to-All programs (Win7), Programs (XP)-->activeperl 5.xx.xx Build Xxxx-->perl package Manager, in the Perl package Manager window, select:
  12. 1) Click on the "View All" package and enter Padwalker;
    2) click mark for Install;
    3) Click Run Mark Action;
    * * These buttons are in the same line in the upper right corner * *


Install EPIC



Use the Eclipse Update Manager feature of Eclipse software to install EPIC.



Open Eclipse, go to menu Help->software and Updates->find and Install ...



1 is shown below:




Figure 1. EPIC Downloads and installs



Select "Search for new features to install" and select Next,



Select "Add Update Site ..." , in the Popup dialog box, fill in the user name and valid URL: http://www.epic-ide.org/updates/testing, 2:




Figure 2. EPIC Download URL



Continue to select ' Next ' until it is complete.



Install Padwalker (global variable Tracker)


    1. Download the Padwalker compression package for Perl 5.8.x.
    2. After extracting the files, copy them to the Perl installation directory, such as C:\Perl.


EPIC Editing Environment



EPIC provides a versatile editor that makes it easy for users to write Perl programs that provide syntax highlighting, instant syntax detection, error and warning message annotations, Perldoc queries, variable checks, module checks, and source folding, for engineers who write test automation scripts. Writing scripts is a cumbersome part of the entire test effort, and we all want this to be a powerful tool to handle these tasks quickly and easily, and fortunately, EPIC helped us achieve this. 3 is shown below:




Figure 3. EPIC Edit dialog box



Configure the Perl program to run the debugging environment



Create a project and enter a file


    1. Create a new project (you can also add your own project to an existing project)
    2. Select ' Import ' in the menu ' file ', and of course, you can create a new file and write the relevant Perl program with the epic editor, which is described above for the epic editor.
    3. Select ' File System ' from the list that pops up. 4 is shown below:



Figure 4. Select the file system that will be imported



4. Select ' Next '



5. In the popup panel, click ' Browse ' to select the folder where you want to enter the file, and the input file will appear on the panel, where you can select the file you want to enter into the project by clicking the check box in front of the file. 5 is shown below:




Figure 5. Import file



6. Click ' Finish ' to complete the current work.



Configuring the Perl Compiler Runtime environment



In the ECLIPSE environment, invoking the Perl language compiler to run the Debug project file, you must configure it, click menu ' Project ', select ' Properties ', and fill in the absolute path of the file for the previous entry into the edit area on the right side of the popup panel. 6 is shown below:




Figure 6.Include File path



Configuring the Debug dialog box



First, for the selected project file, select Menu ' Run ' on the EPIC main screen and select ' Open Debug Dialog ' in the pop-up drop-down box, then modify the following configuration (select Project and file to debug):



7 is shown below:




Figure 7. Debug dialog box Configuration 1



for the Perl program to run debugging all need to add programs Argument, we can add the Argument,epic plug-in for the new project also provides this interface, open the Debug dialog box, and in the project argv items in "(x) = Ar Guments "Add the appropriate Argument. 8: Figure 8. Debug dialog box Configuration 2






EPIC Debug Run Process



Any program debugging and operation are inseparable, from the point of view of the program engineer, a program from the writing finished to the final successful completion, are a run, modify, Debug, re-run, re-modify, re-debug ...



The process. EPIC provides a complete debug run environment.



EPIC Run Program



For the selected project file, select Menu ' Run ' on the EPIC main screen, and select ' Run ' in the pop-up drop-down box, 9: The area of the red line indicates the entire running process and results of the program can be seen.




Figure 9. EPIC Run Program Interface



EPIC Debug Program (commonly known as ' Debug ' program)



This process is much more complex than running a program, which is the essence of this document, and is the first step in making the necessary groundwork. For programmers, the debugger is unavoidable, usually the thread that is going to be debugged hangs, and then uses the single-stepping way to implement a line of code for the whole program, observing the results of each step, and mastering the changes in the variables during the run.



EPIC provides a variety of debugging operations to facilitate the user's practical needs in programming, including stepping, jumping into sub-functions, skipping child functions, breakpoint settings, breakpoint cancellation, directly executing the statement segment until the breakpoint position, and so on.


    1. Step Over – step through functions, loop loops, or execute other normal statements. The line of code that is being executed is highlighted in the EPIC editor, when the thread is suspended and the function icon (the corresponding shortcut is ' F6 ') is pressed on the Debug View toolbar, the line statement will be executed and will automatically jump to the next line to execute the statement. And makes it appear highlighted, the thread continues to suspend pending next instruction.
    2. Stepinto – you can perform entry functions, loop loops, or execute other normal statements. In the Debug View toolbar, press this function icon (the corresponding shortcut is ' F5 '), which is similar to ' step over ', which is different from: If the statement contains sub-functions, loops and other structures, ' Step over ' is directly behind the execution of these sub-functions or loops, and returns the result. But ' Step into ' is executed in the order in which the stack is executed, jumping into a child function or looping to provide a single step execution.
    3. Step return– This function is for the execution process has entered the child function, you can start from the current line of code directly after the execution of the child function remaining code and return, no stepping into the child function. In the Debug View toolbar, press this function icon (the corresponding shortcut is ' F7 ').


4. If you want to perform a direct background to the nearest next program breakpoint location, you can use the shortcut key ' F8 ' to achieve this function. Select Menu ' Run ', ' Debug ' in the main interface, enter the program debugging state, we can choose to debug the operator , including stepping, jump to the nearest next breakpoint to execute, jump into the sub-function and so on, for these operations, for engineers, always concerned about the operation of the entire program and the completion of each step after the implementation of the changes in the relevant variable, we need to introduce some views, using these views, we can better grasp the program Debug status to facilitate next steps.



first, go to the Debug interface interface, you can select:window-> Show View->debug in the main interface, in the pop-up view, you can manage the work area being debugged or running the program, it shows an engineering framework, the work process program health, and so on. 10 is shown below:




Figure 10. EPIC Debug Window



The variable view can show the value of the variables in the process of the program and the changes in fact, this function is particularly important for debugging work, the variable is the program's ' Blood ', the program code is through the variable to connect, grasp the variable situation, is to master the whole program running state.



In the variable view, you can see the frame structure of the variable stack, which shows the original state of the variable, including struct variables, hash variables, list variables, objects, and so on.



Global variables (including Perl internal variables) have specific icons, callouts, and local variables have specific icons (such as the previous description, the local variable must be installed with the Padwalker module to see).



11 is shown below:




Figure 11. EPIC Debug Window



A breakpoint view can display all breakpoints, their status, and their location in the program file. In this view, you can set, invalidate, or cancel breakpoints by selecting one or a breakpoint and activating the program text box for the corresponding breakpoint.



12 is shown below:




Figure 12. EPIC Debug Tracking



Summarize



To sum up, we have seen a set of editing, compiling, debugging Perl program as one of the graphical tools, it solves for several years has been plagued by the test workers for the Perl language to write automated script ' debugging difficult ' problem. Its simple and powerful editing environment also gives Perl language programmers an idyllic experience. The most important thing is to get all of this, you are taking the free way, because all the components are open source, this is a highly recommended software tool.






Resources


    • For more information about EPIC, please refer to the EPIC Homepage .
    • Visit DeveloperWorks Open Source Zone Get rich how-to information, tools and project updates, and Most popular articles and tutorials to help you develop with open source technologies and use them in conjunction with IBM products.


http://www.ibm.com/developerworks/cn/opensource/os-cn-ecl-epic/



Perl Environment Configuration and Eclipse installation Perl development Plugin


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.