Tag: perl
-
Emulating Web Browsers
Here’s a tedious task for you to consider. When you log-in to your favorite website these days, you’re creating a JSON document and posting it to the service you’re logging into. Long gone are the days when you just posted simple form parameters from a whole post. I work on an emulation platform: one of…
-
Profiling Perl
Often we write perl scripts that loop a particular action. Not so often we write a perl script that is called in a loop by another tool. My script was attempting to do a http web login to emulate user traffic. However, I was not able to start more than 8 of these scripts a…
-
Crazy Perl Day
I’m surprised that this is the first time in Perl that I’ve bothered to use the posix character class [:alnum:]. Check this nuttiness out: ($::port_name, $::first_port, $::last_port) = $::port_range =~ /([[:alnum:]]+[^[:alnum:]])(\d+)-[[:alnum:]]+[^[:alnum:]](\d+)/; Yeah…it’s better with coffee.
-
This is not the nastiest perl I’ve ever done…but dang.
This is a stanza where, given a comma separated list of keywords to match on, find the values after the colon. The values could be empty and at the end of a line. I would be delighted to find an even simpler way to do this. my $matcher = ” (“.join(‘|’, keys %option_map).”):”; my @matches =…
-
uh…remind me how to begin a perl script?
Don’t let me forget to do this at the start of my perl scripts at work: package main; use strict; use warnings; use Carp; $SIG{ __DIE__ } = sub { Carp::confess( @_ ) }; use Scalar::Util; #::looks_like_number; # Un-buffer output $| = 1; # this is pedantic necessity for the following use statements use lib…
-
Deduplication, continued.
OK, so what started out as a bash script grew into a rather finicky Perl script. I used a bunch of parallel hashes, judging things by combinations duplicate names, identical file sizes and actually scoring the path name and taking the highest score. I ended up no using the file hashes, because I decided that…
-
Modern Picture Management?
I like to run a thumbnailer across most of my photos so I have little copies to send around, and I mod them so that they look distinctly different from the full resolution source files. I like to use gwenview to flip and rotate them. Gwenview can export to FB and email so that makes…