Showing posts with label Slackware. Show all posts
Showing posts with label Slackware. Show all posts

Thursday, June 13, 2019

LaTeX, Vim and Perl

I'm finishing up grad school.  I write all of my papers in vi (usually Elvis, sometimes Vim) and mark them up with LaTeX.  Yeah, I know.  I'm a geek.  I just love the beautiful look of a typeset document when I'm done.  I like the way it forces me to think about the outline; creating \sections{}, then \subsection{} and even \subsubsection{}.  This looks really nice as an auto-generated table of contents. 

Even better than the beautiful typesetting, I really enjoy keeping my bibliography in BibTeX and having LaTeX/BibTeX automagically write my bibliography citations and print my bibliography at the end by simply writing \cite[p.78]{author}.

And when I'm done, if I don't want a PDF, I can use latex2rtf for an RTF or latex2html to create a web site (or latex2man if I'm feeling extra geeky).  And, I pretty much live in vi all day so, even if I try to use a regular word processor, it gets krufted up with :wq and randomly interjected i's and a's and x', etc.

I used to use emacs.  I did more with emacs I think because I had a Wyse60 monitor and really used the multiple buffers and split screens.  And, loved the macros.  I know, you can do this with vi too.  I really need to learn more of that in vi.  Lately, while writing these papers, I find myself wanting to copy lines from other .tex docs into the current document.  Cutting and pasting outside of vi leaves unexpected broken lines that require a lot of Ctrl-J, x, etc.  Then I saw an article by Jun Wu "Perl as a command line tool"  Lots of fun.  Love Perl one-liners.  She had a version of this example:


    $ perl -ne 'print if $. >=64 && $. <=94' June10.tex >>../FinalPaper/ENG609final.tex 

It's so great to NOT have to clean up line breaks after cut & paste.  And, even better, it gives me an excuse to play around with Perl one-liners.  Some people things that's odd but I see it as recreational - like Soduko or something.

Anyways, that's all I'm up to with Perl lately.  See you all at the 20th anniversary of YAPC


Friday, February 10, 2017

These are a few of my favorite modules

I was messing around with Xen on Slackware 14.2 and got my system goofed up.  The console worked but the mouse and keyboard would not function in X.  So, after a bit of flailing, I did a distro upgrade (from Slackware 14.2 to current), re-ran liloconfig and,  ta-dah! -Success!

I noticed Perl didn't work however.  It upgraded Perl but the modules were "mis-matched" it said.  After some googling, I ran across several suggested fixes.  The simplest seemed to me the brute force - delete all Perl references and reinstall Perl - which I did. (perl -E 'map {say $_} @INC')

Now I had a NEW problem.  NO MODULES AT ALL.  Began slowly adding modules as I needed them but today that was getting old.  So I did a quick grep of a few hundred of my Perl programs to see which modules I was using and then did a cpan install of all of them.  It's still running...

Which Perl modules you ask?  Well, to satisfy your curiosity and have this list handy the next time I install a fresh Perl - here's my list:

Gimp Gimp::Fu File::stat Time::localtime DBI Net::LDAP Net::LDAP::Bind Net::LDAP::Search MIME::Lite Net::Nslookup Nmap::Scanner Net::SSL::ExpireDate XML::RSS XML::Simple Test::Simple Net::LDAP::LDIF File::Basename CGI::Carp Net::SNMP SQL::Abstract Text::xSV Pod::HTML2Pod LWP::Simple LWP::UserAgent Net::IMAP::Simple Mojo::UserAgent Data::Dumper Date::Manip Net::Twitter DBD::SQLite Net::DNS Net::Telnet::Cisco DBD::Sybase Crypt::GPG File::Slurp utf8 Socket Net::DNS AnyEvent Net::RabbitFoot WWW::Mechanize HTTP::Cookies File::Copy Bot::BasicBot POE::Component::SSLify Config::General Log::Log4perl::Appender::RRDs LWP::Protocol::https

Wow.  That's actually shorter than I thought.  It looked more impressive as one line.  ;-)

Tuesday, December 15, 2009

Slackware, Perl, SQLite and SOAP

I was playing around with a project and decided it would be nice to finally try to do something useful with SQLite (and I threw in a SOAP server just-for-fun). I recently reloaded my system with Slackware 13. I was amazed at how easy it was to add Perl modules with Slackware. This is probably making someone out there go "Duh!" but under Fedora and Ubuntu (and Xubuntu, which I use a lot) installing modules on a vanilla system means configuring the CPAN.pm. That's not a big deal but Slackware must have a lot of the CPAN.pm config finished already. It just took off and ran! I had all of the modules I use downloaded in nothing flat and with NONE of the usual haggling I usually have to do to get some of them to load. You have to see it to appreciate it.