<?xml version="1.0" encoding="windows-1252"?>
<node id="253915" title="Skeeve" created="2003-04-29 03:28:04" updated="2010-05-17 07:02:55">
<type id="15">
user</type>
<author id="253915">
Skeeve</author>
<data>
<field name="doctext">
&lt;p&gt;
The image was created using [http://www.sp-studio.de|South Park Studio] and Gimp.
&lt;/p&gt;
&lt;p&gt;
I was introduced to the monastry by [physi]. He was my boss in a project.
&lt;/p&gt;
&lt;p&gt;
I picked my name from [google://Skeeve Myth Inc|Robert Asprin's books about M.Y.T.H. Inc.] which I really love.
&lt;/p&gt;
perlmonk nodes I often use:&lt;ul&gt;
&lt;li&gt;[693828| Yes, even you can use CPAN]&lt;/li&gt;
&lt;li&gt;[Chatterbox FAQ]&lt;/li&gt;
&lt;li&gt;[id://43037|What shortcuts can I use ...]&lt;/li&gt;
&lt;li&gt;[id://119681|New Link Tags]&lt;/li&gt;
&lt;li&gt;[http://nbpfaus.net/~pfau/cbhistory.cgi?site=PM" target="cbhistory|cbhistory]&lt;/li&gt;
&lt;li&gt;[id://17645]&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;
&lt;p&gt;
My perl skeleton
&lt;/p&gt;
&lt;code&gt;
#!/usr/bin/perl
use strict;
use warnings;

use Getopt::Long qw(:config no_ignore_case);

use Pod::Usage;

my ( # options
    $verbose,
    $debug,
    $file,
    @columns,
);

$file= 'default.txt';

help() unless GetOptions(
    'v'          =&gt; \$verbose,
    'verbose!'   =&gt; \$verbose,
    'debug+'     =&gt; \$debug,
    'file=s'     =&gt; \$file,
    'c|column=i' =&gt; \@columns,
    'h|help'     =&gt; \&amp;help,
    'm|man'      =&gt; \&amp;man,
);

sub help { pod2usage(-verbose=&gt;1); exit; }
sub man  { pod2usage(-verbose=&gt;2); exit; }

print "OKAY\n";

# Program goes here...

=head1 NAME

Getopt::Long / Pod::Usage skeleton

=head1 SYNOPSIS

skeleton.pl [options]

=head1 DESCRIPTION

This is a skeleton I use when creating a new perl script

=head1 OPTIONS

=over 4

=item B&lt;-v&gt;

verbose outoput

=item B&lt;-d&gt;

=item B&lt;-debug&gt;

debug mode

=item B&lt;-file&gt; F&lt;filename&gt;

specify the file to work with

=back

=head1 BUGS

none yet

=head1 TODO

much

=cut
&lt;/code&gt;
&lt;br&gt;
Things I might need (again) in the future:&lt;ul&gt;
&lt;li&gt;IP v4 address manipulations
  &lt;code&gt;
#!/usr/bin/perl
use strict;
use warnings;
use Socket;

my $ifconfig='/usr/sbin/ifconfig';

# run ifconfig -a
open my $if, '-|', "$ifconfig -a" or die "Couldn't run $ifconfig: $!\n";
while (&lt;$if&gt;) {
        # find a line with "broadcast" in it
        # on Solaris this contains all the information I need
        next unless /inet\s+(.*?)\s+netmask\s+(.*?)\s+broadcast\s+(.*?)\s*$/;

        # keep ip address as it is (a dotted string)
        my $iaddr= $1;

        # convert the netmask to a "long"
        my $netmsk= hex "0x$2";

        # dito for the broadcast
        my $brdcst= unpack 'N', inet_aton $3;

        # How many bits does the netmask have?
        my $bits= 31-int(log(0xffffffff ^ $netmsk)/log(2));

        # Convert the netmask to a "slashed" IP
        my $network= inet_ntoa(pack "N", ($brdcst &amp; $netmsk)) . "/" . $bits;

        # show all info found
        print "$iaddr\t$network\n";
}
close $if;
  &lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Reverse DNS Lookup&lt;br&gt;
&lt;code&gt;
use Socket;
my ($name,$aliases,$addrtype,$length,@addrs) = gethostbyaddr(inet_aton("74.125.79.94"));
print $name,$/;
&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Building perl on Solaris with gcc
  &lt;ul&gt;
  &lt;li&gt;make sure /usr/ccs/bin is &lt;b&gt;not&lt;/b&gt; in the path
  &lt;/li&gt;
  &lt;li&gt;make sure make is in the path for "make test" e.g. by &lt;code&gt;
ln -s /usr/ccs/bin/make /usr/local/bin
&lt;/code&gt;
  &lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Building perl DBI (on Solaris) with gcc
&lt;code&gt;
perl Makefile.PL CC=gcc LD=gcc CCCDLFLAGS=-fPIC OPTIMIZE=-O3
&lt;/code&gt;
This is not necessary if you build your own perl as above in which case the normal process will work.
&lt;/li&gt;
&lt;li&gt;Building DBD::mySQL ...&lt;br&gt;
make sure .../mysql/bin is in your path
&lt;/li&gt;
&lt;li&gt;CSV splitting without modules&lt;br&gt;
&lt;code&gt;
sub csvsplit {
	my (@result);
	for ($_[0]) {
		s/[\015\012]+$//;
		while (s/^"((?:[^"\\]|\\.)*)"// || s/^'((?:[^'\\]|\\.)*)'// || s/^([^,]*)//) {
			push(@result, $1);
			last unless s/^,//;
		}
	}
	return @result;
}&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;a name="signatures"&gt;my old signatures
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$\=~s;s*.*;q^|D9JYJ^^qq^\//\\\///^;ex;print&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s$$([},&amp;%#}/&amp;/]+}%&amp;{})*;#$&amp;&amp;s&amp;&amp;$^X.($'^"%]=\&amp;(|?*{%.+=%;.#_}\&amp;"^"-+%*).}%:##%}={~=~:.")&amp;e&amp;&amp;s""`$''`"e&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/a&gt;

&lt;!-- location:latitude=50.48.41,longitude=6.29.58 --&gt;
&lt;!-- os:OS X,Solaris,IRIX,Linux --&gt;</field>
<field name="lasttime">
2013-05-24 10:11:28</field>
<field name="experience">
5519</field>
<field name="user_scratchpad">
386500</field>
<field name="imgsrc">
280901</field>
<field name="timeformat">
</field>
<field name="numwriteups">
757</field>
<field name="location">
(near) Aix-La-Chappell, Germany</field>
<field name="timezone">
Europe/Rome</field>
<field name="codewrapoff">
</field>
<field name="codewraplength">
</field>
<field name="codeautowrap">
</field>
<field name="codeprefix">
</field>
<field name="codebig">
</field>
</data>
</node>
