jmClifford has asked for the wisdom of the Perl Monks concerning the following question:

Hi. I have odd behavior from my IDE (as indicated in the Title). I have a very long *.pl with say a section of code similar to;

.... etc ... my $result; if ( $response =~ m/SEARCHING\.\.\.\s+(\w+)\s(\w+)\s(\w+)\s(\w+)\s(\w+)\s(\w+)\s ++>$/ ) { # This is a padentic match # print "yes we found a match with SEARCHING within \n"; # print "\$1 ;$1 \$2 ;$2 \$3 ;$3 \$4 ;$4 \$5 ;$5 \$6 ;$6 + \n"; # printf( "%b \n", hex($3) ); $result = sprintf( "%s %s %08b%08b%08b%08b", $1, $2, hex($3), hex($4), hex($5), hex($6) ); # print $result; X } elsif ( $response =~ m/(\w+)\s(\w+)\s(\w+)\s(\w+)\s(\w+)\s(\w+)\s+ +>$/ ) { ... etc ...

The line X (which I added,) is marked as a syntax error while 12 other lines at X+300 are similarly marked as syntax errors. However, if I remove the comment "# print $result;" and all the white space between "sprintf" statement and the end of the block ("}" at line X), then all is well.

Can anyone shed some light on this for me ???

What are the preferred IDEs used by others ???

Regards JC....

Replies are listed 'Best First'.
Re: Eclipse IDE with add on EPIC; Errors on the code
by sectokia (Friar) on Nov 20, 2024 at 02:23 UTC

    The most widely used IDE these days is visual studio code, which is surprisingly good, free, cross platform, and has a rich pluggin system.

      That's certainly true

      > has a rich pluggin system

      Which can be a curse too, if it's too rich and you get lost in configuration (I'm an emacser after all ;)

      Regarding out of the box features, I had good impressions from Komodo and CamelCade.

      VSCode is still on my to-do list.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      see Wikisyntax for the Monastery

Re: Eclipse IDE with add on EPIC; Errors on the code
by hippo (Archbishop) on Nov 19, 2024 at 09:33 UTC
      I hadn't posted that one yet because it seemed that people here don't really use IDEs.

      You're probably not claiming that vim is an IDE, but having myself used vim for many years and more recently using IntelliJ (with its vim plugin), the functionality gap between them seems too big to put them in the same category.

        In a sample of 1, 100% of me's use IDEs for every coding related thing I do. At $work I'm a firmware engineer and regularly use three variants of Eclipse provided by the manufacturers of the three main processors I work with. I use Visual Studio for C++ development on our flagship application, and I use Visual Code for a few miscellaneous processors and Arduino development. In choosing a processor for a project lack of a competent IDE and debug probe for a specific device is automatic disqualification.

        For Perl and Python development I use Komodo or, sometimes, Visual Code for Python (especially on Pi). I've also used Visual Code for Java development.

        In fact of the 30 or so developers at $work, 100% use IDEs. I live in the hope that FOMO will drive more of the IDE nay sayers to give an appropriate IDE a go, but I guess demographics is the thing that will do the job in the end.

        Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Re: Eclipse IDE with add on EPIC; Errors on the code
by soonix (Chancellor) on Nov 19, 2024 at 08:48 UTC
    What happens if you add another Newline before the "}"?
    (just a shot in the dark, otherwise no idea)

    The thought behind this is: perhaps comment and "}" might just look like two lines, but perhaps there is some special character looking like a newline but not counted as end-of-comment

Re: Eclipse IDE with add on EPIC; Errors on the code
by LanX (Saint) on Nov 19, 2024 at 10:28 UTC
    You haven't told us what kind of error is reported.

    Does the file compile with perl -c ?

    It's not uncommon that syntax parsing is causing hiccups. Normally this goes away after further edits.

    You could also pipe your file thru perltidy and see if the problem persists.

    Otherwise... Not enough data to tell what's happening, if the IDE is causing the problem it might be related to confusion about your regexes.

    I'm using Emacs, the "mother of all IDEs" and it runs well on my phone.

    But like VIM I don't recommend it to people who don't wanna invest time in learning and configuration.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

      … Emacs, the "mother of all IDEs"…

      I use emacs since 1997 or 1998. To be precise: I started with XEmacs on Windows NT and emacs-nox on SuSE-Linux. That was a big shock for my colleagues who used MacOS 9 - for them, BBEdit was the greatest thing since sliced bread. In between I've had forays into Eclipse (free and commercial versions) and IntelliJ, as well as various others whose names I've forgotten or blocked out. The most amazing experience I recently had with emacs was with rust with rustic, rust-analyzer and company. A real IDE - in blink-shell with mosh on my IPad. I use a Magic Keyboard - without a real keyboard I think emacs on the IPad is hell. So, now I'm trying to imagine how you do it on the iPhone 🤪😎. Not a bad performance, I'd say.

        Not iPhone but Android+Termux and only short code examples.

        Customization is key.

        Edit

        PS: I'm using Emacs since my second semester at university.

        There are for sure better and more intuitive IDEs, but they come and go.

        Emacs runs everywhere and stays.

        I customized it to my needs, it's actually not an IDE but an IDE construction set.

        Update

        In hindsight, modal editing in vi style might be more appropriate for mobile keyboards. 🤔

        So I will probably learn it, and take the extra step to activate vim emulation inside Emacs ;)

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        see Wikisyntax for the Monastery

      Hi. Thanks. There is so much information with this site. I think I am responding mainly to soonix and LanX.

      What happens if you add another Newline before the "}"?

      I tried this and the Line X (previous email) error went away but the Line X plus 300 still remained. I got curious about the other white space type of characters. Here is a presentation from the offending code/comment some of which I can remove, and have no errors from Eclipse (and EPIC).

      ; # print $result; } This is a ascii dump of the above (compliments of Notepad++) 3B0D0A0D0A09092320207072696E7420 24726573756C743B09090D0A097D The ascii characters 3B => ; 0D => CR 0A => LF 09 => Tab 23 => # 20 => space 70 => p 74 => t 7D => }

      I found nothing suspicious with the above. Oddly there are 2 tabs after comment "print $result;"

      Does the file compile with perl -c ?

      Yes it does.

      C:\u\Perl_Eclipse_IDE\OBD2_control>perl -c OBD2_control_test_02.pl OBD2_control_test_02.pl syntax OK C:\u\Perl_Eclipse_IDE\OBD2_control>

      This seems to suggest my problems are an issue with Eclipse (and EPIC). I feel I am up for a learning curve with EMACs. It difficult to appreciate an editor having the function of an IDE. Are there any first suggestions for someone running perl on windoms 10 ?? (where best to Emac download from)

      Regards JC......

        If you go the emacs way, make sure to set cperl-mode as standard when opening .pl files.

        Otherwise consider VSCode, Komodo IDE, and CamelCade.

        • Komodo IDE should be free to use now, maybe ask Grandfather
        • CamelCade ... no idea, ask StevieB
        • VsCode, no personal experience. It's free and comes with multiple Perl related LSP plugins, If they play well on windows is another question,
        • regarding Emacs, haj is the maintainer of cperl-mode now.
        Maybe have a look at my IDE criteria thread or the video of my talk and ask yourself which features are essential for you.

        Hope this helps! :)

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        see Wikisyntax for the Monastery