Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

huck's scratchpad

by huck (Prior)
on Nov 03, 2016 at 08:18 UTC ( [id://1175205] : scratchpad . print w/replies, xml ) Need Help??

<mark@<redacted>.net>: host mx1.<redacted>[] sai +d: 552 spam score exceeded threshold (#5.6.1) (in reply to end of DAT +A command) I wrote a program to archive a user on an imap server. It stores the +messages one file per message using the unique id as part of the name +. BUT it adds an extension of '.mfile' after the number so it is not MH +comparable. I cam across your Mail:Box module and tried it anyway. After looking a +round i thought i could extend the Mail:Box:dir class pretty easily. +(it was). so i added my $mgr = Mail::Box::Manager->new(autodetect =>'mhft' ,default_folder_type =>'mhft' ,folder_types => [mhft=>' +Mail::Box::MHft'] ); but when i tried to run it, it wouldnt find my new packages, see they + were inline in my test program. not in the @INC trees. and it failed at ..... next if $require_failed{$class}; eval "require $class"; if($@) { $require_failed{$class}++; next; } i worked around it by ... my $folder = Mail::Box::MHft->new(manager = +> $mgr, folder =>$fname); But i was kinda wondering if you could "fix" it somewhat. So that alre +ady loaded clases dont need to be required. maybe something like { no strict; no warnings; if (defined &{$class.'::init'}) { $found++; last; } } next if $require_failed{$class}; eval "require $class"; if($@) { $require_failed{$class}++; next; } im not saying it is a trivial fix, nor that it only needs to be in one + place. Not that there may not be a better way to do the same thing. but it would allow a testing scenario of all the packages inline or pr +e loaded from single "use" file that was not in the normal .../Mail/Box/..... tree. For the most part this would be part of a testing scenario i would thi +nk I just thought i would toss the idea out there, I also found a few doc errors in +.pod under "The central part of the examples/ script reads:" there is no sub before the show_type subroutine declaration and in under $obj->reportAll( [$level] ) it has my ($object, $level, $text) = @$_; but then it uses $message in the prints below i just changed it to my ($object, $level, $message) = @$oo; i also sent you a PM at perlmonks about colons ':' in the filenames wh +en i tried to cpan install Mail::Box on a windows box otherwise so far i like what i see ....... thanks for all your work

GrandFather Utility to capture parameters and perform a task
Re: Server time vs computer logging in Remember - the three cardinal virtues of a Perlmonk are laziness, impatience, and hubris.
my $groups=[ [ \'DLKTYVR', \'ALPTMVA', \'VLNGYVD', \'QSGTYVP', \'RLHTEAR' ], [ \'SSMPWDH', \'SSNPIYV' ], [ \'RMTMLPN' ], [ \'GWMTEHA', \'NHSTRHA', \'GYCTVRA', \'GDRVEEA' ] ]; # my @reduced = map { ${ $_->[0] } } @$groups; my $unrefed = [ map { [ map { ${ $_}} @$_ ] } @$groups] ; use Data::Dumper; print Dumper $groups; print Dumper $unrefed; my @group1=@{$unrefed ->[1]}; print Dumper \@group1; my $value=$unrefed->[1][1]; print Dumper $value;
## example t2hex($lineno,$inputline); sub t2hex { # text to hex my @lines; my $id=shift; my $str=shift; print $id.' '.$str."\n"; my $hex=unpack('H*', $str); for (my $i=0;$i<length($hex);$i++) { $lines[$i%2].=substr($hex,$i, +1);} print $id.' '.$lines[0]."\n"; print $id.' '.$lines[1]."\n"; }
if ( (index($SourceLine,'#') > -1) && (index($SourceLine,'PAGES') > -1 +)) { sub t2hex { # text to hex my @lines; my $id=shift; my $str=shift; print $id.' '.$str."\n"; my $hex=unpack('H*', $str); for (my $i=0;$i<length($hex);$i++) { $lines[$i%2].=substr($hex,$i, +1);} print $id.' '.$lines[0]."\n"; print $id.' '.$lines[1]."\n"; } t2hex('huh',$SourceLine); } }