News for hackers. Stuff that matters.
Re:Expect – Linux tool for automating interactive programs by thesuperbigfrog on Friday August 30, 2024 @08:01PM (#41405604)
Many years ago I used the Perl version of Expect (https://metacpan.org/pod/Expect) to automate several workflows that wanted manual inputs.

I thought that it was far better than the TCL Expect because I could also use other CPAN modules and have Perl's regular expressions to parse the system's output.

Expect is a great tool to have in your toolkit.

Re:Expect – Linux tool for automating interactive programs by creer on Friday August 30, 2024 @08:06PM (#41405626)
> Perl version of Expect (https://metacpan.org/pod/Expect)

Still a great answer and latest update in March this year.

Re:Expect – Linux tool for automating interactive programs by overanalytcl on Friday August 30, 2024 @09:03PM (#41405909)
Arguably, Tcl can do GUIs much easily and can integrate C less awkwardly than Perl. Both have their use cases, at any rate, and more people should use Tcl, Perl and any version of Expect. Nowadays it falls into the category of tools that were once somewhat used, but now are obscure, like fold/fmt, nl, comm and pr.
Re:Expect – Linux tool for automating interactive programs by thesuperbigfrog on Friday August 30, 2024 @11:20PM (#41406341)
>> Arguably, Tcl can do GUIs much easily and can integrate C less awkwardly than Perl.

We used Perl/Tk for GUIs on that old system. It brimgs the ease of Tk GUIs to Perl:

https://metacpan.org/dist/Tk/view/pod/UserGuide.pod

>> Nowadays it falls into the category of tools that were once somewhat used, but now are obscure

To be sure, but a lot of it still works without changes!

Re:Expect – Linux tool for automating interactive programs by kevin_thibedeau on Saturday August 31, 2024 @11:06AM (#41409408)
Perl/Tk has always been a red headed stepchild since it is a fork attempting to implement a C API that doesn't require Tcl to be linked. Because of that, it has long missed out on significant improvements to Tk over the years. Python Tkinter avoids that by just wrapping around a Tcl interpreter.
Re:Expect – Linux tool for automating interactive programs by bch on Saturday August 31, 2024 @02:51AM (#41406984)
> Perl's regular expressions to parse […]

To be fair, Tcl has Henry Spencer’s regexp[0][1], and is awesome; Postgres also base their regex on Henry’s work for Tcl[2]. Perl is certainly famous for its regex and popularizing thinking of problems in terms of regexes (for better or for worse[3]), but it’s not the only game in town.

[0] https://en.wikipedia.org/wiki/Henry_Spencer

[1] https://wiki.tcl-lang.org/page/Regular+Expressions

[2] https://github.com/postgres/postgres/blob/master/src/backend...

[3] https://stackoverflow.com/questions/1732348/regex-match-open...

Re:Expect – Linux tool for automating interactive programs by thesuperbigfrog on Saturday August 31, 2024 @08:43AM (#41408501)
>> Perl is certainly famous for its regex and popularizing thinking of problems in terms of regexes (for better or for worse), but it’s not the only game in town.

Agreed.

In that old system we did not have any TCL scripts or third-party libraries--just C, Perl, and C shell (no Bash; it was Unix).

C shell scripting is painful (https://www.grymoire.com/Unix/Csh.html), so practically all scripting was Perl or occasionally AWK.