[SOLVED] rerunning perl code efficiently

I am trying to learn perl and for that reason I am looking for the most efficient setup to do coding and not waste time compiling and restarting, etc.
Here is my current setup: I am using gvim and dwm, and I have one urxvt client open. I code in gvim, the file I am editing is called "tt" (for faster typing) and is located in my ~/bin directory, is chmod +'ed and of course in my path. So what I do is I edit my code in gvim, and when I want to see if my program works, I save the file in gvim (using ":w"), and then go to my urxvt terminal and just type "tt" to execute.
Anyone have a suggestion how to make this faster or give me some insights as to how they would do this most efficiently?
Last edited by awayand (2011-07-30 04:59:08)

Depending on how large your program gets and what it does, it may be quicker to recompile each time to get the speed of a compiled language, but I would not worry about that for now.
You could use both vim and tmux, so you can save in vim, then switch panes (in mine, this means pressing ^b and then the direction I want to move, as in vim). [Edit: You're probably using dwm keybindings to just switch windows, which is as fast as this will be]
Also, depending on what your script does, you can execute commands from inside of vim. Try :!ls . If that looks alright to you, you can use :!tt . This comes in handy for other things to, where you can pipe any selection (through visual mode or made manually) to an external command and have the results put in it's place.
Honestly, programming usually isn't something you try to do as fast as possible. As your program grows, the runtime will matter much more than the amount of time it takes for you to do a context switch.
Last edited by jac (2011-06-16 11:12:17)

Similar Messages

  • Converting .rpt file code into Perl code

    Hi All,
    I have some .rpt file which contains the following code to generate the report in Oracle
    .declare booking_no a13
    .declare line_code a10
    .declare line_booking a12
    .declare book_date a11
    .declare taken_by a10
    .declare ud a10
    .declare ship_name a40
    .declare ship_addr1 a40
    .declare ship_addr2 a40
    .declare ship_addr3 a40
    .declare ship_cont a20
    .declare ship_phone a20
    .declare ship_ref a20
    .declare fwdr_name a40
    .declare po_no a20
    .declare vessel_name a25
    .declare voyage a10
    .declare etd_origin a11
    .declare sail_date a11
    .declare origin_name a20
    .declare load_name a20
    .declare disch_name a20
    set page_no 1
    .set first "N"
    .set no_more_clauses "N"
    .declare dest_name a20
    .declare disch_code a4
    .declare dest_code a4
    #dt 1 1 80 #
    #dt 2 1 6 9 48 50 61 63 76 80 80 #
    #dt 3 1 13 15 34 36 40 42 56 58 62 64 74 75 79 #
    #dt 4 1 13 15 49 53 64 66 80 #
    #dt 5 1 15 18 52 #
    .define lock_tables
    lock table booking_table, booking_hazmat, custdata2, edit_table,
    booking_rates, printer_table in share update mode
    .define get_input
    select passkey, '//FAX(fax=' || passkey1, passkey2,
    passkey3, passkey4, printer_name
    into input_booking_seq, fax_header, file_no,
    input_print_rates, myNoteId, printer_name
    from edit_table
    where edit_table.tag = 'BOOKING'
    and edit_table.key = 'PRINT'
    and edit_table.user_id = user
    .define get_user_info
    select user_location,user_name, user_company, &fax_header || ';style=' || letterhead,
    fax_printer, nvl(fax_yn,'N')
    into user_location, user_name, user_company, fax_header, fax_printer, fax_yn
    from security_header
    where user_id = lower(substr(user,5,10))
    .define get_fax_printer
    select &fax_header || ';print = Confirm;printer = ' || &fax_printer || ')'
    into fax_header
    from dual
    .define printMsg
    .execute formatMsg
    .if "&myNote = 'N/A' " then skipMyNote
    .print myNote
    .&skipMyNote
    .if "&myNoteExt = 'N/A' " then skipMyNoteExt
    .print myNoteExt
    .&skipMyNoteExt
    .add line_count line_count 9
    .execute lock_tables
    .execute get_input
    .execute printer_controls
    .execute get_top
    .execute get_user_info
    .execute get_user_office
    .rem --------- this section is added to print bookings by file -------
    .ifnull file_no skip_by_file
    .report get_lots file_loop
    .goto skip_to_end
    .&skip_by_file
    .rem ------------------------------------------------------------------
    .if "&fcl_lcl = 'F' " then ck_fcl
    .execute adjust_letterhead_lcl
    .goto skip_over_fcl
    .&ck_fcl
    .execute adjust_letterhead_fcl
    .&skip_over_fcl
    .if "&fax_yn = 'N' " then skip_confirm
    .execute get_fax_printer
    .goto skip_to_booking
    .&skip_confirm
    .execute set_no_confirm
    .&skip_to_booking
    .print_info
    I need to code to create a generic parser which actually convert the above code in a .rpt file into perl code and then finally the perl code could generate the report ...
    Please help me out for this to process and suggest me if there is any parser module available for that ....
    Shelley

    Is this topic is very new to all programmers????
    Or is it a fake topic to ask???

  • Who can solve the error code 403 on hp5522 ? help please

    who can solve the error code 403  on hp5522 ?   help please

    Hello fredovolley,
    Welcome to the HP Support Forums!
    I see that you are experiencing an error 403 with the Photosmart 5520 series. I would like to offer the steps I have given before, check them out here: Re: Trouble scanning using Photosmart 6520
    Even though it states it is for a 6520, the steps are all the same. I hope this help, cheers!
    JERENDS
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • How to solve itunes error code 0xE8000012?

    how to solve itunes error code 0xE8000012?
    These error make mine itunes cannot detect mine iphone 4
    my iOS version is 5.1.1
    Please i really need some solution to solve this problem
    Urgent Thanks!! 

    howdy tej prakash,
    you may want to look at this thread ...
    - Error -9812 and -1202: Apple Support Communities
    https://discussions.apple.com/thread/2153674?start=0&tstart=0
    i got that from a search for "itunes error 1202". [*grin*]
    take care,
    lee

  • CMOD code efficiency

    Hi Experts,
    I have written the following CMOD for enhancin 2lis_03_bf with fields from tables MKPF and MSEG. I understand that it is not efficient use of ABAP statements. Could you please help me decide write the following code more efficiently?
    DATA: I_MC03BF0 LIKE MC03BF0,
      I_tabix like sy-tabix.
        CLEAR: I_MC03BF0.
        LOOP AT c_t_data INTO I_MC03BF0.
          IF NOT I_MC03BF0-MATNR IS INITIAL.
            I_tabix = sy-tabix.
            select single CPUDT CPUTM from MKPF into (I_MC03BF0-ZZCPUDT,I_MC03BF0-ZZCPUTM)
                                  where
                                   MBLNR = I_MC03BF0-MBLNR and
                                   MJAHR = I_MC03BF0-MJAHR.
            Select single XAUTO FROM MSEG INTO I_MC03BF0-ZZXAUTO
                                  WHERE
                                  MBLNR = I_MC03BF0-MBLNR AND
                                  MJAHR = I_MC03BF0-MJAHR AND
                                  ZEILE = I_MC03BF0-ZEILE.
            modify c_t_data from I_MC03BF0.
            clear: I_MC03BF0.
         ENDIF.
        ENDLOOP.

    Hi CC,
    Although you could also consider to first extract the fields from the MKPF table to BW and then add them to data that are being extracted through the 2LIS_03_BF datasource, from a 'code point of view' you can try the following:
    * Types for internal tables to select data
    TYPES: Begin of ty_mkpf,
         MBLNR type MBLNR,
         MJAHR type MJAHR,
         CPUDT type CPUDT,
         CPUDM type CPUDM,
           end of ty_mkpf,
           Begin of ty_mseg,
         MBLNR type MBLNR,
         MJAHR type MJAHR,     
         ZEILE type MBLPO,
         XAUTO type MB_AUTO,
           end of ty_mseg.
    * Field symbols for adding and checking additional fields
      FIELD-SYMBOLS : <fs_mkpf> type ty_mkpf,
                <fs_mseg> type ty_mseg,
                      <fs_MC03BF0> type MC03BF0.
    * Internal tables to select data
      DATA: it_mkpf type HASHED table WITH UNIQUE KEY MBLNR MJAHR,
         it_mseg type HASHED table WITH UNIQUE KEY MBLNR MJAHR ZEILE,
            it_MC03BF0 TYPE SORTED TABLE OF MC03BF0.
    * Clear internal tables
    CLEAR: it_mkpf,
           it_mseg,     
           it_MC03BF0.
    * Move c_t_data to internal table
      it_MC03BF0 = c_t_data[].
    * Select additional fields from source system tables
    IF it_MC03BF0 is not initial.
            SELECT MBLNR
                   MJAHR
                   CPUDT
                   CPUTM
             FROM MKPF
             INTO table it_mkpf
             FOR ALL ENTRIES IN it_MC03BF0
             WHERE MBLNR = it_MC03BF0-mblnr
              AND MJAHR = it_MC03BF0-mjahr.
            SELECT MBLNR
                   MJAHR
                ZEILE
                   XAUTO 
             FROM MSEG
             INTO table it_mseg
             FOR ALL ENTRIES IN it_MC03BF0
             WHERE MBLNR = it_MC03BF0-mblnr
              AND MJARH = it_MC03BF0-mjahr.
    * Loop on selected fields to add additional fields
          LOOP AT c_t_data ASSIGNING <fs_MC03BF0>.
            READ TABLE it_mkpf ASSIGNING <fs_mkpf>
              WITH TABLE KEY MLBNR = <fs_MC03BF0>-MLBNR
                    MJAHR = <fs_MC03BF0>-MJAHR.
            READ TABLE it_mseg ASSIGNING <fs_mseg>
              WITH TABLE KEY MLBNR = <fs_MC03BF0>-MLBNR
                    MJAHR = <fs_MC03BF0>-MJAHR
                    ZEILE = <fs_MC03BF0>-ZEILE.     
          if sy-subrc = 0.
    * Add additional fields to append in extract structure
            <fs_2lis_03_bf>-ZZCPUDT = <fs_MC03BF0>-CPUDT.
            <fs_2lis_03_bf>-ZZCPUTM = <fs_MC03BF0>-CPUTM.
            <fs_2lis_03_bf>-ZZXAUTO = <fs_MC03BF0>-XAUTO.
          endif.
          endloop.
    endif.
    Edited by: Edwin Neuenschwander on Jun 26, 2011 4:19 PM

  • Mapping arrangement and code efficiency

    Hi all,
    I have a general question about how best to structure and OWB mapping.
    Take the example where I have multiple source tables (Table A, B and C) which are referenced multiple times in one mapping. Is it best to bring in these tables multiple times on the canvas as and when I need them, or is it best to have them placed only once on the mapping and then all references to other transformations/tables to be made from the first drop of the table. From a visual perspective mappings are a lot easier to understand if the tables are copied in more than once, however my main question is around the efficiency of code written underneath...in which example will the most efficient code be written or will it be the same?
    Thanks
    Mitesh

    well, the thing is that a mapping does not have to result in a single SQL statement.
    Row based mapping, e.g. will not.
    So, depending on what the mapping does, it could matter somewhat since the generated code might differ.
    A tricky thing to do, is to make sure that the "flow" in the mapping will be correct (what table get's processed first etc)

  • To check  ABAP Code efficiency

    Hi friends.
    Instead of SQL Trace/SE30/Extended Program check,Is there any SAP Standard or ABAP Program available in SAP R/3 to <b><u>audit</u></b>(To test the efficiency of Source code) the <u><b>Z-Programs</b></u> ?
    Please if any share with me!
    Thanks.
    Surendher Reddy.B

    Hi,
    Get ride of any nested selects. try to select all your data upfront into internal tables and process them instead of loads of selects nested as this increases the number of hits between the application server (front-end) and the database server (back-end).
    Also, use FOR ALL ENTRIES syntax to improve efficiently.
    In SE38 run the menu Environment -> Examples -> Performance examples. This will highlight any areas you may be able to make big savings.
    You can also use the runtime analysis to see where your bottlenecks are.
    If you provide me an e-mail, I will send you some source code you can manipulate for QA checking. However, it is a little hard to understand but you are welcome to view it.
    Cheers
    Colin.

  • How to solve the Error code (12/4186)

    224733.pgapp01!BRIDGE.2864.1.0: GP_CAT:1069: WARN: Could not index FML32 buffer in postrecv
    224733.pgapp01!BRIDGE.2864.1.0: LIBTUX_CAT:6031: ERROR: Unable to pre-process buffer before tranmission. Error code(12/4186)
    how to solve it?
    Thanks.
    :)

    You should contact BEA customer support about this problem. It is possible
    for FML32 buffer indexing to fail if the buffer is not actually an FML32
    buffer, if the buffer is not aligned on a 4-byte boundary, or if there is
    not enough space in the buffer to store an index. However, none of these
    cases should apply to a buffer received in the BRIDGE process.
    <YuanSheng Jiang> wrote in message news:[email protected]..
    224733.pgapp01!BRIDGE.2864.1.0: GP_CAT:1069: WARN: Could not index FML32buffer in postrecv
    224733.pgapp01!BRIDGE.2864.1.0: LIBTUX_CAT:6031: ERROR: Unable topre-process buffer before tranmission. Error code(12/4186)
    >
    how to solve it?
    Thanks.

  • TS3694 how do i solve error with code 1015

    please help me to solve an unknown error code 1015

    1. Close iTunes.
    2. Connect your iPhone to your computer and then launch iTunes.
    3. Turn your iPhone off (hold down the power button at the top of the iPhone).
    4. Then, hold down the sleep/wake button and home button together for EXACTLY 10 SECONDS, then release the sleep/wake button.
    5. Continue to hold down the Home button until a message appears in iTunes telling you an iPhone in recover mode has been detected. When you are in DFU mode your iPhone screen will be completely black. Remember that if you see the restore logo, iTunes logo, or any message on the iPhone screen, you are not in DFU mode but standard Recovery Mode.
    6. Hit the OK message that should popup to restore your phone. Restore as "New".

  • SubVIs and code efficiency

    Hello,
    I would like to know what is better (when thinking about program velocity), to make a huge VI or a lot of subvis distributed in many levels.
    I imagine that this relation (number of sub VIs and program efficiency) will have something to do with the way I pass values between VIs.
    So my second question is what is better, to pass values using global variables, to pass control references and use a lot of property nodes, or to pass it in another way. 
    I tried to find info about this questions but  I had little success,
    I hope someone can help me!
    Best regards, 
    Gabriel
    Solved!
    Go to Solution.

    I have found the answer for my question on the following webcasts: 
    Best Practices for Managing Application Development with the LabVIEW Project
    http://zone.ni.com/wv/app/doc/p/id/wv-167 Tips and Tricks for Improving LabVIEW Application Performancehttp://zone.ni.com/wv/app/doc/p/id/wv-173Software Design Architectures in NI LabVIEWhttp://zone.ni.com/wv/app/doc/p/id/wv-160Design Multirate Applications with LabVIEW Timed Loophttp://zone.ni.com/wv/app/doc/p/id/wv-863
    Message Edited by GPC on 10-01-2009 03:11 PM

  • Calling a Perl code from pl sql

    Hi,
    I have to carry out a process -wherein - i need to execute 2 plsql procedures and a perl function in between the two. The first pl sql procedure creates a file - which needs to be worked on by the perl file and processed and the resulting file is used by the second and last pl sql procedure. Is there any way to pull this off?
    thanks

    I would seriously question the architecture here... That being said, depending on the Oracle version,
    1) A shell script/ external process could
    - invoke SQL*Plus, run the first procedure
    - Call the Perl script
    - invoke SQL*Plus, run the second procedure
    2) The Perl script could do the same thing (i.e. connect to the database, run the first procedure, process the file, run the second procedure)
    3) A SQL*Plus script could connect to the database, run the first procedure, use the HOST command to invoke the Perl script, and then call the second procedure.
    4) A Java stored procedure could call out to the operating system to invoke the Perl script and a PL/SQL procedure could then invoke procedure 1, this new Java stored procedure, and then procedure 2.
    5) (10g and later) You can call procedure 1, then create a one-time DBMS_SCHEDULER job that calls the perl script, then call procedure 2.
    Justin

  • Has anyone solved the "Error Code 0x80020022"

    "The disc can’t be burned because communication between the computer and the disc drive failed (error code 0x80020022)."
    I have researched this at length as I have just been getting this message, but I don't see how to resolve it.
    Has it ever been resolved and if so, I would really like to know how.
    Cheers

    Michael,
    An update on the ongoing superdrive error:
    At the time I responded to your post, I was burning DVD+Rs because my superdrive didn't like -Rs very much and would error out on them. Yesterday, to test my theory on Disk Warrior, I bought some DVD-Rs and burned about 3 in a row successfully before I got the 0x80020022 error again. I ran Disk Warrior again and have been burning the -Rs consistenty (I have a lot of junk to archive off my HD.) But I thought that the type of media might be important to the conversation because the superdrive appears to like one type of DVD blank over another.
    Some key points:
    1) You said you're using a Mac Mini as your bootup disk. I am using a MacBookPro. This may be significant.
    2) Because the error reappears routinely, this is by no means a complete fix. It needs to be repeated when the error reappears. However, in lieu of a more permanent solution, I'll take one that appears to work, even temporarily, until Apple or somebody out there can tell us how to fix this more permanently.
    3) Because it appears to be fixed after running Disk Warrior, I am going to conclude that it is a software error, one of the operating system not communicating with the superdrive, and has little or nothing to do with the drive or the media, as I've read on other forums regarding this error. Of course, if your drive really has gone bad, who's to say that it won't prompt the same error, if it is an all-purpose error. I had my superdrive replaced last year, so I'm pretty sure it's not the drive.
    Jim

  • SOLVED: SQL Developer Code Compilation with warnings

    Hi, I think I found one bug in sql developer.
    I have one pl/sql package, that contains a lot of code. In the previous SQL Developer releases (prior to 1.2) when you compile the code, first appears the errors and then the warnings. Because of some type conversion in my sql statements i have more than 20 warnings, and now i cannot see the errors (i think that they will appear if i'm able to increase this "20 messages" limit). I was searching for some option in SQL Developer to increase the number of displayed warnings or errors (or turn off the warnings) but i cannot find such parameter.
    Is this a bug, or i'm missing something ?
    PS: because of this, i'm not able to compile my package with sql developer, and i'm compiling via sqlplus.
    null

    Yes, you're missing something: the forum's search feature.
    See:
    compile with many warnings causes compiler dont show errors correctly
    Compiling an invalid packagebody without errormessage
    SQL Developer says Compile sucessful but it is not
    K.

  • [solved] my C code gives floating point errors.

    I've tried to create a simple function to determine if a number is prime or not.. whenever I compile and try to run I get a floating point exception and can't quite figure out why, I'm very new to C and compiling manually using gcc so any help is appreciated.
    here's my code: http://pastebin.com/m2f19dbac
    Last edited by zandaa (2008-10-01 06:36:35)

    I'm quite useless at programming:
    for (i=0; i <= x; i++) {
    if (x%i == 0 && i != 1) {
    result = 0;
    //break;
    if (i == x) {
    result = 1;
    //printf("%d\n", x);
    break;
    This loop always ends with result=1 because the last loop has i=x and therefore it changes the result value to 1.
    There are also many checks you could avoid with a "smart" for cycle:
    for (i=2; i <= x; i++) {
    if (x%i == 0) {
    return 0;
    return 1
    I was able to remove the "i != 1" part by having the for loop starting from 2.
    I removed all the if (i == x) clause because that only happens at the end of the for cycle.
    Also you could be smart and eliminate some values from the loop: for example you could avoid checking all the numbers higher than n/2 or than sqrt(n), but that's more related to the mathematics behind than to the programming
    Hope this helps
    edit: beaten
    Last edited by carlocci (2008-09-25 21:36:04)

  • [SOLVED] Building perl failed cannot load libperl.so

    I'm trying build base packages on another arch (sh4).
    Is there any tip about this build error?
    yaourt -SAb perl
    omit
    http://archlinuxarm.org/developers/building-packages
    ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
    ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
    ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
    ==> Starting package()...
    ./perl: error while loading shared libraries: libperl.so: cannot open shared object file: No such file or directory
    ==> ERROR: A failure occurred in package().
    Aborting...
    ==> ERROR: Makepkg was unable to build perl.
    ==> Restart building perl ? [y/N]
    ==> -----------------------------
    $ sudo find . -name libperl.so
    ./src/perl-5.16.2/libperl.so
    temp solution
    added LD_LIBRARY_PATH in PKGBUILD of package()
    Last edited by dlin (2013-02-02 05:01:39)

    I'm trying build base packages on another arch (sh4).
    Is there any tip about this build error?
    yaourt -SAb perl
    omit
    http://archlinuxarm.org/developers/building-packages
    ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
    ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
    ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
    ==> Starting package()...
    ./perl: error while loading shared libraries: libperl.so: cannot open shared object file: No such file or directory
    ==> ERROR: A failure occurred in package().
    Aborting...
    ==> ERROR: Makepkg was unable to build perl.
    ==> Restart building perl ? [y/N]
    ==> -----------------------------
    $ sudo find . -name libperl.so
    ./src/perl-5.16.2/libperl.so
    temp solution
    added LD_LIBRARY_PATH in PKGBUILD of package()
    Last edited by dlin (2013-02-02 05:01:39)

Maybe you are looking for