Matts (email not shown publicly) I work for MessageLabs [messagelabs.com] in Toronto, ON, Canada. I write spam filters, MTA software, high performance network software, string matching algorithms, and other cool stuff mostly in Perl and C.
The script I use to upload a new version of XML::Twig to my site:
#!/usr/bin/perl use XML::Twig;
my $MIRROR_DIR = "/web/mirror/infotree/xmltwig"; my $WEB_DIR = "mirlin:/web/infotree/";
my $version = $XML::Twig::VERSION; # can't get this from the shell! my $tar = "XML-Twig-$version.tar.gz"; my $dev_text = "twig_dev.txt"; my $dev_html = "twig_dev.html"; my $readme = "XML-Twig-$version.README";
system "make clean; rm Twig.pm; perl speedup Twig.pm.slow > Twig.pm;
Like you, I do my calculations from the shell using Perl, but I at least turned the "perl -le 'print...'" into a shell alias to make it easier to type;)
I've known about bc before, but somehow I can't wrap my head around it... I know, it's probably due to my stupidity as I can't say it looks that difficult.
Maybe I'm not good at simple things, maybe that's why I now work where I do.
My calculator is perl -de 1. Earlier this semester I had a bit of a disaster in software engineering class as I was sitting on the front row doing COCOMO calculations for the class and coming up with the wrong answer because I didn't understand the use of Perl's ** operator.:)
-- J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
Occassionlly I use shell scripts for build processes. Usually they grow into a perl thing though. Always using a system() wrapper that dies nicely on errors.
For calculations I use "bc". The 3 second bc guide will instruct you to use
scale=10
as your first command.
I also use awk '{print $1}' once in a while instead of "perl... (split)[0]". Why? No clue.:-) The fingers are doing it.
system, system, system... (Score:2)
mirod
lazier (Score:2)
Like you, I do my calculations from the shell using Perl, but I at least turned the "perl -le 'print...'" into a shell alias to make it easier to type ;)
-- Robin Berjon [berjon.com]
Re:lazier (Score:1)
then pen and paper
then xcalc
then perl -e 'print '
then just perl and typed on stdin
now bc
wish i knew about bc before
Re:lazier (Score:2)
I've known about bc before, but somehow I can't wrap my head around it... I know, it's probably due to my stupidity as I can't say it looks that difficult.
Maybe I'm not good at simple things, maybe that's why I now work where I do.
Hmmmmmm...
-- Robin Berjon [berjon.com]
Debugger (Score:2)
My calculator is perl -de 1. Earlier this semester I had a bit of a disaster in software engineering class as I was sitting on the front row doing COCOMO calculations for the class and coming up with the wrong answer because I didn't understand the use of Perl's ** operator. :)
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
bc & awk (Score:2)
For calculations I use "bc". The 3 second bc guide will instruct you to use
scale=10
as your first command.
I also use awk '{print $1}' once in a while instead of "perl
-- ask bjoern hansen [askbjoernhansen.com], !try; do();
dc (Score:2)
Unfortunately, I don't have a three-key shortcut to bring up dc on OS X yet...