We have a little *BSD box here that we are no longer getting support for. Among other things it is our SMTP gateway using Sendmail. I have the task of reverse-enbineering the alias file for it (it is built directly from a database that we do not have access too).
I wrote this;
#!/usr/bin/perl -w
use DB_File;
use strict;
my %DB;
my $key;
my $val;
tie (%DB, "DB_File", "./igusers.db", O_RDONLY, 0644, $DB_HASH);
while (($key, $val) = each %DB) {
print "$key = $val2\n";
}
untie(%DB);
In hopes of it being simple. Ofcourse it is not... A sample of the output from $val looks like this;
mat071 = Ômat071*mat071ex group dlÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
+ÿÿÿÿÿÿÿÿÿÿÿÿexchforwardÿÿÿÿÿÿÿÿ¡ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
From there I tried;
#!/usr/bin/perl -w
use DB_File;
use strict;
my %DB;
my $key;
my $val;
my $val2;
tie (%DB, "DB_File", "./igusers.db", O_RDONLY, 0644, $DB_HASH);
while (($key, $val) = each %DB) {
$val2 = ref($val);
print "$key = $val2\n";
}
untie(%DB);
but then $val2 has nothing in it.
Can someone kick me in the butt and let me know what I am doing wrong here.
Thanks,
Kahn
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.