From 137242e609fe3a33559bfe376d1ab8c7a88e3754 Mon Sep 17 00:00:00 2001 From: Nick Bebout Date: Sep 19 2016 15:17:24 +0000 Subject: 1.727 --- diff --git a/ChangeLog b/ChangeLog index e86a4b6..666a024 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,17 +1,225 @@ RCS file: RCS/imapsync,v Working file: imapsync -head: 1.684 +head: 1.727 branch: locks: strict - gilles: 1.684 + gilles: 1.727 access list: symbolic names: keyword substitution: kv -total revisions: 684; selected revisions: 684 +total revisions: 727; selected revisions: 727 description: ---------------------------- -revision 1.684 locked by: gilles; +revision 1.727 locked by: gilles; +date: 2016/08/19 10:30:36; author: gilles; state: Exp; lines: +53 -110 +Bugfix. Fall back separator to / even when host has no mailbox at all. +Usability. Better warning about default ssl SSL_VERIFY_NONE +---------------------------- +revision 1.726 +date: 2016/08/16 21:32:35; author: gilles; state: Exp; lines: +19 -19 +Changed "Checking --regexflag --skipmess --regexmess --maxlinelengthcmd --pipemess commands" with a space string instead of an empty one. Because pipemess() now fails when output is empty. +---------------------------- +revision 1.725 +date: 2016/08/16 00:01:48; author: gilles; state: Exp; lines: +122 -83 +Some perl critics. +---------------------------- +revision 1.724 +date: 2016/08/13 11:04:06; author: gilles; state: Exp; lines: +362 -150 +Refactor. No more global $pidfile, $pidfilelocking, $nb_errors, $errorsdump, @errors_log. +Refactor. Changed exit_clean. From exit_clean( 0 ) to exit_clean( $sync, $EX_OK ) ; +Refactor. Changed errors_incr. From errors_incr( $error ) to errors_incr( $sync, $error ). +Refactor. From stats( ) to stats( $sync ). +Added constants: + * $EXIT_WITH_ERRORS_MAX + * $EXIT_BY_SIGNAL + * $EXIT_WITH_ERRORS + * $EXIT_PID_FILE_ALREADY_EXIST + * $INTERVAL_TO_EXIT +---------------------------- +revision 1.723 +date: 2016/07/29 21:57:03; author: gilles; state: Exp; lines: +12 -11 +Force Unconnected state with Ctrl-c. +---------------------------- +revision 1.722 +date: 2016/07/29 21:14:11; author: gilles; state: Exp; lines: +20 -12 +Added sub debugsleep() +Changed --debugsleep to take a float parameter. --debugsleep 4.5 add a sleep of 4.5 seconds every folder and before every copied message. +---------------------------- +revision 1.721 +date: 2016/07/29 17:25:00; author: gilles; state: Exp; lines: +57 -29 +Do reconnections when hit by a signal Ctrl-c, aka INT signal. +2 consecutive Ctrl-c within 1 second then exit the program. +---------------------------- +revision 1.720 +date: 2016/07/29 15:01:38; author: gilles; state: Exp; lines: +324 -225 +Some Perl critics "not one of the allowed literal values". Now still 188 violations of ValuesAndExpressions::ProhibitMagicNumbers. +---------------------------- +revision 1.719 +date: 2016/07/25 19:27:47; author: gilles; state: Exp; lines: +229 -152 +Change some print to myprint. +Fixed some perlcritic level 4 & 5 +sub pipemess now abort on empty message generated. +sub pipemess prints stderr +---------------------------- +revision 1.718 +date: 2016/07/20 10:45:51; author: gilles; state: Exp; lines: +21 -13 +Added --inet4 to force AF_INET connextion in ssl mode. +Added --inet6 too to force AF_INET6 in ssl mode. Might be useless. +---------------------------- +revision 1.717 +date: 2016/07/13 14:05:20; author: gilles; state: Exp; lines: +130 -57 +Started tests_message_for_host2() +Added cyrillic for hard part --automap +--pipemess test with pipe (cat|cat) +--pipemess tests with arrors +---------------------------- +revision 1.716 +date: 2016/07/12 09:02:25; author: gilles; state: Exp; lines: +209 -81 +Added full mocked tests to sub tests_delete1emptyfolders(). Test::MockObject is really helpful! +Changed pipemess() to return both message and stderr output, in list context. Scalar context stays the same, for now. +Added list context tests to tests_pipemess() +---------------------------- +revision 1.715 +date: 2016/07/05 21:17:48; author: gilles; state: Exp; lines: +10 -10 +Removed from errors list "ignoring folder because it is not in host1 whole folders list". Too hard too. +---------------------------- +revision 1.714 +date: 2016/07/05 21:12:23; author: gilles; state: Exp; lines: +10 -10 +Remove "not selectable" folders from the errors list. Too hard. +---------------------------- +revision 1.713 +date: 2016/07/05 12:50:35; author: gilles; state: Exp; lines: +21 -18 +Added "ignoring folder" in the errors list. +---------------------------- +revision 1.712 +date: 2016/06/30 01:35:02; author: gilles; state: Exp; lines: +202 -21 +Added option --delete1emptyfolders ; 8 hours to write it. +Added module dependency Test::MockObject for some tests. Only require for now. +---------------------------- +revision 1.711 +date: 2016/06/22 20:23:33; author: gilles; state: Exp; lines: +10 -10 +Removed a useless debug output +---------------------------- +revision 1.710 +date: 2016/06/22 14:47:23; author: gilles; state: Exp; lines: +28 -27 +Perlcritic fixes. ValuesAndExpressions::ProhibitMagicNumbers some 3 and is_a_release_number tests. +---------------------------- +revision 1.709 +date: 2016/06/22 11:32:40; author: gilles; state: Exp; lines: +58 -37 +Perlcritic fixes. ValuesAndExpressions::ProhibitMagicNumbers -1 => $LAST or $MINUS_ONE. +---------------------------- +revision 1.708 +date: 2016/06/22 10:32:45; author: gilles; state: Exp; lines: +193 -192 +Perlcritic fixes. ProhibitParensWithBuiltins, Last ones. +---------------------------- +revision 1.707 +date: 2016/06/18 00:37:24; author: gilles; state: Exp; lines: +64 -81 +Perlcritic fixes. ProhibitParensWithBuiltins, exists() => exists. But not all. Need to examine precedence with not or and etc. +Uncommented call to $test_builder->reset( ) Don't know why it was commented but it was bad for knowing tests go wrong. +---------------------------- +revision 1.706 +date: 2016/06/17 13:34:09; author: gilles; state: Exp; lines: +13 -13 +Sugar. "return (" => "return(" +---------------------------- +revision 1.705 +date: 2016/06/17 13:28:23; author: gilles; state: Exp; lines: +422 -422 +Replaced all print( calls by myprint( calls. +It prepares better output handling, I hope. +---------------------------- +revision 1.704 +date: 2016/06/17 13:25:16; author: gilles; state: Exp; lines: +36 -36 +Replaced smyprintf by mysprintf +---------------------------- +revision 1.703 +date: 2016/06/17 13:12:09; author: gilles; state: Exp; lines: +700 -697 +Perlcritic fixes. Rmoved parentheses, ProhibitParensWithBuiltins, for defined|scalar|push|keys|unshift|uc +but added parentheses to print. +Replaced printf by myprintf +Replaced sprinf by smyprintf. +---------------------------- +revision 1.702 +date: 2016/06/15 22:43:35; author: gilles; state: Exp; lines: +495 -495 +Fixed perl critic 458 violations of ValuesAndExpressions::ProhibitInterpolationOfLiterals. "Useless interpolation of literal string". 2 left but critic bugs on them. "\1foo" is not '\1foo' but critic suggests equality. +---------------------------- +revision 1.701 +date: 2016/06/12 23:39:04; author: gilles; state: Exp; lines: +812 -812 +Fixed perlcritic "Don't use whitespace at the end of lines". Was 627 violations of CodeLayout::ProhibitTrailingWhitespace. Now 0. For now... +---------------------------- +revision 1.700 +date: 2016/06/12 20:55:25; author: gilles; state: Exp; lines: +33 -33 +Fixed perlcritic latest ouble-sigil dereference $$foo => ${ $ffo } and $#$foo => $#{ $foo } +---------------------------- +revision 1.699 +date: 2016/06/12 19:51:52; author: gilles; state: Exp; lines: +29 -29 +Fixed perlcritic Double-sigil dereference @$foo => @{ $foo } +---------------------------- +revision 1.698 +date: 2016/06/12 19:39:15; author: gilles; state: Exp; lines: +33 -36 +Fixed perlcritic %$foo => %{ $ff } +Double-sigil dereference +---------------------------- +revision 1.697 +date: 2016/06/12 18:42:18; author: gilles; state: Exp; lines: +53 -24 +Perl critic fixes. 10 x "Unnamed numeric literals make code less maintainable.". use Readonly to fix them. +---------------------------- +revision 1.696 +date: 2016/06/09 23:42:34; author: gilles; state: Exp; lines: +201 -201 +Fixed perlcritic 'Quotes used with a string containing no non-whitespace characters'. +"" or '' => q{} +" " or ' ' => q{ } +---------------------------- +revision 1.695 +date: 2016/06/09 18:17:14; author: gilles; state: Exp; lines: +15 -10 +Check connected state in sub create_folder(). +---------------------------- +revision 1.694 +date: 2016/06/08 21:01:15; author: gilles; state: Exp; lines: +43 -17 +Added patch: [imapsync/imapsync] Update XOAUTH2 support to work with Google's newer .json files (#68). +---------------------------- +revision 1.693 +date: 2016/06/07 21:13:03; author: gilles; state: Exp; lines: +38 -28 +CGI loaded when needed only. +In CGI mode, Remove all content in unsafe evalued options. +In CGI mode, help solving permission issues. +---------------------------- +revision 1.692 +date: 2016/05/25 16:34:15; author: gilles; state: Exp; lines: +11 -11 +Small typo +---------------------------- +revision 1.691 +date: 2016/05/24 20:56:34; author: gilles; state: Exp; lines: +25 -18 +Fixed -1 false output for big account %d => %s in printf. +Wrote and use getpwuid_any_os. getpwuid breaks on Windows. +---------------------------- +revision 1.690 +date: 2016/05/14 21:21:56; author: gilles; state: Exp; lines: +33 -23 +*** empty log message *** +---------------------------- +revision 1.689 +date: 2016/05/09 17:58:11; author: gilles; state: Exp; lines: +155 -20 +Started to be CGI compatible. +Started package Imapsync::Getopt::Long. +---------------------------- +revision 1.688 +date: 2016/03/27 22:56:47; author: gilles; state: Exp; lines: +11 -11 +Check return code of message_to_file in sub message_for_host2. +---------------------------- +revision 1.687 +date: 2016/03/24 20:39:33; author: gilles; state: Exp; lines: +10 -10 +Replaced message_string() call by message_to_file() and won 1x again. +Now imapsync crunches only 2x biggest message size in memory. +---------------------------- +revision 1.686 +date: 2016/03/24 20:21:57; author: gilles; state: Exp; lines: +27 -27 +Changed append_message_on_host2() to pass message string by reference. +Memory usage passed from 5x to 3x. 3x remains from underlying Mail::IMAPClient module in Mail::IMAPClient::message_string() +---------------------------- +revision 1.685 +date: 2016/03/24 17:02:13; author: gilles; state: Exp; lines: +65 -35 +Added memory debug in order to decrease the 5x message size in memory. +---------------------------- +revision 1.684 date: 2016/03/17 08:35:03; author: gilles; state: Exp; lines: +24 -16 Bugfix. No more warning about "Use of uninitialized value $sockargs[7] in join or string at" in ssl or tls mode. Was due to "'SSL_version' => undef". diff --git a/FAQ b/FAQ index 673e7b5..e2bd740 100644 --- a/FAQ +++ b/FAQ @@ -1,5 +1,5 @@ #!/bin/cat -# $Id: FAQ,v 1.221 2016/03/07 02:55:01 gilles Exp gilles $ +# $Id: FAQ,v 1.224 2016/06/08 21:32:09 gilles Exp gilles $ +-------------------+ | FAQs for imapsync | @@ -122,36 +122,6 @@ post to this list if you want to stay private. Thank you for your participation. ======================================================================= -Q. Can I copy or sync Calendar or Contacts with imapsync? - -R. No. It's because most IMAP servers don't get contacts and calendar -events via IMAP. In other words, messages synced by imapsync from -Calendar or Contacts folders are not used by email servers to set -or get the contacts or calendars. -No way via IMAP, no way via imapsync. -See next question. - -======================================================================= -Q. How can I copy or synchronize Calendars or Contacts? - -R1. It can't be done with imapsync. - -R2. It can be done, depending on the email server softwares used. - -a) From Exchange to Exchange, export contacts and calendar to - PST format files on host1 and import them on host2. - -b) From Gmail to Gmail, export and import calendars in ical format, - extension for those files is .ics. - Contacts can be copied using a csv file. See the help page - http://support.google.com/mail/bin/topic.py?hl=en&topic=1669027 - -c) Etc. Search the web. There's also specific tools and paid services. - There's no silver bullet to migrate Calendars and Contacts, - if you find one, tell me! - - -======================================================================= Q. Where I can find old imapsync releases? R. Search the Internet. @@ -320,11 +290,11 @@ http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx#maxpath The workaround solution given at the previous link, ie using \\?\D:", does not work for imapsync. So this imapsync Windows bug is still pending and needs a fix using -a different technic to cache, like a database file for example. +a different technique to cache, like a database file for example. A solution to fix the issue is to use a Linux virtual host on a Windows box, with VirtualBox or VmWare etc. There is no bug this way, -pathnames can be several thousands charaters long. +pathnames can be several thousands characters long. Better said that done but not so difficult nor expensive these days, VirtualBox is free and VmWare Player is free for personal or test use. @@ -401,14 +371,6 @@ Q. How can I use imapsync with Mail::IMAPClient 2.2.9 perl module? R. Mail::IMAPClient 2.2.9 is no longer supported. ======================================================================= -Q. I get "Out of memory" errors. How to fix that? - -R. Usually "Out of memory" errors are related to old days, -to old Mail::IMAPClient module releases, before 3.26. -Look at imapsync output first lines to get the Mail::IMAPClient release used. -Then upgrade Mail::IMAPClient Perl module if needed. - -======================================================================= Q. Can I use imapsync to migrate emails from pop3 server to imap server? R1. No. @@ -527,35 +489,6 @@ It works for the star * character, I don't know if it works for the " character. ======================================================================= -Q. On Windows, some passwords contain $ characters. Login fails. -R1. Enclose passwords between "" - - imapsync ... --password1 "zzz$zz$$z" - -R2. Prefix each $ character with a ^ since ^ is the escape character - on Windows - - imapsync ... --password1 zzz^$zz^$^$z - -For a password that is exactly the 8 characters string $%&<>|^" -you have to enter - - imapsync ... --password1 "$%%&<>|^"^" - -======================================================================= -Q. On Windows, some passwords begin with an equal = character. - Login fails. What can I do? - -R. Use twice equals == characters instead; For example, if =secret - is the password then use: - - imapsync ... --password1 ==secret - -or even - - imapsync ... --password1 "==secret" - -======================================================================= Q. With huge account (many messages) when it comes to reading the destination server it comes out this error: "To Folder [INBOX.foobar] Not connected" @@ -588,16 +521,6 @@ R. Use the following syntax: ====================================================================== -Q. How to migrate to Dovecot with an admin/MasterUser account? - -R. Dovecot uses the same syntax as uw-imap - - imapsync ... --user2="loginuser*admin_user" --password2 "admin_user_password" - -To setup a Dovecot MasterUser see -http://wiki2.dovecot.org/Authentication/MasterUsers - -====================================================================== Q. How to migrate from cyrus with an admin account? R. Use: diff --git a/FAQ.d/.htaccess b/FAQ.d/.htaccess deleted file mode 100644 index e78b875..0000000 --- a/FAQ.d/.htaccess +++ /dev/null @@ -1,20 +0,0 @@ - -# $Id: .htaccess,v 1.1 2016/01/18 18:13:48 gilles Exp gilles $ - -AddDescription "Domino." FAQ.Domino.txt -AddDescription "Dovecot." FAQ.Dovecot.txt -AddDescription "Duplicated messages issues." FAQ.Duplicates.txt -AddDescription "Exchange 20xx and Office365." FAQ.Exchange.txt -AddDescription "Changing folders names." FAQ.Folders_Mapping.txt -AddDescription "Flags." FAQ.Flags.txt -AddDescription "Gmail accounts." FAQ.Gmail.txt -AddDescription "ISP." FAQ.ISP.txt -AddDescription "Massive/bulk migrations." FAQ.Massive.txt -AddDescription "Selecting messages." FAQ.Messages_selection.txt -AddDescription "Oracle-UCS." FAQ.Oracle-UCS.txt -AddDescription "Security." FAQ.Security.txt -AddDescription "SmarterMail." FAQ.SmarterMail.txt -AddDescription "Various imap server softwares." FAQ.Various_Server_Softwares.txt -AddDescription "XOAUTH2 (Gmail)." FAQ.XOAUTH2.txt - - diff --git a/FAQ.d/.htaccess b/FAQ.d/.htaccess new file mode 120000 index 0000000..2fe3151 --- /dev/null +++ b/FAQ.d/.htaccess @@ -0,0 +1 @@ +htaccess.txt \ No newline at end of file diff --git a/FAQ.d/FAQ.Archiving.txt b/FAQ.d/FAQ.Archiving.txt new file mode 100644 index 0000000..11dc6a6 --- /dev/null +++ b/FAQ.d/FAQ.Archiving.txt @@ -0,0 +1,23 @@ +#!/bin/cat +$Id: FAQ.Archiving.txt,v 1.2 2016/05/09 13:03:14 gilles Exp gilles $ + +This documentation is also at http://imapsync.lamiral.info/#doc + +============================================ + Imapsync tips about archiving messages. +============================================ + +======================================================================= +Q. How to move emails from one IMAP folder to another either on the + same IMAP server or a different one? + For example, all messages older than 1 year, move from INBOX to Archive. + +R1. Solution: + + imapsync ... --minage 365 --folder Inbox --f1f2 INBOX=Archive --delete --noexpungeaftereach + +Add option --noexpungeaftereach if speed is a concern. +Add option --delete if you want to move messages, instead of just copy/sync them. + +R2. See also file FAQ.Folders_Mapping.txt + diff --git a/FAQ.d/FAQ.Connection.txt b/FAQ.d/FAQ.Connection.txt deleted file mode 100644 index db4c43e..0000000 --- a/FAQ.d/FAQ.Connection.txt +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/cat -$Id: FAQ.Connection.txt,v 1.2 2016/03/16 13:33:51 gilles Exp gilles $ - -This documentation is also at http://imapsync.lamiral.info/#doc - -============================================ - Imapsync tips about connection issues. -============================================ - - -======================================================================= -Q.How to test a ssl imap connection without imapsync? - -R1.Use openssl command like the following, - an example with imap.gmail.com server: - - openssl s_client -connect imap.gmail.com:993 - -The previous command is an interactive connection, hit ctrl-c -to finish it. If you want to finish it gently, then use: - - { sleep 1; echo "a LOGOUT"; } | openssl s_client -connect imap.gmail.com:993 - -======================================================================= - diff --git a/FAQ.d/FAQ.Contacts_Calendars.txt b/FAQ.d/FAQ.Contacts_Calendars.txt new file mode 100644 index 0000000..23c2391 --- /dev/null +++ b/FAQ.d/FAQ.Contacts_Calendars.txt @@ -0,0 +1,49 @@ +#!/bin/cat +$Id: FAQ.Contacts_Calendars.txt,v 1.3 2016/05/09 13:37:21 gilles Exp gilles $ + +This documentation is also at http://imapsync.lamiral.info/#doc + +========================================================= + Imapsync issues about syncing Contacts & Calendars. +========================================================= + + +======================================================================= +Q. Can I copy or sync Calendar or Contacts with imapsync? + +R. No, Imapsync can't migrate Contacts and Calendars. + It's because most IMAP servers don't get contacts and calendars + events via IMAP. In other words, messages synced by imapsync from + Calendars or Contacts folders are not used by email servers to set + or get the contacts or calendars. + No way via IMAP, no way via imapsync. + But see next question. + +======================================================================= +Q. How can I copy or synchronize Calendars or Contacts? + +R1. It can't be done with imapsync. See previous question for explanations. + +R2. It can be done, depending on the email server softwares used. + +a) From Exchange to Exchange, export contacts and calendar to + PST format files on host1 and import them on host2. + +b) From Gmail to Gmail, export and import calendars in ical format, + extension for those files is .ics. + Contacts can be copied using a csv file. See the help page + http://support.google.com/mail/bin/topic.py?hl=en&topic=1669027 + +c) Etc. Search the web. There's also specific tools and paid services. + There's no silver bullet to migrate Calendars and Contacts, + if you find one, tell me! + Also consider asking experts at Sumatra company + https://twitter.com/sumatra_dev + http://sumatra.com/ + +d) I plan to make tools for that but so far nothing has began + more than this discussion: +http://www.linux-france.org/prj/imapsync_list/msg01797.html +http://www.linux-france.org/prj/imapsync_list/msg01811.html + +======================================================================= diff --git a/FAQ.d/FAQ.Dates.txt b/FAQ.d/FAQ.Dates.txt index a159dde..8efcb7f 100644 --- a/FAQ.d/FAQ.Dates.txt +++ b/FAQ.d/FAQ.Dates.txt @@ -1,5 +1,5 @@ #!/bin/cat -$Id: FAQ.Dates.txt,v 1.2 2016/03/07 02:08:12 gilles Exp gilles $ +$Id: FAQ.Dates.txt,v 1.3 2016/07/27 13:14:30 gilles Exp gilles $ This documentation is also at http://imapsync.lamiral.info/#doc @@ -25,21 +25,26 @@ but not with: A thing to keep in mind, imapsync does not touch any byte of messages unless told to do so by option --regexmess or --pipemess -Messages on both parts should be identical. +Messages on both parts should be exactly identical. Now I explain the whole picture about dates of messages. There are several different dates for any message. -First, there is the "Date:" header. Most of the time, this date is set -by the MUA (MUA means Mail User Agent) it can be Outlook, Thunderbird, -a webmail or Mutt. The Date header is usually the date the message was written +First, there is the "Date:" header, which belongs to the message itself. +You can see this "Date:" header line by asking View->Message Source +in most email client software (Ctrl-u in Thunderbird). +Most of the time, this date is set by the MUA, MUA stands for "Mail User Agent". +MUA can be Outlook, Thunderbird, a webmail or Mutt etc. +The Date header is usually the date the message was written or sent the first time, at the writer side. -This Date: header line is never changed by any transfer or copy. +This "Date:" header line is never changed by any transfer or copy. If an email reader uses the "Date:" header for displaying the date of a message then no problem should arise. Another date is the internal date. In IMAP, the internal date is handled -by the server and normally it corresponds to the arrival date in the mailbox. +by the server and normally it corresponds to the arrival date in the mailbox. +This date is not part of the email message itself, it's a metadata kept +by the imap server. The IMAP protocol allows the internal date to be set by a email client when a message is delivered by the imap APPEND command. Imapsync synchronizes internal dates by default, internal dates on host2 diff --git a/FAQ.d/FAQ.Duplicates.txt b/FAQ.d/FAQ.Duplicates.txt index 3c008c7..da15e30 100644 --- a/FAQ.d/FAQ.Duplicates.txt +++ b/FAQ.d/FAQ.Duplicates.txt @@ -1,5 +1,5 @@ #!/bin/cat -$Id: FAQ.Duplicates.txt,v 1.9 2016/03/08 21:17:21 gilles Exp gilles $ +$Id: FAQ.Duplicates.txt,v 1.10 2016/04/17 19:06:39 gilles Exp gilles $ This documentation is also at http://imapsync.lamiral.info/#doc @@ -20,21 +20,50 @@ R0. Normally and by default, imapsync doesn't generate duplicates. So if it does generate duplicates it means a problem occurs with message identification. It happens sometimes with IMAP -servers changing the "Message-Id" line or "Received:" in -the header part of messages. +servers changing the "Message-Id" header line or one or more +of the "Received:" header lines in the header part of messages. +Imapsync uses "Message-Id" header line and "Received:" header +lines to identify messages on both sides. R1. -You can use option --useuid, with it, imapsync won't use -header lines to compare messages in folders. -Keep in mind it uses a local cache. +A first solution is to use option --useuid. +With option --useuid, imapsync doesn't use header lines +to identify and compare messages in folders. +Instead of some headers, --useuid tell imapsync to use +the imap UIDs given by imap servers on bith sides. +To avoid duplicates on next runs, imapsync uses a local cache +where it keeps UIDs already transfered. imapsync ... --useuid +There is an issue when --useuid is not used the first time. A big issue with --useuid is that it doesn't generate duplicates if used from the first time but it does generate duplicates after a previous -run without --useuid (because it uses a different method to identify -the messages). A solution? it depends. --delete2 solves this problem -if you are permitted to use it. +run without --useuid (because then uses a different method to identify +the messages). + +A solution? Two solutions. + +The easiest is --delete2 +if you are permitted to use it. Option --delete2 removes messages on host2 +that are not on host1 so with --delete2 you go for resyncing all +messages again but all previously transferred messages are deleted, +and also messages previously there without imapsync. +So --useuid --delete2 is easy to remove duplicates but not for +all context. + +A second solution, better if R2 works (see R2 below), is to build +the cache before using --useuid + +First sync: + + imapsync ... --useheader "Message-Id" --addheader --usecache + +Next syncs: + + imapsync ... --useuid + imapsync ... --useuid + ... R2. Best way if you can follow it. diff --git a/FAQ.d/FAQ.Emptying.txt b/FAQ.d/FAQ.Emptying.txt new file mode 100644 index 0000000..92f149e --- /dev/null +++ b/FAQ.d/FAQ.Emptying.txt @@ -0,0 +1,35 @@ +#!/bin/cat +$Id: FAQ.Emptying.txt,v 1.4 2016/04/24 00:07:47 gilles Exp gilles $ + +This documentation is also at http://imapsync.lamiral.info/#doc + +============================================ + Imapsync tip to empty an account. +============================================ + +======================================================================= +Q. How to delete all emails of all folders of an account with imapsync? + +R. Use the same account on both sides with option --delete + --noexpungeaftereach + +Option --noexpungeaftereach is just to speed up the deletion. + +Example: + + ./imapsync \ + --host1 test.lamiral.info --user1 test --password1 secret \ + --host2 test.lamiral.info --user2 test --password2 secret \ + --delete --noexpungeaftereach + +======================================================================= +Q. How to delete all folders of an account with imapsync? + +R. Use an already empty account as source and sync this account + to the account you want to clear, with --delete2folders + +Example: + + ./imapsync ... --delete2folders --foldersizes + +======================================================================= diff --git a/FAQ.d/FAQ.Exchange.txt b/FAQ.d/FAQ.Exchange.txt index 2524e10..3ed2d56 100644 --- a/FAQ.d/FAQ.Exchange.txt +++ b/FAQ.d/FAQ.Exchange.txt @@ -1,5 +1,5 @@ #!/bin/cat -$Id: FAQ.Exchange.txt,v 1.20 2016/03/03 15:44:17 gilles Exp gilles $ +$Id: FAQ.Exchange.txt,v 1.23 2016/08/10 01:29:37 gilles Exp gilles $ This documentation is also at http://imapsync.lamiral.info/#doc @@ -91,7 +91,6 @@ In case you don't have it you can still use --regexmess 's,(.{9900}),$1\r\n,g' instead of --maxlinelengthcmd 'reformime -r7' - ======================================================================= Q. How to sync from XXX to Office365 @@ -143,7 +142,7 @@ R3. Try with a classic email client like Thunderbird and the same ======================================================================= Q. Exchange fails with "User is authenticated but not connected". -R. "The message User is authenticated but not connected is due to a +R1. "The message User is authenticated but not connected is due to a bug in the Exchange server's IMAP implementation. If the client presents a valid user name but an invalid password, the server accepts the login, but subsequent commands fail with the @@ -152,6 +151,10 @@ http://unix.stackexchange.com/questions/164823/user-is-authenticated-but-not-con Thanks to James Abbottsmith for this link and explanation at https://github.com/imapsync/imapsync/issues/32#issuecomment-153561647 +R2. Miguel Alameda reported understanding and solving this issue + like this, the context was admin/authuser: + "The admin user had not permission in the target mailbox." + ======================================================================= Q. Exchange fails with "BAD Command received in Invalid state". @@ -276,7 +279,7 @@ R. It looks like limiting 4 messages per second is enough to never imapsync ... --maxmessagespersecond 4 ====================================================================== -Q. How to migrate from or to Exchange 2007/2010 with an +Q. How to migrate from or to Exchange 2007/2010/2013 with an admin/authuser account? R. The tricks comes from Michele Marcionelli and Benjamin Priestman: @@ -326,9 +329,6 @@ The command that I used for imapsync is: --user2 "windows-domain\admin-user\aaaa" ^ --password2 admin-password ... - - - ====================================================================== Q. How to migrate from or to Office 365 with an admin/authuser account? @@ -336,8 +336,7 @@ Note from Yago Torres Fernandez: (a working command using admin/authuser on host2 Office 365) imapsync ... --authuser2 user_admin@domain.com --user2 user_to_be_migrated@domain.com ^ - --password2 XXXX --ssl2 --exclude "Shared Folders" ^ - --regextrans2 "s#Trash$#Papelera#" --regextrans2 "s#^Deleted Items$#Papelera#" + --password2 XXXX --ssl2 ^ but previous in Office365 you must do something like that, using powershell: @@ -351,8 +350,6 @@ Same behavior with the --authuser2 option. See also: http://www.linux-france.org/prj/imapsync_list/msg02203.html - - ====================================================================== Q. How to migrate from or to Exchange 2003 with an admin/authuser account? @@ -387,8 +384,6 @@ In case you are not aware: omitted in our case - Use --debugimap when testing initial connectivity, if necessary - - ======================================================================= Q. Couldn't create folder [trash] "Mailbox already exists". diff --git a/FAQ.d/FAQ.Folders_Selection.txt b/FAQ.d/FAQ.Folders_Selection.txt index 3d5afe5..9d874c8 100644 --- a/FAQ.d/FAQ.Folders_Selection.txt +++ b/FAQ.d/FAQ.Folders_Selection.txt @@ -1,5 +1,5 @@ #!/bin/cat -$Id: FAQ.Folders_Selection.txt,v 1.3 2016/02/07 22:01:56 gilles Exp gilles $ +$Id: FAQ.Folders_Selection.txt,v 1.4 2016/06/07 22:19:04 gilles Exp gilles $ This documentation is also at http://imapsync.lamiral.info/#doc @@ -9,6 +9,16 @@ This documentation is also at http://imapsync.lamiral.info/#doc By default, Imapsync syncs all folders, one by one, in alphanumeric order. +The IMAP protocol has a specific way to code folder names, +when these names use non-ascii 7bit characters. +Imapsync uses the same code as IMAP. +In order to well specify them on the command line you will be +helped by the complete folder list printed by imapsync at each run. +The left column is what you have to use without the first enclosing +square brackets, the right column is the human utf8 view. + + + ====================================================================== Q. How can I sync only one folder? diff --git a/FAQ.d/FAQ.Gmail.txt b/FAQ.d/FAQ.Gmail.txt index 6bba3a7..ecf797d 100644 --- a/FAQ.d/FAQ.Gmail.txt +++ b/FAQ.d/FAQ.Gmail.txt @@ -1,5 +1,5 @@ #!/bin/cat -$Id: FAQ.Gmail.txt,v 1.21 2016/03/17 20:14:14 gilles Exp gilles $ +$Id: FAQ.Gmail.txt,v 1.25 2016/07/22 00:18:35 gilles Exp gilles $ This documentation is also at http://imapsync.lamiral.info/#doc @@ -11,6 +11,8 @@ Questions anwswered in this FAQ are: Q. Can I use imapsync to transfer from or to Gmail accounts? +Q. How many days does it take to transfer X GB? + Q. How to synchronize from Gmail to Gmail? Q. How to synchronize from XXX to Gmail? @@ -50,8 +52,18 @@ it has to be allowed in the Gmail configuration part: -> Enable IMAP ======================================================================= -Q. How to synchronize from Gmail to Gmail? +Q. How many days does it take to transfer X GB? +R. Basically it takes X days to transfer X GB per account. + Gmail has usage limits per day + http://support.google.com/a/bin/answer.py?hl=en&answer=1071518 + From the previous link, + it's 2X days to upload X GB to Gmail + it's X/2 days to download X BG from Gmail + but that's the theory. + +======================================================================= +Q. How to synchronize from Gmail to Gmail? R. Use the following example: @@ -64,7 +76,7 @@ R. Use the following example: --ssl2 \ --user2 account2@gmail.com \ --password2 gmailsecret2 \ - --exitwhenover 500000000 \ + --maxbytespersecond 10000 \ --automap \ --exclude "\[Gmail\]$" @@ -74,17 +86,18 @@ Explanations: --ssl1 --ssl2 are mandatory since Gmail only supports imap ssl connections. ---exitwhenover 500000000 ( ~500 MB ) option is here to avoid -locking or errors when imap transfers exceed maximum limit. +--maxbytespersecond 10000 ( 10 kBytes/s ) option is here to avoid +locking or errors when imap transfers exceed Gmail maximum limit. See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518 ---exitwhenover is not mandatory in the sense Gmail may allow you -to use an upper value than 500 MB without disconnections; I don't -know the hard value, it seems to vary, so just have some tries -and report me what you discover in case you detect something -reliable. +--maxbytespersecond 10000 is not mandatory in the sense Gmail may +allow you to use an upper value than 1 GBytes per 24h without +disconnections. + --automap is not mandatory but it's a feature to automatically map folder names based on the Gmail user configuration itself, par account. +It will save manual folder names changes or the use of --regextrans2 +or --f1f2 to map folder names. For example, imap folder "[Gmail]/Sent Mail" may be mapped as one of E-mails enviados Enviada @@ -97,7 +110,7 @@ Skickat Verzonden etc. on both sides, host1 or host2, maybe differently, sometimes in -incomprehensible alphabets, a headache for imap sysadmins. +incomprehensible alphabets, a headache for imap sysadmins. See a listing here: http://stackoverflow.com/questions/2185391/localized-gmail-imap-folders/2185548#2185548 @@ -112,34 +125,32 @@ Q. How to synchronize from XXX to Gmail? R. Use the following example: -imapsync --host1 mail.oldhost.com \ +imapsync --host1 mail.oldhost.com \ --user1 my_email@oldhost.com \ - --password1 password \ + --password1 password \ --host2 imap.gmail.com \ --user2 my_email@gmail.com \ --password2 password \ --ssl2 \ - --exitwhenover 500000000 \ + --maxbytespersecond 10000 \ --maxsize 25000000 \ - --automap \ - --expunge1 \ + --automap \ + --expunge1 \ --addheader \ - --exclude "\[Gmail\]$" \ - --regextrans2 "s/[ ]+/_/g" \ - --regextrans2 "s/[\^]/_/g" \ - --regextrans2 "s/['\"\\\\]/_/g" + --exclude "\[Gmail\]$" \ + --regextrans2 "s/[ ]+/_/g" \ + --regextrans2 "s/['\^\"\\\\]/_/g" Explanations: --ssl2 is mandatory since Gmail only supports imap ssl connections. ---exitwhenover 500000000 option is here to avoid locking when -transfers exceed maximum limit. +--maxbytespersecond 10000 ( 10 kBytes/s ) option is here to avoid +locking or errors when imap transfers exceed Gmail maximum limit. See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518 ---exitwhenover is not mandatory in the sense you may be able to -use an upper value than 500 MB without disconnections; I don't -know the hard value, it seems to vary, so just have some tries -and report me what you discover in case you detect something. +--maxbytespersecond 10000 is not mandatory in the sense Gmail may +allow you to use an upper value than 1 GBytes per 24h without +disconnections. --maxsize 25000000 is mandatory since Gmail limits messages size up to 25 MB. This value increases over time, it was 10 MB some @@ -147,7 +158,7 @@ years ago so you can try higher values. The Gmail page about this limit is https://support.google.com/mail/answer/6584 --automap is optional but it will save manual folder names -changes or the use of --regextrans2 to map folder names. +changes or the use of --regextrans2 or --f1f2 to map folder names. --expunge1 is optional. It deletes messages marked \Deleted on host1. Imapsync syncs messages with all their flags, Gmail takes the messages @@ -203,7 +214,7 @@ R. Use this example: --user2 tata \ --password2 tatasecret \ --ssl1 \ - --exitwhenover 2500000000 \ + --maxbytespersecond 20000 \ --useheader="X-Gmail-Received" \ --useheader "Message-Id" \ --automap \ @@ -219,14 +230,12 @@ Explanations: --ssl1 is mandatory since Gmail only supports imap ssl connections. ---exitwhenover 2500000000 (2.5 GB) option is here to avoid -locking when transfers exceed maximum limit. - +--maxbytespersecond 20000 ( 20 kBytes/s ) option is here to avoid +locking or errors when imap transfers exceed Gmail maximum limit. See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518 ---exitwhenover is not mandatory in the sense you may be able to -use an upper value than 2.5 GB without disconnections; I don't -know the hard value, it seems to vary, so just have some tries -and report me what you discover in case you detect something. +--maxbytespersecond 20000 is not mandatory in the sense Gmail may +allow you to use an upper value than 2 GBytes per 24h without +disconnections. --useheader="X-Gmail-Received" --useheader "Message-Id" are not mandatory. I use them because I found (several years ago, it may @@ -245,10 +254,6 @@ get rid of this "[Gmail]" part with that. You can select folders exported to imap within the gmail preferences, for example you may unselect all "System labels". ---exitwhenover option is here to avoid locking when transfers -exceed maximum limit. -See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518 - --skipcrossduplicates is optional but it can save Gigabytes of hard disk memory. Within imap protocol, Gmail presents Gmail labels as folders, so a message labeled "Work" "ProjectX" "Urgent" ends up @@ -271,36 +276,23 @@ label CanWait and only it. the messages that are not labeled at all. ======================================================================= -Q. Can I use the Extension of the SEARCH command: X-GM-RAW described at - https://support.google.com/mail/answer/7190?hl=en - https://developers.google.com/gmail/imap_extensions#extension_of_the_search_command_x-gm-raw - -R. Sure. Example, to search only emails with attachment and in unread state: - -On Unix: - - imapsync ... --search 'X-GM-RAW "has:attachment in:unread"' - -On Windows: - - imapsync.exe ... --search "X-GM-RAW ""has:attachment in:unread""" - +Q. I can't authenticate with Gmail via IMAP + and Gmail says "Please log in via your web browser" +R0. My current settings on two Gmail account are made +with 0) 1) 2) -======================================================================= -Q. How to avoid the [IMAP] prefix on Gmail side? -How to stop creating folder with this prefix? -Any switch we can use? e.g. [IMAP]/Archive +0) Login via a browser to the Gmail account concerned. -R. No switch in imapsync since [IMAP]/ prefix is done by Gmail, - it might be configurable within Gmail parameters configuration. +1) The 2-step verification is OFF +https://myaccount.google.com/security?hl=en&pli=1&nlr=1#signin -======================================================================= -Q. I can't authenticate with Gmail via IMAP - and Gmail says "Please log in via your web browser" +2) Access for less secure apps is turned ON +https://www.google.com/settings/security/lesssecureapps +https://support.google.com/accounts/answer/6010255?hl=en R1. See Coert Grobbelaar solution: -https://security.stackexchange.com/questions/86404/how-do-i-interact-with-google-to-import-email-via-imapsync +https://web.archive.org/web/20150906230041/http://security.stackexchange.com/questions/86404/how-do-i-interact-with-google-to-import-email-via-imapsync R2. I had the same issue one time (mars 2015) logging to Gmail with imapsync. @@ -309,9 +301,6 @@ so I logged for this account via a web browser, it asked me to receive a code via a mobile, I said yes, I entered the code and everything went ok. -R3. Use https://www.google.com/settings/security/lesssecureapps - (thanks to Flavio Zarur) - See https://support.google.com/accounts/answer/6010255?hl=en ======================================================================= Q. Can not open imap connection on [imap.gmail.com]: @@ -353,6 +342,29 @@ https://support.google.com/mail/answer/78755?hl=en To really remove messages in folder "[Gmail]/All Mail", they have to be moved to the "Trash" folder and be deleted from "Trash". +======================================================================= +Q. Can I use the Extension of the SEARCH command: X-GM-RAW described at + https://support.google.com/mail/answer/7190?hl=en + https://developers.google.com/gmail/imap_extensions#extension_of_the_search_command_x-gm-raw + +R. Sure. Example, to search only emails with attachment and in unread state: + +On Unix: + + imapsync ... --search 'X-GM-RAW "has:attachment in:unread"' + +On Windows: + + imapsync.exe ... --search "X-GM-RAW ""has:attachment in:unread""" + +======================================================================= +Q. How to avoid the [IMAP] prefix on Gmail side? +How to stop creating folder with this prefix? +Any switch we can use? e.g. [IMAP]/Archive + +R. No switch in imapsync since [IMAP]/ prefix is done by Gmail, + it might be configurable within Gmail parameters configuration. + ======================================================================= Q. Does imapsync have the capability to do 2 stage authentication? diff --git a/FAQ.d/FAQ.Massive.txt b/FAQ.d/FAQ.Massive.txt index cf2c0a3..30d4a94 100644 --- a/FAQ.d/FAQ.Massive.txt +++ b/FAQ.d/FAQ.Massive.txt @@ -1,5 +1,5 @@ #!/bin/cat -$Id: FAQ.Massive.txt,v 1.8 2016/02/07 17:21:40 gilles Exp gilles $ +$Id: FAQ.Massive.txt,v 1.9 2016/03/25 19:59:45 gilles Exp gilles $ This documentation is also at http://imapsync.lamiral.info/#doc diff --git a/FAQ.d/FAQ.Memory.txt b/FAQ.d/FAQ.Memory.txt new file mode 100644 index 0000000..716c3e8 --- /dev/null +++ b/FAQ.d/FAQ.Memory.txt @@ -0,0 +1,30 @@ +#!/bin/cat +$Id: FAQ.Memory.txt,v 1.3 2016/05/09 13:01:22 gilles Exp gilles $ + +This documentation is also at http://imapsync.lamiral.info/#doc + +============================================ + Imapsync tips about memory issues. +============================================ + + +======================================================================= +Q. I got an "Out of memory" error message then imapsync crashes. + How to fix that? + +R0. Add option --debugmemory to debug memory issues. + +R1. It's probably a very big message on the host1 account. + Before imapsync release 1.688 memory usage is at least 5 times + the biggest message size. then 2 times with release 1.688. + So a 700 MB message will crunch 3.5 GB of memory. + Starting with 1.688 it will crunch 1.4 GB of memory. + + +R2. Usually "Out of memory" errors are related to old days, + to old Mail::IMAPClient module releases, before 3.26. + At that time memory usage was around 17 times the biggest message. + Look at imapsync output first lines to get the Mail::IMAPClient + release used. Then upgrade Mail::IMAPClient Perl module if needed. + +======================================================================= \ No newline at end of file diff --git a/FAQ.d/FAQ.Messages_Selection.txt b/FAQ.d/FAQ.Messages_Selection.txt index 33a4470..d387264 100644 --- a/FAQ.d/FAQ.Messages_Selection.txt +++ b/FAQ.d/FAQ.Messages_Selection.txt @@ -1,5 +1,5 @@ #!/bin/cat -$Id: FAQ.Messages_Selection.txt,v 1.5 2016/02/05 08:22:26 gilles Exp gilles $ +$Id: FAQ.Messages_Selection.txt,v 1.6 2016/04/18 12:45:20 gilles Exp gilles $ This documentation is also at http://imapsync.lamiral.info/#doc @@ -65,12 +65,27 @@ Full explanation: past|----maxage+++++minage---->now (intersection) past|++++minage-----maxage++++>now (union) +C.1 By default, + option --maxage is implemented as a --search SENTSINCE +RFC 3501 says: SENTSINCE +Messages whose [RFC-2822] Date: header (disregarding time and +timezone) is within or later than the specified date. + + Option --minage is implemented as a --search SENTBEFORE +RFC 3501 says: SENTBEFORE +Messages whose [RFC-2822] Date: header (disregarding time and +timezone) is earlier than the specified date. + +If --noabletosearch is on then --minage and --maxage deal +with the internal dates given by a FETCH imap command but +not the Date: header. Internal date is the arrival date +in the mailbox. ======================================================================= Q. I want to sync messages based on their UID. -R. First have in mind that UIDs are uniq only per folder, so work this +R. First have in mind that UIDs are unique only per folder, so work this way only with one folder at a time, with --folder option. To show UIDs, there is the --debugLIST parameter. @@ -91,7 +106,148 @@ UIDs 20000 20002 20004: imapsync ... --search1 'NOT OR OR UID 20000 UID 20002 UID 20004' --folder INBOX -If you search n UIDs then you have to put n-1 OR in the search line. -That's IMAP. +If you search n UIDs then you have to put n-1 OR in the search line, +that's IMAP. + + +======================================================================= +Q. What is the selection criteria available with --search option? + +R. The list of search criteria are listed below, an excerpt from RFC3501. + +http://www.faqs.org/rfcs/rfc3501.html + +6.4.4. SEARCH Command +... + ALL + All messages in the mailbox; the default initial key for + ANDing. + + ANSWERED + Messages with the \Answered flag set. + + BCC + Messages that contain the specified string in the envelope + structure's BCC field. + + BEFORE + Messages whose internal date (disregarding time and timezone) + is earlier than the specified date. + + BODY + Messages that contain the specified string in the body of the + message. + + CC + Messages that contain the specified string in the envelope + structure's CC field. + + DELETED + Messages with the \Deleted flag set. + + DRAFT + Messages with the \Draft flag set. + + FLAGGED + Messages with the \Flagged flag set. + + FROM + Messages that contain the specified string in the envelope + structure's FROM field. + + HEADER + Messages that have a header with the specified field-name (as + defined in [RFC-2822]) and that contains the specified string + in the text of the header (what comes after the colon). If the + string to search is zero-length, this matches all messages that + have a header line with the specified field-name regardless of + the contents. + + KEYWORD + Messages with the specified keyword flag set. + + LARGER + Messages with an [RFC-2822] size larger than the specified + number of octets. + + NEW + Messages that have the \Recent flag set but not the \Seen flag. + This is functionally equivalent to "(RECENT UNSEEN)". + + NOT + Messages that do not match the specified search key. + OLD + Messages that do not have the \Recent flag set. This is + functionally equivalent to "NOT RECENT" (as opposed to "NOT + NEW"). + + ON + Messages whose internal date (disregarding time and timezone) + is within the specified date. + + OR + Messages that match either search key. + + RECENT + Messages that have the \Recent flag set. + + SEEN + Messages that have the \Seen flag set. + + SENTBEFORE + Messages whose [RFC-2822] Date: header (disregarding time and + timezone) is earlier than the specified date. + + SENTON + Messages whose [RFC-2822] Date: header (disregarding time and + timezone) is within the specified date. + + SENTSINCE + Messages whose [RFC-2822] Date: header (disregarding time and + timezone) is within or later than the specified date. + + SINCE + Messages whose internal date (disregarding time and timezone) + is within or later than the specified date. + + SMALLER + Messages with an [RFC-2822] size smaller than the specified + number of octets. + + SUBJECT + Messages that contain the specified string in the envelope + structure's SUBJECT field. + + TEXT + Messages that contain the specified string in the header or + body of the message. + + TO + Messages that contain the specified string in the envelope + structure's TO field. + + UID + Messages with unique identifiers corresponding to the specified + unique identifier set. Sequence set ranges are permitted. + + UNANSWERED + Messages that do not have the \Answered flag set. + + UNDELETED + Messages that do not have the \Deleted flag set. + + UNDRAFT + Messages that do not have the \Draft flag set. + + UNFLAGGED + Messages that do not have the \Flagged flag set. + + UNKEYWORD + Messages that do not have the specified keyword flag set. + + UNSEEN + Messages that do not have the \Seen flag set. + +======================================================================= diff --git a/FAQ.d/FAQ.Passwords_on_Windows.txt b/FAQ.d/FAQ.Passwords_on_Windows.txt new file mode 100644 index 0000000..ac46c33 --- /dev/null +++ b/FAQ.d/FAQ.Passwords_on_Windows.txt @@ -0,0 +1,44 @@ +#!/bin/cat +$Id: FAQ.Passwords_on_Windows.txt,v 1.2 2016/05/10 19:19:16 gilles Exp gilles $ + +This documentation is also at http://imapsync.lamiral.info/#doc + +====================================================== + Imapsync issues with passwords on Windows. +====================================================== + + +http://www.robvanderwoude.com/escapechars.php +http://stackoverflow.com/questions/3288552/how-can-i-escape-an-exclamation-mark-in-cmd-scripts + + +======================================================================= +Q. On Windows, some passwords contain $ characters. Login fails. + +R1. Enclose passwords between "" + + imapsync ... --password1 "zzz$zz$$z" + +R2. Prefix each $ character with a ^ since ^ is the escape character + on Windows + + imapsync ... --password1 zzz^$zz^$^$z + +For a password that is exactly the 8 characters string $%&<>|^" +you have to enter + + imapsync ... --password1 "$%%&<>|^"^" + +======================================================================= +Q. On Windows, some passwords begin with an equal = character. + Login fails. What can I do? + +R. Use twice equals == characters instead; For example, if =secret + is the password then use: + + imapsync ... --password1 ==secret + +or even + + imapsync ... --password1 "==secret" + diff --git a/FAQ.d/FAQ.Security.txt b/FAQ.d/FAQ.Security.txt index 8f857e7..17537a6 100644 --- a/FAQ.d/FAQ.Security.txt +++ b/FAQ.d/FAQ.Security.txt @@ -1,5 +1,5 @@ #!/bin/cat -# $Id: FAQ.Security.txt,v 1.6 2016/02/07 21:49:52 gilles Exp gilles $ +# $Id: FAQ.Security.txt,v 1.9 2016/08/19 17:53:21 gilles Exp gilles $ This documentation is also at http://imapsync.lamiral.info/#doc @@ -64,32 +64,40 @@ b OK 73 good day (Success) The client part to type is "a LOGIN ..." and "b LOGOUT" without the double-quotes. +======================================================================= +Q.How to test a ssl imap connection without imapsync? + +R1.Use openssl command like the following, + an example with imap.gmail.com server: + + openssl s_client -crlf -connect imap.gmail.com:993 + +The previous command is an interactive connection, hit ctrl-c +to finish it. If you want to finish it gently, then use: + + { sleep 2; echo "a logout"; sleep 1; } | openssl s_client -crlf -connect imap.gmail.com:993 ====================================================================== Q. Imapsync used to use SSL_VERIFY_PEER now it uses SSL_VERIFY_NONE. How can I change this back to the more secure SSL_VERIFY_PEER? -R1. In function "sub set_ssl", replace - IO::Socket::SSL::SSL_VERIFY_NONE() -by - IO::Socket::SSL::SSL_VERIFY_PEER() - -R2. After imapsync 1.673, for example +R2. After imapsync 1.673, to set SSL_verify_mode to SSL_VERIFY_PEER on host1 and SSL_verify_mode to SSL_VERIFY_NONE on host2 imapsync ... --ssl1 --ssl2 \ --sslargs1 SSL_verify_mode=1 \ - --sslargs2 SSL_verify_mode=0 \ + --sslargs2 SSL_verify_mode=0 See perldoc IO::Socket::SSL for all possibilities, also at http://search.cpan.org/perldoc?IO%3A%3ASocket%3A%3ASSL -C1. Don't do this manual change in function "sub set_tls", - it won't work by principle, because tls is done AFTER - the application level connexion is established. - +It might be possible you need an extra: + --sslargs1 SSL_ca_file=/etc/ssl/certs/ca-certificates.crt +to help the ssl software verifying the server certificate. +The file ca-certificates.crt may be elsewhere on your system, even +named differently. ======================================================================= Q. How can I manually test a login via ssl? diff --git a/FAQ.d/FAQ.Use_addheader.txt b/FAQ.d/FAQ.Use_addheader.txt new file mode 100644 index 0000000..61bca11 --- /dev/null +++ b/FAQ.d/FAQ.Use_addheader.txt @@ -0,0 +1,30 @@ +#!/bin/cat +$Id: FAQ.Use_addheader.txt,v 1.1 2016/06/01 12:25:56 gilles Exp gilles $ + +This documentation is also at http://imapsync.lamiral.info/#doc + +============================================ + Imapsync --addheader suggestion. +============================================ + +======================================================================= +Q. What means this log message: + "Host1 Sent/1234 ignored (no wanted headers so we ignore this message. + To solve this: use --addheader)" + +R. In order to sync messages from one account to another Imapsync has + to identify messages on both sides, and compare them. + Imapsync can use two completely different methods to identify + messages on each account. + The first one, the default one, uses some headers of messages, + Real world syncs with various imap servers have bring to use + two headers "Message-Id:" and "Received:". It works for most + messages except for special folders like Sent or Draft where + messages in those folders don't have "Message-Id:" nor + "Received:" headers. + Here comes -addheader option. Option --addheader adds + a "Message-Id" header consisting of the imap UID of the message + on the host1 folder, like "Message-Id: 12345@imapsync". + This way, messages are well identified on both sides. + +======================================================================= diff --git a/FAQ.d/FAQ.User_Concurrent_Access.txt b/FAQ.d/FAQ.User_Concurrent_Access.txt new file mode 100644 index 0000000..b5d2e6a --- /dev/null +++ b/FAQ.d/FAQ.User_Concurrent_Access.txt @@ -0,0 +1,35 @@ +#!/bin/cat +$Id: FAQ.User_Concurrent_Access.txt,v 1.1 2016/07/22 00:00:08 gilles Exp gilles $ + +This documentation is also at http://imapsync.lamiral.info/#doc + +======================================= + Imapsync and user concurrent access. +======================================= + +======================================================================= +Q. What happens if a user access the mailbox during the transfer process? + +R. Think all potential problems with a sync between + a master/source/host1 and a slave/destination/host2 + +What happens when a user access syncing accounts depends +on what he does, where he does and when: + +* Reading: no problem anywhere, anytime. + +* Writing at source/host1: + * adding folder => will need a resync after + * deleting folder => deletion not synced unless --delete2folders + * deleting message => deletion not synced unless --delete2 + * adding message => will need a resync + * message flag change => will need a resync + +* Writing at destination/host2: + * adding folder => no problem, unless --delete2folders is used + * deleting folder => might reappear by the sync + * adding message => no problem, unless --delete2 is used + * deleting message => might reappear by the sync + * message flag change => might be canceled by the sync + +======================================================================= diff --git a/FAQ.d/FAQ.XOAUTH2.txt b/FAQ.d/FAQ.XOAUTH2.txt index 16442ce..ba25ffc 100644 --- a/FAQ.d/FAQ.XOAUTH2.txt +++ b/FAQ.d/FAQ.XOAUTH2.txt @@ -1,5 +1,5 @@ #!/bin/cat -$Id: FAQ.XOAUTH2.txt,v 1.9 2016/01/28 14:34:15 gilles Exp gilles $ +$Id: FAQ.XOAUTH2.txt,v 1.11 2016/07/27 23:08:19 gilles Exp gilles $ This documentation is also at http://imapsync.lamiral.info/#doc @@ -14,8 +14,64 @@ Q. Is XOAUTH2 authentication available with imapsync? R. Yes, but XOAUTH2 has been really tested on Unix systems, less profund on Windows but it should work. + Two file formats are available from Gmail: json and pk12. + json is easier to manage than pk12. + +======================================================================= +Q. Imapsync XOAUTH2 fails with the following message, how to fix that? +{ + "error": "unauthorized_client", + "error_description": "Unauthorized client or scope in request." +} + +R. In order to work you also have to allow the service https://mail.google.com/ + in the Google client API manager for OAUTH2. + "Select OAuth 2.0 scopes:" + +======================================================================= +Q. How to use XOAUTH2 via a json file to globally authenticate gmail users? + +R. Unless you use an imapsync binary like imapsync.exe or imapsync_bin_Darwin, + Perl modules needed for xoauth2 are: + + Crypt::OpenSSL::RSA + JSON + JSON::WebToken + LWP + HTML::Entities + Encode::Byte + +A easy way to install or upgrade Perl modules is to use cpanm command, +also called cpanminus. On Linux it is something like + + sudo cpanm JSON::WebToken JSON Crypt::OpenSSL::RSA LWP HTML::Entities Encode::Byte + +The json file patch code and explanation comes from Secretion at +https://github.com/imapsync/imapsync/pull/68 + +Here is a complete example for Gmail. It is a little stupid +since it is the same account as source and destination but +it's just to get the picture for xoauth2 authentication. + +All xoauth2 config is given via the --password1 parameter. +It has the form: + + --password1 secret.xoauth2.json + +where secret.xoauth2.json is the json file given by Gmail. + + +imapsync \ + --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \ + --password1 secret.xoauth2.json --authmech1 XOAUTH2 \ + --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com \ + --password2 secret.xoauth2.json --authmech2 XOAUTH2 \ + --justlogin --debug + +Use your own xoauth2 values. + ======================================================================= -Q. How to use XOAUTH2 to globally authenticate gmail users? +Q. How to use XOAUTH2 via pk12 file to globally authenticate gmail users? R. First, consider the XOAUTH2 feature at a prototype level. @@ -115,7 +171,8 @@ R2. In case you still have to use XOAUTH, here is the method: --password2 secret2 \ --authmech2 XOAUTH -Google Apps is a paid service, but you can try it for 30 days without any cost. +Google Apps is a paid service, but you can try it for 30 days without any cost, +or you could try, time goes on on free trial offers. Some notes about configuring the Google Apps XOAUTH: diff --git a/FAQ.d/htaccess.txt b/FAQ.d/htaccess.txt new file mode 100644 index 0000000..46d7ab8 --- /dev/null +++ b/FAQ.d/htaccess.txt @@ -0,0 +1,31 @@ + +# $Id: htaccess.txt,v 1.10 2016/07/22 00:20:13 gilles Exp gilles $ + +AddDescription "Back to Imapsync main page." .. +AddDescription "Archiving tips." FAQ.Archiving.txt +AddDescription "Connection issues." FAQ.Connection.txt +AddDescription "Contacts & Calendars issues." FAQ.Contacts_Calendars.txt +AddDescription "Dates issues." FAQ.Dates.txt +AddDescription "Domino." FAQ.Domino.txt +AddDescription "Dovecot." FAQ.Dovecot.txt +AddDescription "Duplicated messages issues." FAQ.Duplicates.txt +AddDescription "Emptying an account." FAQ.Emptying.txt +AddDescription "Exchange 20xx and Office365." FAQ.Exchange.txt +AddDescription "Changing folders names." FAQ.Folders_Mapping.txt +AddDescription "Selecting folders." FAQ.Folders_Selection.txt +AddDescription "Flags." FAQ.Flags.txt +AddDescription "Gmail accounts." FAQ.Gmail.txt +AddDescription "ISP tips." FAQ.ISP.txt +AddDescription "Massive/bulk migrations." FAQ.Massive.txt +AddDescription "Memory issues." FAQ.Memory.txt +AddDescription "Password & special characters on Windows." FAQ.Passwords_on_Windows.txt +AddDescription "Selecting messages." FAQ.Messages_Selection.txt +AddDescription "Oracle-UCS." FAQ.Oracle-UCS.txt +AddDescription "Security." FAQ.Security.txt +AddDescription "SmarterMail." FAQ.SmarterMail.txt +AddDescription "User concurrent access." FAQ.User_Concurrent_Access.txt +AddDescription "Why use --addheader?." FAQ.Use_addheader.txt +AddDescription "Various imap server softwares." FAQ.Various_Server_Softwares.txt +AddDescription "XOAUTH2 (Gmail)." FAQ.XOAUTH2.txt +AddDescription "Where this Description column comes from." htaccess.txt + diff --git a/INSTALL.d/INSTALL.Darwin.txt b/INSTALL.d/INSTALL.Darwin.txt index ade5e43..39f5127 100644 --- a/INSTALL.d/INSTALL.Darwin.txt +++ b/INSTALL.d/INSTALL.Darwin.txt @@ -1,11 +1,12 @@ #!/bin/cat -# $Id: INSTALL.Darwin.txt,v 1.11 2016/01/05 23:43:26 gilles Exp gilles $ +# $Id: INSTALL.Darwin.txt,v 1.14 2016/06/22 19:57:00 gilles Exp gilles $ =================================================== = Installing imapsync binary on Darwin / Mac OS X = =================================================== -There is a standalone imapsync binary for Mac OS X called imapsync_bin_Darwin, +There is a standalone imapsync binary for Mac OS X +called "imapsync_bin_Darwin" (without the quotes), available in the compressed tarball called imapsync-1.xxx.tgz where 1.xxx is the version number. I suppose this tarball is put under your $HOME directory, let say /Users/gilles/, but you can @@ -35,7 +36,21 @@ real IMAP server accounts: ./imapsync_bin_Darwin --testslive If this sync works fine then imapsync_bin_Darwin is ready for any -imap account synchronization. +imap account synchronization. + +When reading the documentation with imapsync command lines +examples, you have to replace the command "imapsync" by "imapsync_bin_Darwin" +For example, instead of the command: + + ./imapsync \ + --host1 test1.lamiral.info --user1 test1 --password1 secret1 \ + --host2 test2.lamiral.info --user2 test2 --password2 secret2 + +you have to use: + + ./imapsync_bin_Darwin \ + --host1 test1.lamiral.info --user1 test1 --password1 secret1 \ + --host2 test2.lamiral.info --user2 test2 --password2 secret2 =================================================== @@ -59,6 +74,7 @@ sh prerequisites_imapsync cpanm Authen::NTLM cpanm File::Copy::Recursive IO::Tee cpanm Mail::IMAPClient +cpanm Readonly cpanm Unicode::String wget -c http://imapsync.lamiral.info/imapsync @@ -94,7 +110,6 @@ pp -o imapsync.bin imapsync ./imapsync.bin --module - ========================================== == Installing imapsync Mac OS X Leopard == ========================================== diff --git a/INSTALL.d/INSTALL.Debian.txt b/INSTALL.d/INSTALL.Debian.txt index 0b3cb12..8a347d1 100644 --- a/INSTALL.d/INSTALL.Debian.txt +++ b/INSTALL.d/INSTALL.Debian.txt @@ -1,5 +1,5 @@ #!/bin/cat -# $Id: INSTALL.Debian.txt,v 1.6 2016/01/21 15:10:01 gilles Exp gilles $ +# $Id: INSTALL.Debian.txt,v 1.7 2016/06/22 19:58:32 gilles Exp gilles $ There is one section for Debian 7 and one for Debian 6. @@ -24,6 +24,7 @@ libio-tee-perl \ libmodule-scandeps-perl \ libnet-ssleay-perl \ libpar-packer-perl \ +libreadonly-perl \ libterm-readkey-perl \ libtest-pod-perl \ libtest-simple-perl \ @@ -87,6 +88,7 @@ libio-tee-perl \ libmodule-scandeps-perl \ libnet-ssleay-perl \ libpar-packer-perl \ +libreadonly-perl \ libterm-readkey-perl \ libtest-pod-perl \ libtest-simple-perl \ diff --git a/INSTALL.d/INSTALL.Ubuntu.txt b/INSTALL.d/INSTALL.Ubuntu.txt index 7620f08..38e9781 100644 --- a/INSTALL.d/INSTALL.Ubuntu.txt +++ b/INSTALL.d/INSTALL.Ubuntu.txt @@ -1,5 +1,5 @@ #!/bin/cat -# $Id: INSTALL.Ubuntu.txt,v 1.5 2016/01/21 15:10:01 gilles Exp gilles $ +# $Id: INSTALL.Ubuntu.txt,v 1.7 2016/06/22 19:58:32 gilles Exp gilles $ ================================================= = Installing imapsync on Ubuntu 12.04 or higher = @@ -23,6 +23,7 @@ libio-tee-perl \ libmodule-scandeps-perl \ libnet-ssleay-perl \ libpar-packer-perl \ +libreadonly-perl \ libterm-readkey-perl \ libtest-pod-perl \ libtest-simple-perl \ @@ -35,7 +36,7 @@ because Debian hasn't made it available via a package yet. It also install manually Perl module Mail::IMAPClient because it is good to be up to date: - cpanm Data::Uniqid Mail::IMAPClient + sudo cpanm Data::Uniqid Mail::IMAPClient After installing the dependencies, imapsync should be working. diff --git a/INSTALL.d/prerequisites_imapsync b/INSTALL.d/prerequisites_imapsync index 29a2eea..a79d384 100755 --- a/INSTALL.d/prerequisites_imapsync +++ b/INSTALL.d/prerequisites_imapsync @@ -1,13 +1,13 @@ #!/bin/sh -# $Id: prerequisites_imapsync,v 1.12 2015/07/06 03:12:43 gilles Exp gilles $ +# $Id: prerequisites_imapsync,v 1.16 2016/08/16 16:25:01 gilles Exp gilles $ MODULES_MANDATORY=' -Digest::HMAC_MD5 Authen::NTLM Compress::Zlib Data::Dumper Data::Uniqid +Digest::HMAC_MD5 Digest::HMAC Digest::MD5 File::Copy::Recursive @@ -15,9 +15,12 @@ IO::Socket::INET IO::Socket::INET6 IO::Socket::SSL IO::Tee +JSON::WebToken Mail::IMAPClient Parse::RecDescent +Readonly Term::ReadKey +Test::MockObject Test::More Test::Pod Unicode::String @@ -53,6 +56,7 @@ test_module() { echo "Failure: Not found Perl module $M_tested $@" LIST_TO_INSTALL="$LIST_TO_INSTALL $M_tested" fi + return } test_mandatory_modules() { @@ -79,15 +83,15 @@ search_modules_any() { # no yum, no apt-get { - search_modules_cpan "$@" + search_modules_cpanm "$@" return } } -search_modules_cpan() { +search_modules_cpanm() { cat </dev/null || cat VERSION) +VERSION_PREVIOUS=$(shell perl -I$(IMAPClient) ./dist/imapsync --version 2>/dev/null || echo ERROR) VERSION_EXE=$(shell cat ./VERSION_EXE) HELLO=$(shell date;uname -a) @@ -66,7 +72,7 @@ hello: @echo "$(BIN_NAME)" -all: doc VERSION biz prereq allcritic bin mac imapsync.exe VERSION_EXE +all: doc VERSION biz prereq allcritic bin VERSION_EXE testp : sh INSTALL.d/prerequisites_imapsync @@ -142,7 +148,7 @@ install: testp W/imapsync.1 ci: cidone cidone: - rcsdiff W/*.bat W/*.out W/*.txt W/*.htaccess + rcsdiff W/*.bat W/*.sh W/*.out W/*.txt W/*.htaccess rcsdiff S/*.txt S/*.shtml S/*.html rcsdiff doc/*.t2t rcsdiff INSTALL.d/*.txt INSTALL.d/prerequisites_imapsync @@ -154,12 +160,20 @@ cidone: # Local goals ############### -.PHONY: prereq test tests testp testf test3xx testv3 perlcritic allcritic +.PHONY: prereq test tests testp testf test3xx testv3 perlcritic allcritic compok + +compok: W/.compok + + +W/.compok: imapsync + perl -c imapsync + touch W/.compok prereq: W/prereq.scandeps W/prereq.scandeps: INSTALL.d/prerequisites_imapsync imapsync scandeps -c -x imapsync | tee W/prereq.scandeps + rcsdiff W/prereq.scandeps || { echo 'rcsdiff detected a diff' | ci -l W/prereq.scandeps ; } ./INSTALL.d/prerequisites_imapsync | tee W/prereq.`lsb_release -i -s || echo Unknown` @@ -168,20 +182,20 @@ perlcritic: W/perlcritic_3.out W/perlcritic_2.out allcritic: W/perlcritic_4.out W/perlcritic_3.out W/perlcritic_2.out W/perlcritic_1.out -W/perlcritic_1.out: imapsync - perlcritic -1 imapsync > W/perlcritic_1.out || : +W/perlcritic_1.out: imapsync W/.compok + perlcritic --statistics -1 imapsync > W/perlcritic_1.out || : echo | ci -l W/perlcritic_1.out -W/perlcritic_2.out: imapsync - perlcritic -2 imapsync > W/perlcritic_2.out || : +W/perlcritic_2.out: imapsync W/.compok + perlcritic --statistics -2 imapsync > W/perlcritic_2.out || : echo | ci -l W/perlcritic_2.out -W/perlcritic_3.out: imapsync - perlcritic -3 imapsync > W/perlcritic_3.out || : +W/perlcritic_3.out: imapsync W/.compok + perlcritic --statistics -3 imapsync > W/perlcritic_3.out || : echo | ci -l W/perlcritic_3.out -W/perlcritic_4.out: imapsync - perlcritic -4 imapsync > W/perlcritic_4.out || : +W/perlcritic_4.out: imapsync W/.compok + perlcritic --statistics -4 imapsync > W/perlcritic_4.out || : echo | ci -l W/perlcritic_4.out @@ -218,7 +232,7 @@ copy_win32: W/test.bat: unix2dos W/test.bat scp imapsync W/test.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' -# ssh Admin@c 'perl C:/msys/1.0/home/Admin/imapsync/imapsync --tests_debug' +# ssh Admin@c 'perl C:/msys/1.0/home/Admin/imapsync/imapsync --testsdebug' ssh Admin@c 'perl C:/msys/1.0/home/Admin/imapsync/imapsync --tests' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test.bat' # ssh Admin@c 'tasklist /FI "PID eq 0"' @@ -229,6 +243,15 @@ W/test_tests.bat: unix2dos W/test_tests.bat scp imapsync W/test_tests.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_tests.bat' + ./W/check_winerr test_tests.bat + +W/test_testsdebug.bat: + unix2dos W/test_testsdebug.bat + scp imapsync W/test_testsdebug.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' + ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_testsdebug.bat' + ./W/check_winerr test_testsdebug.bat + + .PHONY: W/*.bat examples/* @@ -271,15 +294,35 @@ W/test3_gmail.bat: scp imapsync W/test3_gmail.bat /g/var/pass/secret.gilles_gmail Admin@c:'C:/msys/1.0/home/Admin/imapsync/' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test3_gmail.bat' -test_exe: +test_exe: W/test_exe.bat + +W/test_exe.bat: unix2dos W/test_exe.bat scp W/test_exe.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat' + ./W/check_winerr test_exe.bat + +W/build_exe.bat: + unix2dos W/build_exe.bat + scp W/build_exe.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' + ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/build_exe.bat' + ./W/check_winerr build_exe.bat + + +W/learn_func.bat: + unix2dos W/learn_func.bat + scp W/learn_func.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' + ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/learn_func.bat' + ./W/check_winerr learn_func.bat + +win32_prereq: W/install_modules.bat -win32_prereq: +W/install_modules.bat: unix2dos W/install_modules.bat scp W/install_modules.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/install_modules.bat' + ./W/check_winerr install_modules.bat + win32_update_ssl: scp W/install_module_ssl.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' @@ -295,24 +338,28 @@ imapsync.exe: imapsync ssh Admin@c 'perl -V' (date "+%s"| tr "\n" " "; echo -n "BEGIN " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME unix2dos W/build_exe.bat W/test_exe.bat W/install_modules.bat - scp W/install_modules.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' - scp imapsync W/build_exe.bat W/test_exe.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' + scp imapsync W/build_exe.bat W/test_exe.bat W/install_modules.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/build_exe.bat' + ./W/check_winerr build_exe.bat ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat' + ./W/check_winerr test_exe.bat rm -f imapsync.exe scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/imapsync.exe' . (date "+%s"| tr "\n" " "; echo -n "END " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME -exe: imapsync W/build_exe.bat dosify_bat +exe: imapsync (date "+%s"| tr "\n" " "; echo -n "BEGIN " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME - scp imapsync W/build_exe.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' + scp imapsync W/build_exe.bat W/install_modules.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/build_exe.bat' - ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/imapsync.exe --modules_version' + ./W/check_winerr build_exe.bat + ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/imapsync.exe --justbanner' rm -f imapsync.exe scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/imapsync.exe' . (date "+%s"| tr "\n" " "; echo -n "END " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME + + zip: dosify_bat rm -rfv ../prepa_zip/imapsync_$(VERSION_EXE)/ mkdir -p ../prepa_zip/imapsync_$(VERSION_EXE)/FAQ.d/ ../prepa_zip/imapsync_$(VERSION_EXE)/Cook/ @@ -329,17 +376,21 @@ zip: dosify_bat # C:\Users\mansour\Desktop\imapsync -.PHONY: mac bin +.PHONY: mac bin win lin mac: imapsync_bin_Darwin -imapsync_bin_Darwin: imapsync +imapsync_bin_Darwin: imapsync W/build_mac.sh INSTALL.d/prerequisites_imapsync rcsdiff imapsync - rsync -p -e 'ssh -p 995' imapsync W/build_mac.sh gilleslamira@gate.polarhome.com: + rsync -p -e 'ssh -p 995' imapsync W/build_mac.sh INSTALL.d/prerequisites_imapsync gilleslamira@gate.polarhome.com: ssh -p 995 gilleslamira@gate.polarhome.com 'sh build_mac.sh' rsync -P -e 'ssh -p 995' gilleslamira@gate.polarhome.com:imapsync_bin_Darwin . -bin: $(BIN_NAME) +bin: lin mac win + +lin: $(BIN_NAME) + +win: imapsync.exe $(BIN_NAME): imapsync rcsdiff imapsync @@ -359,6 +410,7 @@ lfo: upload_lfo tarball: ../prepa_dist/$(DIST_FILE) + ../prepa_dist/$(DIST_FILE): imapsync echo making tarball ../prepa_dist/$(DIST_FILE) rcsdiff RCS/* @@ -373,6 +425,7 @@ tarball: ../prepa_dist/$(DIST_FILE) ls -l ../prepa_dist/$(DIST_FILE) + DIST_PATH := ./dist/ dist: cidone test clean all perlcritic dist_prepa dist_zip README_dist.txt @@ -384,11 +437,17 @@ md5: sha: cd $(DIST_PATH)/ && sha512sum * +.PHONY: moveoldrelease -dist_prepa: tarball +moveoldrelease: + ls -dl dist/imapsync dist/imapsync-$(VERSION_PREVIOUS).tgz dist/imapsync_$(VERSION_PREVIOUS).zip + test -d dist/old_releases/$(VERSION_PREVIOUS) || mkdir dist/old_releases/$(VERSION_PREVIOUS) && cd dist/old_releases/$(VERSION_PREVIOUS) + mv -vf dist/imapsync dist/imapsync-$(VERSION_PREVIOUS).tgz dist/imapsync_$(VERSION_PREVIOUS).zip dist/old_releases/$(VERSION_PREVIOUS) + +dist_prepa: tarball moveoldrelease ln -f ../prepa_dist/$(DIST_FILE) $(DIST_PATH)/ rcsdiff imapsync - cp -a imapsync $(DIST_PATH)/ + cp -a ../prepa_dist/$(DIST_NAME)/imapsync $(DIST_PATH)/ #cd $(DIST_PATH)/ && md5sum $(DIST_FILE) > $(DIST_FILE).md5.txt #cd $(DIST_PATH)/ && md5sum -c $(DIST_FILE).md5.txt ls -l $(DIST_PATH)/ @@ -454,28 +513,37 @@ upload_lfo: /home/gilles/public_html/www.linux-france.org/html/prj/imapsync/.htaccess sh ~/memo/lfo-rsync -valid_index: .valid.index.shtml +valid_index: W/.valid.index.shtml + +cl: ./W/checklink.txt -checklink: index.shtml - checklink -b -q http://lamiral.info/~gilles/imapsync/ +./W/checklink.txt: index.shtml + checklink -b -q http://lamiral.info/~gilles/imapsync/ |tee ./W/checklink.txt -checklinkext: S/news.shtml S/external.shtml S/imapservers.shtml S/template.shtml +cle: ./W/checklinkext.txt + +./W/checklinkext.txt: S/news.shtml S/external.shtml S/imapservers.shtml S/template_xhtml1.shtml checklink -b -q \ - http://lamiral.info/~gilles/imapsync/S/template.shtml \ + http://lamiral.info/~gilles/imapsync/S/template_xhtml1.shtml \ http://lamiral.info/~gilles/imapsync/S/news.shtml \ http://lamiral.info/~gilles/imapsync/S/external.shtml \ - http://lamiral.info/~gilles/imapsync/S/imapservers.shtml - -.valid.index.shtml: index.shtml S/*.shtml + http://lamiral.info/~gilles/imapsync/S/imapservers.shtml \ + | tee ./W/checklinkext.txt + +W/.valid.index.shtml: index.shtml S/*.shtml for f in index.shtml S/*.shtml; do echo tidy -q $$f; tidy -q $$f > /dev/null; done - validate --verbose index.shtml S/*.shtml - touch .valid.index.shtml + ./W/tools/validate_xml_html5 index.shtml S/*.shtml + touch W/.valid.index.shtml + +.PHONY: upload_index upload_FAQ ci_imapsync upload_bin -.PHONY: upload_index upload_FAQ +upload_bin: + rsync -a imapsync.exe imapsync_bin_Darwin imapsync_bin_Linux_i686 imapsync ../imapsync_website/ + rsync -aHvz --delete ../imapsync_website/ root@ks.lamiral.info:/var/www/imapsync/ -upload_index: .valid.index.shtml - rcsdiff index.shtml S/*.shtml FAQ FAQ.d/*.txt INSTALL LICENSE CREDITS TODO W/*.bat examples/*.bat index.shtml INSTALL.d/*.txt imapsync - rsync -avH index.shtml FAQ INSTALL OPTIONS NOLIMIT LICENSE CREDITS TODO imapsync imapsync.exe $(BIN_NAME) imapsync_bin_Darwin ../imapsync_website/ +upload_index: W/.valid.index.shtml + rcsdiff index.shtml S/*.shtml FAQ FAQ.d/*.txt INSTALL LICENSE CREDITS TODO W/*.bat examples/*.bat index.shtml INSTALL.d/*.txt + rsync -avH index.shtml FAQ INSTALL OPTIONS NOLIMIT LICENSE CREDITS TODO ../imapsync_website/ rsync -avH S/ ../imapsync_website/S/ rsync -aHv --delete ./examples/ ../imapsync_website/examples/ rsync -aHv --delete ./INSTALL.d/ ../imapsync_website/INSTALL.d/ @@ -484,6 +552,13 @@ upload_index: .valid.index.shtml rsync -aHvz --delete ../imapsync_website/ root@ks.lamiral.info:/var/www/imapsync/ +ci_imapsync: + rcsdiff imapsync + +upload_latest: ci_imapsync bin + rsync -a imapsync imapsync_bin_Linux_i686 imapsync_bin_Darwin imapsync.exe ../imapsync_website/ + rsync -aHvz --delete ../imapsync_website/ root@ks.lamiral.info:/var/www/imapsync/ + upload_FAQ: rcsdiff FAQ FAQ.d/*.txt INSTALL LICENSE CREDITS TODO INSTALL.d/*.txt rsync -avH FAQ INSTALL OPTIONS CREDITS TODO ../imapsync_website/ @@ -495,7 +570,6 @@ upload_FAQ: upload_ks: ci tarball rsync -aHv $(PUBLIC) ../imapsync_website/ - rsync -aHv $(PUBLIC_W) ../imapsync_website/W/ rsync -aHv --delete ./W/ks.htaccess ../imapsync_website/.htaccess rsync -avH ./S/ ../imapsync_website/S/ rsync -aHv --delete ./dist/ ../imapsync_website/dist/ diff --git a/OPTIONS b/OPTIONS index 08a2dc9..e637ced 100644 --- a/OPTIONS +++ b/OPTIONS @@ -36,8 +36,8 @@ See all possibilities in the new() method of IO::Socket::SSL http://search.cpan.org/perldoc?IO::Socket::SSL#Description_Of_Methods --sslargs2 str : Pass any ssl parameter for host2 ssl or tls connection. - See --sslargs1 - + See --sslargs1 + --timeout1 int : Connection timeout in seconds for host1. Default is 120 and 0 means no timeout at all. --timeout2 int : Connection timeout in seconds for host2. @@ -91,9 +91,9 @@ It does it by adding two --regextrans2 options before all others. Add --debug to see what's really going on. - --automap : guesses folders mapping, for folders like + --automap : guesses folders mapping, for folders like "Sent", "Junk", "Drafts", "All", "Archive", "Flagged". - --f1f2 str1=str2 : Force folder str1 to be synced to str2, + --f1f2 str1=str2 : Force folder str1 to be synced to str2, --f1f2 overrides --automap and --regextrans2. --regextrans2 reg : Apply the whole regex to each destination folders. --regextrans2 reg : and this one. etc. @@ -134,7 +134,7 @@ --pipemess cmd : Apply this cmd command to each message content before the copy. --pipemess cmd : and this one, etc. - + --disarmreadreceipts : Disarms read receipts (host2 Exchange issue) --regexmess reg : Apply the whole regex to each message before transfer. @@ -274,10 +274,10 @@ --host1 test1.lamiral.info --user1 test1 --password1 secret1 \ --host2 test2.lamiral.info --user2 test2 --password2 secret2 -Here is a [linux] system (Linux petite 3.2.0-97-generic #137-Ubuntu SMP Thu Dec 17 21:14:00 UTC 2015 i686) -With perl 5.14.2 Mail::IMAPClient 3.38 -$Id: imapsync,v 1.684 2016/03/17 08:35:03 gilles Exp gilles $ -This current imapsync is up to date +Here is a [linux] system (Linux petite 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:32 UTC 2016 i686) +with Perl 5.18.2 Mail::IMAPClient 3.38 +$Id: imapsync,v 1.727 2016/08/19 10:30:36 gilles Exp gilles $ +This imapsync is up to date Homepage: http://imapsync.lamiral.info/ diff --git a/README b/README index 5e929f9..0a1b132 100644 --- a/README +++ b/README @@ -1,15 +1,17 @@ NAME - imapsync - IMAP synchronisation, sync, copy or migration tool. - Synchronises mailboxes between two imap servers. Good at IMAP migration. - More than 66 different IMAP server softwares supported with success, few + imapsync - Email IMAP tool for syncing, copying and migrating email + mailboxes. + + The imapsync command synchronises mailboxes between two imap servers. + More than 69 different IMAP server softwares supported with success, few failures. - $Revision: 1.684 $ + $Revision: 1.727 $ SYNOPSIS - To synchronize the source imap account - "test1" on server "test1.lamiral.info" with password "secret1" - to the destination imap account + To synchronize the source imap account + "test1" on server "test1.lamiral.info" with password "secret1" + to the destination imap account "test2" on server "test2.lamiral.info" with password "secret2" do: @@ -17,11 +19,16 @@ SYNOPSIS --host1 test1.lamiral.info --user1 test1 --password1 secret1 \ --host2 test2.lamiral.info --user2 test2 --password2 secret2 +REQUIRED ARGUMENTS + The required argmuments are the six values, three on each sides, needed + to login into the IMAP servers, a host, a username, and a password, two + times. + INSTALL Imapsync works under any Unix with perl. - Imapsync works under Windows (2000, XP, Vista, Seven) + Imapsync works under Windows (2000, XP, Vista, Seven) as a standalone binary software called imapsync.exe - Imapsync works under OS X as a standalone binary + Imapsync works under OS X as a standalone binary software called imapsync_bin_Darwin. Purchase latest imapsync at @@ -35,11 +42,15 @@ INSTALL Go into the directory imapsync-x.xx and read the INSTALL file. As mentioned at http://imapsync.lamiral.info/#install - the INSTALL file can also be found at + the INSTALL file can also be found at http://imapsync.lamiral.info/INSTALL It is now split in several files for each system http://imapsync.lamiral.info/INSTALL.d/ +CONFIGURATION + There is no specific configuration file for imapsync, everything is + specified by the command line parameteres and the default behavior. + USAGE To get a description of each option just run imapsync with no argument, like this: @@ -50,16 +61,16 @@ USAGE http://imapsync.lamiral.info/OPTIONS and is reproduced here: usage: ./imapsync [options] - - Several options are mandatory. + + Several options are mandatory. str means string int means integer reg means regular expression cmd means command - - --dry : Makes imapsync doing nothing, just print what would + + --dry : Makes imapsync doing nothing, just print what would be done without --dry. - + --host1 str : Source or "from" imap server. Mandatory. --port1 int : Port to connect on host1. Default is 143, 993 if --ssl1 --user1 str : User to login on host1. Mandatory. @@ -70,12 +81,12 @@ USAGE --port2 int : Port to connect on host2. Default is 143, 993 if --ssl2 --user2 str : User to login on host2. Mandatory. --password2 str : Password for the user2. - - --passfile1 str : Password file for the user1. It must contain the + + --passfile1 str : Password file for the user1. It must contain the password on the first line. This option avoids to show the password on the command line like --password1 does. --passfile2 str : Password file for the user2. Contains the password. - + --ssl1 : Use a SSL connection on host1. --ssl2 : Use a SSL connection on host2. --tls1 : Use a TLS connection on host1. @@ -86,45 +97,45 @@ USAGE See all possibilities in the new() method of IO::Socket::SSL http://search.cpan.org/perldoc?IO::Socket::SSL#Description_Of_Methods --sslargs2 str : Pass any ssl parameter for host2 ssl or tls connection. - See --sslargs1 - - --timeout1 int : Connection timeout in seconds for host1. + See --sslargs1 + + --timeout1 int : Connection timeout in seconds for host1. Default is 120 and 0 means no timeout at all. - --timeout2 int : Connection timeout in seconds for host2. + --timeout2 int : Connection timeout in seconds for host2. Default is 120 and 0 means no timeout at all. - + --authmech1 str : Auth mechanism to use with host1: PLAIN, LOGIN, CRAM-MD5 etc. Use UPPERCASE. --authmech2 str : Auth mechanism to use with host2. See --authmech1 - --authuser1 str : User to auth with on host1 (admin user). + --authuser1 str : User to auth with on host1 (admin user). Avoid using --authmech1 SOMETHING with --authuser1. --authuser2 str : User to auth with on host2 (admin user). --proxyauth1 : Use proxyauth on host1. Requires --authuser1. Required by Sun/iPlanet/Netscape IMAP servers to be able to use an administrative user. --proxyauth2 : Use proxyauth on host2. Requires --authuser2. - + --authmd51 : Use MD5 authentification for host1. --authmd52 : Use MD5 authentification for host2. --domain1 str : Domain on host1 (NTLM authentication). --domain2 str : Domain on host2 (NTLM authentication). - - + + --folder str : Sync this folder. --folder str : and this one, etc. --folderrec str : Sync this folder recursively. --folderrec str : and this one, etc. - + --folderfirst str : Sync this folder first. --folderfirst "Work" --folderfirst str : then this one, etc. --folderlast str : Sync this folder last. --folderlast "[Gmail]/All Mail" --folderlast str : then this one, etc. - + --nomixfolders : Do not merge folders when host1 is case sensitive while host2 is not (like Exchange). Only the first similar folder is synced (ex: Sent SENT sent -> Sent). - + --skipemptyfolders : Empty host1 folders are not created on host2. --f1f2 str1=str2 : Force folder str1 to be synced to str2. @@ -136,12 +147,12 @@ USAGE Several folders to avoid: --exclude 'fold1|fold2|f3' skips fold1, fold2 and f3. --exclude reg : or this one, etc. - - --subfolder2 str : Move whole host1 folders hierarchy under this + + --subfolder2 str : Move whole host1 folders hierarchy under this host2 folder str . It does it by adding two --regextrans2 options before all others. Add --debug to see what's really going on. - + --regextrans2 reg : Apply the whole regex to each destination folders. --regextrans2 reg : and this one. etc. When you play with the --regextrans2 option, first @@ -149,21 +160,21 @@ USAGE Then, when happy, remove --dry, remove --justfolders. Have in mind that --regextrans2 is applied after prefix and separator inversion. - + --tmpdir str : Where to store temporary files and subdirectories. Will be created if it doesn't exist. Default is system specific, Unix is /tmp but it's often small and deleted at reboot. --tmpdir /var/tmp should be better. --pidfile str : The file where imapsync pid is written. - --pidfilelocking : Abort if pidfile already exists. Usefull to avoid + --pidfilelocking : Abort if pidfile already exists. Usefull to avoid concurrent transfers on the same mailbox. - + --nolog : Turn off logging on file --logfile str : Change the default log filename (can be dirname/filename). --logdir str : Change the default log directory. Default is LOG_imapsync - --prefix1 str : Remove prefix to all destination folders + --prefix1 str : Remove prefix to all destination folders (usually INBOX. or INBOX/ or an empty string "") you have to use --prefix1 if host1 imap server does not have NAMESPACE capability, so imapsync @@ -171,16 +182,16 @@ USAGE --prefix2 str : Add prefix to all host2 folders. See --prefix1 --sep1 str : Host1 separator in case NAMESPACE is not supported. --sep2 str : Host2 separator in case NAMESPACE is not supported. - + --skipmess reg : Skips messages maching the regex. Example: 'm/[\x80-ff]/' # to avoid 8bits messages. --skipmess is applied before --regexmess --skipmess reg : or this one, etc. - --pipemess cmd : Apply this cmd command to each message content + --pipemess cmd : Apply this cmd command to each message content before the copy. --pipemess cmd : and this one, etc. - + --disarmreadreceipts : Disarms read receipts (host2 Exchange issue) --regexmess reg : Apply the whole regex to each message before transfer. @@ -190,20 +201,20 @@ USAGE --regexflag reg : Apply the whole regex to each flags list. Example: 's/"Junk"//g' # to remove "Junk" flag. --regexflag reg : and this one, etc. - - --delete : Deletes messages on host1 server after a successful - transfer. Option --delete has the following behavior: - it marks messages as deleted with the IMAP flag - \Deleted, then messages are really deleted with an + + --delete : Deletes messages on host1 server after a successful + transfer. Option --delete has the following behavior: + it marks messages as deleted with the IMAP flag + \Deleted, then messages are really deleted with an EXPUNGE IMAP command. --delete2 : Delete messages in host2 that are not in host1 server. Useful for backup or pre-sync. --delete2duplicates : Delete messages in host2 that are duplicates. - Works only without --useuid since duplicates are + Works only without --useuid since duplicates are detected with an header part of each message. - --delete2folders : Delete folders in host2 that are not in host1 server. + --delete2folders : Delete folders in host2 that are not in host1 server. For safety, first try it like this (it is safe): --delete2folders --dry --justfolders --nofoldersizes --delete2foldersonly reg : Deleted only folders matching regex. @@ -212,8 +223,8 @@ USAGE Example: --delete2foldersbutnot "/Tasks$|Contacts$|Foo$/" --noexpunge : Do not expunge messages on host1. Expunge really deletes messages marked deleted. - Expunge is made at the beginning, on host1 only. - Newly transferred messages are also expunged if + Expunge is made at the beginning, on host1 only. + Newly transferred messages are also expunged if option --delete is given. No expunge is done on host2 account (unless --expunge2) --expunge1 : Expunge messages on host1 after messages transfer. @@ -221,13 +232,13 @@ USAGE --uidexpunge2 : uidexpunge messages on the host2 account that are not on the host1 account, requires --delete2 --nomixfolders : Avoid merging folders that are considered different on - host1 but the same on destination host2 because of + host1 but the same on destination host2 because of case sensitivities and insensitivities. - + --syncinternaldates : Sets the internal dates on host2 same as host1. Turned on by default. Internal date is the date a message arrived on a host (mtime). - --idatefromheader : Sets the internal dates on host2 same as the + --idatefromheader : Sets the internal dates on host2 same as the "Date:" headers. --maxsize int : Skip messages larger (or equal) than int bytes @@ -242,48 +253,48 @@ USAGE past|+++++++++++++++minage---->now past|----maxage+++++minage---->now (intersection) past|++++minage-----maxage++++>now (union) - - --search str : Selects only messages returned by this IMAP SEARCH + + --search str : Selects only messages returned by this IMAP SEARCH command. Applied on both sides. --search1 str : Same as --search for selecting host1 messages only. --search2 str : Same as --search for selecting host2 messages only. --search CRIT equals --search1 CRIT --search2 CRIT - + --exitwhenover int : Stop syncing when total bytes transferred reached. - Gmail per day allows + Gmail per day allows 2500000000 = 2.5 GB downloaded from Gmail as host2 500000000 = 500 MB uploaded to Gmail as host1. - + --maxlinelength int : skip messages with a line length longer than int bytes. RFC 2822 says it must be no more than 1000 bytes. --useheader str : Use this header to compare messages on both sides. Ex: Message-ID or Subject or Date. --useheader str and this one, etc. - + --subscribed : Transfers subscribed folders. - --subscribe : Subscribe to the folders transferred on the + --subscribe : Subscribe to the folders transferred on the host2 that are subscribed on host1. On by default. - --subscribeall : Subscribe to the folders transferred on the + --subscribeall : Subscribe to the folders transferred on the host2 even if they are not subscribed on host1. - + --nofoldersizes : Do not calculate the size of each folder in bytes and message counts. Default is to calculate them. --nofoldersizesatend: Do not calculate the size of each folder in bytes and message counts at the end. Default is on. --justfoldersizes : Exit after having printed the folder sizes. - + --syncacls : Synchronises acls (Access Control Lists). --nosyncacls : Does not synchronize acls. This is the default. Acls in IMAP are not standardized, be careful. - + --usecache : Use cache to speedup. --nousecache : Do not use cache. Caveat: --useuid --nousecache creates duplicates on multiple runs. - --useuid : Use uid instead of header as a criterium to recognize - messages. Option --usecache is then implied unless - --nousecache is used. - + --useuid : Use uid instead of header as a criterium to recognize + messages. Option --usecache is then implied unless + --nousecache is used. + --debug : Debug mode. --debugfolders : Debug mode for the folders part only. --debugcontent : Debug content of the messages transfered. Huge ouput. @@ -296,7 +307,7 @@ USAGE --errorsmax int : Exit when int number of errors is reached. Default is 50. --tests : Run local non-regression tests. Exit code 0 means all ok. - --testslive : Run a live test with test1.lamiral.info imap server. + --testslive : Run a live test with test1.lamiral.info imap server. Useful to check the basics. Needs internet connexion. --version : Print only software version. @@ -305,19 +316,19 @@ USAGE --noid : Do not send/receive ID command to imap servers. --justconnect : Just connect to both servers and print useful information. Need only --host1 and --host2 options. - --justlogin : Just login to both host1 and host2 with users + --justlogin : Just login to both host1 and host2 with users credentials, then exit. --justfolders : Do only things about folders (ignore messages). --help : print this help. - Example: - To synchronize the source imap account - "test1" on server "test1.lamiral.info" with password "secret1" - to the destination imap account + Example: + To synchronize the source imap account + "test1" on server "test1.lamiral.info" with password "secret1" + to the destination imap account "test2" on server "test2.lamiral.info" with password "secret2" do: - + imapsync \ --host1 test1.lamiral.info --user1 test1 --password1 secret1 \ --host2 test2.lamiral.info --user2 test2 --password2 secret2 @@ -365,6 +376,8 @@ OPTIONS imapsync + or read the previous section named USAGE, + or read http://imapsync.lamiral.info/OPTIONS HISTORY @@ -429,15 +442,21 @@ EXIT STATUS So if you have an unreliable internet connection, you can use this loop in a Bourne shell: - while ! imapsync ...; do + while ! imapsync ...; do echo imapsync not complete done -LICENSE +LICENSE AND COPYRIGHT imapsync is free, open, public but not always gratis software cover by the NOLIMIT Public License. See the LICENSE file included in the distribution or just read this simple sentence as it is the licence - text: No limit to do anything with this work and this license. + text: + + "No limit to do anything with this work and this license." + + In case it is not long enough I repeat: + + "No limit to do anything with this work and this license." MAILING-LIST The public mailing-list may be the best way to get free support. @@ -473,13 +492,13 @@ AUTHOR good way to stay maintening and supporting free open public softwares (see the license) over decades. -BUG REPORT GUIDELINES +BUGS AND LIMITATIONS Help me to help you: follow the following guidelines. Report any bugs or feature requests to the public mailing-list or to the author. - Before reporting bugs, read the FAQ, the README and the TODO files. + Before reporting bugs, read the FAQs, the README and the TODO files. http://imapsync.lamiral.info/ Upgrade to last imapsync release, maybe the bug is already fixed. @@ -498,23 +517,23 @@ BUG REPORT GUIDELINES - imapsync version. - output near the first failures, a few lines before is good to get the context - of the issue. First failures messages are often more significant than - the last ones. - - - if the issue is always related to the same messages, include the output + of the issue. First failures messages are often more significant than + the last ones. + + - if the issue is always related to the same messages, include the output with --debug --debugimap, near the failure point. For example, - Isolate a buggy message or two in a folder 'BUG' and use + Isolate a buggy message or two in a folder 'BUG' and use - imapsync ... --folder 'BUG' --debug --debugimap + imapsync ... --folder 'BUG' --debug --debugimap - imap server softwares on both sides and their version number. - imapsync with all the options you use, the full command line - you use (except the passwords of course). + you use (except the passwords of course). - IMAPClient.pm version. - - the run context. Do you run imapsync.exe, a unix binary + - the run context. Do you run imapsync.exe, a unix binary or the perl script imapsync. - operating system running imapsync. @@ -554,7 +573,7 @@ HUGE MIGRATION On Unix the shell program can be: - { while IFS=';' read u1 p1 u2 p2; do + { while IFS=';' read u1 p1 u2 p2; do imapsync --host1 imap.side1.org --user1 "$u1" --password1 "$p1" \ --host2 imap.side2.org --user2 "$u2" --password2 "$p2" ... done ; } < file.txt @@ -571,10 +590,10 @@ HUGE MIGRATION You will find already written scripts at http://imapsync.lamiral.info/examples/ -Hacking +HACKING Feel free to hack imapsync as the NOLIMIT license permits it. -Links +LINKS Entries for imapsync: https://web.archive.org/web/20070202005121/http://www.imap.org/products/ showall.php @@ -598,5 +617,5 @@ SIMILAR SOFTWARES Feedback (good or bad) will often be welcome. - $Id: imapsync,v 1.684 2016/03/17 08:35:03 gilles Exp gilles $ + $Id: imapsync,v 1.727 2016/08/19 10:30:36 gilles Exp gilles $ diff --git a/S/S b/S/S new file mode 120000 index 0000000..945c9b4 --- /dev/null +++ b/S/S @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/S/bc-payment.html b/S/bc-payment.html index 5a59931..d1eaa34 100755 --- a/S/bc-payment.html +++ b/S/bc-payment.html @@ -1,11 +1,13 @@ - + -Pay with bitcoins - +Pay with bitcoins + + + diff --git a/S/external.shtml b/S/external.shtml index 7d08d84..25cdaac 100755 --- a/S/external.shtml +++ b/S/external.shtml @@ -42,6 +42,8 @@ http://freecode.com/projects/imap-repl/
  • imapcopy (Pascal): http://home.arcor.de/armin.diehl/imapcopy/imapcopy.html
  • imapcopy (Java): https://code.google.com/p/imapcopy/
  • + +
  • imapsize: http://www.broobles.com/imapsize/
  • migrationtool: http://sourceforge.net/projects/migrationtool/
  • imapmigrate: http://sourceforge.net/projects/cyrus-utils/
  • larch: https://github.com/rgrove/larch (derived from wonko_imapsync, good at Gmail)
  • @@ -98,7 +100,7 @@ alt="Viewable With Any Browser" /> This document last modified on -($Id: external.shtml,v 1.6 2016/03/03 22:36:57 gilles Exp gilles $)
    +($Id: external.shtml,v 1.7 2016/03/19 22:05:24 gilles Exp gilles $)
    Top of the page

    diff --git a/S/fb-like.html b/S/fb-like.html old mode 100755 new mode 100644 index a6cfbf1..97b326e --- a/S/fb-like.html +++ b/S/fb-like.html @@ -1,3 +1,8 @@ + + +
    + +
    Imapsync list of imap server softwares supported (and the failures one) - - - + + + @@ -29,23 +29,25 @@

    Let's start with the long reported success stories list: -66 different imap server softwares supported!
    +67 different imap server softwares supported!
    [host1] means "source server" and [host2] means "destination server":

    Please report to the author (gilles.lamiral@laposte.net) any success or bad story with -imapsync and do not forget to mention the IMAP server +imapsync and, if you know them, mention the IMAP server software names and version on both sides. This will help -future users. To help the author maintaining this section -report the two lines at the begining of the output if they -are useful to know the softwares. Example: +future users. You can grab these values, software name and release number, +by looking at two lines at the beginning of the output. Example:

    +
    - Host1 software:* OK louloutte Cyrus IMAP4 v1.5.19 server ready
    - Host2 software:* OK Courier-IMAP ready
    + ...
    + Host1 banner:* OK louloutte Cyrus IMAP4 v1.5.19 server ready
    + Host2 banner:* OK Courier-IMAP ready
     
    +

    You can use option --justconnect to get those lines. -Examples:

    +Examples (really working)):

       imapsync --host1 test1.lamiral.info --host2 test2.lamiral.info --justconnect
     
    @@ -76,13 +78,14 @@ Examples:

    (http://cyrusimap.web.cmu.edu/)
  • David Tobit V8. (http://de.tobit.com/)
  • +
  • David.fx Mail Access Server MA-12.00a (0188) [host1]
  • DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL). 2.0.7 seems buggy. (http://www.dbmail.org/)
  • DBOX 2.41 System [host1] (http://www.dbox.handshake.de/).
  • Deerfield VisNetic MailServer 5.8.6 [host1] (http://www.deerfield.net/products/visnetic-mailserver/)
  • dkimap4 [host1]
  • -
  • Domino (Notes) 4.61[host1], 6.5, 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1, 7.0.1[host1], 8.0.1[host1] +
  • Domino (IBM Notes) 4.61[host1], 6.5, 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1, 7.0.1[host1], 8.0.1[host1] (http://www-03.ibm.com/software/products/en/ibmnotes)
  • Dovecot 0.99.10.4, 0.99.14, 0.99.14-8.fc4, 1.0-0.beta2.7, 1.0.0 [dest/source] (LGPL) (http://www.dovecot.org/) (http://www.dovecot.org/)
  • @@ -91,7 +94,8 @@ Examples:

    6.5.7638.1 [host2], 6.5 [host1], Exchange 2007 SP1 (with Update Rollup 2), Exchange2007-EP-SP2, Exchange 2010 RTM (Release to Manufacturing) [host2], - Exchange 2010 SP1 RU2 [host2] + Exchange 2010 SP1 RU2 [host2], + Exchange 2010 SP3 [host2], (http://www.microsoft.com/exchange/)
  • FirtClass 12 [host1] hard so read the FAQ! (http://www.firstclass.com/)
  • @@ -105,8 +109,9 @@ Examples:

  • hMailServer 5.40-B1950 [host12], 5.3.3 [host2], 4.4.1 [host1], 5.3.2-B1769 [host2], 5.6 [host2] (https://www.hmailserver.com/)
  • Hotmail hotmail.com is outlook.com and live.com now.
  • -
  • IceWarp 10.4.5 [host1] 11.2.1.1 [host2] (https://www.icewarp.com/)
  • -
  • iPlanet Messaging server 4.15, 5.1, 5.2 +
  • IceWarp 10.4.5 [host1] 11.2.1.1 [host2] 11.4.1.0 [host2] (https://www.icewarp.com/)
  • +
  • IdeaImapServer v0.80.1 [host1]
  • +
  • iPlanet Messaging server 4.15, 5.1, 5.2 (http://en.wikipedia.org/wiki/Oracle_Communications_Messaging_Server)
  • IMail 7.15 (Ipswitch/Win2003), 8.12, 11.03 [host1] (http://www.imailserver.com/)
  • Kerio 7.2.0P1 [host1] (http://www.kerio.com/)
  • @@ -135,7 +140,7 @@ Examples:

  • RackSpace hoster secure.emailsrvr.com:993 http://www.rackspace.com/)
  • QQMail IMAP4Server [host1] [host2] (See FAQ) https://en.mail.qq.com/
  • Samsung Contact IMAP server 8.5.0
  • -
  • Scalix v10.1, 10.0.1.3, 11.0.0.431, 11.4.6 (http://www.scalix.com/)
  • +
  • Scalix v10.1, 10.0.1.3, 11.0.0.431, 11.4.5, 11.4.6 (http://www.scalix.com/)
  • Sendmail Mail Store IMAP4rev1 (5.5.6/mstore-5-5-build-1874 [host1].
  • SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1], SmarterMail Professional 10.2 [host1], Smarter Mail 11.7 [host1][host2]. @@ -203,7 +208,7 @@ alt="Viewable With Any Browser" /> This document last modified on -($Id: imapservers.shtml,v 1.10 2016/03/03 22:36:57 gilles Exp gilles $)
    +($Id: imapservers.shtml,v 1.15 2016/06/13 22:52:46 gilles Exp gilles $)
    Top of the page

    diff --git a/S/imapsync_sold_by_country.txt b/S/imapsync_sold_by_country.txt index 85dc57d..5b4b9b1 100644 --- a/S/imapsync_sold_by_country.txt +++ b/S/imapsync_sold_by_country.txt @@ -1,83 +1,86 @@ -1156 Etats-Unis_d'Amerique___ 25.47 % 25.47 % 1 -832 Allemagne_______________ 18.33 % 43.81 % 2 -427 Royaume-Uni_____________ 9.41 % 53.22 % 3 -220 Italie__________________ 4.85 % 58.07 % 4 -219 France__________________ 4.83 % 62.89 % 5 -202 Canada__________________ 4.45 % 67.34 % 6 -184 Suisse__________________ 4.05 % 71.40 % 7 -160 Pays-Bas________________ 3.53 % 74.92 % 8 -158 Australie_______________ 3.48 % 78.40 % 9 -92 Autriche________________ 2.03 % 80.43 % 10 -83 Espagne_________________ 1.83 % 82.26 % 11 -83 Belgique________________ 1.83 % 84.09 % 12 -65 Suede___________________ 1.43 % 85.52 % 13 -56 Danemark________________ 1.23 % 86.76 % 14 -48 Bresil__________________ 1.06 % 87.81 % 15 -41 Norvege_________________ 0.90 % 88.72 % 16 -31 Pologne_________________ 0.68 % 89.40 % 17 -31 Finlande________________ 0.68 % 90.08 % 18 -26 Japon___________________ 0.57 % 90.66 % 19 -25 Republique_tcheque______ 0.55 % 91.21 % 20 -25 ________________________ 0.55 % 91.76 % 21 -23 Irlande_________________ 0.51 % 92.27 % 22 -22 Russie__________________ 0.48 % 92.75 % 23 -21 Nouvelle-Zelande________ 0.46 % 93.21 % 24 -20 Hongrie_________________ 0.44 % 93.65 % 25 -16 Hong-Kong_______________ 0.35 % 94.01 % 26 -15 Portugal________________ 0.33 % 94.34 % 27 -15 Afrique_du_Sud__________ 0.33 % 94.67 % 28 -13 Slovaquie_______________ 0.29 % 94.95 % 29 -13 Malaisie________________ 0.29 % 95.24 % 30 -13 Luxembourg______________ 0.29 % 95.53 % 31 -13 Grece___________________ 0.29 % 95.81 % 32 -12 Inde____________________ 0.26 % 96.08 % 33 -12 Argentine_______________ 0.26 % 96.34 % 34 -11 Singapour_______________ 0.24 % 96.58 % 35 -11 Israel__________________ 0.24 % 96.83 % 36 -11 Chine___________________ 0.24 % 97.07 % 37 -11 Chili___________________ 0.24 % 97.31 % 38 -10 Roumanie________________ 0.22 % 97.53 % 39 -10 Mexique_________________ 0.22 % 97.75 % 40 -8 Slovenie________________ 0.18 % 97.93 % 41 -8 Emirats_Arabes_Unis_____ 0.18 % 98.10 % 42 -7 Lettonie________________ 0.15 % 98.26 % 43 -5 Thailande_______________ 0.11 % 98.37 % 44 -5 Malte___________________ 0.11 % 98.48 % 45 -5 Islande_________________ 0.11 % 98.59 % 46 -4 Turquie_________________ 0.09 % 98.68 % 47 -4 Indonesie_______________ 0.09 % 98.77 % 48 -4 Egypte__________________ 0.09 % 98.85 % 49 -4 Croatie_________________ 0.09 % 98.94 % 50 -4 Bulgarie________________ 0.09 % 99.03 % 51 -3 Venezuela_______________ 0.07 % 99.10 % 52 -3 Serbie__________________ 0.07 % 99.16 % 53 -3 Philippines_____________ 0.07 % 99.23 % 54 -3 Estonie_________________ 0.07 % 99.29 % 55 -2 Vietnam_________________ 0.04 % 99.34 % 56 -2 Uruguay_________________ 0.04 % 99.38 % 57 -2 Lituanie________________ 0.04 % 99.43 % 58 -2 Costa_Rica______________ 0.04 % 99.47 % 59 -2 Chypre__________________ 0.04 % 99.52 % 60 -1 Ukraine_________________ 0.02 % 99.54 % 61 -1 Trinite-et-Tobago_______ 0.02 % 99.56 % 62 -1 Tanzanie________________ 0.02 % 99.58 % 63 -1 Taiwan__________________ 0.02 % 99.60 % 64 -1 Senegal_________________ 0.02 % 99.63 % 65 -1 Saint_Christophe-Nevis-Anguilla__ 0.02 % 99.65 % 66 -1 Qatar___________________ 0.02 % 99.67 % 67 -1 Perou___________________ 0.02 % 99.69 % 68 -1 Panama__________________ 0.02 % 99.71 % 69 -1 Nouvelle-Caledonie______ 0.02 % 99.74 % 70 -1 Nigeria_________________ 0.02 % 99.76 % 71 -1 Namibie_________________ 0.02 % 99.78 % 72 -1 Mongolie________________ 0.02 % 99.80 % 73 -1 Moldavie________________ 0.02 % 99.82 % 74 -1 Maldives________________ 0.02 % 99.85 % 75 -1 Îles_Vierges_britanniques__ 0.02 % 99.87 % 76 -1 Koweit__________________ 0.02 % 99.89 % 77 -1 Jordanie________________ 0.02 % 99.91 % 78 -1 Colombie________________ 0.02 % 99.93 % 79 -1 Cameroun________________ 0.02 % 99.96 % 80 -1 Bahrein_________________ 0.02 % 99.98 % 81 -1 Antilles_neerlandaises__ 0.02 % 100.00 % 82 -TOTAL = 4538 sales over 82 countries on Thu Mar 17 09:36:49 CET 2016 +1225 Etats-Unis______________ 24.84 % 25 % 1 +918 Allemagne_______________ 18.62 % 43 % 2 +454 Royaume-Uni_____________ 9.21 % 53 % 3 +253 Italie__________________ 5.13 % 58 % 4 +243 France__________________ 4.93 % 63 % 5 +219 Canada__________________ 4.44 % 67 % 6 +199 Suisse__________________ 4.04 % 71 % 7 +183 Pays-Bas________________ 3.71 % 75 % 8 +172 Australie_______________ 3.49 % 78 % 9 +98 Autriche________________ 1.99 % 80 % 10 +91 Espagne_________________ 1.85 % 82 % 11 +88 Belgique________________ 1.78 % 84 % 12 +71 Suede___________________ 1.44 % 85 % 13 +58 Danemark________________ 1.18 % 87 % 14 +51 Bresil__________________ 1.03 % 88 % 15 +43 Norvege_________________ 0.87 % 89 % 16 +36 Pologne_________________ 0.73 % 89 % 17 +33 Finlande________________ 0.67 % 90 % 18 +28 Republique_tcheque______ 0.57 % 91 % 19 +26 Russie__________________ 0.53 % 91 % 20 +26 Japon___________________ 0.53 % 92 % 21 +25 ________________________ 0.51 % 92 % 22 +23 Nouvelle-Zelande________ 0.47 % 93 % 23 +23 Irlande_________________ 0.47 % 93 % 24 +23 Hongrie_________________ 0.47 % 93 % 25 +19 Portugal________________ 0.39 % 94 % 26 +18 Hong-Kong_______________ 0.37 % 94 % 27 +18 Grece___________________ 0.37 % 95 % 28 +18 Afrique_du_Sud__________ 0.37 % 95 % 29 +14 Slovaquie_______________ 0.28 % 95 % 30 +14 Malaisie________________ 0.28 % 96 % 31 +13 Luxembourg______________ 0.26 % 96 % 32 +13 Inde____________________ 0.26 % 96 % 33 +12 Singapour_______________ 0.24 % 96 % 34 +12 Mexique_________________ 0.24 % 97 % 35 +12 Argentine_______________ 0.24 % 97 % 36 +11 Israel__________________ 0.22 % 97 % 37 +11 Chine___________________ 0.22 % 97 % 38 +11 Chili___________________ 0.22 % 97 % 39 +10 Roumanie________________ 0.20 % 98 % 40 +9 Slovenie________________ 0.18 % 98 % 41 +9 Lettonie________________ 0.18 % 98 % 42 +9 Emirats_Arabes_Unis_____ 0.18 % 98 % 43 +7 Croatie_________________ 0.14 % 98 % 44 +6 Thailande_______________ 0.12 % 98 % 45 +5 Malte___________________ 0.10 % 99 % 46 +5 Islande_________________ 0.10 % 99 % 47 +4 Turquie_________________ 0.08 % 99 % 48 +4 Indonesie_______________ 0.08 % 99 % 49 +4 Estonie_________________ 0.08 % 99 % 50 +4 Egypte__________________ 0.08 % 99 % 51 +4 Bulgarie________________ 0.08 % 99 % 52 +3 Venezuela_______________ 0.06 % 99 % 53 +3 Serbie__________________ 0.06 % 99 % 54 +3 Philippines_____________ 0.06 % 99 % 55 +2 Vietnam_________________ 0.04 % 99 % 56 +2 Uruguay_________________ 0.04 % 99 % 57 +2 Perou___________________ 0.04 % 99 % 58 +2 Lituanie________________ 0.04 % 99 % 59 +2 Costa_Rica______________ 0.04 % 99 % 60 +2 Chypre__________________ 0.04 % 99 % 61 +2 Antilles_neerlandaises__ 0.04 % 100 % 62 +1 Ukraine_________________ 0.02 % 100 % 63 +1 Trinite-et-Tobago_______ 0.02 % 100 % 64 +1 Tanzanie________________ 0.02 % 100 % 65 +1 Taiwan__________________ 0.02 % 100 % 66 +1 Senegal_________________ 0.02 % 100 % 67 +1 Saint_Christophe-Nevis-Anguilla__ 0.02 % 100 % 68 +1 Qatar___________________ 0.02 % 100 % 69 +1 Panama__________________ 0.02 % 100 % 70 +1 Nouvelle-Caledonie______ 0.02 % 100 % 71 +1 Nigeria_________________ 0.02 % 100 % 72 +1 Namibie_________________ 0.02 % 100 % 73 +1 Mongolie________________ 0.02 % 100 % 74 +1 Moldavie________________ 0.02 % 100 % 75 +1 Maldives________________ 0.02 % 100 % 76 +1 Koweit__________________ 0.02 % 100 % 77 +1 Jordanie________________ 0.02 % 100 % 78 +1 Iles_Vierges_britanniques__ 0.02 % 100 % 79 +1 Grenade_________________ 0.02 % 100 % 80 +1 Coree_du_Sud____________ 0.02 % 100 % 81 +1 Colombie________________ 0.02 % 100 % 82 +1 Cameroun________________ 0.02 % 100 % 83 +1 Burkina_Faso____________ 0.02 % 100 % 84 +1 Bahrein_________________ 0.02 % 100 % 85 +TOTAL = 4931 sales 219147 EUR over 85 countries on Fri Aug 19 12:49:52 CEST 2016 diff --git a/S/mailing_list.shtml b/S/mailing_list.shtml new file mode 100644 index 0000000..11a8cdc --- /dev/null +++ b/S/mailing_list.shtml @@ -0,0 +1,112 @@ + + + + + + +The English imapsync mailing-list + + + + + + + + + + + + + +
    + +

    Discuss or search on the English imapsync mailing-list (back to menu) +

    + + +

    + The English public mailing-list may be the best way to get free and gratis support (not as quick as the professional support).
    + You can write to the mailing-list even if you're not subscribed to it.
    + In that case you will receive a confirmation message each time you post (to avoid spam). +

    + +

    + To write on the mailing-list, the address is: + imapsync@linux-france.org (English language list, hosted in France)
    +

    + +

    + To subscribe, send a message to: + imapsync-subscribe@listes.linux-france.org
    +

    + +

    + To unsubscribe, send a message to: + imapsync-unsubscribe@listes.linux-france.org
    +

    + +

    + To contact the person in charge for the list: + imapsync-request@listes.linux-france.org
    +

    + +

    + The list archives are available at + + http://linux-france.org/prj/imapsync_list/
    + So consider that the list is public, anyone can see your post.
    + Use a pseudonym or do not post to + this list if you want to stay private.
    +

    + +
    +

    Search in the imapsync list archives: + + + (change the keywords with your own request and press Enter) +

    +
    + +

    +Thank you for your participation to the English imapsync mailing-list! +

    + +
    + +
    +
    + +Valid HTML5 + +CSS Valide ! + + + +
    +

    + + +This document was last modified on +($Id: mailing_list.shtml,v 1.2 2016/08/05 14:24:46 gilles Exp gilles $)
    +Top of the page +

    +
    + + + diff --git a/S/news.shtml b/S/news.shtml index ff793d5..6fa1b14 100755 --- a/S/news.shtml +++ b/S/news.shtml @@ -21,24 +21,19 @@ -

    News about imapsync and previous releases (back to menu) +

    News about next imapsync, currently distributed , next and previous releases (back to menu)

    imapsync was written on

    -
    - - - -

    See ChangeLog to read what has been done in details since 2001.

    New features or bugfixes since previous releases:

    + +
      +
    • 1.727 https website and CGI on the way!
    • + + +
    • Security: Thanks to free and easy letsencrypt, +Imapsync website is available in https: +https://imapsync.lamiral.info/ +
    • + +
    • Enhancement: Added option --delete1emptyfolders. It deletes empty folders on host1, INBOX excepted. +Useful with --delete since what remains on host1 is only what failed to be synced.
    • + +
    • Enhancement: Imapsync can be used as a CGI program. Still experimental. The web UI interface has to be written.
    • +
    • Enhancement: XOAUTH2 authentication works with json files without extra tool openssl. Old pk12 files are still supported (still with openssl).
    • +
    • Enhancement: Memory usage passed from 5x to 2x of the biggest message size. +Some users do send 700MB messages, imapsync needed 3.5 GB of RAM, now it crunches only 1.4 GB, +a more common RAM value available on small hosts.
    • + +
    • Enhancement: Added option --inet4 to force ipv4 in ssl and tls modes. +Useful with Gmail and Office365 when ipv6 is disable on the imapsync host but not ipv6 resolution.
    • + +
    • Enhancement: Reconnect to imap servers with a Ctrl-c. Exit with two Ctrl-c within one second or one Ctrl-\
    • +
    • Enhancement: Copy is not done when one --pipemess command ends with an empty message generated.
    • +
    • Enhancement: STDERR of --pipemess commands are reported on STDOUT and in the logfile (they were ignored before).
    • +
    • Enhancement:
    • + +
    • Dependency: Added Perl module dependency of Readonly to transform hard coded magic numbers into names. Mandatory module.
    • +
    • Dependency: Added Perl module dependency of Test::MockObject for some tests. Only a "require" for now.
    • + + +
    • Security: In CGI mode, remove all content in the unsafe "eval"uated options + (--regextrans2 --regexflag --regexmess --skipmess --pipemess --delete2foldersonly --delete2foldersbutnot). + Consider these options not available in CGI mode.
    • + + +
    • Bug fix: Fixed -1 wrong output in statistics for big accounts (%d => %s) in printf.
    • +
    • Bug fix: Uncommented call to $test_builder->reset( ) Don't know why it was commented but it was bad for knowing tests go wrong.
    • +
    • Bug fix: Check connected state in sub create_folder(). Avoid multiple useless failures.
    • + + +
    • Refactoring: Wrote Perl package Imapsync::Getopt::Long to handle CGI requests like command line options. +Started as a copy of Luke Ross Getopt::Long::CGI
    • +
    • Refactoring: Perlcritic cleanup 627 violations of CodeLayout::ProhibitTrailingWhitespace.
    • +
    • Refactoring: Perlcritic cleanup 60 Double-sigil dereferences.
    • +
    • Refactoring: Perlcritic cleanup 458 ValuesAndExpressions::ProhibitInterpolationOfLiterals. "Useless interpolation of literal string"
    • +
    • Refactoring: Perlcritic cleanup 420 CodeLayout::ProhibitParensWithBuiltins. "Builtin function called with parentheses". (Severity: 1).
    • +
    • Refactoring: Perlcritic cleanup, various small advices.
    • + +
    • Refactoring: Replaced print by myprint, printf by myprintf, sprinf by mysprintf. + Will ease --quiet mode and general output handling.
    • + +
    • 1.684 Small changes, bugfixes
    • @@ -78,13 +130,13 @@ in ssl or tls mode. Was due to "'SSL_version' => undef". Example: --sslargs1 SSL_verify_mode=1 --sslargs1 SSL_version=SSLv3
    • Enhancement: Added --timeout1 int and --timeout2 int in seconds (--timeout int still available to set both with the same value)
    • Enhancement: Added --debugssl int. Default is like --debugssl 1 (Only print out errors).
    • -
    • Enhancement: Added several polls to know where I shall focus improvements.
    • +
    • Enhancement: Added several polls to know where I shall focus improvements.
    • Usability: Added env_proxy call in sub xoauth2() to read proxy settings from environment variable http_proxy without using PERL_LWP_ENV_PROXY=1
    • -
    • Usability: Wrote TUTORIAL_Unix.
    • +
    • Usability: Wrote TUTORIAL_Unix.
    • Usability: Check f1 folder exists when specified by --f1f2 and warns when it doesn't
    • Usability: Added --automap --justfolders --dry in imapsync_example.sh and imapsync_example.bat
    • @@ -403,7 +455,7 @@ by ignoring PERMANENTFLAGS (Exchange tests) This document last modified on -($Id: news.shtml,v 1.15 2016/03/17 19:59:00 gilles Exp gilles $)
      +($Id: news.shtml,v 1.28 2016/08/19 14:16:58 gilles Exp gilles $)
      Top of the page

      - \ No newline at end of file + diff --git a/S/paypal_return.shtml b/S/paypal_return.shtml index 9408dc7..e9c608d 100644 --- a/S/paypal_return.shtml +++ b/S/paypal_return.shtml @@ -3,9 +3,9 @@ imapsync download - + - + @@ -47,6 +47,8 @@ and the latest imapsync source code release -This document last modified on
      -($Id: paypal_return.shtml,v 1.23 2016/03/03 22:36:57 gilles Exp gilles $) +This document last modified on +($Id: paypal_return.shtml,v 1.27 2016/08/18 09:53:42 gilles Exp gilles $)

      diff --git a/S/poll.shtml b/S/poll.shtml new file mode 100644 index 0000000..6bf4083 --- /dev/null +++ b/S/poll.shtml @@ -0,0 +1,98 @@ + + + + + + +Imapsync template file + + + + + + + + + + + + + + + + + + +

      Vote for a better imapsync and better services (back to menu) +

      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      +
      + + Valid XHTML 1.0 Strict + + + + CSS Valide ! + + + + + +
      + +
      +

      + + +This document last modified on +($Id: poll.shtml,v 1.2 2016/07/21 22:55:54 gilles Exp gilles $)
      +Top of the page +

      + + + + diff --git a/S/style.css b/S/style.css index 80dd900..9810de1 100644 --- a/S/style.css +++ b/S/style.css @@ -1,6 +1,11 @@ /* $Id: style.css,v 1.8 2016/01/21 00:58:22 gilles Exp gilles $ */ +/* http://www.w3schools.com/html/html5_browsers.asp */ +header, section, footer, aside, nav, main, article, figure { + display: block; +} + body { color: black; background-color: #eeffff diff --git a/S/template.shtml b/S/template.shtml deleted file mode 100755 index 23edce5..0000000 --- a/S/template.shtml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - -Imapsync template file - - - - - - - - - - - - - - - - - - -

      Tittle 1 (back to menu) -

      - -

      Blabla 1

      - -

      Tittle 2 (back to menu) -

      - -

      Blabla 2

      - -
      -
      - - Valid XHTML 1.0 Strict - - - - CSS Valide ! - - - - - -
      - -
      -

      - - -This document last modified on -($Id: template.shtml,v 1.4 2016/03/03 22:36:57 gilles Exp gilles $)
      -Top of the page -

      - - - - diff --git a/S/template_html5.shtml b/S/template_html5.shtml new file mode 100755 index 0000000..9a655a7 --- /dev/null +++ b/S/template_html5.shtml @@ -0,0 +1,76 @@ + + + + + + +Template file Title + + + + + + + + + + + + + + +
      + + +

      Tittle 1 (back to menu) +

      + +

      Blabla 1

      + + +

      Tittle 2 (back to menu) +

      + +

      Blabla 2

      + + +
      + +
      +
      + + + Valid HTML5 + + + + CSS Valide ! + + + + + + +
      +

      + + +This document was last modified on +($Id: template_html5.shtml,v 1.1 2016/08/05 14:27:39 gilles Exp gilles $)
      +Top of the page +

      +
      + + + diff --git a/S/template_xhtml1.shtml b/S/template_xhtml1.shtml new file mode 100755 index 0000000..90f85fa --- /dev/null +++ b/S/template_xhtml1.shtml @@ -0,0 +1,68 @@ + + + + + + +Imapsync template file + + + + + + + + + + + + + + + + + + +

      Tittle 1 (back to menu) +

      + +

      Blabla 1

      + +

      Tittle 2 (back to menu) +

      + +

      Blabla 2

      + +
      +
      + + Valid XHTML 1.0 Strict + + + + CSS Valide ! + + + + + +
      + +
      +

      + + +This document last modified on +($Id: template_xhtml1.shtml,v 1.5 2016/08/03 18:18:40 gilles Exp gilles $)
      +Top of the page +

      + + + + diff --git a/TODO b/TODO index d5f84bb..33969f6 100644 --- a/TODO +++ b/TODO @@ -1,14 +1,127 @@ #!/bin/cat -# $Id: TODO,v 1.155 2016/03/13 13:01:26 gilles Exp gilles $ +# $Id: TODO,v 1.168 2016/08/19 14:17:53 gilles Exp gilles $ This documentation is also at http://imapsync.lamiral.info/#doc +=========================================================================== TODO file for imapsync ---------------------- +SUGGESTED 2016_08_19 by Gilles +Go back to SSL_VERIFY_PEER but include +SSL_ca_file inside imapsync or near. + +SUGGESTED 2016_08_07 by Gilles +Add a meaningful exit value to all die: + * fatal software dependency, Perl modules + * fatal parameter issue + * fatal connect issue + * fatal login issue + * fatal permission file issue (open) + * fatal IMAP issue + * fatal IMAP disconnection +Add a meaningful exit value to all exit + * exit at end but with errors + * exit at middle because of errormax + * exit by signal + + +SUGGESTED 2016_07_29 by Gilles from CSS3 Coursera course +Take a look at +https://modernizr.com/ + +SUGGESTED 2016_07_29 by Gilles +Move website to HTML5 +https://about.validator.nu/ + +SUGGESTED 2016_07_12 by Fronik +With --automap apply the mapping to subfolders of mapped folders. +If +Sent => Envoyes +then +Sent.Foo => Envoyes.Foo +Sent.Foo.Bar => Envoyes.Foo.bar + +SUGGESTED 2016_07_07 by Jean-Dominique Delyon. +Add a way to know easily which account transfers went wrong. +G�n�rer un fichier des comptes qui ont rencontr� des probl�mes +et afficher le contenu � la fin de la boucle sur les comptes. + +SUGGESTED 2016_06_29 by Gilles +Clarify system flags in RFC +Example to add: +If \Forwarded is not in PERMANENTFLAGS but \* is then transform +\Forwarded to Forwarded. And by default. + +SUGGESTED 2016_06_29 by Gilles +Add --gmail1 --gmail2 --gmail12 to set automatically advices from +https://imapsync.lamiral.info/FAQ.d/FAQ.Gmail.txt +Add --exchange --office365 to set automatically advices from +https://imapsync.lamiral.info/FAQ.d/FAQ.Exchange.txt + + +SUGGESTED 2016_06_13 by David Carter +--pipemess could also treat stderr +` $command < $input_tmpfile > $output_tmpfile 2> $error_tmpfile ` + + +SUGGESTED 2016_06_22 by Gilles +Add --quiet mode +Make --quiet mode being switched by a signal + +SUGGESTED by Gilles Try to act as --tls if CAPABILITY allows it and if there is no --notls. Fallback without --tls if --tls fails. +DONE 2016_07_27 by Gilles +SUGGESTED 2016_06_15 by Gilles +Fix sub check_lib_version and its call. +It was ok because of the Perl line "use Mail::IMAPClient 3.30". + +SUGGESTED 2016_06_12 by Gilles +Fix many perlcritic, all? +DONE * 60 perlcritic Double-sigil dereference (Severity 2) +DONE * 627 perlcritic violations of CodeLayout::ProhibitTrailingWhitespace. (Severity 1). +DONE * 458 perlcritic violations of ValuesAndExpressions::ProhibitInterpolationOfLiterals. "Useless interpolation of literal string" +DONE * 420 perlcritic violations of CodeLayout::ProhibitParensWithBuiltins. "Builtin function called with parentheses". (Severity: 1). + +* 304 violations of ValuesAndExpressions::ProhibitMagicNumbers. +* 236 violations of InputOutput::RequireCheckedSyscalls. "Return value of flagged function ignored". (Severity: 1). +* 115 violations of ControlStructures::ProhibitPostfixControls. Postfix control "if" used. (Severity: 2). +* 90 violations of ValuesAndExpressions::ProhibitNoisyQuotes. +* 86 violations of ValuesAndExpressions::RequireInterpolationOfMetachars. +* 85 violations of RegularExpressions::RequireLineBoundaryMatching. +* 85 violations of RegularExpressions::RequireDotMatchAnything. +* 37 violations of Variables::ProhibitPunctuationVars. +* 30 violations of RegularExpressions::RequireExtendedFormatting. +* 30 violations of NamingConventions::Capitalization. +* 24 violations of ValuesAndExpressions::RequireNumberSeparators. +* 20 violations of RegularExpressions::ProhibitEscapedMetacharacters. +* 19 violations of ControlStructures::ProhibitUnlessBlocks. +* 14 violations of Variables::ProhibitReusedNames. +* 11 violations of Subroutines::ProhibitManyArgs. + +SUGGESTED 2016_06_09 by Gilles and David Carter +In order to avoid useless headaches from --regexmess, add +--regexheader +--regexbody + +SUGGESTED 2016_06_09 by David Carter +Add --pipemess-on-fail +If, and only if, the target server responses with NO or BAD then have another go +with a sanitized version of the message. + +SUGGESTED 2016_06_01 by M. Beaubien +Add flag --noheaderwarnings or better name +no header by parse_headers so taking whole header with BODY.PEEK[HEADER] +no header found so adding our own [Message-Id: <151648@imapsync>] + +SUGGESTED 2016_04_17 by Gilles +Add a --passfile to allow user=>password style file. + +SUGGESTED 2016_04_13 by Gilles +Split --noabletosearch in --noabletosearch1 --noabletosearch2 + WANTED 2016_03_11 Add a FAQ about Authentication failures and quoting. @@ -167,9 +280,6 @@ http://www.linux-france.org/prj/imapsync_list/msg00022.html http://mail.google.com/support/bin/answer.py?hl=en&answer=77657 http://mail.google.com/support/bin/answer.py?answer=78892 -Look at larch https://github.com/rgrove/larch/ -http://wonko.com/ - Add and option to sync to & from files. Add an --aclregextrans2 flag. @@ -178,9 +288,6 @@ their ACLs. Syncing ACLs vom Cyrus to Dovecot (at least 1.2) doesn't work. Cyrus uses c and d, Dovecot uses k and x instead." Peer Heinlein. -Add different levels of output to see clearly the -problem by default. - Add more information about skipped messages. Add Rick Romero patch with @@ -199,30 +306,18 @@ Fix bug "not possible to use space in the imap password" Add kerberos authentification - Fix bug with folder names starting with an asterisk: *Archiv Sending: 220 SELECT *Archiv/Support/foobar Read: 220 BAD Protokollfehler: "Invalid folder specified in SELECT command" -Compare speed between 1.182 and 1.217 -"un mailbox de 90MB, ~2400 fichiers prends 80s avec la version 1.182 -vs 250s avec la version 1.217". Marc Jauvin - Add LITERAL+ [RFC 2088] support to imapsync. Make a m4 file for lsm.imapsync and generate it at each public release. -Add an option to tell imapsync that the domain -is changing and have it replace the domain in all user names that are -related to ACLs. -See patches/imapsync-acls-users - Add --verbose from Kjetil jumbo patch. Read the IMAP RFC http://www.faqs.org/rfcs/rfc3501.html -Interface with external software like procmail - Read: http://www.washington.edu/imap/documentation/commndmt.txt.html @@ -233,6 +328,27 @@ http://asg.web.cmu.edu/cyrus/download/imapd/altnamespace.html Now the TODO done! (or not) =========================================================================== +SUGGESTED 2016_06_22 by Gilles +DONE 2016_07_29 by Gilles +Make reconnections launched by a signal Ctrl-c, aka INT signal. +2 consecutive Ctrl-c within 1 second then exit the program. +Inline help when Ctrl-c is hit + +SUGGESTED 2016_07_15 by Alan Williams +DONE 2016_07_20 for IO::Socket::SSL +Add --inet4 --inet6 to force AF_INET or AF_INET6 ip connexion, +aka ipv4 or ipv6. + +SUGGESTED 2016_06_24 by Jean-Dominique Delyon +DONE 2016_06_30 by Gilles +Add --delete1emptyfolders +Destroy host1 empty folders. +Be carefull of non-empty subfolders! + + +SUGGESTED 2016_07_01 by Gilles +DONE 2016_07_01 by Gilles +Add exit explanation after errorsdump DONE 2016_01_06. Write a Unix tutorial, TUTORIAL_Unix.html. diff --git a/VERSION b/VERSION index 7e2503d..fe5eb12 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.684 +1.727 diff --git a/VERSION_EXE b/VERSION_EXE index 7e2503d..fe5eb12 100644 --- a/VERSION_EXE +++ b/VERSION_EXE @@ -1 +1 @@ -1.684 +1.727 diff --git a/W/.BUILD_EXE_TIME b/W/.BUILD_EXE_TIME index 3360262..45a14a0 100644 --- a/W/.BUILD_EXE_TIME +++ b/W/.BUILD_EXE_TIME @@ -380,3 +380,64 @@ 1458206536 END 1.684 : jeudi 17 mars 2016, 10:22:16 (UTC+0100) 1458216703 BEGIN 1.684 : jeudi 17 mars 2016, 13:11:43 (UTC+0100) 1458217520 END 1.684 : jeudi 17 mars 2016, 13:25:20 (UTC+0100) +1458428579 BEGIN 1.684 : dimanche 20 mars 2016, 00:02:59 (UTC+0100) +1458428756 END 1.684 : dimanche 20 mars 2016, 00:05:56 (UTC+0100) +1458433683 BEGIN 1.684 : dimanche 20 mars 2016, 01:28:03 (UTC+0100) +1458434445 END 1.684 : dimanche 20 mars 2016, 01:40:45 (UTC+0100) +1458436534 BEGIN 1.684 : dimanche 20 mars 2016, 02:15:34 (UTC+0100) +1458437310 END 1.684 : dimanche 20 mars 2016, 02:28:30 (UTC+0100) +1463261525 BEGIN 1.690 : samedi 14 mai 2016, 23:32:05 (UTC+0200) +1463261701 END 1.690 : samedi 14 mai 2016, 23:35:01 (UTC+0200) +1463261777 BEGIN 1.690 : samedi 14 mai 2016, 23:36:17 (UTC+0200) +1463262258 END 1.690 : samedi 14 mai 2016, 23:44:18 (UTC+0200) +1464194085 BEGIN 1.692 : mercredi 25 mai 2016, 18:34:45 (UTC+0200) +1464194868 END 1.692 : mercredi 25 mai 2016, 18:47:49 (UTC+0200) +1465431106 BEGIN 1.694 : jeudi 9 juin 2016, 02:11:46 (UTC+0200) +1465431905 END 1.694 : jeudi 9 juin 2016, 02:25:05 (UTC+0200) +1465864115 BEGIN 1.701 : mardi 14 juin 2016, 02:28:35 (UTC+0200) +1465864364 END 1.701 : mardi 14 juin 2016, 02:32:44 (UTC+0200) +1465865557 BEGIN 1.701 : mardi 14 juin 2016, 02:52:37 (UTC+0200) +1465866291 END 1.701 : mardi 14 juin 2016, 03:04:51 (UTC+0200) +1466171000 BEGIN 1.706 : vendredi 17 juin 2016, 15:43:20 (UTC+0200) +1466171789 END 1.706 : vendredi 17 juin 2016, 15:56:29 (UTC+0200) +1466210899 BEGIN 1.707 : samedi 18 juin 2016, 02:48:19 (UTC+0200) +1466211650 END 1.707 : samedi 18 juin 2016, 03:00:50 (UTC+0200) +1466610746 BEGIN 1.710 : mercredi 22 juin 2016, 17:52:26 (UTC+0200) +1466611426 END 1.710 : mercredi 22 juin 2016, 18:03:46 (UTC+0200) +1466627202 BEGIN 1.711 : mercredi 22 juin 2016, 22:26:42 (UTC+0200) +1466627955 END 1.711 : mercredi 22 juin 2016, 22:39:15 (UTC+0200) +1467069519 BEGIN 1.711 : mardi 28 juin 2016, 01:18:39 (UTC+0200) +1467069574 END 1.711 : mardi 28 juin 2016, 01:19:34 (UTC+0200) +1467069750 BEGIN 1.711 : mardi 28 juin 2016, 01:22:30 (UTC+0200) +1467069794 END 1.711 : mardi 28 juin 2016, 01:23:14 (UTC+0200) +1467069926 BEGIN 1.711 : mardi 28 juin 2016, 01:25:26 (UTC+0200) +1467070138 BEGIN 1.711 : mardi 28 juin 2016, 01:28:58 (UTC+0200) +1467070225 BEGIN 1.711 : mardi 28 juin 2016, 01:30:25 (UTC+0200) +1467070345 BEGIN 1.711 : mardi 28 juin 2016, 01:32:25 (UTC+0200) +1467070391 BEGIN 1.711 : mardi 28 juin 2016, 01:33:11 (UTC+0200) +1467070514 BEGIN 1.711 : mardi 28 juin 2016, 01:35:14 (UTC+0200) +1467070588 BEGIN 1.711 : mardi 28 juin 2016, 01:36:28 (UTC+0200) +1467070950 BEGIN 1.711 : mardi 28 juin 2016, 01:42:30 (UTC+0200) +1467255653 BEGIN 1.712 : jeudi 30 juin 2016, 05:00:53 (UTC+0200) +1467255813 END 1.712 : jeudi 30 juin 2016, 05:03:33 (UTC+0200) +1467755793 BEGIN 1.715 : mardi 5 juillet 2016, 23:56:34 (UTC+0200) +1467756564 END 1.715 : mercredi 6 juillet 2016, 00:09:24 (UTC+0200) +1469013686 BEGIN 1.718 : mercredi 20 juillet 2016, 13:21:26 (UTC+0200) +1469014489 BEGIN 1.718 : mercredi 20 juillet 2016, 13:34:49 (UTC+0200) +1469814584 BEGIN 1.721 : vendredi 29 juillet 2016, 19:49:44 (UTC+0200) +1469815484 END 1.721 : vendredi 29 juillet 2016, 20:04:44 (UTC+0200) +1469828350 BEGIN 1.722 : vendredi 29 juillet 2016, 23:39:10 (UTC+0200) +1469829123 END 1.722 : vendredi 29 juillet 2016, 23:52:03 (UTC+0200) +1469831589 BEGIN 1.723 : samedi 30 juillet 2016, 00:33:09 (UTC+0200) +1469832393 END 1.723 : samedi 30 juillet 2016, 00:46:33 (UTC+0200) +1471305986 BEGIN 1.725 : mardi 16 août 2016, 02:06:26 (UTC+0200) +1471306861 END 1.725 : mardi 16 août 2016, 02:21:01 (UTC+0200) +1471390396 BEGIN 1.726 : mercredi 17 août 2016, 01:33:16 (UTC+0200) +1471391143 END 1.726 : mercredi 17 août 2016, 01:45:43 (UTC+0200) +1471399447 BEGIN 1.726 : mercredi 17 août 2016, 04:04:07 (UTC+0200) +1471399633 END 1.726 : mercredi 17 août 2016, 04:07:13 (UTC+0200) +1471514233 BEGIN 1.726 : jeudi 18 août 2016, 11:57:13 (UTC+0200) +1471515101 END 1.726 : jeudi 18 août 2016, 12:11:41 (UTC+0200) +1471606171 BEGIN 1.727 : vendredi 19 août 2016, 13:29:31 (UTC+0200) +1471616659 BEGIN 1.727 : vendredi 19 août 2016, 16:24:19 (UTC+0200) +1471617309 END 1.727 : vendredi 19 août 2016, 16:35:09 (UTC+0200) diff --git a/W/.checklinkext b/W/.checklinkext new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/W/.checklinkext diff --git a/W/.compok b/W/.compok new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/W/.compok diff --git a/W/.tests.errors.txt b/W/.tests.errors.txt new file mode 100644 index 0000000..8beaca0 --- /dev/null +++ b/W/.tests.errors.txt @@ -0,0 +1,61 @@ +2016_08_16_22_49_23 : FAILED 1/4 TESTS: ll_authmech_xoauth2_json_gmail +2016_08_16_22_52_37 : FAILED 1/2 TESTS: ll_authmech_XOAUTH2_json_gmail +2016_08_16_22_55_09 : FAILED 1/2 TESTS: ll_authmech_XOAUTH2_gmail +2016_08_16_22_56_48 : FAILED 1/2 TESTS: ll_pipemess +2016_08_16_23_59_51 : ALL 1 TESTS SUCCESSFUL +2016_08_16_23_59_56 : ALL 2 TESTS SUCCESSFUL +2016_08_17_00_00_27 : ALL 1 TESTS SUCCESSFUL +2016_08_17_00_24_36 : ALL 114 TESTS SUCCESSFUL +2016_08_17_00_48_26 : ALL 1 TESTS SUCCESSFUL +2016_08_17_01_20_59 : ALL 114 TESTS SUCCESSFUL +2016_08_19_10_22_53 : ALL 1 TESTS SUCCESSFUL +2016_08_19_10_22_59 : ALL 2 TESTS SUCCESSFUL +2016_08_19_11_45_57 : ALL 1 TESTS SUCCESSFUL +2016_08_19_11_46_02 : ALL 2 TESTS SUCCESSFUL +2016_08_19_11_48_53 : ALL 1 TESTS SUCCESSFUL +2016_08_19_11_48_58 : ALL 2 TESTS SUCCESSFUL +2016_08_19_11_49_28 : ALL 1 TESTS SUCCESSFUL +2016_08_19_11_49_32 : ALL 2 TESTS SUCCESSFUL +2016_08_19_11_50_21 : ALL 1 TESTS SUCCESSFUL +2016_08_19_11_50_25 : ALL 2 TESTS SUCCESSFUL +2016_08_19_11_52_06 : ALL 1 TESTS SUCCESSFUL +2016_08_19_11_52_11 : ALL 2 TESTS SUCCESSFUL +2016_08_19_11_53_49 : ALL 1 TESTS SUCCESSFUL +2016_08_19_11_53_53 : ALL 2 TESTS SUCCESSFUL +2016_08_19_11_55_13 : ALL 1 TESTS SUCCESSFUL +2016_08_19_11_55_18 : ALL 2 TESTS SUCCESSFUL +2016_08_19_11_57_16 : ALL 1 TESTS SUCCESSFUL +2016_08_19_11_57_21 : ALL 2 TESTS SUCCESSFUL +2016_08_19_11_58_33 : ALL 1 TESTS SUCCESSFUL +2016_08_19_11_58_58 : ALL 2 TESTS SUCCESSFUL +2016_08_19_12_29_48 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_33_39 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_33_46 : FAILED 1/2 TESTS: ll_ssl_justconnect_SSL_VERIFY_PEER +2016_08_19_16_34_36 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_34_41 : FAILED 1/2 TESTS: ll_ssl_justconnect_SSL_VERIFY_PEER +2016_08_19_16_38_37 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_38_42 : FAILED 1/2 TESTS: ll_ssl_justconnect_SSL_VERIFY_PEER +2016_08_19_16_41_01 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_41_05 : FAILED 1/2 TESTS: ll_ssl_justconnect_SSL_VERIFY_PEER +2016_08_19_16_41_27 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_41_32 : ALL 2 TESTS SUCCESSFUL +2016_08_19_16_42_51 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_42_56 : ALL 2 TESTS SUCCESSFUL +2016_08_19_16_43_21 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_43_26 : ALL 2 TESTS SUCCESSFUL +2016_08_19_16_44_25 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_44_29 : FAILED 1/2 TESTS: ll_ssl_justconnect_SSL_VERIFY_PEER +2016_08_19_16_50_18 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_50_26 : FAILED 1/2 TESTS: l_office365_justlogin_2 +2016_08_19_16_51_12 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_52_50 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_52_56 : ALL 2 TESTS SUCCESSFUL +2016_08_19_16_53_30 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_54_47 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_54_54 : FAILED 1/2 TESTS: l_office365_justconnect_tls_SSL_verify_mode +2016_08_19_16_55_13 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_55_19 : FAILED 1/2 TESTS: l_office365_justconnect_tls_SSL_verify_mode +2016_08_19_16_55_37 : ALL 1 TESTS SUCCESSFUL +2016_08_19_16_55_43 : ALL 2 TESTS SUCCESSFUL +2016_08_19_19_54_03 : ALL 1 TESTS SUCCESSFUL +2016_08_19_20_18_58 : ALL 115 TESTS SUCCESSFUL diff --git a/W/.valid.index.shtml b/W/.valid.index.shtml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/W/.valid.index.shtml diff --git a/W/LOG_bat/learn_func.bat.txt b/W/LOG_bat/learn_func.bat.txt new file mode 100644 index 0000000..73ca616 --- /dev/null +++ b/W/LOG_bat/learn_func.bat.txt @@ -0,0 +1 @@ +Failure running NOEXIST diff --git a/W/build_exe.bat b/W/build_exe.bat index 854cbc5..da9496a 100644 --- a/W/build_exe.bat +++ b/W/build_exe.bat @@ -1,19 +1,55 @@ -REM $Id: build_exe.bat,v 1.35 2015/12/14 15:15:36 gilles Exp gilles $ -@ECHO OFF +REM $Id: build_exe.bat,v 1.40 2016/08/19 14:12:29 gilles Exp gilles $ + +@SETLOCAL +ECHO Currently running through %0 %* ECHO Building imapsync.exe @REM the following command change current directory to the dirname of the current batch pathname CD /D %~dp0 +REM Remove the error file because its existence means an error occured during this script execution +IF EXIST LOG_bat\%~nx0.txt DEL LOG_bat\%~nx0.txt + + +CALL :handle_error CALL :detect_perl +CALL :handle_error CALL :check_modules +CALL :handle_error CALL :pp_exe + + +@ENDLOCAL +EXIT /B + + +:pp_exe +@SETLOCAL +CALL pp -o imapsync.exe --link libeay32_.dll --link zlib1_.dll --link ssleay32_.dll .\imapsync +IF ERRORLEVEL 1 CALL pp -o imapsync.exe .\imapsync +@ENDLOCAL +EXIT /B + + + + +::------------------------------------------------------ +::--------------- Detect Perl -------------------------- +:detect_perl +@SETLOCAL perl -v -IF ERRORLEVEL 1 ECHO Perl needed. Install Strawberry Perl. Get it at http://strawberryperl.com/ ^ - && PAUSE && EXIT /B 3 +@ENDLOCAL +EXIT /B +::------------------------------------------------------ -REM CALL .\install_modules.bat +::------------------------------------------------------ +::--------------- Check modules are here -------------- +:check_modules +@SETLOCAL perl ^ + -mTest::MockObject ^ + -mPAR::Packer ^ + -mReadonly ^ -mAuthen::NTLM ^ -mData::Dumper ^ -mData::Uniqid ^ @@ -39,66 +75,29 @@ perl ^ -mCrypt::OpenSSL::RSA ^ -mEncode::Byte ^ -e '' +IF ERRORLEVEL 1 CALL .\install_modules.bat +@ENDLOCAL +EXIT /B +::------------------------------------------------------ + + + + +::------------------------------------------------------ +::--------------- Handle error ------------------------- +:handle_error +SETLOCAL +ECHO IN %0 with parameters %* +%* +SET CMD_RETURN=%ERRORLEVEL% -@ECHO ON -DEL imapsync.exe -pp -o imapsync.exe ^ - --link libeay32_.dll ^ - --link zlib1_.dll ^ - --link ssleay32_.dll ^ - .\imapsync - -ECHO Done building imapsync.exe - -@REM Previous options to pp -@REM Previous options to pp -@REM --link libeay32_.dll ^ -@REM --link zlib1_.dll ^ -@REM --link ssleay32_.dll ^ -@REM -M Mail::IMAPClient ^ -@REM -M IO::Socket ^ -@REM -M IO::Socket::IP ^ -@REM -M IO::Socket::SSL ^ -@REM -M IO::Socket::INET ^ -@REM -M Digest::MD5 ^ -@REM -M Digest::HMAC_MD5 ^ -@REM -M Digest::HMAC_SHA1 ^ -@REM -M Term::ReadKey ^ -@REM -M File::Spec ^ -@REM -M Authen::NTLM ^ -@REM -M Time::Local ^ -@REM -M URI::Escape ^ -@REM -M Data::Uniqid ^ -@REM -M File::Copy::Recursive ^ -@REM -M IO::Tee ^ -@REM -M Unicode::String ^ -@REM -M JSON::WebToken ^ -@REM -M LWP::UserAgent ^ -@REM -M HTML::Entities ^ -@REM -M JSON ^ -@REM -M Encode::Byte ^ -EXIT /B - - -M Mail::IMAPClient ^ - -M IO::Socket ^ - -M IO::Socket::IP ^ - -M IO::Socket::SSL ^ - -M IO::Socket::INET ^ - -M Digest::MD5 ^ - -M Digest::HMAC_MD5 ^ - -M Digest::HMAC_SHA1 ^ - -M Term::ReadKey ^ - -M File::Spec ^ - -M Authen::NTLM ^ - -M Time::Local ^ - -M URI::Escape ^ - -M Data::Uniqid ^ - -M File::Copy::Recursive ^ - -M IO::Tee ^ - -M Unicode::String ^ - -M JSON::WebToken ^ - -M LWP::UserAgent ^ - -M HTML::Entities ^ - -M Crypt::OpenSSL::RSA ^ - -M JSON ^ - -M Encode::Byte ^ +IF %CMD_RETURN% EQU 0 ( + ECHO GOOD END +) ELSE ( + ECHO BAD END + IF NOT EXIST LOG_bat MKDIR LOG_bat + ECHO Failure calling: %* >> LOG_bat\%~nx0.txt +) +ENDLOCAL +EXIT /B +::------------------------------------------------------ diff --git a/W/build_mac.sh b/W/build_mac.sh index 884ff85..36c8e4e 100755 --- a/W/build_mac.sh +++ b/W/build_mac.sh @@ -1,6 +1,9 @@ #!/bin/sh -# $Id: build_mac.sh,v 1.2 2015/11/04 18:19:48 gilles Exp gilles $ +# $Id: build_mac.sh,v 1.6 2016/06/22 20:04:16 gilles Exp gilles $ + +# exit on any failure +set -e eval `perl -I $HOME/perl5/lib/perl5 -Mlocal::lib` export MANPATH=$HOME/perl5/man:$MANPATH @@ -10,10 +13,15 @@ ARCH=`uname -m` KERNEL=`uname -s` echo "$HOSTNAME $ARCH $KERNEL" -VERSION=`./imapsync --version` BIN_NAME=imapsync_bin_Darwin -cpanm Mail::IMAPClient +# exit if known needed modules are missing +sh prerequisites_imapsync + +VERSION=`./imapsync --version` + +# Update important Perl modules +cpanm Mail::IMAPClient IO::Socket::SSL PAR::Packer pp -o $BIN_NAME \ -M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \ @@ -22,6 +30,6 @@ pp -o $BIN_NAME \ -M Crypt::OpenSSL::RSA -M JSON -M JSON::WebToken -M LWP -M HTML::Entities \ imapsync -./imapsync_bin_Darwin +./imapsync_bin_Darwin ./imapsync_bin_Darwin --tests ./imapsync_bin_Darwin --testslive diff --git a/W/check_winerr b/W/check_winerr new file mode 100755 index 0000000..a3fcbe5 --- /dev/null +++ b/W/check_winerr @@ -0,0 +1,17 @@ +#!/bin/sh + +# $Id: check_winerr,v 1.4 2016/06/30 11:10:37 gilles Exp gilles $ + +test -n "$1" || { echo usage: "$0 script.bat" && exit 1 ; } + +test -d W/LOG_bat || mkdir W/LOG_bat +ERROR_FILENAME=$1.txt +rm -f "W/LOG_bat/$ERROR_FILENAME" +if scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/LOG_bat/'"$ERROR_FILENAME" W/LOG_bat/ > /dev/null 2>&1 ; then + #echo -n "W/LOG_bat/$ERROR_FILENAME : " + #cat "W/LOG_bat/$ERROR_FILENAME" + sed -e "s#^#W/LOG_bat/$ERROR_FILENAME : #" "W/LOG_bat/$ERROR_FILENAME" + exit 1 +else + echo NO errror +fi diff --git a/W/checklink.txt b/W/checklink.txt new file mode 100644 index 0000000..267bf49 --- /dev/null +++ b/W/checklink.txt @@ -0,0 +1,11 @@ + +Processing http://lamiral.info/~gilles/imapsync/ + + +List of broken links and other issues: +http://fr.linkedin.com/in/gilleslamiral + Line: 185 + Code: 405 Method Not Allowed + To do: The server does not allow HTTP HEAD requests, which prevents the + Link Checker to check the link automatically. Check the link + manually. diff --git a/W/checklinkext.txt b/W/checklinkext.txt new file mode 100644 index 0000000..f8ede5b --- /dev/null +++ b/W/checklinkext.txt @@ -0,0 +1,44 @@ + +---------------------------------------- + +Processing http://lamiral.info/~gilles/imapsync/S/news.shtml + + +List of broken links and other issues: +http://lamiral.info/~gilles/imapsync/ + Line: 135 + Code: 200 OK + To do: Some of the links to this resource point to broken URI fragments + (such as index.html#fragment). +The following fragments need to be fixed: + poll Line: 135 + +---------------------------------------- + +Processing http://lamiral.info/~gilles/imapsync/S/external.shtml + + +List of broken links and other issues: +https://bl0rg.net/software/ + Line: 41 + Code: 500 Can't connect to bl0rg.net:443 + To do: This is a server side problem. Check the URI. + +---------------------------------------- + +Processing http://lamiral.info/~gilles/imapsync/S/imapservers.shtml + + +List of broken links and other issues: +http://www.mirapoint.com/ + Line: 126 + Code: 404 Not Found + To do: The link is broken. Double-check that you have not made any typo, + or mistake in copy-pasting. If the link points to a resource that + no longer exists, you may want to remove or fix the link. + +http://www.kerio.com/ + Line: 117 + Code: 302 -> 302 Found + To do: This is a temporary redirect. Update the link if you believe it + makes sense, or leave it as is. diff --git a/W/dprof2_bigmail_tmon.out b/W/dprof2_bigmail_tmon.out new file mode 100644 index 0000000..a173976 --- /dev/null +++ b/W/dprof2_bigmail_tmon.out @@ -0,0 +1,1108 @@ +time elapsed (wall): 6.5301 +time running program: 6.2874 (96.28%) +time profiling (est.): 0.2420 (3.71%) +missing time: 0.0007 (0.01%) +number of calls: 18150 + +%Time Sec. #calls sec/call F name +31.82 2.0003 1 2.000343 Time::HiRes::sleep +14.76 0.9280 0 0.927960 * + 6.53 0.4107 686 0.000599 Mail::IMAPClient::__read_more + 3.95 0.2481 3 0.082698 main::memory_consumption_of_pids + 2.65 0.1667 40 0.004167 Mail::IMAPClient::_read_line + 2.40 0.1511 1 0.151053 main::modules_VERSION + 1.66 0.1045 686 0.000152 Mail::IMAPClient::_sysread + 1.44 0.0904 1 0.090377 :./imapsync:700 + 1.22 0.0764 1 0.076397 main::copy_message + 1.21 0.0760 1 0.075999 :...erl/5.14.2/Data/Uniqid.pm:25 + 1.01 0.0632 40 0.001581 Mail::IMAPClient::_get_response + 1.01 0.0632 1 0.063219 main::message_for_host2 + 0.92 0.0577 28 0.002060 DynaLoader::dl_load_file + 0.91 0.0570 1 0.057039 :...re/perl5/LWP/UserAgent.pm:10 + 0.84 0.0531 737 0.000072 Mail::IMAPClient::_list_or_lsub_response_parse + 0.84 0.0528 3 0.017595 IO::Socket::connect + 0.77 0.0484 1 0.048437 :.../5.14/Math/BigInt.pm:2763]:1 + 0.76 0.0475 686 0.000069 Mail::IMAPClient::_read_more + 0.67 0.0419 568 0.000074 Unicode::String::utf7 + 0.64 0.0401 3 0.013379 Socket::inet_aton + 0.60 0.0375 1 0.037507 :./imapsync:694 + 0.59 0.0373 1 0.037313 :...rl5/Test/Builder/Module.pm:5 + 0.59 0.0369 148 0.000250 Exporter::import + 0.55 0.0349 701 0.000050 Mail::IMAPClient::_debug + 0.55 0.0347 1 0.034747 Mail::IMAPClient::message_string + 0.54 0.0340 1 0.033960 :.../Uncompress/RawInflate.pm:11 + 0.51 0.0322 1 0.032211 main::append_message_on_host2 + 0.50 0.0311 1 0.031145 main::imapsync_version_public + 0.49 0.0311 871 0.000036 :.../lib/Mail/IMAPClient.pm:1327 + 0.45 0.0281 38 0.000741 Mail::IMAPClient::_send_bytes + 0.43 0.0273 639 0.000043 :.../lib/Mail/IMAPClient.pm:1793 + 0.42 0.0264 1 0.026380 :...re/perl5/Compress/Zlib.pm:10 + 0.40 0.0249 1 0.024881 :./imapsync:683 + 0.38 0.0241 85 0.000284 IO::Tee::PRINT + 0.35 0.0222 1 0.022171 :./imapsync:696 + 0.34 0.0215 6 0.003583 Mail::IMAPClient::_escaped_trans_data + 0.34 0.0214 5 0.004276 Mail::IMAPClient::_folders_or_subscribed + 0.33 0.0210 27 0.000777 Exporter::export + 0.33 0.0208 874 0.000024 Mail::IMAPClient::_record + 0.32 0.0202 1 0.020197 :...IO/Compress/RawDeflate.pm:10 + 0.31 0.0194 1 0.019444 :./imapsync:704 + 0.29 0.0184 639 0.000029 :.../lib/Mail/IMAPClient.pm:1750 + 0.28 0.0177 989 0.000018 UNIVERSAL::isa + 0.27 0.0172 639 0.000027 :.../lib/Mail/IMAPClient.pm:1742 + 0.27 0.0167 116 0.000144 constant::import + 0.26 0.0166 284 0.000058 main::imap_utf7_decode + 0.26 0.0162 1 0.016195 :...re/perl5/Compress/Zlib.pm:11 + 0.24 0.0154 1 0.015399 :...are/perl/5.14/File/Path.pm:6 + 0.23 0.0147 1 0.014704 :...re/perl5/IO/Socket/SSL.pm:94 + 0.23 0.0145 1 0.014507 :...l5/File/Copy/Recursive.pm:11 + 0.22 0.0140 732 0.000019 Mail::IMAPClient::Unescape + 0.21 0.0132 158 0.000083 Getopt::Long::ParseOptionSpec + 0.20 0.0128 1 0.012769 :./imapsync:692 + 0.20 0.0126 38 0.000332 Mail::IMAPClient::_imap_command_do + 0.20 0.0123 836 0.000015 Mail::IMAPClient::_is_output + 0.19 0.0121 1 0.012128 :./imapsync:690 + 0.19 0.0121 284 0.000042 main::jux_utf8 + 0.19 0.0117 1 0.011728 :./imapsync:707 + 0.19 0.0117 294 0.000040 Unicode::String::append + 0.19 0.0116 1 0.011648 :...are/perl5/HTTP/Response.pm:8 + 0.17 0.0109 1 0.010912 main::teelaunch + 0.17 0.0106 1 0.010647 :...b/perl/5.14/IO/Seekable.pm:9 + 0.16 0.0103 9 0.001141 Getopt::Long::FindOption + 0.15 0.0095 1 0.009472 JSON::_load_xs + 0.15 0.0094 1 0.009421 :.../perl5/Digest/HMAC_SHA1.pm:5 + 0.15 0.0093 1 0.009300 :...ib/perl/5.14/IO/Socket.pm:12 + 0.15 0.0092 1 0.009200 Getopt::Long::GetOptions + 0.14 0.0091 80 0.000114 Mail::IMAPClient::Socket + 0.14 0.0090 745 0.000012 Mail::IMAPClient::_is_literal + 0.14 0.0087 1 0.008684 :./imapsync:682 + 0.14 0.0087 1 0.008663 :./imapsync:699 + 0.14 0.0086 138 0.000062 main::prefix_seperator_invertion + 0.14 0.0085 1 0.008549 :...IO/Compress/Base/Common.pm:9 + 0.14 0.0085 1 0.008512 :...re/perl/5.14/File/Copy.pm:13 + 0.13 0.0083 138 0.000060 main::imap2_folder_name + 0.13 0.0079 1 0.007925 :...re/perl5/Compress/Zlib.pm:13 + 0.13 0.0079 1 0.007890 :...re/perl5/LWP/UserAgent.pm:11 + 0.12 0.0078 21 0.000371 XSLoader::load + 0.12 0.0077 53 0.000146 vars::import + 0.12 0.0076 1 0.007559 :...re/perl5/Compress/Zlib.pm:12 + 0.12 0.0073 8 0.000917 AutoLoader::import + 0.12 0.0073 3 0.002439 main::jux_utf8_list + 0.12 0.0073 1 0.007303 :...share/perl5/Authen/NTLM.pm:3 + 0.11 0.0068 1 0.006799 :...5/IO/Uncompress/Gunzip.pm:12 + 0.11 0.0068 1 0.006762 :./imapsync:689 + 0.11 0.0067 1 0.006750 Net::SSLeay::load_error_strings + 0.11 0.0067 294 0.000023 Unicode::String::latin1 + 0.10 0.0065 1 0.006464 :...perl5/IO/Compress/Gzip.pm:11 + 0.10 0.0065 1 0.006458 :./imapsync:698 + 0.10 0.0064 1 0.006418 :./imapsync:703 + 0.10 0.0064 1 0.006403 :...re/perl5/IO/Socket/SSL.pm:18 + 0.10 0.0060 1 0.006022 :...r/share/perl5/JSON.pm:252]:2 + 0.10 0.0060 1 0.006016 main::good_date + 0.09 0.0060 1 0.005973 :...38/lib/Mail/IMAPClient.pm:15 + 0.09 0.0060 52 0.000115 IO::Tee::PRINTF + 0.09 0.0059 38 0.000155 Mail::IMAPClient::_send_line + 0.09 0.0059 284 0.000021 Unicode::String::new + 0.09 0.0058 1 0.005775 :...re/perl5/LWP/UserAgent.pm:15 + 0.09 0.0058 1 0.005758 :...re/perl5/LWP/UserAgent.pm:12 + 0.09 0.0057 1 0.005659 :...share/perl5/Authen/NTLM.pm:4 + 0.09 0.0056 1 0.005556 :./imapsync:706 + 0.09 0.0055 116 0.000048 Mail::IMAPClient::Transaction + 0.09 0.0054 1 0.005388 :...usr/lib/perl/5.14/POSIX.pm:9 + 0.08 0.0053 1 0.005288 :./imapsync:686 + 0.08 0.0051 1 0.005109 Net::SSLeay::bootstrap + 0.08 0.0051 1 0.005101 :...l/5.14.2/JSON/WebToken.pm:14 + 0.08 0.0051 1 0.005077 :...perl5/IO/Compress/Gzip.pm:15 + 0.08 0.0049 1 0.004949 :...perl5/IO/Compress/Gzip.pm:16 + 0.08 0.0049 138 0.000036 main::separator_invert + 0.08 0.0049 161 0.000030 :.../lib/Mail/IMAPClient.pm:1393 + 0.08 0.0048 1 0.004798 :...usr/lib/perl5/Socket6.pm:215 + 0.07 0.0047 1 0.004652 POSIX::AUTOLOAD + 0.07 0.0044 1 0.004431 :...perl/5.14/Getopt/Long.pm:208 + 0.07 0.0044 38 0.000116 Mail::IMAPClient::_imap_command + 0.07 0.0044 1 0.004393 :...IO/Compress/RawDeflate.pm:12 + 0.07 0.0043 284 0.000015 Unicode::String::utf8 + 0.07 0.0041 76 0.000054 Mail::IMAPClient::Clear + 0.06 0.0039 1 0.003854 :.../Uncompress/RawInflate.pm:12 + 0.06 0.0038 1 0.003779 :...l5/File/Copy/Recursive.pm:83 + 0.06 0.0038 1 0.003764 :...are/perl/5.14/English.pm:187 + 0.06 0.0037 72 0.000052 Mail::IMAPClient::_transaction + 0.06 0.0035 1 0.003501 :...sr/lib/perl/5.14/POSIX.pm:58 + 0.05 0.0034 79 0.000043 Mail::IMAPClient::IsConnected + 0.05 0.0034 1 0.003360 :...38/lib/Mail/IMAPClient.pm:12 + 0.05 0.0033 1 0.003350 :/usr/lib/perl5/JSON/XS.pm:0 + 0.05 0.0033 4 0.000831 main::foldersizes + 0.05 0.0032 1 0.003205 :...erl/5.14.2/Data/Uniqid.pm:26 + 0.05 0.0032 1 0.003154 :./imapsync:695 + 0.05 0.0031 5 0.000628 Mail::IMAPClient::_remove_doubles + 0.05 0.0031 1 0.003103 :./imapsync:702 + 0.05 0.0031 1 0.003076 :...e/perl5/IO/Socket/SSL.pm:134 + 0.05 0.0030 7 0.000427 DynaLoader::bootstrap + 0.05 0.0029 2 0.001448 main::guess_separator + 0.04 0.0028 1 0.002824 :...r/lib/perl/5.14/IO/File.pm:9 + 0.04 0.0028 2 0.001395 main::guess_prefix + 0.04 0.0027 37 0.000074 UNIVERSAL::VERSION + 0.04 0.0027 122 0.000022 Mail::IMAPClient::State + 0.04 0.0027 40 0.000068 Mail::IMAPClient::_response_code_sub + 0.04 0.0027 7 0.000389 Net::SSLeay::AUTOLOAD + 0.04 0.0027 1 0.002703 :...lib/perl/5.14/File/Glob.pm:7 + 0.04 0.0026 47 0.000054 :.../lib/Mail/IMAPClient.pm:1657 + 0.04 0.0026 1 0.002551 :.../perl/5.14/Data/Dumper.pm:34 + 0.04 0.0025 114 0.000022 :.../lib/Mail/IMAPClient.pm:1226 + 0.04 0.0024 1 0.002437 :.../perl5/Digest/HMAC_SHA1.pm:6 + 0.04 0.0024 3 0.000808 Mail::IMAPClient::folders + 0.04 0.0024 1 0.002397 :...e/perl5/Module/Runtime.pm:51 + 0.04 0.0023 38 0.000062 :.../lib/Mail/IMAPClient.pm:1594 + 0.04 0.0023 40 0.000058 Mail::IMAPClient::_next_index + 0.04 0.0023 138 0.000017 main::regextrans2 + 0.04 0.0023 1 0.002260 JSON::XS::bootstrap + 0.04 0.0022 72 0.000031 :.../lib/Mail/IMAPClient.pm:1893 + 0.03 0.0021 38 0.000055 Mail::IMAPClient::_trans_index + 0.03 0.0021 1 0.002056 :.../share/perl5/Test/More.pm:23 + 0.03 0.0019 1 0.001920 :...ib/perl/5.14/Digest/SHA.pm:7 + 0.03 0.0019 96 0.000020 strict::import + 0.03 0.0019 1 0.001888 :.../lib/perl/5.14/IO/File.pm:11 + 0.03 0.0019 9 0.000207 overload::OVERLOAD + 0.03 0.0019 16 0.000116 Mail::IMAPClient::capability + 0.03 0.0018 47 0.000038 strict::unimport + 0.03 0.0018 1 0.001755 :...usr/lib/perl5/JSON/XS.pm:104 + 0.03 0.0017 76 0.000023 :.../lib/Mail/IMAPClient.pm:1321 + 0.03 0.0017 35 0.000049 Exporter::as_heavy + 0.03 0.0016 4 0.000405 Mail::IMAPClient::namespace + 0.03 0.0016 1 0.001612 :./imapsync:685 + 0.03 0.0016 2 0.000797 Mail::IMAPClient::subscribed + 0.02 0.0016 5 0.000311 warnings::register_categories + 0.02 0.0015 1 0.001537 main::stats + 0.02 0.0015 76 0.000020 Mail::IMAPClient::LastError + 0.02 0.0015 1 0.001488 :./imapsync:684 + 0.02 0.0015 1 0.001466 POSIX::bootstrap + 0.02 0.0015 1 0.001455 :...l/5.14.2/JSON/WebToken.pm:16 + 0.02 0.0014 2 0.000695 AutoLoader::AUTOLOAD + 0.02 0.0014 26 0.000053 Mail::IMAPClient::_trans_data + 0.02 0.0014 1 0.001374 :...rl/5.14.2/JSON/WebToken.pm:9 + 0.02 0.0013 1 0.001343 :...erl5/Crypt/OpenSSL/RSA.pm:17 + 0.02 0.0013 1 0.001320 Math::BigInt::import + 0.02 0.0013 2 0.000648 JSON::Boolean::_overrride_overload + 0.02 0.0013 6 0.000215 Mail::IMAPClient::search + 0.02 0.0012 47 0.000026 :.../lib/Mail/IMAPClient.pm:1662 + 0.02 0.0012 1 0.001199 :...lib/perl/5.14/IO/Handle.pm:9 + 0.02 0.0012 1 0.001192 :...l/5.14.2/JSON/WebToken.pm:17 + 0.02 0.0012 1 0.001154 main::foldersizesatend + 0.02 0.0011 2 0.000562 :...e/perl5/Test/Builder.pm:1460 + 0.02 0.0011 1 0.001113 :...perl/5.14/Data/Dumper.pm:683 + 0.02 0.0011 40 0.000027 :.../lib/Mail/IMAPClient.pm:1626 + 0.02 0.0011 1 0.001097 :.../lib/perl/5.14/IO/File.pm:10 + 0.02 0.0011 1 0.001095 main::load_modules + 0.02 0.0011 26 0.000042 main::module_version_str + 0.02 0.0011 6 0.000181 Mail::IMAPClient::Escaped_results + 0.02 0.0011 1 0.001079 :.../Compress/Base/Common.pm:115 + 0.02 0.0011 2 0.000536 Mail::IMAPClient::connect + 0.02 0.0011 28 0.000038 Mail::IMAPClient::IsUnconnected + 0.02 0.0011 48 0.000022 strict::bits + 0.02 0.0010 1 0.001018 :...5.14/Math/BigInt/Calc.pm:194 + 0.02 0.0010 34 0.000030 warnings::import + 0.02 0.0010 4 0.000250 IO::Select::new + 0.02 0.0010 6 0.000166 Mail::IMAPClient::select + 0.02 0.0010 3 0.000326 IO::Socket::INET::configure + 0.02 0.0010 28 0.000035 DynaLoader::dl_install_xsub + 0.02 0.0009 116 0.000008 mro::method_changed_in + 0.01 0.0009 133 0.000007 utf8::is_utf8 + 0.01 0.0009 4 0.000226 Mail::IMAPClient::fetch + 0.01 0.0009 38 0.000023 :.../lib/Mail/IMAPClient.pm:1549 + 0.01 0.0009 1 0.000862 ? main::exit_clean + 0.01 0.0008 4 0.000210 Mail::IMAPClient::_split_sequence + 0.01 0.0008 15 0.000055 warnings::unimport + 0.01 0.0008 2 0.000411 main::login_imap + 0.01 0.0008 11 0.000073 Mail::IMAPClient::_imap_uid_command + 0.01 0.0008 2 0.000403 main::init_imap + 0.01 0.0008 3 0.000261 Mail::IMAPClient::fetch_hash + 0.01 0.0008 14 0.000055 Mail::IMAPClient::has_capability + 0.01 0.0008 15 0.000052 main::bytes_display_string + 0.01 0.0008 2 0.000386 Mail::IMAPClient::separator + 0.01 0.0007 1 0.000730 main::write_pidfile + 0.01 0.0007 2 0.000357 main::list_keys_in_2_not_in_1 + 0.01 0.0007 131 0.000005 Internals::SvREADONLY + 0.01 0.0007 1 0.000697 PerlIO::import + 0.01 0.0007 14 0.000049 Mail::IMAPClient::Results + 0.01 0.0007 1 0.000662 :...ib/perl/5.14/Digest/SHA.pm:8 + 0.01 0.0007 12 0.000055 Mail::IMAPClient::History + 0.01 0.0007 20 0.000033 :./imapsync:2822 + 0.01 0.0006 4 0.000160 AutoLoader::find_filename + 0.01 0.0006 1 0.000594 :...are/perl/5.14/English.pm:148 + 0.01 0.0006 1 0.000585 Socket::bootstrap + 0.01 0.0006 1 0.000580 Mail::IMAPClient::message_to_file + 0.01 0.0006 52 0.000011 UNIVERSAL::can + 0.01 0.0006 1 0.000560 :...r/lib/perl/5.14/Errno.pm:172 + 0.01 0.0006 1 0.000551 Compress::Raw::Zlib::bootstrap + 0.01 0.0005 1 0.000531 :...8/lib/Mail/IMAPClient.pm:104 + 0.01 0.0005 1 0.000529 Fcntl::bootstrap + 0.01 0.0005 1 0.000505 Mail::IMAPClient::parse_headers + 0.01 0.0005 2 0.000252 main::get_separator + 0.01 0.0005 6 0.000084 Mail::IMAPClient::_list_or_lsub + 0.01 0.0005 1 0.000480 main::get_options + 0.01 0.0005 2 0.000238 Exporter::Heavy::_rebuild_cache + 0.01 0.0005 2 0.000235 base::import + 0.01 0.0005 4 0.000117 IO::Select::_update + 0.01 0.0005 3 0.000156 IO::Socket::new + 0.01 0.0005 2 0.000232 main::get_prefix + 0.01 0.0005 2 0.000227 IO::Handle::close + 0.01 0.0004 13 0.000035 Mail::IMAPClient::Quote + 0.01 0.0004 2 0.000225 main::firstline + 0.01 0.0004 2 0.000220 Mail::IMAPClient::login + 0.01 0.0004 1 0.000438 Digest::SHA::bootstrap + 0.01 0.0004 2 0.000219 Mail::IMAPClient::_load_module + 0.01 0.0004 9 0.000047 overload::import + 0.01 0.0004 3 0.000138 IO::Socket::socket + 0.01 0.0004 1 0.000408 Crypt::OpenSSL::RSA::bootstrap + 0.01 0.0004 1 0.000406 Crypt::OpenSSL::Bignum::bootstrap + 0.01 0.0004 1 0.000401 main::quota + 0.01 0.0004 6 0.000067 IO::Socket::INET::_sock_info + 0.01 0.0004 14 0.000027 :./imapsync:2824 + 0.01 0.0004 2 0.000185 Mail::IMAPClient::new + 0.01 0.0004 2 0.000185 main::authenticate_imap + 0.01 0.0004 4 0.000092 parent::import + 0.01 0.0004 4 0.000091 :...8/lib/Mail/IMAPClient.pm:401 + 0.01 0.0004 1 0.000363 IO::bootstrap + 0.01 0.0004 6 0.000060 main::select_msgs_by_search + 0.01 0.0004 3 0.000120 Socket::pack_sockaddr_in + 0.01 0.0004 1 0.000360 main::remove_tmp_files + 0.01 0.0004 4 0.000088 Mail::IMAPClient::MessageSet::range + 0.01 0.0004 2 0.000175 main::check_capability + 0.01 0.0003 4 0.000085 Mail::IMAPClient::MessageSet::new + 0.01 0.0003 1 0.000338 Net::SSLeay::SSLeay_add_ssl_algorithms + 0.01 0.0003 3 0.000112 main::memory_consumption + 0.01 0.0003 4 0.000082 IO::Handle::blocking + 0.01 0.0003 1 0.000328 :...perl/5.14/Math/BigInt.pm:153 + 0.01 0.0003 1 0.000321 Term::ReadKey::bootstrap + 0.01 0.0003 1 0.000316 Storable::bootstrap + 0.00 0.0003 2 0.000156 Mail::IMAPClient::_disconnect + 0.00 0.0003 6 0.000050 main::select_msgs + 0.00 0.0003 8 0.000037 :./imapsync:4069 + 0.00 0.0003 28 0.000011 DynaLoader::dl_find_symbol + 0.00 0.0003 1 0.000297 main::not_long_imapsync_version_public + 0.00 0.0003 1 0.000296 JSON::_set_module + 0.00 0.0003 1 0.000291 Params::Classify::bootstrap + 0.00 0.0003 28 0.000010 DynaLoader::dl_undef_symbols + 0.00 0.0003 1 0.000285 :.../lib/perl5/Net/SSLeay.pm:680 + 0.00 0.0003 4 0.000071 Exporter::export_ok_tags + 0.00 0.0003 4 0.000070 IO::Socket::blocking + 0.00 0.0003 4 0.000070 Mail::IMAPClient::Range + 0.00 0.0003 6 0.000045 main::max + 0.00 0.0003 3 0.000089 IO::Socket::INET::connect + 0.00 0.0003 3 0.000089 IO::Handle::autoflush + 0.00 0.0003 5 0.000053 main::timenext + 0.00 0.0003 4 0.000066 Exporter::export_to_level + 0.00 0.0003 1 0.000263 HTML::Parser::bootstrap + 0.00 0.0003 6 0.000043 Mail::IMAPClient::Fast_io + 0.00 0.0003 5 0.000051 IO::Socket::import + 0.00 0.0003 1 0.000253 main::command_line_nopassword + 0.00 0.0003 1 0.000253 Mail::IMAPClient::uidnext + 0.00 0.0002 6 0.000041 :...8/lib/Mail/IMAPClient.pm:662 + 0.00 0.0002 6 0.000041 :./imapsync:2847 + 0.00 0.0002 7 0.000035 Mail::IMAPClient::MessageSet::str + 0.00 0.0002 1 0.000236 :...lib/perl/5.14/Storable.pm:45 + 0.00 0.0002 3 0.000078 IO::Socket::INET::_get_addr + 0.00 0.0002 8 0.000029 :.../lib/Mail/IMAPClient.pm:2139 + 0.00 0.0002 11 0.000021 :.../lib/Mail/IMAPClient.pm:1437 + 0.00 0.0002 1 0.000232 List::Util::bootstrap + 0.00 0.0002 3 0.000077 IO::Socket::INET::new + 0.00 0.0002 2 0.000115 Mail::IMAPClient::RawSocket + 0.00 0.0002 4 0.000057 IO::Select::_fileno + 0.00 0.0002 1 0.000229 main::localhost_info + 0.00 0.0002 3 0.000076 IO::Handle::new + 0.00 0.0002 1 0.000222 File::Spec::Unix::_tmpdir + 0.00 0.0002 6 0.000037 Mail::IMAPClient::messages + 0.00 0.0002 15 0.000015 bytes::import + 0.00 0.0002 1 0.000219 Test::Builder::_open_testhandles + 0.00 0.0002 4 0.000054 IO::Select::add + 0.00 0.0002 7 0.000031 Net::SSLeay::constant + 0.00 0.0002 4 0.000054 Exporter::Heavy::_push_tags + 0.00 0.0002 1 0.000213 :.../perl5/IO/Socket/SSL.pm:1366 + 0.00 0.0002 1 0.000205 Tie::Hash::NamedCapture::bootstrap + 0.00 0.0002 5 0.000041 warnings::register::import + 0.00 0.0002 8 0.000025 :./imapsync:2880 + 0.00 0.0002 6 0.000034 Mail::IMAPClient::_quote_search + 0.00 0.0002 1 0.000198 Net::LibIDN::bootstrap + 0.00 0.0002 6 0.000033 :...8/lib/Mail/IMAPClient.pm:366 + 0.00 0.0002 2 0.000095 Test::Builder::Module::import + 0.00 0.0002 1 0.000190 Unicode::String::bootstrap + 0.00 0.0002 1 0.000187 :...re/perl5/IO/Socket/SSL.pm:17 + 0.00 0.0002 10 0.000019 warnings::_mkMask + 0.00 0.0002 2 0.000092 IO::Socket::close + 0.00 0.0002 1 0.000183 File::Glob::bootstrap + 0.00 0.0002 1 0.000183 IO::Tee::new + 0.00 0.0002 6 0.000030 :...8/lib/Mail/IMAPClient.pm:846 + 0.00 0.0002 2 0.000090 IO::Select::can_write + 0.00 0.0002 4 0.000044 :.../lib/Mail/IMAPClient.pm:2815 + 0.00 0.0002 1 0.000176 main::banner_imapsync + 0.00 0.0002 1 0.000172 main::check_last_release + 0.00 0.0002 1 0.000169 Socket6::bootstrap + 0.00 0.0002 1 0.000169 :...re/perl5/IO/Socket/SSL.pm:32 + 0.00 0.0002 2 0.000084 Test::Builder::_try + 0.00 0.0002 3 0.000056 SelectSaver::new + 0.00 0.0002 1 0.000167 :...erl/5.14/Getopt/Long.pm:1490 + 0.00 0.0002 8 0.000021 :.../lib/Mail/IMAPClient.pm:2883 + 0.00 0.0002 12 0.000014 MIME::Base64::decode_base64 + 0.00 0.0002 1 0.000164 main::list_folders_in_2_not_in_1 + 0.00 0.0002 1 0.000162 Net::SSLeay::RAND_load_file + 0.00 0.0002 1 0.000162 :...sr/lib/perl5/Net/LibIDN.pm:3 + 0.00 0.0002 4 0.000040 Mail::IMAPClient::list + 0.00 0.0002 1 0.000159 File::Basename::fileparse_set_fstype + 0.00 0.0002 4 0.000040 :./imapsync:3381 + 0.00 0.0002 1 0.000157 :...hare/perl/5.14/constant.pm:2 + 0.00 0.0002 3 0.000052 Mail::IMAPClient::IsAuthenticated + 0.00 0.0002 1 0.000156 main::date_for_host2 + 0.00 0.0002 1 0.000154 :...b/perl5/Unicode/String.pm:37 + 0.00 0.0002 4 0.000038 Symbol::gensym + 0.00 0.0002 2 0.000076 File::Basename::fileparse + 0.00 0.0002 1 0.000152 :...share/perl5/Digest/HMAC.pm:4 + 0.00 0.0002 1 0.000152 Test::Builder::reset + 0.00 0.0002 6 0.000025 :.../lib/Mail/IMAPClient.pm:2703 + 0.00 0.0001 1 0.000150 :...b/perl5/Net/SSLeay.pm:678]:1 + 0.00 0.0001 1 0.000149 main::parse_header_msg + 0.00 0.0001 1 0.000147 attributes::bootstrap + 0.00 0.0001 7 0.000021 Time::HiRes::time + 0.00 0.0001 1 0.000145 :...re/perl5/IO/Socket/SSL.pm:52 + 0.00 0.0001 1 0.000144 Digest::MD5::bootstrap + 0.00 0.0001 1 0.000142 main::count_from_select + 0.00 0.0001 2 0.000070 Errno::FETCH + 0.00 0.0001 4 0.000034 :.../lib/Mail/IMAPClient.pm:2864 + 0.00 0.0001 2 0.000068 Mail::IMAPClient::logout + 0.00 0.0001 1 0.000135 main::flagsCase + 0.00 0.0001 1 0.000135 :...e/perl5/File/GlobMapper.pm:3 + 0.00 0.0001 8 0.000017 integer::import + 0.00 0.0001 2 0.000065 main::is_valid_directory + 0.00 0.0001 1 0.000128 MIME::Base64::bootstrap + 0.00 0.0001 1 0.000127 :./imapsync:3245 + 0.00 0.0001 6 0.000021 IO::Uncompress::Base::_notAvailable + 0.00 0.0001 2 0.000063 IO::Select::handles + 0.00 0.0001 7 0.000018 overload::AddrRef + 0.00 0.0001 1 0.000125 :.../Compress/Base/Common.pm:482 + 0.00 0.0001 1 0.000124 Math::BigInt::Calc::_base_len + 0.00 0.0001 1 0.000122 Test::Builder::_dup_stdhandles + 0.00 0.0001 2 0.000061 Time::HiRes::import + 0.00 0.0001 6 0.000020 IO::Compress::Base::_notAvailable + 0.00 0.0001 2 0.000060 Test::Builder::_apply_layers + 0.00 0.0001 1 0.000120 Test::Builder::_ending + 0.00 0.0001 1 0.000118 :...perl/5.14/Math/BigInt.pm:201 + 0.00 0.0001 1 0.000118 main::cache_folder + 0.00 0.0001 1 0.000118 POSIX::sigaction + 0.00 0.0001 1 0.000117 :...b/perl/5.14/IO/Seekable.pm:5 + 0.00 0.0001 1 0.000117 Devel::Size::bootstrap + 0.00 0.0001 1 0.000116 :...e/perl5/Test/Builder.pm:1221 + 0.00 0.0001 1 0.000116 :...rl5/IO/Uncompress/Base.pm:20 + 0.00 0.0001 1 0.000116 :...rl5/IO/Uncompress/Base.pm:17 + 0.00 0.0001 3 0.000038 Config::import + 0.00 0.0001 1 0.000115 PerlIO::scalar::bootstrap + 0.00 0.0001 4 0.000029 Mail::IMAPClient::MessageSet::_unfold_range + 0.00 0.0001 2 0.000056 File::Glob::import + 0.00 0.0001 3 0.000038 Mail::IMAPClient::status + 0.00 0.0001 1 0.000112 :...r/lib/perl/5.14/IO/File.pm:5 + 0.00 0.0001 1 0.000111 JSON::Backend::XS::init + 0.00 0.0001 1 0.000109 POSIX::import + 0.00 0.0001 2 0.000054 Mail::IMAPClient::capability_update + 0.00 0.0001 3 0.000036 Mail::IMAPClient::imap4rev1 + 0.00 0.0001 4 0.000027 :.../lib/Mail/IMAPClient.pm:2177 + 0.00 0.0001 2 0.000054 main::imapsync_version + 0.00 0.0001 1 0.000107 Sys::Hostname::bootstrap + 0.00 0.0001 1 0.000104 Data::Dumper::bootstrap + 0.00 0.0001 1 0.000103 Devel::Size::size + 0.00 0.0001 2 0.000052 main::select_folder + 0.00 0.0001 1 0.000103 Math::BigInt::TIESCALAR + 0.00 0.0001 3 0.000034 IO::Socket::register_domain + 0.00 0.0001 2 0.000051 Test::Builder::_copy_io_layers + 0.00 0.0001 4 0.000026 :.../lib/Mail/IMAPClient.pm:2877 + 0.00 0.0001 1 0.000102 :...e/perl5/Compress/Zlib.pm:456 + 0.00 0.0001 1 0.000102 :.../share/perl5/JSON.pm:353]:14 + 0.00 0.0001 1 0.000102 :.../perl5/IO/Socket/SSL.pm:1397 + 0.00 0.0001 1 0.000101 :...SON/WebToken/Constants.pm:34 + 0.00 0.0001 1 0.000101 :.../perl5/IO/Socket/SSL.pm:1598 + 0.00 0.0001 2 0.000050 :...8/lib/Mail/IMAPClient.pm:365 + 0.00 0.0001 2 0.000050 File::Basename::_strip_trailing_sep + 0.00 0.0001 2 0.000050 :./imapsync:2993 + 0.00 0.0001 1 0.000099 :...O/Compress/RawDeflate.pm:124 + 0.00 0.0001 1 0.000098 :./imapsync:687 + 0.00 0.0001 1 0.000097 :...r/lib/perl5/Net/SSLeay.pm:19 + 0.00 0.0001 2 0.000048 Mail::IMAPClient::lsub + 0.00 0.0001 1 0.000097 main::logfile + 0.00 0.0001 1 0.000097 :...rl5/IO/Uncompress/Base.pm:19 + 0.00 0.0001 1 0.000096 :...sr/lib/perl5/JSON/XS.pm:1481 + 0.00 0.0001 1 0.000095 :...rl/5.14/IO/Socket/INET.pm:12 + 0.00 0.0001 1 0.000095 :...ib/perl5/Term/ReadKey.pm:218 + 0.00 0.0001 1 0.000094 POSIX::strftime + 0.00 0.0001 1 0.000094 common::sense::import + 0.00 0.0001 4 0.000023 :.../lib/Mail/IMAPClient.pm:2143 + 0.00 0.0001 1 0.000092 Cwd::bootstrap + 0.00 0.0001 1 0.000092 :...re/perl5/IO/Socket/SSL.pm:20 + 0.00 0.0001 1 0.000092 :...perl/5.14.2/Data/Uniqid.pm:3 + 0.00 0.0001 6 0.000015 Symbol::qualify + 0.00 0.0001 1 0.000091 :.../perl5/IO/Socket/SSL.pm:1404 + 0.00 0.0001 1 0.000091 :...rl5/IO/Uncompress/Base.pm:22 + 0.00 0.0001 1 0.000091 main::permanentflags + 0.00 0.0001 1 0.000090 attributes::import + 0.00 0.0001 1 0.000090 Mail::IMAPClient::noop + 0.00 0.0001 1 0.000089 :...sr/share/perl/5.14/base.pm:3 + 0.00 0.0001 1 0.000089 POSIX::uname + 0.00 0.0001 1 0.000088 :...b/perl/5.14/MIME/Base64.pm:3 + 0.00 0.0001 1 0.000088 :...rl5/IO/Uncompress/Base.pm:90 + 0.00 0.0001 1 0.000088 :...erl/5.14/IO/Socket/INET.pm:9 + 0.00 0.0001 1 0.000087 :...rl5/IO/Uncompress/Base.pm:14 + 0.00 0.0001 1 0.000087 :...are/perl5/Test/Builder.pm:69 + 0.00 0.0001 1 0.000087 :.../perl5/IO/Socket/SSL.pm:1396 + 0.00 0.0001 1 0.000086 :.../share/perl5/HTTP/Date.pm:11 + 0.00 0.0001 7 0.000012 DynaLoader::dl_load_flags + 0.00 0.0001 1 0.000086 Getopt::Long::import + 0.00 0.0001 2 0.000043 main::lost_connection + 0.00 0.0001 3 0.000028 Scalar::Util::dualvar + 0.00 0.0001 3 0.000028 IO::Socket::INET::_get_proto_name + 0.00 0.0001 1 0.000084 :...re/perl5/IO/Socket/SSL.pm:21 + 0.00 0.0001 4 0.000021 version::("" + 0.00 0.0001 1 0.000084 Time::HiRes::AUTOLOAD + 0.00 0.0001 1 0.000083 :...re/perl5/IO/Socket/SSL.pm:41 + 0.00 0.0001 3 0.000028 base::has_version + 0.00 0.0001 1 0.000083 :...rl5/Compress/Raw/Zlib.pm:151 + 0.00 0.0001 1 0.000083 :.../perl5/IO/Socket/SSL.pm:1403 + 0.00 0.0001 1 0.000083 :...usr/lib/perl/5.14/Errno.pm:8 + 0.00 0.0001 1 0.000083 :...e/perl/5.14/Digest/base.pm:3 + 0.00 0.0001 1 0.000082 :...mpress/Gzip/Constants.pm:119 + 0.00 0.0001 1 0.000082 :...rl5/IO/Uncompress/Base.pm:23 + 0.00 0.0001 1 0.000082 :...l/5.14/Math/BigInt/Calc.pm:3 + 0.00 0.0001 1 0.000082 :....14/Math/BigInt/Calc.pm:2115 + 0.00 0.0001 1 0.000082 :.../Compress/Base/Common.pm:521 + 0.00 0.0001 1 0.000082 :...perl5/File/GlobMapper.pm:341 + 0.00 0.0001 1 0.000082 :...re/perl/5.14/File/Copy.pm:10 + 0.00 0.0001 2 0.000041 :./imapsync:2862 + 0.00 0.0001 1 0.000081 :...perl5/IO/Compress/Gzip.pm:12 + 0.00 0.0001 3 0.000027 :.../lib/Mail/IMAPClient.pm:2715 + 0.00 0.0001 2 0.000040 :./imapsync:4720 + 0.00 0.0001 1 0.000080 :.../perl/5.14/Math/BigInt.pm:19 + 0.00 0.0001 1 0.000080 :.../perl/5.14/Data/Dumper.pm:16 + 0.00 0.0001 1 0.000079 :...38/lib/Mail/IMAPClient.pm:20 + 0.00 0.0001 1 0.000078 :...5.14/Math/BigInt/Calc.pm:137 + 0.00 0.0001 1 0.000078 :...r/share/perl5/JSON.pm:268]:9 + 0.00 0.0001 1 0.000078 :.../perl/5.14/Getopt/Long.pm:15 + 0.00 0.0001 1 0.000078 File::Basename::dirname + 0.00 0.0001 1 0.000077 main::header_construct + 0.00 0.0001 1 0.000077 :...perl5/Crypt/OpenSSL/RSA.pm:3 + 0.00 0.0001 1 0.000077 Mail::IMAPClient::getquotaroot + 0.00 0.0001 1 0.000077 :...5/IO/Uncompress/Gunzip.pm:16 + 0.00 0.0001 1 0.000077 :...erl5/IO/Uncompress/Base.pm:6 + 0.00 0.0001 1 0.000077 :...l5/Crypt/OpenSSL/Bignum.pm:3 + 0.00 0.0001 1 0.000077 :...are/perl/5.14/File/Path.pm:3 + 0.00 0.0001 3 0.000025 Test::Builder::_new_fh + 0.00 0.0001 1 0.000076 :...e/perl5/Test/Builder.pm:2502 + 0.00 0.0001 1 0.000076 :...ompress/Adapter/Deflate.pm:8 + 0.00 0.0001 1 0.000076 :...r/share/perl5/Test/More.pm:3 + 0.00 0.0001 1 0.000075 English::import + 0.00 0.0001 1 0.000075 :...e/perl5/Module/Runtime.pm:47 + 0.00 0.0001 1 0.000075 :...hare/perl5/Test/Builder.pm:3 + 0.00 0.0001 1 0.000074 :...hare/perl5/Test/More.pm:1255 + 0.00 0.0001 1 0.000074 :...IO/Compress/Zlib/Extra.pm:13 + 0.00 0.0001 1 0.000074 :...JSON/WebToken/Constants.pm:5 + 0.00 0.0001 1 0.000074 :...re/perl5/IO/Socket/SSL.pm:54 + 0.00 0.0001 3 0.000025 Math::BigInt::Calc::_new + 0.00 0.0001 4 0.000018 Test::Builder::_autoflush + 0.00 0.0001 1 0.000073 :.../share/perl/5.14/Symbol.pm:3 + 0.00 0.0001 1 0.000072 :...rl5/IO/Uncompress/Base.pm:21 + 0.00 0.0001 2 0.000036 main::convert_sep_to_slash + 0.00 0.0001 1 0.000072 :...5.14/Math/BigInt/Calc.pm:792 + 0.00 0.0001 1 0.000072 :...perl/5.14/Sys/Hostname.pm:26 + 0.00 0.0001 1 0.000072 :.../perl5/IO/Compress/Base.pm:9 + 0.00 0.0001 1 0.000072 :...5.14/Math/BigInt/Calc.pm:475 + 0.00 0.0001 1 0.000072 :...5/IO/Uncompress/Gunzip.pm:50 + 0.00 0.0001 1 0.000072 :...O/Uncompress/RawInflate.pm:8 + 0.00 0.0001 1 0.000072 :.../perl5/Params/Classify.pm:77 + 0.00 0.0001 1 0.000072 :...ib/perl5/Unicode/String.pm:5 + 0.00 0.0001 1 0.000072 :...l5/IO/Uncompress/Base.pm:428 + 0.00 0.0001 1 0.000072 :...sr/lib/perl/5.14/POSIX.pm:52 + 0.00 0.0001 1 0.000071 :...ompress/Adapter/Inflate.pm:7 + 0.00 0.0001 1 0.000071 Net::SSLeay::RAND_seed + 0.00 0.0001 1 0.000071 :...perl5/IO/Compress/Gzip.pm:14 + 0.00 0.0001 1 0.000070 :...erl5/IO/Compress/Base.pm:884 + 0.00 0.0001 1 0.000070 :.../perl5/IO/Socket/SSL.pm:1355 + 0.00 0.0001 1 0.000070 :...rl/5.14.2/JSON/WebToken.pm:5 + 0.00 0.0001 1 0.000070 :...e/perl5/Digest/HMAC_MD5.pm:6 + 0.00 0.0001 1 0.000069 :...b/perl/5.14/MIME/Base64.pm:4 + 0.00 0.0001 1 0.000069 :...erl5/IO/Compress/Base.pm:272 + 0.00 0.0001 1 0.000069 :...share/perl5/Authen/NTLM.pm:2 + 0.00 0.0001 1 0.000068 :...IO/Compress/Base/Common.pm:5 + 0.00 0.0001 1 0.000068 :...lib/perl/5.14/Storable.pm:22 + 0.00 0.0001 1 0.000068 :...IO/Compress/RawDeflate.pm:11 + 0.00 0.0001 1 0.000068 :...ompress/Adapter/Inflate.pm:8 + 0.00 0.0001 1 0.000068 :/usr/share/perl5/JSON.pm:318 + 0.00 0.0001 1 0.000068 :...erl5/IO/Uncompress/Base.pm:5 + 0.00 0.0001 1 0.000068 :...O/Compress/RawDeflate.pm:125 + 0.00 0.0001 1 0.000068 :...perl5/Compress/Raw/Zlib.pm:6 + 0.00 0.0001 3 0.000023 :./imapsync:1668 + 0.00 0.0001 1 0.000068 :.../Compress/Base/Common.pm:846 + 0.00 0.0001 1 0.000068 File::Spec::Unix::canonpath + 0.00 0.0001 1 0.000068 :...O/Compress/RawDeflate.pm:157 + 0.00 0.0001 1 0.000068 :...usr/lib/perl5/Socket6.pm:213 + 0.00 0.0001 1 0.000067 :...O/Uncompress/RawInflate.pm:9 + 0.00 0.0001 2 0.000034 :.../lib/Mail/IMAPClient.pm:1984 + 0.00 0.0001 1 0.000067 :....14/Math/BigInt/Calc.pm:1909 + 0.00 0.0001 1 0.000067 :...b/perl/5.14/Scalar/Util.pm:9 + 0.00 0.0001 1 0.000067 :...re/perl/5.14/overload.pm:147 + 0.00 0.0001 1 0.000067 :...re/perl5/Compress/Zlib.pm:46 + 0.00 0.0001 1 0.000066 :.../perl5/File/GlobMapper.pm:24 + 0.00 0.0001 1 0.000066 :...erl/5.14/File/Basename.pm:51 + 0.00 0.0001 1 0.000066 :/usr/share/perl5/URI.pm:3 + 0.00 0.0001 1 0.000066 :...usr/lib/perl5/JSON/XS.pm:121 + 0.00 0.0001 1 0.000066 Mail::IMAPClient::selectable + 0.00 0.0001 2 0.000033 Mail::IMAPClient::uidvalidity + 0.00 0.0001 1 0.000066 :...r/lib/perl5/HTML/Parser.pm:9 + 0.00 0.0001 1 0.000066 File::Basename::basename + 0.00 0.0001 2 0.000033 Mail::IMAPClient::Reconnect_counter + 0.00 0.0001 1 0.000066 :...b/perl5/HTML/Entities.pm:138 + 0.00 0.0001 1 0.000066 :...ompress/Adapter/Deflate.pm:7 + 0.00 0.0001 1 0.000066 :...re/perl5/Test/Builder.pm:916 + 0.00 0.0001 1 0.000066 :...hare/perl5/HTTP/Headers.pm:3 + 0.00 0.0001 1 0.000066 :...erl/5.14/Math/BigInt.pm:3069 + 0.00 0.0001 1 0.000066 :...Compress/Base/Common.pm:1050 + 0.00 0.0001 1 0.000066 :./imapsync:0 + 0.00 0.0001 1 0.000066 :/usr/share/perl5/URI.pm:28 + 0.00 0.0001 1 0.000066 :...re/perl/5.14/AutoLoader.pm:4 + 0.00 0.0001 1 0.000065 :...ib/perl/5.14/attributes.pm:9 + 0.00 0.0001 1 0.000065 :...erl/5.14/Math/BigInt.pm:2623 + 0.00 0.0001 1 0.000065 :.../Compress/Base/Common.pm:481 + 0.00 0.0001 3 0.000022 :./imapsync:1253 + 0.00 0.0001 1 0.000065 :.../perl/5.14/IO/Seekable.pm:12 + 0.00 0.0001 1 0.000065 :.../share/perl5/HTTP/Date.pm:14 + 0.00 0.0001 1 0.000065 :...ib/perl/5.14/IO/Socket.pm:11 + 0.00 0.0001 1 0.000065 :./imapsync:688 + 0.00 0.0001 1 0.000065 :...re/perl5/HTTP/Message.pm:648 + 0.00 0.0001 1 0.000064 main::is_a_release_number + 0.00 0.0001 1 0.000064 :...are/perl5/LWP/UserAgent.pm:3 + 0.00 0.0001 1 0.000064 :...lib/perl/5.14/IO/Handle.pm:3 + 0.00 0.0001 1 0.000064 :...are/perl5/Authen/NTLM.pm:191 + 0.00 0.0001 1 0.000064 :...perl/5.14/Math/BigInt.pm:879 + 0.00 0.0001 1 0.000064 :...re/perl5/IO/Socket/SSL.pm:38 + 0.00 0.0001 1 0.000063 :...hare/perl5/HTTP/Message.pm:3 + 0.00 0.0001 1 0.000063 :...perl/5.14/Math/BigInt.pm:207 + 0.00 0.0001 1 0.000063 :.../perl5/Params/Classify.pm:78 + 0.00 0.0001 1 0.000063 :...re/perl5/IO/Socket/SSL.pm:43 + 0.00 0.0001 1 0.000063 :.../share/perl5/JSON.pm:268]:16 + 0.00 0.0001 1 0.000063 :...rl5/Compress/Raw/Zlib.pm:120 + 0.00 0.0001 1 0.000063 :...rl5/IO/Uncompress/Base.pm:15 + 0.00 0.0001 1 0.000062 :...sr/lib/perl5/Devel/Size.pm:3 + 0.00 0.0001 1 0.000062 :/usr/lib/perl5/Cwd.pm:811 + 0.00 0.0001 1 0.000062 :...sr/lib/perl/5.14/POSIX.pm:60 + 0.00 0.0001 1 0.000062 :...JSON/WebToken/Exception.pm:7 + 0.00 0.0001 1 0.000062 :...5/IO/Uncompress/Gunzip.pm:15 + 0.00 0.0001 1 0.000062 :...lib/perl/5.14/Storable.pm:60 + 0.00 0.0001 1 0.000061 :...e/perl5/LWP/UserAgent.pm:374 + 0.00 0.0001 1 0.000061 :...re/perl5/Compress/Zlib.pm:15 + 0.00 0.0001 1 0.000061 :.../IMAPClient/MessageSet.pm:18 + 0.00 0.0001 1 0.000061 :...b/perl/5.14/IO/Handle.pm:366 + 0.00 0.0001 1 0.000061 :...rl/5.14/IO/Socket/INET.pm:11 + 0.00 0.0001 1 0.000061 :.../5.14.2/JSON/WebToken.pm:249 + 0.00 0.0001 1 0.000061 :...r/lib/perl/5.14/IO/File.pm:6 + 0.00 0.0001 1 0.000061 main::header_line_normalize + 0.00 0.0001 1 0.000061 :...r/lib/perl5/Net/SSLeay.pm:20 + 0.00 0.0001 1 0.000061 :...rl5/Compress/Raw/Zlib.pm:122 + 0.00 0.0001 1 0.000061 :.../share/perl5/JSON.pm:353]:14 + 0.00 0.0001 1 0.000061 :...are/perl5/Compress/Zlib.pm:6 + 0.00 0.0001 1 0.000060 :...perl5/IO/Compress/Base.pm:11 + 0.00 0.0001 1 0.000060 :...hare/perl5/Test/More.pm:1621 + 0.00 0.0001 1 0.000060 :...ib/perl5/Unicode/String.pm:6 + 0.00 0.0001 1 0.000060 :...hare/perl5/Digest/HMAC.pm:47 + 0.00 0.0001 1 0.000060 :...hare/perl/5.14/English.pm:47 + 0.00 0.0001 1 0.000060 :...sr/lib/perl/5.14/POSIX.pm:19 + 0.00 0.0001 1 0.000060 :./imapsync:678 + 0.00 0.0001 3 0.000020 IO::Socket::INET::_get_proto_number + 0.00 0.0001 1 0.000059 main::quota_extract_storage_current_in_bytes + 0.00 0.0001 1 0.000059 :...re/perl/5.14/Time/Local.pm:4 + 0.00 0.0001 1 0.000059 List::Util::first + 0.00 0.0001 1 0.000059 :...re/perl5/IO/Socket/SSL.pm:19 + 0.00 0.0001 1 0.000059 :/usr/share/perl5/JSON.pm:4 + 0.00 0.0001 1 0.000058 :...usr/lib/perl5/File/Spec.pm:3 + 0.00 0.0001 1 0.000058 :...e/perl/5.14/File/Path.pm:329 + 0.00 0.0001 2 0.000029 Test::Builder::new + 0.00 0.0001 2 0.000029 :.../lib/Mail/IMAPClient.pm:1318 + 0.00 0.0001 1 0.000058 :...ib/perl/5.14/File/Glob.pm:50 + 0.00 0.0001 1 0.000058 main::automap + 0.00 0.0001 1 0.000058 :.../perl/5.14/AutoLoader.pm:138 + 0.00 0.0001 1 0.000058 :...e/perl5/Test/Builder.pm:2181 + 0.00 0.0001 1 0.000058 :/usr/share/perl5/URI.pm:128 + 0.00 0.0001 1 0.000058 :...e/perl5/Test/Builder.pm:1600 + 0.00 0.0001 1 0.000058 :...r/lib/perl5/Net/SSLeay.pm:24 + 0.00 0.0001 1 0.000058 :...r/lib/perl5/Net/SSLeay.pm:16 + 0.00 0.0001 1 0.000058 :...perl5/Params/Classify.pm:122 + 0.00 0.0001 1 0.000058 :...ib/perl/5.14/List/Util.pm:11 + 0.00 0.0001 1 0.000057 :...perl/5.14/Getopt/Long.pm:222 + 0.00 0.0001 1 0.000057 :...re/perl/5.14/IPC/Open3.pm:92 + 0.00 0.0001 1 0.000057 :...perl/5.14/Math/BigInt.pm:336 + 0.00 0.0001 1 0.000057 :...sr/share/perl/5.14/Carp.pm:3 + 0.00 0.0001 1 0.000057 :.../Compress/Base/Common.pm:149 + 0.00 0.0001 1 0.000057 JSON::import + 0.00 0.0001 1 0.000057 :...erl/5.14/File/Basename.pm:47 + 0.00 0.0001 1 0.000057 :.../perl5/Authen/NTLM/MD4.pm:19 + 0.00 0.0001 1 0.000057 :...perl5/Crypt/OpenSSL/RSA.pm:4 + 0.00 0.0001 1 0.000056 :.../share/perl5/JSON.pm:268]:99 + 0.00 0.0001 1 0.000056 :.../perl5/IO/Socket/INET6.pm:12 + 0.00 0.0001 1 0.000056 :...38/lib/Mail/IMAPClient.pm:21 + 0.00 0.0001 1 0.000056 :.../share/perl/5.14/parent.pm:2 + 0.00 0.0001 1 0.000056 :...perl5/Crypt/OpenSSL/RSA.pm:9 + 0.00 0.0001 2 0.000028 :...8/lib/Mail/IMAPClient.pm:584 + 0.00 0.0001 2 0.000028 PerlIO::get_layers + 0.00 0.0001 2 0.000028 Mail::IMAPClient::Banner + 0.00 0.0001 1 0.000056 Test::Builder::reset_outputs + 0.00 0.0001 1 0.000056 :...ompress/Adapter/Inflate.pm:3 + 0.00 0.0001 1 0.000056 :.../share/perl/5.14/Carp.pm:341 + 0.00 0.0001 1 0.000056 :...JSON/WebToken/Constants.pm:3 + 0.00 0.0001 1 0.000056 :.../IO/Compress/RawDeflate.pm:5 + 0.00 0.0001 1 0.000056 :...hare/perl5/LWP/Protocol.pm:7 + 0.00 0.0001 1 0.000056 :...l/5.14.2/JSON/WebToken.pm:13 + 0.00 0.0001 1 0.000056 :...ompress/Adapter/Deflate.pm:3 + 0.00 0.0001 1 0.000056 :...e/perl/5.14/SelectSaver.pm:6 + 0.00 0.0001 1 0.000056 :...re/perl/5.14/File/Copy.pm:14 + 0.00 0.0001 1 0.000055 :...38/lib/Mail/IMAPClient.pm:16 + 0.00 0.0001 1 0.000055 main::filter_forbidden_characters + 0.00 0.0001 1 0.000055 :...hare/perl/5.14/Tie/Hash.pm:5 + 0.00 0.0001 1 0.000055 :...r/lib/perl/5.14/IO/File.pm:8 + 0.00 0.0001 1 0.000055 File::Spec::Unix::tmpdir + 0.00 0.0001 1 0.000055 :...r/lib/perl5/Net/SSLeay.pm:17 + 0.00 0.0001 1 0.000055 main::quota_extract_storage_limit_in_bytes + 0.00 0.0001 1 0.000055 :...share/perl5/Authen/NTLM.pm:5 + 0.00 0.0001 1 0.000055 feature::import + 0.00 0.0001 1 0.000055 :.../share/perl5/URI/Escape.pm:2 + 0.00 0.0001 1 0.000055 :...are/perl5/HTTP/Response.pm:7 + 0.00 0.0001 1 0.000054 :...r/lib/perl5/Net/LibIDN.pm:85 + 0.00 0.0001 1 0.000054 :...rl5/Compress/Raw/Zlib.pm:106 + 0.00 0.0001 1 0.000054 :...perl/5.14/Math/BigInt.pm:656 + 0.00 0.0001 1 0.000054 :...rl/5.14/File/Basename.pm:394 + 0.00 0.0001 1 0.000054 :/usr/share/perl5/JSON.pm:383 + 0.00 0.0001 1 0.000054 :...e/perl5/Digest/HMAC_MD5.pm:4 + 0.00 0.0001 1 0.000053 :...re/perl/5.14/File/Path.pm:19 + 0.00 0.0001 1 0.000053 :...perl/5.14/Math/BigInt.pm:548 + 0.00 0.0001 1 0.000053 :...O/Compress/Base/Common.pm:46 + 0.00 0.0001 1 0.000053 :...erl/5.14/IO/Socket/UNIX.pm:9 + 0.00 0.0001 1 0.000053 :.../lib/Mail/IMAPClient.pm:1541 + 0.00 0.0001 1 0.000053 :...erl5/IO/Uncompress/Base.pm:4 + 0.00 0.0001 1 0.000053 :...are/perl5/Compress/Zlib.pm:7 + 0.00 0.0001 1 0.000053 :...ib/perl/5.14/IO/Socket.pm:13 + 0.00 0.0001 1 0.000053 :...sr/lib/perl/5.14/POSIX.pm:39 + 0.00 0.0001 1 0.000052 :...rl5/IO/Socket/SSL.pm:1363]:1 + 0.00 0.0001 1 0.000052 :/usr/lib/perl5/Socket6.pm:38 + 0.00 0.0001 1 0.000052 :...l5/IO/Uncompress/Gunzip.pm:8 + 0.00 0.0001 2 0.000026 :.../lib/Mail/IMAPClient.pm:1719 + 0.00 0.0001 2 0.000026 main::ucsecond + 0.00 0.0001 1 0.000052 :...hare/perl5/Test/More.pm:1332 + 0.00 0.0001 1 0.000052 :...are/perl/5.14/constant.pm:32 + 0.00 0.0001 1 0.000052 :...ib/perl5/File/Spec/Unix.pm:3 + 0.00 0.0001 1 0.000052 :...rl/5.14/IO/Socket/INET.pm:13 + 0.00 0.0001 1 0.000052 :...sr/lib/perl5/Devel/Size.pm:4 + 0.00 0.0001 1 0.000052 :...e/perl5/IO/Socket/SSL.pm:114 + 0.00 0.0001 1 0.000052 :.../perl/5.14/Sys/Hostname.pm:3 + 0.00 0.0001 1 0.000052 :...perl5/Crypt/OpenSSL/RSA.pm:6 + 0.00 0.0001 1 0.000051 :...IO/Compress/Base/Common.pm:3 + 0.00 0.0001 1 0.000051 :...r/lib/perl5/Net/SSLeay.pm:18 + 0.00 0.0001 1 0.000051 :.../IO/Compress/Zlib/Extra.pm:5 + 0.00 0.0001 1 0.000051 :...perl/5.14/Math/BigInt.pm:943 + 0.00 0.0001 1 0.000051 :...rl/5.14.2/JSON/WebToken.pm:3 + 0.00 0.0001 1 0.000051 :...5/IO/Uncompress/Gunzip.pm:17 + 0.00 0.0001 1 0.000051 Time::Local::_daygm + 0.00 0.0001 1 0.000051 main::flags_for_host2 + 0.00 0.0001 1 0.000051 main::logfileprepa + 0.00 0.0001 1 0.000051 :...JSON/WebToken/Exception.pm:9 + 0.00 0.0001 1 0.000051 :...re/perl5/IO/Socket/SSL.pm:22 + 0.00 0.0001 1 0.000051 :.../perl5/IO/Compress/Base.pm:6 + 0.00 0.0001 1 0.000051 :...Compress/Gzip/Constants.pm:3 + 0.00 0.0001 1 0.000051 :...perl5/Compress/Raw/Zlib.pm:7 + 0.00 0.0001 1 0.000051 :...mpress/Gzip/Constants.pm:145 + 0.00 0.0001 1 0.000051 Math::BigInt::STORE + 0.00 0.0001 1 0.000051 :.../perl5/IO/Compress/Gzip.pm:5 + 0.00 0.0001 1 0.000051 :...e/perl5/Module/Runtime.pm:55 + 0.00 0.0001 1 0.000051 :...38/lib/Mail/IMAPClient.pm:14 + 0.00 0.0001 1 0.000051 :...l/5.14.2/JSON/WebToken.pm:11 + 0.00 0.0001 1 0.000051 :.../perl/5.14/Sys/Hostname.pm:5 + 0.00 0.0000 1 0.000050 :...e/perl5/Authen/NTLM/DES.pm:8 + 0.00 0.0000 1 0.000050 :.../lib/perl/5.14/Socket.pm:326 + 0.00 0.0000 1 0.000050 :...perl/5.14/Math/BigInt.pm:690 + 0.00 0.0000 1 0.000050 :...ib/perl/5.14/Digest/MD5.pm:3 + 0.00 0.0000 1 0.000050 :...perl/5.14.2/Data/Uniqid.pm:8 + 0.00 0.0000 1 0.000050 Math::BigInt::round_mode + 0.00 0.0000 1 0.000050 :.../Compress/Base/Common.pm:484 + 0.00 0.0000 1 0.000050 :...lib/perl/5.14/File/Glob.pm:3 + 0.00 0.0000 1 0.000050 :...erl/5.14.2/Data/Uniqid.pm:27 + 0.00 0.0000 1 0.000050 :/usr/share/perl5/IO/Tee.pm:4 + 0.00 0.0000 1 0.000050 :...hare/perl5/HTTP/Request.pm:7 + 0.00 0.0000 1 0.000049 :...rl/5.14/IO/Socket/UNIX.pm:12 + 0.00 0.0000 1 0.000049 :...usr/lib/perl/5.14/POSIX.pm:2 + 0.00 0.0000 1 0.000049 :...perl/5.14/Math/BigInt.pm:377 + 0.00 0.0000 1 0.000049 :...share/perl5/HTTP/Status.pm:3 + 0.00 0.0000 1 0.000049 :...b/perl5/HTML/Entities.pm:139 + 0.00 0.0000 1 0.000049 :...38/lib/Mail/IMAPClient.pm:99 + 0.00 0.0000 1 0.000049 :...perl/5.14/Getopt/Long.pm:228 + 0.00 0.0000 1 0.000049 :...perl/5.14/Math/BigInt.pm:447 + 0.00 0.0000 1 0.000049 Test::Builder::create + 0.00 0.0000 1 0.000049 :...re/perl/5.14/AutoLoader.pm:3 + 0.00 0.0000 1 0.000049 :/usr/share/perl5/IO/Tee.pm:8 + 0.00 0.0000 1 0.000049 :...are/perl5/LWP/Protocol.pm:62 + 0.00 0.0000 1 0.000048 :....14/Math/BigInt/Calc.pm:2150 + 0.00 0.0000 1 0.000048 :...O/Uncompress/RawInflate.pm:4 + 0.00 0.0000 1 0.000048 Digest::MD5::md5_base64 + 0.00 0.0000 1 0.000048 :....38/lib/Mail/IMAPClient.pm:6 + 0.00 0.0000 2 0.000024 Mail::IMAPClient::Tls + 0.00 0.0000 1 0.000048 :...are/perl/5.14/IPC/Open3.pm:3 + 0.00 0.0000 1 0.000048 :.../perl5/File/Spec/Unix.pm:149 + 0.00 0.0000 1 0.000048 :...ib/perl/5.14/Digest/SHA.pm:6 + 0.00 0.0000 1 0.000048 :...5/IO/Uncompress/Gunzip.pm:14 + 0.00 0.0000 1 0.000048 :...l5/File/Copy/Recursive.pm:10 + 0.00 0.0000 1 0.000048 :.../perl/5.14/AutoLoader.pm:186 + 0.00 0.0000 1 0.000048 :...IO/Compress/Base/Common.pm:7 + 0.00 0.0000 1 0.000048 :...e/perl/5.14/Time/Local.pm:27 + 0.00 0.0000 1 0.000048 :...re/perl/5.14/Time/Local.pm:5 + 0.00 0.0000 1 0.000047 :.../perl5/Digest/HMAC_MD5.pm:20 + 0.00 0.0000 1 0.000047 :...perl/5.14/Math/BigInt.pm:225 + 0.00 0.0000 1 0.000047 :...r/lib/perl5/Net/LibIDN.pm:11 + 0.00 0.0000 1 0.000047 :.../perl5/Digest/HMAC_SHA1.pm:4 + 0.00 0.0000 1 0.000047 :...JSON/WebToken/Exception.pm:3 + 0.00 0.0000 1 0.000047 :...rl5/Test/Builder/Module.pm:3 + 0.00 0.0000 1 0.000047 :...lib/perl/5.14/IO/Select.pm:9 + 0.00 0.0000 1 0.000047 :.../perl/5.14/Math/BigInt.pm:29 + 0.00 0.0000 1 0.000047 :./imapsync:701 + 0.00 0.0000 1 0.000047 :...e/perl5/Digest/HMAC_MD5.pm:5 + 0.00 0.0000 1 0.000047 :...l/5.14.2/JSON/WebToken.pm:12 + 0.00 0.0000 1 0.000047 :...ompress/Gzip/Constants.pm:65 + 0.00 0.0000 1 0.000047 :./imapsync:691 + 0.00 0.0000 1 0.000047 :...ib/perl/5.14/IO/Socket.pm:17 + 0.00 0.0000 1 0.000047 :...share/perl/5.14/parent.pm:25 + 0.00 0.0000 1 0.000047 :./imapsync:705 + 0.00 0.0000 1 0.000047 :...perl/5.14/Math/BigInt.pm:278 + 0.00 0.0000 1 0.000047 :.../perl5/IO/Socket/INET6.pm:13 + 0.00 0.0000 1 0.000046 :/usr/lib/perl5/Cwd.pm:170 + 0.00 0.0000 1 0.000046 :...are/perl5/Test/Builder.pm:19 + 0.00 0.0000 1 0.000046 :...rl/5.14.2/JSON/WebToken.pm:4 + 0.00 0.0000 1 0.000046 :...perl/5.14.2/Data/Uniqid.pm:4 + 0.00 0.0000 1 0.000046 :...b/perl/5.14/IO/Seekable.pm:6 + 0.00 0.0000 1 0.000046 :...l/IMAPClient/MessageSet.pm:1 + 0.00 0.0000 1 0.000046 :...38/lib/Mail/IMAPClient.pm:19 + 0.00 0.0000 1 0.000046 :.../perl5/IO/Socket/INET6.pm:38 + 0.00 0.0000 1 0.000046 :.../Compress/Base/Common.pm:523 + 0.00 0.0000 1 0.000046 :...rl5/File/Copy/Recursive.pm:3 + 0.00 0.0000 1 0.000046 :...rl5/Compress/Raw/Zlib.pm:121 + 0.00 0.0000 1 0.000046 :.../perl/5.14/Scalar/Util.pm:10 + 0.00 0.0000 1 0.000046 :....14/Math/BigInt/Calc.pm:2186 + 0.00 0.0000 1 0.000046 :...38/lib/Mail/IMAPClient.pm:31 + 0.00 0.0000 1 0.000046 :...5.14/Math/BigInt/Calc.pm:154 + 0.00 0.0000 1 0.000046 :...sr/lib/perl5/Net/LibIDN.pm:7 + 0.00 0.0000 1 0.000046 :...sr/lib/perl/5.14/Socket.pm:3 + 0.00 0.0000 1 0.000046 :/usr/share/perl5/URI.pm:4 + 0.00 0.0000 1 0.000046 :...e/perl5/Digest/HMAC_MD5.pm:9 + 0.00 0.0000 1 0.000046 :...l/5.14/Math/BigInt/Calc.pm:4 + 0.00 0.0000 1 0.000046 :...are/perl/5.14/IPC/Open3.pm:9 + 0.00 0.0000 1 0.000046 :.../share/perl/5.14/parent.pm:3 + 0.00 0.0000 1 0.000046 :.../Compress/Base/Common.pm:524 + 0.00 0.0000 1 0.000046 :...4/Tie/Hash/NamedCapture.pm:1 + 0.00 0.0000 1 0.000045 :...ib/perl/5.14/Digest/SHA.pm:5 + 0.00 0.0000 2 0.000023 :...8/lib/Mail/IMAPClient.pm:360 + 0.00 0.0000 2 0.000023 :./imapsync:4087 + 0.00 0.0000 1 0.000045 :/usr/lib/perl5/Cwd.pm:172 + 0.00 0.0000 1 0.000045 :...l5/File/Copy/Recursive.pm:18 + 0.00 0.0000 1 0.000045 :.../perl5/IO/Socket/INET6.pm:31 + 0.00 0.0000 1 0.000045 :...IO/Compress/Base/Common.pm:8 + 0.00 0.0000 1 0.000045 :...share/perl5/Authen/NTLM.pm:6 + 0.00 0.0000 1 0.000045 :...e/perl/5.14/Digest/base.pm:4 + 0.00 0.0000 1 0.000045 :...e/perl/5.14/AutoLoader.pm:30 + 0.00 0.0000 1 0.000045 :.../perl/5.14/Getopt/Long.pm:25 + 0.00 0.0000 1 0.000045 :...usr/lib/perl/5.14/Fcntl.pm:3 + 0.00 0.0000 1 0.000045 :...sr/lib/perl5/Net/LibIDN.pm:6 + 0.00 0.0000 1 0.000044 :.../perl5/IO/Socket/SSL.pm:1357 + 0.00 0.0000 1 0.000044 :...sr/share/perl/5.14/base.pm:4 + 0.00 0.0000 1 0.000044 :.../share/perl5/JSON.pm:268]:42 + 0.00 0.0000 1 0.000044 :...share/perl5/Authen/NTLM.pm:8 + 0.00 0.0000 1 0.000044 :...sr/lib/perl5/Net/LibIDN.pm:4 + 0.00 0.0000 1 0.000044 :...ib/perl5/Unicode/String.pm:7 + 0.00 0.0000 1 0.000044 :.../share/perl5/JSON.pm:268]:24 + 0.00 0.0000 1 0.000044 :...are/perl/5.14/File/Path.pm:4 + 0.00 0.0000 1 0.000044 :...perl/5.14/Math/BigInt.pm:470 + 0.00 0.0000 1 0.000044 :...perl5/Digest/HMAC_SHA1.pm:20 + 0.00 0.0000 1 0.000044 :...perl5/IO/Compress/Base.pm:12 + 0.00 0.0000 1 0.000044 :...38/lib/Mail/IMAPClient.pm:37 + 0.00 0.0000 3 0.000015 base::has_fields + 0.00 0.0000 1 0.000043 :/usr/share/perl5/IO/Tee.pm:5 + 0.00 0.0000 1 0.000043 :.../share/perl5/JSON.pm:268]:29 + 0.00 0.0000 1 0.000043 :...rl5/Compress/Raw/Zlib.pm:114 + 0.00 0.0000 1 0.000043 :.../perl5/IO/Socket/INET6.pm:40 + 0.00 0.0000 1 0.000043 :.../perl5/IO/Socket/SSL.pm:1356 + 0.00 0.0000 1 0.000043 :...l5/IO/Uncompress/Gunzip.pm:9 + 0.00 0.0000 1 0.000043 :...JSON/WebToken/Constants.pm:4 + 0.00 0.0000 1 0.000043 :./imapsync:679 + 0.00 0.0000 1 0.000043 :.../perl5/IO/Socket/INET6.pm:41 + 0.00 0.0000 1 0.000043 :...re/perl/5.14/constant.pm:114 + 0.00 0.0000 1 0.000043 :...l5/Crypt/OpenSSL/Bignum.pm:5 + 0.00 0.0000 1 0.000043 :...hare/perl/5.14/constant.pm:3 + 0.00 0.0000 1 0.000043 :...hare/perl5/URI/Escape.pm:145 + 0.00 0.0000 1 0.000043 :...lib/perl/5.14/IO/Handle.pm:6 + 0.00 0.0000 1 0.000043 :...rl5/Compress/Raw/Zlib.pm:137 + 0.00 0.0000 1 0.000043 :...sr/lib/perl/5.14/Socket.pm:8 + 0.00 0.0000 1 0.000043 :...re/perl/5.14/IPC/Open3.pm:10 + 0.00 0.0000 1 0.000043 main::setlogfile + 0.00 0.0000 1 0.000043 :.../perl/5.14/Data/Dumper.pm:20 + 0.00 0.0000 1 0.000043 :...re/perl5/Compress/Zlib.pm:16 + 0.00 0.0000 1 0.000043 :...hare/perl5/HTTP/Headers.pm:6 + 0.00 0.0000 1 0.000043 :...O/Compress/Base/Common.pm:52 + 0.00 0.0000 1 0.000043 :...perl5/Compress/Raw/Zlib.pm:9 + 0.00 0.0000 1 0.000043 :...e/perl5/Module/Runtime.pm:48 + 0.00 0.0000 1 0.000043 :...IO/Compress/Base/Common.pm:4 + 0.00 0.0000 1 0.000042 :...8/lib/Mail/IMAPClient.pm:862 + 0.00 0.0000 1 0.000042 :/usr/lib/perl5/Socket6.pm:39 + 0.00 0.0000 1 0.000042 :...erl/5.14/File/Basename.pm:50 + 0.00 0.0000 1 0.000042 :.../perl/5.14/Math/BigInt.pm:30 + 0.00 0.0000 1 0.000042 :...38/lib/Mail/IMAPClient.pm:18 + 0.00 0.0000 1 0.000042 :...e/perl5/File/GlobMapper.pm:5 + 0.00 0.0000 1 0.000042 :...are/perl/5.14/constant.pm:29 + 0.00 0.0000 1 0.000042 :...rl5/Compress/Raw/Zlib.pm:119 + 0.00 0.0000 1 0.000042 :...JSON/WebToken/Exception.pm:4 + 0.00 0.0000 2 0.000021 File::Spec::Unix::file_name_is_absolute + 0.00 0.0000 1 0.000042 :...share/perl5/HTTP/Status.pm:6 + 0.00 0.0000 1 0.000042 :...hare/perl5/HTTP/Message.pm:4 + 0.00 0.0000 1 0.000042 :.../perl5/IO/Compress/Base.pm:7 + 0.00 0.0000 1 0.000042 :...l5/Crypt/OpenSSL/Bignum.pm:7 + 0.00 0.0000 1 0.000042 :...re/perl/5.14/Time/Local.pm:6 + 0.00 0.0000 1 0.000042 :.../perl5/Digest/HMAC_SHA1.pm:9 + 0.00 0.0000 1 0.000042 :...re/perl5/Compress/Zlib.pm:48 + 0.00 0.0000 1 0.000042 :...mpress/Gzip/Constants.pm:109 + 0.00 0.0000 1 0.000042 :.../Compress/Base/Common.pm:847 + 0.00 0.0000 1 0.000042 :...l5/Crypt/OpenSSL/Bignum.pm:4 + 0.00 0.0000 1 0.000042 :/usr/lib/perl/5.14/IO.pm:6 + 0.00 0.0000 1 0.000042 :...perl/5.14.2/Data/Uniqid.pm:5 + 0.00 0.0000 1 0.000042 :...ompress/Gzip/Constants.pm:69 + 0.00 0.0000 1 0.000041 :...r/share/perl/5.14/Carp.pm:46 + 0.00 0.0000 1 0.000041 :...are/perl5/Compress/Zlib.pm:8 + 0.00 0.0000 1 0.000041 :...5.14/Math/BigInt/Calc.pm:165 + 0.00 0.0000 1 0.000041 :...ompress/Adapter/Deflate.pm:4 + 0.00 0.0000 1 0.000041 :.../Compress/Base/Common.pm:150 + 0.00 0.0000 1 0.000041 main::size_filtered + 0.00 0.0000 1 0.000041 :/usr/share/perl5/URI.pm:7 + 0.00 0.0000 1 0.000041 :/usr/lib/perl5/Cwd.pm:171 + 0.00 0.0000 1 0.000041 :...l5/File/Copy/Recursive.pm:12 + 0.00 0.0000 1 0.000041 :...usr/lib/perl5/JSON/XS.pm:122 + 0.00 0.0000 1 0.000041 :...re/perl/5.14/Time/Local.pm:8 + 0.00 0.0000 1 0.000041 :...are/perl5/LWP/UserAgent.pm:4 + 0.00 0.0000 1 0.000041 :.../lib/perl5/HTML/Parser.pm:10 + 0.00 0.0000 1 0.000041 :.../IO/Compress/Zlib/Extra.pm:6 + 0.00 0.0000 1 0.000041 :...ib/perl/5.14/List/Util.pm:12 + 0.00 0.0000 1 0.000041 :...perl/5.14/Math/BigInt.pm:239 + 0.00 0.0000 1 0.000041 :...erl5/Compress/Raw/Zlib.pm:11 + 0.00 0.0000 1 0.000041 :...Compress/Gzip/Constants.pm:5 + 0.00 0.0000 1 0.000041 :/usr/share/perl5/URI.pm:13 + 0.00 0.0000 1 0.000041 :.../perl5/Params/Classify.pm:83 + 0.00 0.0000 1 0.000041 :/usr/share/perl5/JSON.pm:6 + 0.00 0.0000 1 0.000041 :/usr/lib/perl/5.14/IO.pm:8 + 0.00 0.0000 1 0.000041 :...sr/lib/perl5/Net/LibIDN.pm:5 + 0.00 0.0000 1 0.000041 :...e/perl/5.14/SelectSaver.pm:7 + 0.00 0.0000 1 0.000041 :...Compress/Gzip/Constants.pm:4 + 0.00 0.0000 1 0.000041 :.../perl/5.14/Getopt/Long.pm:45 + 0.00 0.0000 1 0.000041 :...ib/perl/5.14/Digest/MD5.pm:4 + 0.00 0.0000 1 0.000041 :.../perl5/Params/Classify.pm:79 + 0.00 0.0000 1 0.000041 :...e/perl5/File/GlobMapper.pm:4 + 0.00 0.0000 1 0.000041 :.../perl5/IO/Compress/Gzip.pm:6 + 0.00 0.0000 1 0.000040 :.../Compress/Base/Common.pm:483 + 0.00 0.0000 1 0.000040 :...ib/perl/5.14/IO/Socket.pm:14 + 0.00 0.0000 1 0.000040 :...erl5/Compress/Raw/Zlib.pm:10 + 0.00 0.0000 1 0.000040 :...ompress/Adapter/Inflate.pm:5 + 0.00 0.0000 1 0.000040 :...5/IO/Uncompress/Gunzip.pm:10 + 0.00 0.0000 1 0.000040 Time::HiRes::constant + 0.00 0.0000 1 0.000040 Errno::TIEHASH + 0.00 0.0000 1 0.000040 :/usr/share/perl5/IO/Tee.pm:9 + 0.00 0.0000 1 0.000040 :...ompress/Adapter/Deflate.pm:5 + 0.00 0.0000 1 0.000040 :.../perl5/IO/Compress/Gzip.pm:7 + 0.00 0.0000 1 0.000040 :...r/share/perl5/Test/More.pm:4 + 0.00 0.0000 1 0.000040 :.../Compress/Base/Common.pm:496 + 0.00 0.0000 1 0.000040 :...O/Uncompress/RawInflate.pm:5 + 0.00 0.0000 1 0.000040 :/usr/share/perl5/IO/Tee.pm:6 + 0.00 0.0000 1 0.000040 :.../IO/Compress/RawDeflate.pm:7 + 0.00 0.0000 1 0.000040 :...re/perl/5.14/File/Copy.pm:11 + 0.00 0.0000 1 0.000040 :...re/perl5/Compress/Zlib.pm:17 + 0.00 0.0000 1 0.000040 :...perl/5.14/Math/BigInt.pm:253 + 0.00 0.0000 1 0.000040 :...ompress/Adapter/Inflate.pm:4 + 0.00 0.0000 1 0.000040 :.../IO/Compress/RawDeflate.pm:6 + 0.00 0.0000 1 0.000040 :...usr/lib/perl/5.14/POSIX.pm:3 + 0.00 0.0000 1 0.000040 :....38/lib/Mail/IMAPClient.pm:7 + 0.00 0.0000 1 0.000040 :...b/perl5/HTML/Entities.pm:140 + 0.00 0.0000 1 0.000040 :.../IO/Compress/Zlib/Extra.pm:7 + 0.00 0.0000 1 0.000039 :...hare/perl/5.14/constant.pm:4 + 0.00 0.0000 1 0.000039 :...hare/perl/5.14/constant.pm:6 + 0.00 0.0000 1 0.000039 :...erl/5.14/File/Basename.pm:52 + 0.00 0.0000 1 0.000039 :...r/share/perl5/Test/More.pm:5 + 0.00 0.0000 1 0.000039 :...lib/perl/5.14/IO/Handle.pm:7 + 0.00 0.0000 3 0.000013 base::has_attr + 0.00 0.0000 1 0.000039 :...O/Compress/Base/Common.pm:47 + 0.00 0.0000 1 0.000039 :.../perl/5.14/Getopt/Long.pm:17 + 0.00 0.0000 1 0.000039 :...e/perl5/Module/Runtime.pm:49 + 0.00 0.0000 1 0.000039 :.../perl/5.14/Getopt/Long.pm:49 + 0.00 0.0000 1 0.000039 :...usr/lib/perl5/File/Spec.pm:4 + 0.00 0.0000 1 0.000039 :...l/IMAPClient/MessageSet.pm:2 + 0.00 0.0000 1 0.000039 :...rl/5.14/IO/Socket/UNIX.pm:11 + 0.00 0.0000 1 0.000039 :.../perl/5.14/Getopt/Long.pm:19 + 0.00 0.0000 1 0.000039 :...lib/perl/5.14/IO/Handle.pm:4 + 0.00 0.0000 1 0.000039 :...ib/perl/5.14/IO/Select.pm:11 + 0.00 0.0000 1 0.000039 :...sr/lib/perl/5.14/POSIX.pm:56 + 0.00 0.0000 1 0.000039 :...perl5/IO/Compress/Gzip.pm:24 + 0.00 0.0000 1 0.000039 :.../perl/5.14/Getopt/Long.pm:51 + 0.00 0.0000 1 0.000039 main::total_bytes_max_reached + 0.00 0.0000 1 0.000038 :...rl5/Compress/Raw/Zlib.pm:138 + 0.00 0.0000 1 0.000038 :.../Compress/Base/Common.pm:497 + 0.00 0.0000 1 0.000038 :...perl5/IO/Compress/Base.pm:18 + 0.00 0.0000 1 0.000038 :.../Compress/Base/Common.pm:153 + 0.00 0.0000 2 0.000019 Config::FETCH + 0.00 0.0000 1 0.000038 :...perl/5.14/Getopt/Long.pm:220 + 0.00 0.0000 1 0.000038 :...O/Compress/Base/Common.pm:48 + 0.00 0.0000 1 0.000038 :...perl/5.14/Getopt/Long.pm:223 + 0.00 0.0000 1 0.000038 :...perl/5.14/Getopt/Long.pm:218 + 0.00 0.0000 1 0.000038 :.../Compress/Base/Common.pm:848 + 0.00 0.0000 1 0.000038 :.../perl/5.14/Getopt/Long.pm:26 + 0.00 0.0000 1 0.000038 :.../perl/5.14/Getopt/Long.pm:46 + 0.00 0.0000 1 0.000038 :.../share/perl/5.14/Carp.pm:342 + 0.00 0.0000 1 0.000038 :.../Compress/Base/Common.pm:486 + 0.00 0.0000 1 0.000038 :.../Compress/Base/Common.pm:495 + 0.00 0.0000 1 0.000038 :...are/perl5/Authen/NTLM.pm:193 + 0.00 0.0000 1 0.000038 :...mpress/Gzip/Constants.pm:113 + 0.00 0.0000 1 0.000038 :...hare/perl5/Test/Builder.pm:4 + 0.00 0.0000 1 0.000038 :.../Compress/Base/Common.pm:493 + 0.00 0.0000 1 0.000038 :...O/Compress/Base/Common.pm:49 + 0.00 0.0000 1 0.000038 :...rl5/Compress/Raw/Zlib.pm:107 + 0.00 0.0000 1 0.000037 :...hare/perl5/Test/Builder.pm:5 + 0.00 0.0000 1 0.000037 :.../Compress/Base/Common.pm:489 + 0.00 0.0000 1 0.000037 :...38/lib/Mail/IMAPClient.pm:24 + 0.00 0.0000 1 0.000037 :.../Compress/Base/Common.pm:485 + 0.00 0.0000 1 0.000037 :...ib/perl5/File/Spec/Unix.pm:4 + 0.00 0.0000 1 0.000037 :...re/perl5/Compress/Zlib.pm:49 + 0.00 0.0000 1 0.000037 :/usr/share/perl5/IO/Tee.pm:7 + 0.00 0.0000 1 0.000037 :...hare/perl/5.14/Tie/Hash.pm:6 + 0.00 0.0000 1 0.000037 :/usr/lib/perl/5.14/IO.pm:7 + 0.00 0.0000 1 0.000037 :...ompress/Gzip/Constants.pm:80 + 0.00 0.0000 1 0.000037 :.../Compress/Base/Common.pm:849 + 0.00 0.0000 1 0.000037 :...ompress/Gzip/Constants.pm:91 + 0.00 0.0000 1 0.000037 :.../Compress/Base/Common.pm:491 + 0.00 0.0000 1 0.000037 :...ompress/Gzip/Constants.pm:93 + 0.00 0.0000 1 0.000037 :...ib/perl/5.14/IO/Socket.pm:16 + 0.00 0.0000 1 0.000037 :.../Compress/Base/Common.pm:498 + 0.00 0.0000 1 0.000037 :...mpress/Gzip/Constants.pm:115 + 0.00 0.0000 1 0.000037 :...ompress/Gzip/Constants.pm:86 + 0.00 0.0000 1 0.000036 :...O/Uncompress/RawInflate.pm:6 + 0.00 0.0000 1 0.000036 :.../Compress/Base/Common.pm:490 + 0.00 0.0000 1 0.000036 :...O/Compress/Base/Common.pm:51 + 0.00 0.0000 1 0.000036 :...b/perl/5.14/IO/Seekable.pm:7 + 0.00 0.0000 1 0.000036 :...ompress/Gzip/Constants.pm:66 + 0.00 0.0000 1 0.000036 :...rl5/Compress/Raw/Zlib.pm:141 + 0.00 0.0000 1 0.000036 :...ompress/Gzip/Constants.pm:84 + 0.00 0.0000 1 0.000036 :...ompress/Gzip/Constants.pm:82 + 0.00 0.0000 1 0.000036 :...are/perl5/LWP/Protocol.pm:10 + 0.00 0.0000 1 0.000036 :...rl/5.14/IO/Socket/INET.pm:14 + 0.00 0.0000 1 0.000036 :...re/perl/5.14/File/Copy.pm:12 + 0.00 0.0000 1 0.000036 :.../Compress/Base/Common.pm:494 + 0.00 0.0000 1 0.000036 :...rl5/File/Copy/Recursive.pm:8 + 0.00 0.0000 1 0.000036 :.../Compress/Base/Common.pm:151 + 0.00 0.0000 1 0.000036 :...re/perl5/Compress/Zlib.pm:51 + 0.00 0.0000 1 0.000036 :...rl/5.14/IO/Socket/INET.pm:15 + 0.00 0.0000 1 0.000036 :...rl5/Compress/Raw/Zlib.pm:123 + 0.00 0.0000 1 0.000036 :...e/perl/5.14/Time/Local.pm:28 + 0.00 0.0000 1 0.000036 :...rl5/Compress/Raw/Zlib.pm:147 + 0.00 0.0000 1 0.000036 :...ompress/Gzip/Constants.pm:75 + 0.00 0.0000 1 0.000036 :...rl5/Compress/Raw/Zlib.pm:139 + 0.00 0.0000 1 0.000036 :...are/perl5/Authen/NTLM.pm:195 + 0.00 0.0000 1 0.000036 :...re/perl5/Compress/Zlib.pm:50 + 0.00 0.0000 1 0.000036 :...O/Compress/Base/Common.pm:50 + 0.00 0.0000 1 0.000036 :...rl5/Compress/Raw/Zlib.pm:144 + 0.00 0.0000 1 0.000036 :...8/lib/Mail/IMAPClient.pm:597 + 0.00 0.0000 1 0.000036 :...ompress/Gzip/Constants.pm:76 + 0.00 0.0000 1 0.000036 :...ompress/Gzip/Constants.pm:78 + 0.00 0.0000 1 0.000036 :...rl5/Compress/Raw/Zlib.pm:148 + 0.00 0.0000 1 0.000036 :...ompress/Gzip/Constants.pm:89 + 0.00 0.0000 1 0.000036 :...ompress/Gzip/Constants.pm:87 + 0.00 0.0000 1 0.000036 :...ompress/Gzip/Constants.pm:73 + 0.00 0.0000 1 0.000036 :...rl5/Compress/Raw/Zlib.pm:142 + 0.00 0.0000 1 0.000036 :...sr/share/perl/5.14/Carp.pm:4 + 0.00 0.0000 1 0.000036 :...mpress/Gzip/Constants.pm:111 + 0.00 0.0000 1 0.000036 :...are/perl/5.14/constant.pm:52 + 0.00 0.0000 1 0.000035 :...sr/lib/perl/5.14/Socket.pm:9 + 0.00 0.0000 2 0.000018 :...re/perl5/Test/Builder.pm:145 + 0.00 0.0000 1 0.000035 :...ompress/Gzip/Constants.pm:77 + 0.00 0.0000 1 0.000035 :...rl5/Compress/Raw/Zlib.pm:140 + 0.00 0.0000 1 0.000035 :...ompress/Gzip/Constants.pm:88 + 0.00 0.0000 1 0.000035 :...rl5/Compress/Raw/Zlib.pm:149 + 0.00 0.0000 1 0.000035 :...ompress/Gzip/Constants.pm:74 + 0.00 0.0000 1 0.000035 :/usr/lib/perl5/Cwd.pm:215 + 0.00 0.0000 1 0.000035 main::fix_Inbox_INBOX_mapping + 0.00 0.0000 1 0.000035 :...e/perl/5.14/AutoLoader.pm:19 + 0.00 0.0000 1 0.000035 :...perl/5.14/Getopt/Long.pm:246 + 0.00 0.0000 1 0.000035 :...ompress/Gzip/Constants.pm:67 + 0.00 0.0000 1 0.000035 :.../lib/perl/5.14/IO/File.pm:12 + 0.00 0.0000 1 0.000035 :...ompress/Gzip/Constants.pm:70 + 0.00 0.0000 1 0.000035 :...mpress/Gzip/Constants.pm:114 + 0.00 0.0000 1 0.000035 :...perl/5.14/Getopt/Long.pm:236 + 0.00 0.0000 1 0.000035 :...rl5/Compress/Raw/Zlib.pm:146 + 0.00 0.0000 1 0.000035 :...rl5/Compress/Raw/Zlib.pm:150 + 0.00 0.0000 1 0.000034 :...ib/perl/5.14/IO/Select.pm:10 + 0.00 0.0000 1 0.000034 :...perl/5.14/Getopt/Long.pm:247 + 0.00 0.0000 1 0.000034 :...perl/5.14/Getopt/Long.pm:229 + 0.00 0.0000 1 0.000034 :...perl/5.14/Getopt/Long.pm:224 + 0.00 0.0000 1 0.000034 :...are/perl/5.14/IPC/Open3.pm:4 + 0.00 0.0000 1 0.000033 :./imapsync:693 + 0.00 0.0000 1 0.000033 :...perl/5.14/Getopt/Long.pm:226 + 0.00 0.0000 1 0.000033 :...perl/5.14/Getopt/Long.pm:225 + 0.00 0.0000 1 0.000033 :...e/perl/5.14/Time/Local.pm:29 + 0.00 0.0000 3 0.000011 SelectSaver::DESTROY + 0.00 0.0000 1 0.000031 Test::Builder::Module::builder + 0.00 0.0000 1 0.000030 :...re/perl5/LWP/UserAgent.pm:17 + 0.00 0.0000 1 0.000030 attributes::_modify_attrs_and_deprecate + 0.00 0.0000 1 0.000030 main::check_lib_version + 0.00 0.0000 1 0.000030 :...re/perl/5.14/File/Copy.pm:53 + 0.00 0.0000 1 0.000029 main::imapsync_basename + 0.00 0.0000 1 0.000029 main::sort_requested_folders + 0.00 0.0000 1 0.000029 main::errorsdump + 0.00 0.0000 1 0.000029 utf8::import + 0.00 0.0000 1 0.000029 main::acls_sync + 0.00 0.0000 1 0.000028 :...re/perl5/LWP/UserAgent.pm:14 + 0.00 0.0000 1 0.000028 :.../perl/5.14/Getopt/Long.pm:42 + 0.00 0.0000 1 0.000028 Tie::StdHash::TIEHASH + 0.00 0.0000 1 0.000027 IO::Tee::TIEHANDLE + 0.00 0.0000 1 0.000026 :/usr/share/perl5/JSON.pm:13 + 0.00 0.0000 1 0.000026 :...re/perl/5.14/File/Path.pm:16 + 0.00 0.0000 3 0.000009 Test::Builder::is_fh + 0.00 0.0000 1 0.000025 Test::Builder::output + 0.00 0.0000 1 0.000025 :/usr/lib/perl/5.14/IO.pm:5 + 0.00 0.0000 1 0.000025 Test::Builder::failure_output + 0.00 0.0000 1 0.000025 Test::Builder::todo_output + 0.00 0.0000 1 0.000025 main::add_to_requested_folders + 0.00 0.0000 1 0.000024 main::imap_id_stuff + 0.00 0.0000 1 0.000024 Getopt::Long::ConfigDefaults + 0.00 0.0000 1 0.000024 :./imapsync:1675 + 0.00 0.0000 1 0.000023 :/usr/share/perl5/URI.pm:21 + 0.00 0.0000 1 0.000023 Math::BigInt::Calc::import + 0.00 0.0000 1 0.000023 :...are/perl5/Test/Builder.pm:14 + 0.00 0.0000 1 0.000023 :/usr/share/perl5/JSON.pm:5 + 0.00 0.0000 1 0.000023 :.../lib/Mail/IMAPClient.pm:3394 + 0.00 0.0000 1 0.000023 Getopt::Long::Configure + 0.00 0.0000 1 0.000023 :.../lib/perl/5.14/Socket.pm:243 + 0.00 0.0000 1 0.000023 :...are/perl/5.14/File/Path.pm:7 + 0.00 0.0000 3 0.000008 Term::ReadKey::blockoptions + 0.00 0.0000 1 0.000022 :.../lib/Mail/IMAPClient.pm:2428 + 0.00 0.0000 1 0.000022 :.../perl5/IO/Socket/INET6.pm:24 + 0.00 0.0000 1 0.000022 :...perl5/IO/Compress/Base.pm:16 + 0.00 0.0000 1 0.000021 :.../lib/Mail/IMAPClient.pm:2544 + 0.00 0.0000 1 0.000021 :...hare/perl5/HTTP/Headers.pm:4 + 0.00 0.0000 1 0.000021 :...8/lib/Mail/IMAPClient.pm:937 + 0.00 0.0000 1 0.000020 :/usr/share/perl5/URI.pm:22 + 0.00 0.0000 1 0.000020 :...rl5/File/Copy/Recursive.pm:7 + 0.00 0.0000 1 0.000020 :...lib/perl/5.14/IO/Handle.pm:8 + 0.00 0.0000 1 0.000020 :...38/lib/Mail/IMAPClient.pm:22 + 0.00 0.0000 1 0.000019 :.../lib/Mail/IMAPClient.pm:1831 + 0.00 0.0000 1 0.000019 Test::Builder::Module::_strip_imports + 0.00 0.0000 1 0.000019 :...hare/perl5/LWP/Protocol.pm:9 + 0.00 0.0000 1 0.000019 :...hare/perl5/LWP/Protocol.pm:8 + 0.00 0.0000 1 0.000019 :...perl5/IO/Compress/Base.pm:17 + 0.00 0.0000 1 0.000018 :...re/perl/5.14/File/Path.pm:18 + 0.00 0.0000 1 0.000018 Test::Builder::is_passing + 0.00 0.0000 1 0.000017 :...are/perl/5.14/File/Path.pm:8 + 0.00 0.0000 1 0.000016 main::thank_author + 0.00 0.0000 1 0.000016 Test::More::import_extra + 0.00 0.0000 1 0.000014 Test::Builder::exported_to + 0.00 0.0000 1 0.000013 integer::unimport + 0.00 0.0000 1 0.000012 attributes::_modify_attrs + 0.00 0.0000 1 0.000011 attributes::reftype + 0.00 0.0000 1 0.000009 Test::Builder::plan + 0.00 0.0000 1 0.000007 Math::BigInt::Calc::api_version + 0.00 0.0000 1 0.000006 File::Glob::GLOB_CSH diff --git a/W/imapsync.1 b/W/imapsync.1 index 9f64a6b..828be1c 100644 --- a/W/imapsync.1 +++ b/W/imapsync.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== @@ -38,6 +38,8 @@ . ds PI \(*p . ds L" `` . ds R" '' +. ds C` +. ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. @@ -48,17 +50,24 @@ .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX .. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{ +. if \nF \{ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. +. if !\nF==2 \{ +. nr % 0 +. nr F 2 +. \} +. \} .\} +.rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -124,24 +133,25 @@ .\" ======================================================================== .\" .IX Title "IMAPSYNC 1" -.TH IMAPSYNC 1 "2016-03-17" "perl v5.14.2" "User Contributed Perl Documentation" +.TH IMAPSYNC 1 "2016-08-19" "perl v5.18.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" -imapsync \- IMAP synchronisation, sync, copy or migration tool. -Synchronises mailboxes between two imap servers. -Good at IMAP migration. More than 66 different IMAP server softwares -supported with success, few failures. +imapsync \- Email IMAP tool for syncing, copying and migrating email mailboxes. +.PP +The imapsync command synchronises mailboxes between two imap servers. +More than 69 different IMAP server softwares supported with success, +few failures. .PP -$Revision: 1.684 $ +$Revision: 1.727 $ .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 -\& To synchronize the source imap account -\& "test1" on server "test1.lamiral.info" with password "secret1" -\& to the destination imap account +\& To synchronize the source imap account +\& "test1" on server "test1.lamiral.info" with password "secret1" +\& to the destination imap account \& "test2" on server "test2.lamiral.info" with password "secret2" \& do: \& @@ -149,13 +159,18 @@ $Revision: 1.684 $ \& \-\-host1 test1.lamiral.info \-\-user1 test1 \-\-password1 secret1 \e \& \-\-host2 test2.lamiral.info \-\-user2 test2 \-\-password2 secret2 .Ve +.SH "REQUIRED ARGUMENTS" +.IX Header "REQUIRED ARGUMENTS" +The required argmuments are the six values, three on each sides, +needed to login into the \s-1IMAP\s0 servers, +a host, a username, and a password, two times. .SH "INSTALL" .IX Header "INSTALL" .Vb 5 \& Imapsync works under any Unix with perl. -\& Imapsync works under Windows (2000, XP, Vista, Seven) +\& Imapsync works under Windows (2000, XP, Vista, Seven) \& as a standalone binary software called imapsync.exe -\& Imapsync works under OS X as a standalone binary +\& Imapsync works under OS X as a standalone binary \& software called imapsync_bin_Darwin. \& \& Purchase latest imapsync at @@ -169,14 +184,19 @@ $Revision: 1.684 $ \& \& Go into the directory imapsync\-x.xx and read the INSTALL file. \& As mentioned at http://imapsync.lamiral.info/#install -\& the INSTALL file can also be found at +\& the INSTALL file can also be found at \& http://imapsync.lamiral.info/INSTALL \& It is now split in several files for each system \& http://imapsync.lamiral.info/INSTALL.d/ .Ve +.SH "CONFIGURATION" +.IX Header "CONFIGURATION" +There is no specific configuration file for imapsync, +everything is specified by the command line parameteres +and the default behavior. .SH "USAGE" .IX Header "USAGE" -To get a description of each option just run imapsync +To get a description of each option just run imapsync with no argument, like this: .PP .Vb 1 @@ -189,16 +209,16 @@ reproduced here: .PP .Vb 1 \& usage: ./imapsync [options] -\& -\& Several options are mandatory. +\& +\& Several options are mandatory. \& str means string \& int means integer \& reg means regular expression \& cmd means command -\& -\& \-\-dry : Makes imapsync doing nothing, just print what would +\& +\& \-\-dry : Makes imapsync doing nothing, just print what would \& be done without \-\-dry. -\& +\& \& \-\-host1 str : Source or "from" imap server. Mandatory. \& \-\-port1 int : Port to connect on host1. Default is 143, 993 if \-\-ssl1 \& \-\-user1 str : User to login on host1. Mandatory. @@ -209,12 +229,12 @@ reproduced here: \& \-\-port2 int : Port to connect on host2. Default is 143, 993 if \-\-ssl2 \& \-\-user2 str : User to login on host2. Mandatory. \& \-\-password2 str : Password for the user2. -\& -\& \-\-passfile1 str : Password file for the user1. It must contain the +\& +\& \-\-passfile1 str : Password file for the user1. It must contain the \& password on the first line. This option avoids to show \& the password on the command line like \-\-password1 does. \& \-\-passfile2 str : Password file for the user2. Contains the password. -\& +\& \& \-\-ssl1 : Use a SSL connection on host1. \& \-\-ssl2 : Use a SSL connection on host2. \& \-\-tls1 : Use a TLS connection on host1. @@ -225,45 +245,45 @@ reproduced here: \& See all possibilities in the new() method of IO::Socket::SSL \& http://search.cpan.org/perldoc?IO::Socket::SSL#Description_Of_Methods \& \-\-sslargs2 str : Pass any ssl parameter for host2 ssl or tls connection. -\& See \-\-sslargs1 -\& -\& \-\-timeout1 int : Connection timeout in seconds for host1. +\& See \-\-sslargs1 +\& +\& \-\-timeout1 int : Connection timeout in seconds for host1. \& Default is 120 and 0 means no timeout at all. -\& \-\-timeout2 int : Connection timeout in seconds for host2. +\& \-\-timeout2 int : Connection timeout in seconds for host2. \& Default is 120 and 0 means no timeout at all. -\& +\& \& \-\-authmech1 str : Auth mechanism to use with host1: \& PLAIN, LOGIN, CRAM\-MD5 etc. Use UPPERCASE. \& \-\-authmech2 str : Auth mechanism to use with host2. See \-\-authmech1 \& -\& \-\-authuser1 str : User to auth with on host1 (admin user). +\& \-\-authuser1 str : User to auth with on host1 (admin user). \& Avoid using \-\-authmech1 SOMETHING with \-\-authuser1. \& \-\-authuser2 str : User to auth with on host2 (admin user). \& \-\-proxyauth1 : Use proxyauth on host1. Requires \-\-authuser1. \& Required by Sun/iPlanet/Netscape IMAP servers to \& be able to use an administrative user. \& \-\-proxyauth2 : Use proxyauth on host2. Requires \-\-authuser2. -\& +\& \& \-\-authmd51 : Use MD5 authentification for host1. \& \-\-authmd52 : Use MD5 authentification for host2. \& \-\-domain1 str : Domain on host1 (NTLM authentication). \& \-\-domain2 str : Domain on host2 (NTLM authentication). -\& -\& +\& +\& \& \-\-folder str : Sync this folder. \& \-\-folder str : and this one, etc. \& \-\-folderrec str : Sync this folder recursively. \& \-\-folderrec str : and this one, etc. -\& +\& \& \-\-folderfirst str : Sync this folder first. \-\-folderfirst "Work" \& \-\-folderfirst str : then this one, etc. \& \-\-folderlast str : Sync this folder last. \-\-folderlast "[Gmail]/All Mail" \& \-\-folderlast str : then this one, etc. -\& +\& \& \-\-nomixfolders : Do not merge folders when host1 is case sensitive \& while host2 is not (like Exchange). Only the first \& similar folder is synced (ex: Sent SENT sent \-> Sent). -\& +\& \& \-\-skipemptyfolders : Empty host1 folders are not created on host2. \& \& \-\-f1f2 str1=str2 : Force folder str1 to be synced to str2. @@ -275,12 +295,12 @@ reproduced here: \& Several folders to avoid: \& \-\-exclude \*(Aqfold1|fold2|f3\*(Aq skips fold1, fold2 and f3. \& \-\-exclude reg : or this one, etc. -\& -\& \-\-subfolder2 str : Move whole host1 folders hierarchy under this +\& +\& \-\-subfolder2 str : Move whole host1 folders hierarchy under this \& host2 folder str . \& It does it by adding two \-\-regextrans2 options before \& all others. Add \-\-debug to see what\*(Aqs really going on. -\& +\& \& \-\-regextrans2 reg : Apply the whole regex to each destination folders. \& \-\-regextrans2 reg : and this one. etc. \& When you play with the \-\-regextrans2 option, first @@ -288,21 +308,21 @@ reproduced here: \& Then, when happy, remove \-\-dry, remove \-\-justfolders. \& Have in mind that \-\-regextrans2 is applied after prefix \& and separator inversion. -\& +\& \& \-\-tmpdir str : Where to store temporary files and subdirectories. \& Will be created if it doesn\*(Aqt exist. \& Default is system specific, Unix is /tmp but \& it\*(Aqs often small and deleted at reboot. \& \-\-tmpdir /var/tmp should be better. \& \-\-pidfile str : The file where imapsync pid is written. -\& \-\-pidfilelocking : Abort if pidfile already exists. Usefull to avoid +\& \-\-pidfilelocking : Abort if pidfile already exists. Usefull to avoid \& concurrent transfers on the same mailbox. -\& +\& \& \-\-nolog : Turn off logging on file \& \-\-logfile str : Change the default log filename (can be dirname/filename). \& \-\-logdir str : Change the default log directory. Default is LOG_imapsync \& -\& \-\-prefix1 str : Remove prefix to all destination folders +\& \-\-prefix1 str : Remove prefix to all destination folders \& (usually INBOX. or INBOX/ or an empty string "") \& you have to use \-\-prefix1 if host1 imap server \& does not have NAMESPACE capability, so imapsync @@ -310,16 +330,16 @@ reproduced here: \& \-\-prefix2 str : Add prefix to all host2 folders. See \-\-prefix1 \& \-\-sep1 str : Host1 separator in case NAMESPACE is not supported. \& \-\-sep2 str : Host2 separator in case NAMESPACE is not supported. -\& +\& \& \-\-skipmess reg : Skips messages maching the regex. \& Example: \*(Aqm/[\ex80\-ff]/\*(Aq # to avoid 8bits messages. \& \-\-skipmess is applied before \-\-regexmess \& \-\-skipmess reg : or this one, etc. \& -\& \-\-pipemess cmd : Apply this cmd command to each message content +\& \-\-pipemess cmd : Apply this cmd command to each message content \& before the copy. \& \-\-pipemess cmd : and this one, etc. -\& +\& \& \-\-disarmreadreceipts : Disarms read receipts (host2 Exchange issue) \& \& \-\-regexmess reg : Apply the whole regex to each message before transfer. @@ -329,20 +349,20 @@ reproduced here: \& \-\-regexflag reg : Apply the whole regex to each flags list. \& Example: \*(Aqs/"Junk"//g\*(Aq # to remove "Junk" flag. \& \-\-regexflag reg : and this one, etc. -\& -\& \-\-delete : Deletes messages on host1 server after a successful -\& transfer. Option \-\-delete has the following behavior: -\& it marks messages as deleted with the IMAP flag -\& \eDeleted, then messages are really deleted with an +\& +\& \-\-delete : Deletes messages on host1 server after a successful +\& transfer. Option \-\-delete has the following behavior: +\& it marks messages as deleted with the IMAP flag +\& \eDeleted, then messages are really deleted with an \& EXPUNGE IMAP command. \& \& \-\-delete2 : Delete messages in host2 that are not in \& host1 server. Useful for backup or pre\-sync. \& \-\-delete2duplicates : Delete messages in host2 that are duplicates. -\& Works only without \-\-useuid since duplicates are +\& Works only without \-\-useuid since duplicates are \& detected with an header part of each message. \& -\& \-\-delete2folders : Delete folders in host2 that are not in host1 server. +\& \-\-delete2folders : Delete folders in host2 that are not in host1 server. \& For safety, first try it like this (it is safe): \& \-\-delete2folders \-\-dry \-\-justfolders \-\-nofoldersizes \& \-\-delete2foldersonly reg : Deleted only folders matching regex. @@ -351,8 +371,8 @@ reproduced here: \& Example: \-\-delete2foldersbutnot "/Tasks$|Contacts$|Foo$/" \& \-\-noexpunge : Do not expunge messages on host1. \& Expunge really deletes messages marked deleted. -\& Expunge is made at the beginning, on host1 only. -\& Newly transferred messages are also expunged if +\& Expunge is made at the beginning, on host1 only. +\& Newly transferred messages are also expunged if \& option \-\-delete is given. \& No expunge is done on host2 account (unless \-\-expunge2) \& \-\-expunge1 : Expunge messages on host1 after messages transfer. @@ -360,13 +380,13 @@ reproduced here: \& \-\-uidexpunge2 : uidexpunge messages on the host2 account \& that are not on the host1 account, requires \-\-delete2 \& \-\-nomixfolders : Avoid merging folders that are considered different on -\& host1 but the same on destination host2 because of +\& host1 but the same on destination host2 because of \& case sensitivities and insensitivities. -\& +\& \& \-\-syncinternaldates : Sets the internal dates on host2 same as host1. \& Turned on by default. Internal date is the date \& a message arrived on a host (mtime). -\& \-\-idatefromheader : Sets the internal dates on host2 same as the +\& \-\-idatefromheader : Sets the internal dates on host2 same as the \& "Date:" headers. \& \& \-\-maxsize int : Skip messages larger (or equal) than int bytes @@ -381,48 +401,48 @@ reproduced here: \& past|+++++++++++++++minage\-\-\-\->now \& past|\-\-\-\-maxage+++++minage\-\-\-\->now (intersection) \& past|++++minage\-\-\-\-\-maxage++++>now (union) -\& -\& \-\-search str : Selects only messages returned by this IMAP SEARCH +\& +\& \-\-search str : Selects only messages returned by this IMAP SEARCH \& command. Applied on both sides. \& \-\-search1 str : Same as \-\-search for selecting host1 messages only. \& \-\-search2 str : Same as \-\-search for selecting host2 messages only. \& \-\-search CRIT equals \-\-search1 CRIT \-\-search2 CRIT -\& +\& \& \-\-exitwhenover int : Stop syncing when total bytes transferred reached. -\& Gmail per day allows +\& Gmail per day allows \& 2500000000 = 2.5 GB downloaded from Gmail as host2 \& 500000000 = 500 MB uploaded to Gmail as host1. -\& +\& \& \-\-maxlinelength int : skip messages with a line length longer than int bytes. \& RFC 2822 says it must be no more than 1000 bytes. \& \& \-\-useheader str : Use this header to compare messages on both sides. \& Ex: Message\-ID or Subject or Date. \& \-\-useheader str and this one, etc. -\& +\& \& \-\-subscribed : Transfers subscribed folders. -\& \-\-subscribe : Subscribe to the folders transferred on the +\& \-\-subscribe : Subscribe to the folders transferred on the \& host2 that are subscribed on host1. On by default. -\& \-\-subscribeall : Subscribe to the folders transferred on the +\& \-\-subscribeall : Subscribe to the folders transferred on the \& host2 even if they are not subscribed on host1. -\& +\& \& \-\-nofoldersizes : Do not calculate the size of each folder in bytes \& and message counts. Default is to calculate them. \& \-\-nofoldersizesatend: Do not calculate the size of each folder in bytes \& and message counts at the end. Default is on. \& \-\-justfoldersizes : Exit after having printed the folder sizes. -\& +\& \& \-\-syncacls : Synchronises acls (Access Control Lists). \& \-\-nosyncacls : Does not synchronize acls. This is the default. \& Acls in IMAP are not standardized, be careful. -\& +\& \& \-\-usecache : Use cache to speedup. \& \-\-nousecache : Do not use cache. Caveat: \-\-useuid \-\-nousecache creates \& duplicates on multiple runs. -\& \-\-useuid : Use uid instead of header as a criterium to recognize -\& messages. Option \-\-usecache is then implied unless -\& \-\-nousecache is used. -\& +\& \-\-useuid : Use uid instead of header as a criterium to recognize +\& messages. Option \-\-usecache is then implied unless +\& \-\-nousecache is used. +\& \& \-\-debug : Debug mode. \& \-\-debugfolders : Debug mode for the folders part only. \& \-\-debugcontent : Debug content of the messages transfered. Huge ouput. @@ -435,7 +455,7 @@ reproduced here: \& \-\-errorsmax int : Exit when int number of errors is reached. Default is 50. \& \& \-\-tests : Run local non\-regression tests. Exit code 0 means all ok. -\& \-\-testslive : Run a live test with test1.lamiral.info imap server. +\& \-\-testslive : Run a live test with test1.lamiral.info imap server. \& Useful to check the basics. Needs internet connexion. \& \& \-\-version : Print only software version. @@ -444,19 +464,19 @@ reproduced here: \& \-\-noid : Do not send/receive ID command to imap servers. \& \-\-justconnect : Just connect to both servers and print useful \& information. Need only \-\-host1 and \-\-host2 options. -\& \-\-justlogin : Just login to both host1 and host2 with users +\& \-\-justlogin : Just login to both host1 and host2 with users \& credentials, then exit. \& \-\-justfolders : Do only things about folders (ignore messages). \& \& \-\-help : print this help. \& -\& Example: -\& To synchronize the source imap account -\& "test1" on server "test1.lamiral.info" with password "secret1" -\& to the destination imap account +\& Example: +\& To synchronize the source imap account +\& "test1" on server "test1.lamiral.info" with password "secret1" +\& to the destination imap account \& "test2" on server "test2.lamiral.info" with password "secret2" \& do: -\& +\& \& imapsync \e \& \-\-host1 test1.lamiral.info \-\-user1 test1 \-\-password1 secret1 \e \& \-\-host2 test2.lamiral.info \-\-user2 test2 \-\-password2 secret2 @@ -466,42 +486,42 @@ reproduced here: Imapsync command is a tool allowing incremental and recursive imap transfers from one mailbox to another. .PP -By default all folders are transferred, recursively, all +By default all folders are transferred, recursively, all possible flags (\eSeen \eAnswered \eFlagged etc.) are synced too. .PP We sometimes need to transfer mailboxes from one imap server to another. This is called migration. .PP Imapsync reduces the amount -of data transferred by not transferring a given message +of data transferred by not transferring a given message if it resides already on both sides. Same specific headers -and the transfer is done only once; taken into account are by default -Message-Id and Received header lines. +and the transfer is done only once; taken into account are by default +Message-Id and Received header lines. All flags are preserved, unread will stay unread, read will stay read, deleted will stay deleted. You can stop the transfer at any -time and restart it later, imapsync works well with bad +time and restart it later, imapsync works well with bad connections and interruptions. .PP You can decide to delete the messages from the source mailbox after a successful transfer, it can be a good feature when migrating live mailboxes since messages will be only on one side. -In that case, use the \-\-delete option. Option \-\-delete implies -also option \-\-expunge so all messages marked deleted on host1 +In that case, use the \-\-delete option. Option \-\-delete implies +also option \-\-expunge so all messages marked deleted on host1 will be really deleted. (you can use \-\-noexpunge to avoid this but I don't see any good real world scenario for the combination \-\-delete \-\-noexpunge). .PP A different scenario is synchronizing a mailbox B from another mailbox A -in case you just want to keep a \*(L"live\*(R" copy of A in B. +in case you just want to keep a \*(L"live\*(R" copy of A in B. In that case \-\-delete2 has to be used, it deletes messages in host2 -folder B that are not in host1 folder A. If you also need to destroy -host2 folders that are not in host1 then use \-\-delete2folders (see also +folder B that are not in host1 folder A. If you also need to destroy +host2 folders that are not in host1 then use \-\-delete2folders (see also \&\-\-delete2foldersonly and \-\-delete2foldersbutnot). .PP -Imapsync is not adequate for maintaining two active imap accounts +Imapsync is not adequate for maintaining two active imap accounts in synchronization when the user plays independently on both sides. -Use offlineimap (written by John Goerzen) or mbsync (written by +Use offlineimap (written by John Goerzen) or mbsync (written by Michael R. Elkins) for 2 ways synchronizations. .SH "OPTIONS" .IX Header "OPTIONS" @@ -511,6 +531,8 @@ To get a description of each option just invoke: \& imapsync .Ve .PP +or read the previous section named \s-1USAGE,\s0 +.PP or read http://imapsync.lamiral.info/OPTIONS .SH "HISTORY" .IX Header "HISTORY" @@ -528,8 +550,8 @@ While working on imapsync parameters please run imapsync in dry mode (no modification induced) with the \-\-dry option. Nothing bad can be done this way. .PP -To synchronize the imap account \*(L"buddy\*(R" (with password \*(L"secret1\*(R") -on host \*(L"imap.src.fr\*(R" to the imap account \*(L"max\*(R" (with password \*(L"secret2\*(R") +To synchronize the imap account \*(L"buddy\*(R" (with password \*(L"secret1\*(R") +on host \*(L"imap.src.fr\*(R" to the imap account \*(L"max\*(R" (with password \*(L"secret2\*(R") on host \*(L"imap.dest.fr\*(R": .PP .Vb 2 @@ -542,7 +564,7 @@ mailbox. .SH "SECURITY" .IX Header "SECURITY" You can use \-\-passfile1 instead of \-\-password1 to give the -password since it is safer. With \-\-password1 option any user +password since it is safer. With \-\-password1 option any user on your host can see the password by using the 'ps auxwwww' command. Using a variable (like \f(CW$PASSWORD1\fR) is also dangerous because of the 'ps auxwwwwe' command. So, saving @@ -552,7 +574,7 @@ the best solution. imasync is not totally protected against sniffers on the network since passwords may be transferred in plain text if \s-1CRAM\-MD5\s0 is not supported by your imap servers. Use -\&\-\-ssl1 (or \-\-tls1) and \-\-ssl2 (or \-\-tls2) to enable +\&\-\-ssl1 (or \-\-tls1) and \-\-ssl2 (or \-\-tls2) to enable encryption on host1 and host2. .PP You may authenticate as one user (typically an admin user), @@ -566,8 +588,8 @@ Same behavior with the \-\-authuser2 option. Authenticate with an admin account must be supported by your imap server to work with imapsync. .PP -When working on Sun/iPlanet/Netscape \s-1IMAP\s0 servers you must use -\&\-\-proxyauth1 to enable administrative user to masquerade as another user. +When working on Sun/iPlanet/Netscape \s-1IMAP\s0 servers you must use +\&\-\-proxyauth1 to enable administrative user to masquerade as another user. Can also be used on destination server with \-\-proxyauth2 .PP You can authenticate with \s-1OAUTH\s0 when transfering from Google Apps. @@ -579,21 +601,30 @@ with Google Apps free edition. imapsync will exit with a 0 status (return code) if everything went good. Otherwise, it exits with a non-zero status. .PP -So if you have an unreliable internet connection, you can use this loop +So if you have an unreliable internet connection, you can use this loop in a Bourne shell: .PP .Vb 3 -\& while ! imapsync ...; do +\& while ! imapsync ...; do \& echo imapsync not complete \& done .Ve -.SH "LICENSE" -.IX Header "LICENSE" -imapsync is free, open, public but not always gratis software +.SH "LICENSE AND COPYRIGHT" +.IX Header "LICENSE AND COPYRIGHT" +imapsync is free, open, public but not always gratis software cover by the \s-1NOLIMIT\s0 Public License. See the \s-1LICENSE\s0 file included in the distribution or just read this simple sentence as it is the licence text: -No limit to do anything with this work and this license. +.PP +.Vb 1 +\& "No limit to do anything with this work and this license." +.Ve +.PP +In case it is not long enough I repeat: +.PP +.Vb 1 +\& "No limit to do anything with this work and this license." +.Ve .SH "MAILING-LIST" .IX Header "MAILING-LIST" The public mailing-list may be the best way to get free support. @@ -628,16 +659,16 @@ Gilles \s-1LAMIRAL\s0 earns his living by writing, installing, configuring and teaching free, open and often gratis softwares. It used to be \*(L"always gratis\*(R" but now it is \&\*(L"often\*(R" because imapsync is sold by its author, a good -way to stay maintening and supporting free open public +way to stay maintening and supporting free open public softwares (see the license) over decades. -.SH "BUG REPORT GUIDELINES" -.IX Header "BUG REPORT GUIDELINES" +.SH "BUGS AND LIMITATIONS" +.IX Header "BUGS AND LIMITATIONS" Help me to help you: follow the following guidelines. .PP -Report any bugs or feature requests to the public mailing-list +Report any bugs or feature requests to the public mailing-list or to the author. .PP -Before reporting bugs, read the \s-1FAQ\s0, the \s-1README\s0 and the +Before reporting bugs, read the FAQs, the \s-1README\s0 and the \&\s-1TODO\s0 files. http://imapsync.lamiral.info/ .PP Upgrade to last imapsync release, maybe the bug @@ -647,7 +678,7 @@ Upgrade to last Mail-IMAPClient Perl module. http://search.cpan.org/dist/Mail\-IMAPClient/ maybe the bug is already fixed there. .PP -Make a good title with word \*(L"imapsync\*(R" in it (my spam filters won't filter it), +Make a good title with word \*(L"imapsync\*(R" in it (my spam filters won't filter it), Try to write an email title with more words than just \*(L"imapsync\*(R" or \*(L"problem\*(R", a good title is made of keywords summary, but not too long (one visible line). .PP @@ -657,23 +688,23 @@ Help us to help you: in your report, please include: \& \- imapsync version. \& \& \- output near the first failures, a few lines before is good to get the context -\& of the issue. First failures messages are often more significant than -\& the last ones. -\& -\& \- if the issue is always related to the same messages, include the output +\& of the issue. First failures messages are often more significant than +\& the last ones. +\& +\& \- if the issue is always related to the same messages, include the output \& with \-\-debug \-\-debugimap, near the failure point. For example, -\& Isolate a buggy message or two in a folder \*(AqBUG\*(Aq and use +\& Isolate a buggy message or two in a folder \*(AqBUG\*(Aq and use \& -\& imapsync ... \-\-folder \*(AqBUG\*(Aq \-\-debug \-\-debugimap +\& imapsync ... \-\-folder \*(AqBUG\*(Aq \-\-debug \-\-debugimap \& \& \- imap server softwares on both sides and their version number. \& \& \- imapsync with all the options you use, the full command line -\& you use (except the passwords of course). +\& you use (except the passwords of course). \& \& \- IMAPClient.pm version. \& -\& \- the run context. Do you run imapsync.exe, a unix binary +\& \- the run context. Do you run imapsync.exe, a unix binary \& or the perl script imapsync. \& \& \- operating system running imapsync. @@ -687,7 +718,7 @@ Help us to help you: in your report, please include: Most of those values can be found as a copy/paste at the begining of the output, so a carbon copy of the output is a very easy and very good debug report for me. .PP -One time in your life, read the paper +One time in your life, read the paper \&\*(L"How To Ask Questions The Smart Way\*(R" http://www.catb.org/~esr/faqs/smart\-questions.html and then forget it. @@ -696,7 +727,7 @@ and then forget it. See http://imapsync.lamiral.info/S/imapservers.shtml .SH "HUGE MIGRATION" .IX Header "HUGE MIGRATION" -Pay special attention to options +Pay special attention to options \&\-\-subscribed \&\-\-subscribe \&\-\-delete @@ -725,7 +756,7 @@ user005_1;password005_1;user005_2;password005_2 On Unix the shell program can be: .PP .Vb 4 -\& { while IFS=\*(Aq;\*(Aq read u1 p1 u2 p2; do +\& { while IFS=\*(Aq;\*(Aq read u1 p1 u2 p2; do \& imapsync \-\-host1 imap.side1.org \-\-user1 "$u1" \-\-password1 "$p1" \e \& \-\-host2 imap.side2.org \-\-user2 "$u2" \-\-password2 "$p2" ... \& done ; } < file.txt @@ -742,13 +773,13 @@ On Windows the batch program can be: The ... have to be replaced by nothing or any imapsync option. Welcome in shell programming ! .PP -You will find already written scripts at +You will find already written scripts at http://imapsync.lamiral.info/examples/ -.SH "Hacking" -.IX Header "Hacking" +.SH "HACKING" +.IX Header "HACKING" Feel free to hack imapsync as the \s-1NOLIMIT\s0 license permits it. -.SH "Links" -.IX Header "Links" +.SH "LINKS" +.IX Header "LINKS" Entries for imapsync: https://web.archive.org/web/20070202005121/http://www.imap.org/products/showall.php .SH "SIMILAR SOFTWARES" @@ -773,4 +804,4 @@ https://web.archive.org/web/20070202005121/http://www.imap.org/products/showall. .PP Feedback (good or bad) will often be welcome. .PP -\&\f(CW$Id:\fR imapsync,v 1.684 2016/03/17 08:35:03 gilles Exp gilles $ +\&\f(CW$Id:\fR imapsync,v 1.727 2016/08/19 10:30:36 gilles Exp gilles $ diff --git a/W/install_module_one.bat b/W/install_module_one.bat index f8b534b..1ba4898 100644 --- a/W/install_module_one.bat +++ b/W/install_module_one.bat @@ -1,12 +1,11 @@ -@REM $Id: install_module_one.bat,v 1.1 2015/11/23 16:49:17 gilles Exp gilles $ +@REM $Id: install_module_one.bat,v 1.4 2016/07/20 21:44:40 gilles Exp gilles $ @ECHO OFF SET SHELL= SET REM EXIT -ECHO Installing Perl module IO::Socket::SSL for imapsync REM CD /D %~dp0 perl -v @@ -16,9 +15,9 @@ IF ERRORLEVEL 1 ECHO Perl needed. Install Strawberry Perl. Get it at http://stra @ECHO perl is here FOR %%M in ( - IO::Socket::SSL ^ + IO::Socket::SSL Net::SSLeay PAR::Packer^ ) DO perl -m%%M -e "print qq{Updating %%M $%%M::VERSION \n}" ^ - & cpanm %%M + & cpanm --force %%M REM IO::Socket::SSL diff --git a/W/install_modules.bat b/W/install_modules.bat index 46c18e8..aa8af3f 100644 --- a/W/install_modules.bat +++ b/W/install_modules.bat @@ -1,7 +1,11 @@ +REM $Id: install_modules.bat,v 1.27 2016/08/17 02:03:46 gilles Exp gilles $ -REM $Id: install_modules.bat,v 1.22 2015/12/26 02:10:15 gilles Exp gilles $ - +::------------------------------------------------------ +::--------------- Main of install_modules.bat ---------- +@SETLOCAL @ECHO OFF +ECHO Currently running through %0 %* + @REM Needed with remote ssh SET SHELL= SET @@ -9,13 +13,34 @@ ECHO Installing Perl modules for imapsync CD /D %~dp0 +CALL :handle_error CALL :detect_perl +CALL :handle_error CALL :update_modules + +@ENDLOCAL +EXIT /B +::------------------------------------------------------ + + +::------------------------------------------------------ +::--------------- Detect Perl -------------------------- +:detect_perl +@SETLOCAL perl -v IF ERRORLEVEL 1 ECHO Perl needed. Install Strawberry Perl. Get it at http://strawberryperl.com/ ^ - && PAUSE && EXIT /B 3 - + && PAUSE && EXIT 3 ECHO perl is there +@ENDLOCAL +EXIT /B +::------------------------------------------------------ + +::------------------------------------------------------ +::---------------- Update modules ---------------------- +:update_modules +@SETLOCAL FOR %%M in ( ^ + Test::MockObject ^ + Readonly ^ Filesys::DfPortable ^ Authen::NTLM ^ Crypt::SSLeay ^ @@ -49,5 +74,27 @@ FOR %%M in ( ^ ECHO Perl modules for imapsync updated REM PAUSE +@ENDLOCAL +EXIT /B +::------------------------------------------------------ + + +::------------------------------------------------------ +::----------- Handle errors in LOG_bat\ directory ------ +:handle_error +SETLOCAL +ECHO IN %0 with parameters %* +%* +SET CMD_RETURN=%ERRORLEVEL% +IF %CMD_RETURN% EQU 0 ( + ECHO GOOD END +) ELSE ( + ECHO BAD END + IF NOT EXIST LOG_bat MKDIR LOG_bat + ECHO Failure calling with extra %* >> LOG_bat\%~nx0.txt +) +ENDLOCAL +EXIT /B +::------------------------------------------------------ diff --git a/W/learn/automap_languages b/W/learn/automap_languages new file mode 100644 index 0000000..aee3330 --- /dev/null +++ b/W/learn/automap_languages @@ -0,0 +1,11 @@ + +From +http://stackoverflow.com/questions/2185391/localized-gmail-imap-folders/2185548#2185548 + + drafts Borradores, Borradores, Bozze, Brouillons, Concepten, Entwürfe, Kladder, Koncepty, Kopie robocze, Rascunhos, Rascunhos, Taslaklar, Utkast, Utkast, Πρόχειρα, Черновики, 下書き, 草稿, 草稿, 임시보관함 + inbox Bandeja de entrada, Boîte de réception, Caixa de entrada, Caixa de entrada, Doručená pošta, Gelen Kutusu, Indbakke, Inkorgen, Innboks, Odebrane, Posta in arrivo, Posteingang, Postvak IN, Recibidos, Εισερχόμενα, Входящие, 受信トレイ, 收件匣, 收件箱, 받은편지함 + junk Correio electrónico não solicitado, Correo basura, Junk, Junk, Lixo, Nettsøppel, Nevyžádaná pošta, No solicitado, Ongewenst, Posta indesiderata, Skräp, Spam, Wiadomości-śmieci, Önemsiz, Ανεπιθύμητα, Спам, 垃圾邮件, 垃圾郵件, 迷惑メール, 스팸 + outbox Bandeja de salida, Boîte d'envoi, Caixa de saída, Caixa de saída, Do wysłania, Enviados, Giden Kutusu, Posta in uscita, Postausgang, Postvak UIT, Pošta k odeslání, Udbakke, Utboks, Utkorgen, Εξερχόμενα, Исходящие, 发件箱, 寄件匣, 送信トレイ, 보낼편지함 + sent E-mails enviados, Enviada, Enviado, Enviado, Gesendet, Gönderildi, Inviati, Odeslaná pošta, Sendt, Sendt, Skickat, Verzonden, Wysłane, Éléments envoyés, Απεσταλμένα, Отправленные, 寄件備份, 已发送邮件, 送信済み, 보낸편지함 + trash Cestino, Corbeille, Kosz, Koš, Lixeira, Lixo, Papelera, Papelera, Papierkorb, Papirkurv, Papirkurv, Papperskorgen, Prullenbak, Çöp Kutusu, Κάδος απορριμμάτων, Корзина, ゴミ箱, 垃圾桶, 已删除邮件, 휴지통 + diff --git a/W/learn/create_folder b/W/learn/create_folder new file mode 100755 index 0000000..5a1b1b8 --- /dev/null +++ b/W/learn/create_folder @@ -0,0 +1,29 @@ +#!/usr/bin/perl -w + +use Mail::IMAPClient; + +$ARGV[2] or die "usage: $0 host user password folder1 folder2 ...\n"; + +$host = $ARGV[0]; +$user = $ARGV[1]; +$password = $ARGV[2]; + +my $imap = Mail::IMAPClient->new(); +$imap->Debug(1); +$imap->Server($host); +$imap->connect() or die; +$imap->User($user); +$imap->Password($password); +$imap->login() or die; +$imap->Uid(1); +$imap->Peek(1); + +foreach $folder (@ARGV[3..$#ARGV]) { + print "creating folder $folder\n"; + $imap->create($folder); +} + +$imap->logout(); +# $imap->close(); + + diff --git a/W/learn/delete_all_folders b/W/learn/delete_all_folders new file mode 100755 index 0000000..2ba7ee7 --- /dev/null +++ b/W/learn/delete_all_folders @@ -0,0 +1,36 @@ +#!/usr/bin/perl -w + +# $Id: delete_folder,v 1.1 2016/07/05 20:59:43 gilles Exp gilles $ + +use Mail::IMAPClient; + +$ARGV[2] or die "usage: $0 host user password folder1 folder2 ...\n"; + +$host = $ARGV[0]; +$user = $ARGV[1]; +$password = $ARGV[2]; + +my $imap = Mail::IMAPClient->new(); +$imap->Debug(1); +$imap->Server($host); +$imap->Ssl( 1 ) ; +$imap->connect() or die; +$imap->User($user); +$imap->Password($password); +$imap->login() or die; +$imap->Uid(1); +$imap->Peek(1); + + + +my @folders = $imap->folders( ) ; +print map { "$_\n" } @folders ; +foreach $folder ( @folders) { + print "deleting folder $folder\n"; + $imap->delete( $folder ) ; +} + +$imap->logout(); +# $imap->close(); + + diff --git a/W/learn/delete_folder b/W/learn/delete_folder new file mode 100755 index 0000000..0783363 --- /dev/null +++ b/W/learn/delete_folder @@ -0,0 +1,36 @@ +#!/usr/bin/perl -w + +# $Id: delete_folder,v 1.1 2016/07/05 20:59:43 gilles Exp gilles $ + +use Mail::IMAPClient; + +$ARGV[2] or die "usage: $0 host user password folder1 folder2 ...\n"; + +$host = $ARGV[0]; +$user = $ARGV[1]; +$password = $ARGV[2]; + +my $imap = Mail::IMAPClient->new(); +$imap->Debug(1); +$imap->Server($host); +$imap->Ssl( 1 ) ; +$imap->connect() or die; +$imap->User($user); +$imap->Password($password); +$imap->login() or die; +$imap->Uid(1); +$imap->Peek(1); + + + +my @folders = $imap->folders( ) ; +print map { "$_\n" } @folders ; +foreach $folder (@ARGV[3..$#ARGV]) { + print "deleting folder $folder\n"; + $imap->delete( $folder ) ; +} + +$imap->logout(); +# $imap->close(); + + diff --git a/W/learn/dns_srv_imap b/W/learn/dns_srv_imap new file mode 100755 index 0000000..073d734 --- /dev/null +++ b/W/learn/dns_srv_imap @@ -0,0 +1,205 @@ +#!/usr/bin/perl + +# $Id: dns_srv_imap,v 1.5 2016/08/15 01:24:20 gilles Exp gilles $ + +use strict ; +use warnings ; +use English ; +use Test::More ; +use Net::DNS ; + + + +foreach my $email ( @ARGV ) { + my $domain = domain_name_of( $email ) ; + print "Domain for email $email: $domain\n" ; + my ( $host, $port ) = host_port_from_lookup_srv( '_imaps._tcp.' . $domain ) ; + $host ||= q{} ; + $port ||= q{} ; + print "IMAPS server name and port for $email: $host $port\n" ; + + ( $host, $port ) = host_port_from_lookup_srv( '_imap._tcp.' . $domain ) ; + $host ||= q{} ; + $port ||= q{} ; + print "IMAP server name and port for $email: $host $port\n" ; +} + + +tests_server_name_from_srv_string( ) ; +tests_server_port_from_srv_string( ) ; +tests_domain_name_of( ) ; +tests_host_port_ssl_from_user( ) ; +done_testing( ) ; + +my $debug = 1 ; + + +sub host_port_ssl_from_user { + my $user = shift @ARG ; + + if ( ! $user ) { + return ; + } + + my $domain = domain_name_of( $user ) ; + if ( ! $domain ) { + return ; + } + + my ( $host, $port ) = host_port_from_lookup_srv( qq{_imaps._tcp.$domain} ) ; + my $ssl = 1 ; + if ( $host and $port ) { + return ( $host, $port, $ssl ) ; + } + + # fallback to imap in clear + $ssl = 0 ; + ( $host, $port ) = host_port_from_lookup_srv( qq{_imap._tcp.$domain} ) ; + + if ( $host and $port ) { + return ( $host, $port, $ssl ) ; + } + + return ; + +} + +sub tests_host_port_ssl_from_user { + is( undef, host_port_ssl_from_user( ), 'host_port_ssl_from_user: no args => undef' ) ; + is_deeply( [qw( imap.gmail.com. 993 1 )], [host_port_ssl_from_user( 'gilles.lamiral@gmail.com' )], + 'host_port_ssl_from_user: gilles.lamiral@gmail.com => imap.gmail.com. 993 1 (ssl)' ) ; + +} + +sub host_port_from_lookup_srv { + my $request = shift @ARG ; + + my $lookup = lookup_srv_string( $request ) ; + if ( ! $lookup ) { + return ; + } + + my $host = server_name_from_srv_string( $lookup ) ; + my $port = server_port_from_srv_string( $lookup ) ; + + if( $host and $port ) { + return ( $host, $port ) ; + } + else { + return ; + } +} + + +sub domain_name_of_email { + my $email = shift ; + + return( undef ) if ( not $email ) ; + + my $domain ; + + if ( $email =~ /^.*@([^@]+)$/ ) { + $domain = $1 ; + $debug and print "domain: $domain\n" ; + return( $domain ) ; + } + return ; +} + + +sub domain_name_of { + my $email = shift ; + + return( undef ) if ( not $email ) ; + + my $domain = domain_name_of_email( $email ) ; + + if ( ! $domain ) { + $domain = $email ; + } + + return( $domain ) ; +} + +sub tests_domain_name_of { + ok( not( domain_name_of( '' ) ), 'domain_name_of: void => undef' ) ; + ok( not( domain_name_of( ) ), 'domain_name_of: undef => undef' ) ; + ok( 'foo' eq domain_name_of( 'foo' ), 'domain_name_of: foo => foo' ) ; + #ok( 'foo' eq domain_name_of( 'foo ' ), 'domain_name_of: foo => foo' ) ; + #ok( 'foo' eq domain_name_of( 'foo ' ), 'domain_name_of: foo => foo' ) ; + ok( 'example.com' eq domain_name_of( 'foo@example.com' ), 'domain_name_of: foo@example.com => example.com' ) ; + ok( 'example.com' eq domain_name_of( '@foo@example.com' ), 'domain_name_of: @foo@example.com => example.com' ) ; + ok( 'example.com' eq domain_name_of( 'bar@foo@example.com' ), 'domain_name_of: bar@foo@example.com => example.com' ) ; +} + +sub lookup_srv_string { + my $name = shift ; + + my $resolver = new Net::DNS::Resolver( ) ; + my $reply = $resolver->query( $name, 'SRV' ) ; + + my $string ; + if ( $reply ) { + #($reply->answer)[0]->print; + foreach my $rr ( $reply->answer ) { + $debug and print 'name: ' . $rr->name . "\n" ; + $debug and print 'class: ' . $rr->class . "\n" ; + $debug and print 'type: ' . $rr->type . "\n" ; + $debug and print 'ttl: ' . $rr->ttl . "\n" ; + $debug and print 'string: ' . $rr->string . "\n" ; + next if ( 'SRV' ne $rr->type ) ; + next if ( not( $rr->string ) ) ; + $string = $rr->string ; + return( $string ) ; + } + } else { + print "Query failed SRV for domain $name: ", $resolver->errorstring, "\n" ; + return( undef ) ; + } + return( $string ) ; +} + + + + +sub server_name_from_srv_string { + my $srv_string = shift ; + + return( undef ) if ( not $srv_string ) ; + my $server_name = (split( /\s+/ , $srv_string ) )[7] ; + return( undef ) if ( '.' eq $server_name ) ; + return( $server_name ) ; +} + +sub tests_server_name_from_srv_string { + ok( not( server_name_from_srv_string( '' ) ), 'server_name_from_srv_string: void' ) ; + ok( not( server_name_from_srv_string( ) ), 'server_name_from_srv_string: undef' ) ; + ok( 'imap.gmail.com.' eq + server_name_from_srv_string( '_imaps._tcp.gmail.com. 82466 IN SRV 5 0 993 imap.gmail.com.' ), + 'server_name_from_srv_string: _imaps._tcp.gmail.com. => imap.gmail.com.' ) ; + ok( not( server_name_from_srv_string( '_imap._tcp.gmail.com. 81999 IN SRV 0 0 0 .' ) ), + 'server_name_from_srv_string: _imap._tcp.gmail.com. => undef' ) ; + + return( ) ; +} + +sub server_port_from_srv_string { + my $srv_string = shift ; + + return( undef ) if ( not $srv_string ) ; + my $server_port = (split( /\s+/ , $srv_string ) )[6] ; + return( undef ) if ( 0 == $server_port ) ; + return( $server_port ) ; +} + +sub tests_server_port_from_srv_string { + ok( not( server_port_from_srv_string( '' ) ), 'server_port_from_srv_string: void' ) ; + ok( not( server_port_from_srv_string( ) ), 'server_port_from_srv_string: undef' ) ; + ok( '993' eq + server_port_from_srv_string( '_imaps._tcp.gmail.com. 82466 IN SRV 5 0 993 imap.gmail.com.' ), + 'server_port_from_srv_string: _imaps._tcp.gmail.com. => 993' ) ; + ok( not( server_port_from_srv_string( '_imap._tcp.gmail.com. 81999 IN SRV 0 0 0 .' ) ), + 'server_port_from_srv_string: _imap._tcp.gmail.com. => undef' ) ; + + return( ) ; +} diff --git a/W/learn/dns_srv_imap.tdy b/W/learn/dns_srv_imap.tdy new file mode 100755 index 0000000..23287a3 --- /dev/null +++ b/W/learn/dns_srv_imap.tdy @@ -0,0 +1,249 @@ +#!/usr/bin/perl + +# $Id: dns_srv_imap,v 1.5 2016/08/15 01:24:20 gilles Exp gilles $ + +use strict; +use warnings; +use English; +use Test::More; +use Net::DNS; + +# _imaps._tcp.gmail.com. 86183 IN SRV 5 0 993 imap.gmail.com. +lookup_srv_string('_imaps._tcp.gmail.com'); + +#lookup_srv( '_imap._tcp.gmail.com' ) ; +#lookup_srv( '_imaps._tcp.lamiral.info' ) ; +#lookup_srv( '_imap._tcp.lamiral.info' ) ; + +foreach my $email (@ARGV) { + my $domain = domain_name_of($email); + print "Domain for email $email: $domain\n"; + my ( $host, $port ) = host_port_from_lookup_srv( '_imaps._tcp.' . $domain ); + $host ||= q{}; + $port ||= q{}; + print "IMAPS server name and port for $email: $host $port\n"; + + ( $host, $port ) = host_port_from_lookup_srv( '_imap._tcp.' . $domain ); + $host ||= q{}; + $port ||= q{}; + print "IMAP server name and port for $email: $host $port\n"; + +} + +tests_server_name_from_srv_string(); +tests_server_port_from_srv_string(); +tests_domain_name_of(); +tests_host_port_ssl_from_user(); +done_testing(); + +my $debug = 1; + +sub host_port_ssl_from_user { + my $user = shift @ARG; + + if ( !$user ) { + return; + } + + my $domain = domain_name_of($user); + if ( !$domain ) { + return; + } + + my ( $host, $port ) = host_port_from_lookup_srv(qq{_imaps._tcp.$domain}); + my $ssl = 1; + if ( $host and $port ) { + return ( $host, $port, $ssl ); + } + + # fallback to imap in clear + $ssl = 0; + ( $host, $port ) = host_port_from_lookup_srv(qq{_imap._tcp.$domain}); + + if ( $host and $port ) { + return ( $host, $port, $ssl ); + } + + return; + +} + +sub tests_host_port_ssl_from_user { + is( undef, host_port_ssl_from_user(), + 'host_port_ssl_from_user: no args => undef' ); + is_deeply( + [qw( imap.gmail.com. 993 1 )], + [ host_port_ssl_from_user('gilles.lamiral@gmail.com') ], +'host_port_ssl_from_user: gilles.lamiral@gmail.com => imap.gmail.com. 993 1 (ssl)' + ); + +} + +sub host_port_from_lookup_srv { + my $request = shift @ARG; + + my $lookup = lookup_srv_string($request); + if ( !$lookup ) { + return; + } + + my $host = server_name_from_srv_string($lookup); + my $port = server_port_from_srv_string($lookup); + + if ( $host and $port ) { + return ( $host, $port ); + } + else { + return; + } +} + +sub domain_name_of_email { + my $email = shift; + + return (undef) if ( not $email ); + + my $domain; + + if ( $email =~ /^.*@([^@]+)$/ ) { + $domain = $1; + $debug and print "domain: $domain\n"; + return ($domain); + } + return; +} + +sub domain_name_of { + my $email = shift; + + return (undef) if ( not $email ); + + my $domain = domain_name_of_email($email); + + if ( !$domain ) { + $domain = $email; + } + + return ($domain); +} + +sub tests_domain_name_of { + ok( not( domain_name_of('') ), 'domain_name_of: void => undef' ); + ok( not( domain_name_of() ), 'domain_name_of: undef => undef' ); + ok( 'foo' eq domain_name_of('foo'), 'domain_name_of: foo => foo' ); + + #ok( 'foo' eq domain_name_of( 'foo ' ), 'domain_name_of: foo => foo' ) ; + #ok( 'foo' eq domain_name_of( 'foo ' ), 'domain_name_of: foo => foo' ) ; + ok( + 'example.com' eq domain_name_of('foo@example.com'), + 'domain_name_of: foo@example.com => example.com' + ); + ok( + 'example.com' eq domain_name_of('@foo@example.com'), + 'domain_name_of: @foo@example.com => example.com' + ); + ok( + 'example.com' eq domain_name_of('bar@foo@example.com'), + 'domain_name_of: bar@foo@example.com => example.com' + ); +} + +sub lookup_srv_string { + my $name = shift; + + my $resolver = new Net::DNS::Resolver(); + my $reply = $resolver->query( $name, 'SRV' ); + + my $string; + if ($reply) { + + #($reply->answer)[0]->print; + foreach my $rr ( $reply->answer ) { + $debug and print 'name: ' . $rr->name . "\n"; + $debug and print 'class: ' . $rr->class . "\n"; + $debug and print 'type: ' . $rr->type . "\n"; + $debug and print 'ttl: ' . $rr->ttl . "\n"; + $debug and print 'string: ' . $rr->string . "\n"; + next if ( 'SRV' ne $rr->type ); + next if ( not( $rr->string ) ); + $string = $rr->string; + return ($string); + } + } + else { + print "Query failed SRV for domain $name: ", $resolver->errorstring, + "\n"; + return (undef); + } + return ($string); +} + +sub server_name_from_srv_string { + my $srv_string = shift; + + return (undef) if ( not $srv_string ); + my $server_name = ( split( /\s+/, $srv_string ) )[7]; + return (undef) if ( '.' eq $server_name ); + return ($server_name); +} + +sub tests_server_name_from_srv_string { + ok( + not( server_name_from_srv_string('') ), + 'server_name_from_srv_string: void' + ); + ok( + not( server_name_from_srv_string() ), + 'server_name_from_srv_string: undef' + ); + ok( + 'imap.gmail.com.' eq server_name_from_srv_string( +'_imaps._tcp.gmail.com. 82466 IN SRV 5 0 993 imap.gmail.com.' + ), + 'server_name_from_srv_string: _imaps._tcp.gmail.com. => imap.gmail.com.' + ); + ok( + not( + server_name_from_srv_string( + '_imap._tcp.gmail.com. 81999 IN SRV 0 0 0 .') + ), + 'server_name_from_srv_string: _imap._tcp.gmail.com. => undef' + ); + + return (); +} + +sub server_port_from_srv_string { + my $srv_string = shift; + + return (undef) if ( not $srv_string ); + my $server_port = ( split( /\s+/, $srv_string ) )[6]; + return (undef) if ( 0 == $server_port ); + return ($server_port); +} + +sub tests_server_port_from_srv_string { + ok( + not( server_port_from_srv_string('') ), + 'server_port_from_srv_string: void' + ); + ok( + not( server_port_from_srv_string() ), + 'server_port_from_srv_string: undef' + ); + ok( + '993' eq server_port_from_srv_string( +'_imaps._tcp.gmail.com. 82466 IN SRV 5 0 993 imap.gmail.com.' + ), + 'server_port_from_srv_string: _imaps._tcp.gmail.com. => 993' + ); + ok( + not( + server_port_from_srv_string( + '_imap._tcp.gmail.com. 81999 IN SRV 0 0 0 .') + ), + 'server_port_from_srv_string: _imap._tcp.gmail.com. => undef' + ); + + return (); +} diff --git a/W/learn/imap_utf7_tests b/W/learn/imap_utf7_tests new file mode 100755 index 0000000..ac70bb3 --- /dev/null +++ b/W/learn/imap_utf7_tests @@ -0,0 +1,9 @@ +#!/bin/sh + + + +echo 收件箱 + +touch './+ZyhnUA-' + + diff --git a/W/learn/mi2 b/W/learn/mi2 deleted file mode 100755 index ba00318..0000000 --- a/W/learn/mi2 +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -perl -I../Mail-IMAPClient-2.2.9 "$@" - diff --git a/W/learn/mi3 b/W/learn/mi3 deleted file mode 100755 index e84e800..0000000 --- a/W/learn/mi3 +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -perl -I../Mail-IMAPClient-3.28/lib "$@" - diff --git a/W/learn/net_dns_srv_imap b/W/learn/net_dns_srv_imap deleted file mode 100755 index 3e41793..0000000 --- a/W/learn/net_dns_srv_imap +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/perl - -use strict ; -use warnings ; -use Net::DNS; - - - -lookup_srv( '_imaps._tcp.gmail.com' ) ; -lookup_srv( '_imap._tcp.gmail.com' ) ; - -sub lookup_srv { - my $name = shift ; - - my $resolver = new Net::DNS::Resolver( ) ; - my $reply = $resolver->query( $name, 'SRV' ) ; - - if ( $reply ) { - #($reply->answer)[0]->print; - foreach my $rr ($reply->answer) { - print $rr->name . "\n" ; - print $rr->class . "\n" ; - print $rr->type . "\n" ; - print $rr->ttl . "\n" ; - print $rr->string . "\n" ; - } - } else { - print "query failed: ", $resolver->errorstring, "\n"; - } -} - - -sub lookup_address { -# Perform a lookup, using the searchlist if appropriate. - my $resolver = new Net::DNS::Resolver( ) ; - my $reply = $resolver->search( 'example.com' ); - if ($reply) { - foreach my $rr ($reply->answer) { - next unless $rr->type eq "A"; - print $rr->address, "\n"; - } - } else { - warn "query failed: ", $resolver->errorstring, "\n"; - } -} - diff --git a/W/learn/perlcritic_ProhibitInterpolationOfLiterals b/W/learn/perlcritic_ProhibitInterpolationOfLiterals new file mode 100755 index 0000000..88951ea --- /dev/null +++ b/W/learn/perlcritic_ProhibitInterpolationOfLiterals @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +# $Id: perlcritic_ProhibitInterpolationOfLiterals,v 1.3 2016/06/15 22:18:23 gilles Exp gilles $ + +use strict; +use warnings; + +our $VERSION = q$Revision: 1.3 $; + +if ( "\1foo" eq '\1foo' ) { + print "equal\n"; +} +else { + print "not equal\n"; +} + diff --git a/W/learn/perlcritic_ProhibitInterpolationOfLiterals_2 b/W/learn/perlcritic_ProhibitInterpolationOfLiterals_2 new file mode 100755 index 0000000..196647b --- /dev/null +++ b/W/learn/perlcritic_ProhibitInterpolationOfLiterals_2 @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +# $Id: perlcritic_ProhibitInterpolationOfLiterals,v 1.3 2016/06/15 22:18:23 gilles Exp gilles $ + +use strict; +use warnings; + +our $VERSION = q$Revision: 1.3 $; + +if ( "\afoo" eq '\afoo' ) { + print "equal\n"; +} +else { + print "not equal\n"; +} + diff --git a/W/learn/print b/W/learn/print new file mode 100755 index 0000000..355431d --- /dev/null +++ b/W/learn/print @@ -0,0 +1,27 @@ +#!/usr/bin/perl + +# $Id: print,v 1.1 2016/06/16 19:10:04 gilles Exp gilles $ + +use strict; +use warnings; +use English; + +our $VERSION = q$Revision: 1.1 $; + +# myprint( STDOUT "Hello\n" ) ; # DO NOT WORK + +open my $stdout, ">-" ; +#myprint( $stdout, "Hello from myprint & filehandle\n" ) ; # DO NOT WORK +close $stdout ; + +myprint( "Hello\n" ) ; # WORKS + +myprint( << 'EOF' ) ; +lalala +myprint inline +EOF + +exit; + +sub myprint { print @ARG ; } + diff --git a/W/learn/quotes b/W/learn/quotes new file mode 100755 index 0000000..742b9f8 --- /dev/null +++ b/W/learn/quotes @@ -0,0 +1,24 @@ +#!/usr/bin/perl + +use strict ; +use warnings ; + +print "123456789\\" ."\n" ; +print '123456789\\' ."\n" ; +print "123456789\"" ."\n" ; +print '123456789\'' ."\n" ; + +print "\\" ."\n" ; +print q{\\} ."\n" ; + +print qq{ !"#$%&'()*+,-./0123456789:;<=>?\@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg\n} ; + +print "\1auth=Bearer " . "\1\1" . "\n" ; +print '\1auth=Bearer ' . '\1\1' . "\n" ; + +if ( "\1foo" eq '\1foo' ) { + print "equal\n" ; +}else{ + print "not equal\n" ; +} + diff --git a/W/learn/ref b/W/learn/ref new file mode 100755 index 0000000..363d580 --- /dev/null +++ b/W/learn/ref @@ -0,0 +1,12 @@ +#!/usr/bin/perl + + +use strict; +use warnings; + + +my $debug = 'val_debug' ; + +print "ref(\\\$debug)=" . ref(\$debug) . "\n" ; +print "ref(\$debug)=" . ref($debug) . "\n" ; +print "\n$debug=$debug\n" ; diff --git a/W/learn/tmp/+ZyhnUA- b/W/learn/tmp/+ZyhnUA- new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/W/learn/tmp/+ZyhnUA- diff --git "a/W/learn/tmp/\346\224\266\344\273\266\347\256\261" "b/W/learn/tmp/\346\224\266\344\273\266\347\256\261" new file mode 100644 index 0000000..e69de29 --- /dev/null +++ "b/W/learn/tmp/\346\224\266\344\273\266\347\256\261" diff --git a/W/learn/utf7_to_utf7imap b/W/learn/utf7_to_utf7imap new file mode 100755 index 0000000..b30fb0c --- /dev/null +++ b/W/learn/utf7_to_utf7imap @@ -0,0 +1,21 @@ +#!/usr/bin/perl + +# $Id: utf7_to_utf7imap,v 1.1 2016/08/08 22:57:44 gilles Exp gilles $ + +use strict ; +use warnings ; + +foreach my $str_utf7 ( @ARGV ) { + my $str_utf7imap = utf7_to_uft7imap( $str_utf7 ) ; + print qq{mv '$str_utf7' '$str_utf7imap'\n} ; +} + +# http://cpansearch.perl.org/src/FABPOT/Unicode-IMAPUtf7-2.01/lib/Unicode/IMAPUtf7.pm +sub utf7_to_uft7imap { + my ( $s ) = @_ ; + + $s =~ s/\+([^\/&\-]*)\/([^\/\-&]*)\-/\+$1,$2\-/g ; + $s =~ s/&/&\-/g ; + $s =~ s/\+([^+\-]+)?\-/&$1\-/g ; + return( $s ) ; +} diff --git a/W/learn_func.bat b/W/learn_func.bat new file mode 100644 index 0000000..d8d92dc --- /dev/null +++ b/W/learn_func.bat @@ -0,0 +1,39 @@ +REM $Id: learn_func.bat,v 1.2 2016/06/28 11:39:42 gilles Exp gilles $ + +@SETLOCAL +@ECHO OFF + +ECHO Currently running through %0 %* + +CD /D %~dp0 + +REM Remove the error file because its existence means an error occured during this script execution +IF EXIST LOG_bat\%~nx0.txt DEL LOG_bat\%~nx0.txt + +CALL :handle_error EXIT /B 1 +CALL :handle_error EXIT /B 0 +CALL :handle_error NOEXIST +CALL :handle_error ECHO "STILL THERE? FIRST" +CALL :handle_error EXIT 0 +CALL :handle_error ECHO "STILL THERE? SECOND" +@ENDLOCAL +@EXIT /B + + + +:handle_error +SETLOCAL +ECHO IN %0 with parameters %* +%* +SET CMD_RETURN=%ERRORLEVEL% + +IF %CMD_RETURN% EQU 0 ( + ECHO GOOD END +) ELSE ( + ECHO BAD END + IF NOT EXIST LOG_bat MKDIR LOG_bat + ECHO Failure running %* >> LOG_bat\%~nx0.txt +) +ENDLOCAL +EXIT /B + diff --git a/W/ml_announce.in b/W/ml_announce.in index 961d2a4..a8c652e 100644 --- a/W/ml_announce.in +++ b/W/ml_announce.in @@ -1,4 +1,4 @@ -m4_dnl $Id: ml_announce.in,v 1.12 2016/01/21 02:22:24 gilles Exp gilles $ +m4_dnl $Id: ml_announce.in,v 1.16 2016/08/18 09:38:48 gilles Exp gilles $ m4_dnl m4_define(`M4_imapsync_VERSION',m4_esyscmd(cat VERSION|tr -d '\n'))m4_dnl m4_define(`M4_SECRET_PATH',m4_esyscmd(cat dist/path_last.txt|tr -d '\n'))m4_dnl @@ -14,14 +14,15 @@ You're subscribed to the newsletter announcing imapsync new releases (very few traffic) and the way to get them. Send me a note if you don't want to receive those announces anymore. -You will find the latest imapsync.exe binary (release M4_imapsync_VERSION) -and the latest imapsync source code (release M4_imapsync_VERSION) at the following link: +You will find the latest imapsync.exe binary (release M4_imapsync_VERSION), +the latest imapsync source code (release M4_imapsync_VERSION), +OS X and Linux (i386) binaries at the following link: - http://imapsync.lamiral.info/dist/M4_SECRET_PATH/ + https://imapsync.lamiral.info/dist/M4_SECRET_PATH or also more permanently from this page - http://imapsync.lamiral.info/paypal_return.shtml + https://imapsync.lamiral.info/paypal_return.shtml Three important files are there: * imapsync is directly the perl script (also found in the tarball and zip) for a fast upgrade. @@ -29,20 +30,20 @@ Three important files are there: * imapsync.M4_imapsync_VERSION.zip is the win32 zip archive including standalone binary imapsync.exe. What's new in this M4_imapsync_VERSION release can be found at -http://imapsync.lamiral.info/S/news.shtml +https://imapsync.lamiral.info/S/news.shtml Vote for better imapsync and services at -http://imapsync.lamiral.info/#poll +http://imapsync.lamiral.info/poll.shtml I thank you again for buying and using imapsync, I wish you successful imap transfers! Feedback is welcome! -Web site: http://imapsync.lamiral.info/ +Web site: https://imapsync.lamiral.info/ -- Au revoir. Gilles Lamiral, La Billais, 35580 Baulon, France tel +33 951 84 42 42 -mob +33 620 79 76 06 +mob +33 619 22 03 54 diff --git a/W/paypal_reply/imapsync_sold_by_country.txt b/W/paypal_reply/imapsync_sold_by_country.txt index 40affcd..2541445 100644 --- a/W/paypal_reply/imapsync_sold_by_country.txt +++ b/W/paypal_reply/imapsync_sold_by_country.txt @@ -1,82 +1,86 @@ -1145 Etats-Unis_d'Amerique___ 25.78 % 25.78 % 1 -813 Allemagne_______________ 18.30 % 44.08 % 2 -418 Royaume-Uni_____________ 9.41 % 53.49 % 3 -213 France__________________ 4.80 % 58.28 % 4 -212 Italie__________________ 4.77 % 63.06 % 5 -202 Canada__________________ 4.55 % 67.60 % 6 -180 Suisse__________________ 4.05 % 71.66 % 7 -156 Pays-Bas________________ 3.51 % 75.17 % 8 -151 Australie_______________ 3.40 % 78.57 % 9 -90 Autriche________________ 2.03 % 80.59 % 10 -80 Belgique________________ 1.80 % 82.40 % 11 -76 Espagne_________________ 1.71 % 84.11 % 12 -65 Suede___________________ 1.46 % 85.57 % 13 -53 Danemark________________ 1.19 % 86.76 % 14 -48 Bresil__________________ 1.08 % 87.84 % 15 -41 Norvege_________________ 0.92 % 88.77 % 16 -31 Finlande________________ 0.70 % 89.46 % 17 -29 Pologne_________________ 0.65 % 90.12 % 18 -26 Japon___________________ 0.59 % 90.70 % 19 -25 Republique_tcheque______ 0.56 % 91.27 % 20 -25 ________________________ 0.56 % 91.83 % 21 -22 Russie__________________ 0.50 % 92.32 % 22 -22 Irlande_________________ 0.50 % 92.82 % 23 -21 Nouvelle-Zelande________ 0.47 % 93.29 % 24 -18 Hongrie_________________ 0.41 % 93.70 % 25 -15 Hong-Kong_______________ 0.34 % 94.03 % 26 -15 Afrique_du_Sud__________ 0.34 % 94.37 % 27 -14 Portugal________________ 0.32 % 94.69 % 28 -13 Slovaquie_______________ 0.29 % 94.98 % 29 -13 Malaisie________________ 0.29 % 95.27 % 30 -12 Luxembourg______________ 0.27 % 95.54 % 31 -12 Inde____________________ 0.27 % 95.81 % 32 -12 Grece___________________ 0.27 % 96.08 % 33 -12 Argentine_______________ 0.27 % 96.35 % 34 -11 Singapour_______________ 0.25 % 96.60 % 35 -11 Israel__________________ 0.25 % 96.85 % 36 -11 Chine___________________ 0.25 % 97.10 % 37 -11 Chili___________________ 0.25 % 97.34 % 38 -10 Mexique_________________ 0.23 % 97.57 % 39 -9 Roumanie________________ 0.20 % 97.77 % 40 -8 Slovenie________________ 0.18 % 97.95 % 41 -8 Emirats_Arabes_Unis_____ 0.18 % 98.13 % 42 -7 Lettonie________________ 0.16 % 98.29 % 43 -5 Thailande_______________ 0.11 % 98.40 % 44 -5 Malte___________________ 0.11 % 98.51 % 45 -5 Islande_________________ 0.11 % 98.63 % 46 -4 Turquie_________________ 0.09 % 98.72 % 47 -4 Indonesie_______________ 0.09 % 98.81 % 48 -4 Egypte__________________ 0.09 % 98.90 % 49 -4 Croatie_________________ 0.09 % 98.99 % 50 -4 Bulgarie________________ 0.09 % 99.08 % 51 -3 Venezuela_______________ 0.07 % 99.14 % 52 -3 Philippines_____________ 0.07 % 99.21 % 53 -3 Estonie_________________ 0.07 % 99.28 % 54 -2 Vietnam_________________ 0.05 % 99.32 % 55 -2 Uruguay_________________ 0.05 % 99.37 % 56 -2 Lituanie________________ 0.05 % 99.41 % 57 -2 Costa_Rica______________ 0.05 % 99.46 % 58 -2 Chypre__________________ 0.05 % 99.50 % 59 -1 Ukraine_________________ 0.02 % 99.53 % 60 -1 Trinite-et-Tobago_______ 0.02 % 99.55 % 61 -1 Tanzanie________________ 0.02 % 99.57 % 62 -1 Taiwan__________________ 0.02 % 99.59 % 63 -1 Serbie__________________ 0.02 % 99.62 % 64 -1 Senegal_________________ 0.02 % 99.64 % 65 -1 Saint_Christophe-Nevis-Anguilla__ 0.02 % 99.66 % 66 -1 Qatar___________________ 0.02 % 99.68 % 67 -1 Perou___________________ 0.02 % 99.71 % 68 -1 Panama__________________ 0.02 % 99.73 % 69 -1 Nouvelle-Caledonie______ 0.02 % 99.75 % 70 -1 Nigeria_________________ 0.02 % 99.77 % 71 -1 Namibie_________________ 0.02 % 99.80 % 72 -1 Mongolie________________ 0.02 % 99.82 % 73 -1 Moldavie________________ 0.02 % 99.84 % 74 -1 Maldives________________ 0.02 % 99.86 % 75 -1 Îles_Vierges_britanniques__ 0.02 % 99.89 % 76 -1 Koweit__________________ 0.02 % 99.91 % 77 -1 Jordanie________________ 0.02 % 99.93 % 78 -1 Colombie________________ 0.02 % 99.95 % 79 -1 Bahrein_________________ 0.02 % 99.98 % 80 -1 Antilles_neerlandaises__ 0.02 % 100.00 % 81 -TOTAL = 4442 sales over 81 countries on Sat Jan 23 10:46:48 CET 2016 +1225 Etats-Unis______________ 24.84 % 25 % 1 +918 Allemagne_______________ 18.62 % 43 % 2 +454 Royaume-Uni_____________ 9.21 % 53 % 3 +253 Italie__________________ 5.13 % 58 % 4 +243 France__________________ 4.93 % 63 % 5 +219 Canada__________________ 4.44 % 67 % 6 +199 Suisse__________________ 4.04 % 71 % 7 +183 Pays-Bas________________ 3.71 % 75 % 8 +172 Australie_______________ 3.49 % 78 % 9 +98 Autriche________________ 1.99 % 80 % 10 +91 Espagne_________________ 1.85 % 82 % 11 +88 Belgique________________ 1.78 % 84 % 12 +71 Suede___________________ 1.44 % 85 % 13 +58 Danemark________________ 1.18 % 87 % 14 +51 Bresil__________________ 1.03 % 88 % 15 +43 Norvege_________________ 0.87 % 89 % 16 +36 Pologne_________________ 0.73 % 89 % 17 +33 Finlande________________ 0.67 % 90 % 18 +28 Republique_tcheque______ 0.57 % 91 % 19 +26 Russie__________________ 0.53 % 91 % 20 +26 Japon___________________ 0.53 % 92 % 21 +25 ________________________ 0.51 % 92 % 22 +23 Nouvelle-Zelande________ 0.47 % 93 % 23 +23 Irlande_________________ 0.47 % 93 % 24 +23 Hongrie_________________ 0.47 % 93 % 25 +19 Portugal________________ 0.39 % 94 % 26 +18 Hong-Kong_______________ 0.37 % 94 % 27 +18 Grece___________________ 0.37 % 95 % 28 +18 Afrique_du_Sud__________ 0.37 % 95 % 29 +14 Slovaquie_______________ 0.28 % 95 % 30 +14 Malaisie________________ 0.28 % 96 % 31 +13 Luxembourg______________ 0.26 % 96 % 32 +13 Inde____________________ 0.26 % 96 % 33 +12 Singapour_______________ 0.24 % 96 % 34 +12 Mexique_________________ 0.24 % 97 % 35 +12 Argentine_______________ 0.24 % 97 % 36 +11 Israel__________________ 0.22 % 97 % 37 +11 Chine___________________ 0.22 % 97 % 38 +11 Chili___________________ 0.22 % 97 % 39 +10 Roumanie________________ 0.20 % 98 % 40 +9 Slovenie________________ 0.18 % 98 % 41 +9 Lettonie________________ 0.18 % 98 % 42 +9 Emirats_Arabes_Unis_____ 0.18 % 98 % 43 +7 Croatie_________________ 0.14 % 98 % 44 +6 Thailande_______________ 0.12 % 98 % 45 +5 Malte___________________ 0.10 % 99 % 46 +5 Islande_________________ 0.10 % 99 % 47 +4 Turquie_________________ 0.08 % 99 % 48 +4 Indonesie_______________ 0.08 % 99 % 49 +4 Estonie_________________ 0.08 % 99 % 50 +4 Egypte__________________ 0.08 % 99 % 51 +4 Bulgarie________________ 0.08 % 99 % 52 +3 Venezuela_______________ 0.06 % 99 % 53 +3 Serbie__________________ 0.06 % 99 % 54 +3 Philippines_____________ 0.06 % 99 % 55 +2 Vietnam_________________ 0.04 % 99 % 56 +2 Uruguay_________________ 0.04 % 99 % 57 +2 Perou___________________ 0.04 % 99 % 58 +2 Lituanie________________ 0.04 % 99 % 59 +2 Costa_Rica______________ 0.04 % 99 % 60 +2 Chypre__________________ 0.04 % 99 % 61 +2 Antilles_neerlandaises__ 0.04 % 100 % 62 +1 Ukraine_________________ 0.02 % 100 % 63 +1 Trinite-et-Tobago_______ 0.02 % 100 % 64 +1 Tanzanie________________ 0.02 % 100 % 65 +1 Taiwan__________________ 0.02 % 100 % 66 +1 Senegal_________________ 0.02 % 100 % 67 +1 Saint_Christophe-Nevis-Anguilla__ 0.02 % 100 % 68 +1 Qatar___________________ 0.02 % 100 % 69 +1 Panama__________________ 0.02 % 100 % 70 +1 Nouvelle-Caledonie______ 0.02 % 100 % 71 +1 Nigeria_________________ 0.02 % 100 % 72 +1 Namibie_________________ 0.02 % 100 % 73 +1 Mongolie________________ 0.02 % 100 % 74 +1 Moldavie________________ 0.02 % 100 % 75 +1 Maldives________________ 0.02 % 100 % 76 +1 Koweit__________________ 0.02 % 100 % 77 +1 Jordanie________________ 0.02 % 100 % 78 +1 Iles_Vierges_britanniques__ 0.02 % 100 % 79 +1 Grenade_________________ 0.02 % 100 % 80 +1 Coree_du_Sud____________ 0.02 % 100 % 81 +1 Colombie________________ 0.02 % 100 % 82 +1 Cameroun________________ 0.02 % 100 % 83 +1 Burkina_Faso____________ 0.02 % 100 % 84 +1 Bahrein_________________ 0.02 % 100 % 85 +TOTAL = 4931 sales 219147 EUR over 85 countries on Tue Aug 16 19:44:43 CEST 2016 diff --git a/W/paypal_reply/memo b/W/paypal_reply/memo index 0ee3827..f1f440c 100644 --- a/W/paypal_reply/memo +++ b/W/paypal_reply/memo @@ -1,6 +1,6 @@ #!/bin/sh -# $Id: memo,v 1.18 2015/12/03 16:47:48 gilles Exp gilles $ +# $Id: memo,v 1.19 2016/08/09 10:50:30 gilles Exp gilles $ echo paypal_bilan_todo @@ -29,6 +29,49 @@ EOF } +echo paypal_bilan_changefix_Commission_Frais +paypal_bilan_changefix_Commission_Frais() { +# DID output diff between +( +#set -x +perl -c /g/public_html/imapsync/W/paypal_reply/paypal_bilan || return 1 +cd /g/var/paypal_bilan_changefix_Commission_Frais || return 1 +/g/public_html/imapsync/W/paypal_reply/paypal_bilan_1.81 \ + --debug --debug_csv --debug_email --details --debug_invoice \ + --dir_invoices /g/var/paypal_invoices_dev --first_in 40001 \ + 2016_07_old.csv \ + > 2016_07_old.out1 2>&1 || return 1 + +/g/public_html/imapsync/W/paypal_reply/paypal_bilan \ + --debug --debug_csv --debug_email --details --debug_invoice \ + --dir_invoices /g/var/paypal_invoices_dev --first_in 40001 \ + 2016_07_old.csv \ + > 2016_07_old.out2 2>&1 || return 1 + +echo diff 2016_07_old.out1 2016_07_old.out2 + diff 2016_07_old.out1 2016_07_old.out2 + + +/g/public_html/imapsync/W/paypal_reply/paypal_bilan \ + --debug --debug_csv --debug_email --details --debug_invoice \ + --dir_invoices /g/var/paypal_invoices_dev --first_in 40001 \ + 2016_07_old.csv \ + > 2016_07_old.out3 2>&1 || return 1 + +/g/public_html/imapsync/W/paypal_reply/paypal_bilan \ + --debug --debug_csv --debug_email --details --debug_invoice \ + --dir_invoices /g/var/paypal_invoices_dev --first_in 40001 \ + 2016_07_new.csv \ + > 2016_07_new.out3 2>&1 || return 1 + +echo diff 2016_07_old.out3 2016_07_new.out3 + diff 2016_07_old.out3 2016_07_new.out3 + + +) +} + + echo paypal_bilan_licence_support_only_csv paypal_bilan_licence_support_only_csv() { diff --git a/W/paypal_reply/paypal_bilan b/W/paypal_reply/paypal_bilan index bf4b09d..284c0aa 100755 --- a/W/paypal_reply/paypal_bilan +++ b/W/paypal_reply/paypal_bilan @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: paypal_bilan,v 1.81 2016/01/23 09:37:19 gilles Exp gilles $ +# $Id: paypal_bilan,v 1.83 2016/08/18 09:43:40 gilles Exp gilles $ use strict; use warnings; @@ -13,7 +13,7 @@ use Test::More 'no_plan' ; die unless (utf8_supported_charset('ISO-8859-1')); -my $rcs = '$Id: paypal_bilan,v 1.81 2016/01/23 09:37:19 gilles Exp gilles $ ' ; +my $rcs = '$Id: paypal_bilan,v 1.83 2016/08/18 09:43:40 gilles Exp gilles $ ' ; $rcs =~ m/,v (\d+\.\d+)/ ; my $VERSION = ($1) ? $1: "UNKNOWN" ; @@ -592,6 +592,18 @@ sub compute_line { ( $A->{Etat} ) = @action{ ( 'Etat' ) } || @action{ ( '�tat' ) } ; ( $A->{Hors_taxe_paypal} ) = @action{ ( 'Hors taxe' ) } || @action{ ( 'Avant commission' ) } ; + + # August 2016 + ( $A->{N_de_transaction} ) = @action{ ( 'N� de transaction' ) } || @action{ ( 'Num�ro de transaction' ) } ; + #( $A->{} ) = @action{ ( '' ) } || @action{ ( '' ) } ; + #( $A->{} ) = @action{ ( '' ) } || @action{ ( '' ) } ; + #( $A->{} ) = @action{ ( '' ) } || @action{ ( '' ) } ; + #( $A->{} ) = @action{ ( '' ) } || @action{ ( '' ) } ; + #( $A->{} ) = @action{ ( '' ) } || @action{ ( '' ) } ; + #( $A->{} ) = @action{ ( '' ) } || @action{ ( '' ) } ; + #( $A->{} ) = @action{ ( '' ) } || @action{ ( '' ) } ; + + # $A->{Impact_sur_le_solde} ||= '' ; $A->{invoice} = 'NONE' ; $A->{Montant} = $action->{ 'Net' } if not defined $A->{Montant}; @@ -700,6 +712,16 @@ sub build_invoice { 'Etat/Province/R�gion/Comt�/Territoire/Pr�fecture/R�publique', 'Code postal', 'Pays', 'line_number', 'line_csv', 'file_csv', 'Nom Option 2', 'Option 2 Valeur' ) } ; + # August 2016 + $F->{Commission} = $action->{'Commission'} || $action->{'Frais'} ; + $F->{N_de_transaction} = $action->{'N� de transaction'} || $action->{'Num�ro de transaction'} ; + $F->{Adresse_1} = $action->{'Adresse 1'} || $action->{'Adresse (ligne 1)'} ; + #$F->{} = $action->{''} || $action->{''} ; + #$F->{} = $action->{''} || $action->{''} ; + #$F->{} = $action->{''} || $action->{''} ; + #$F->{} = $action->{''} || $action->{''} ; + # + $F->{Etat_Province} = $action->{'Etat/Province/R�gion/Comt�/Territoire/Pr�fecture/R�publique'} || $action->{'�tat/Province/R�gion/Comt�/Territoire/Pr�fecture/R�publique'} || '' ; @@ -918,11 +940,14 @@ or any other gpg graphical tool. Once more, thank you for buying and using imapsync $F->{object_type}. -Any feedback is welcome. +Any feedback is welcome! +Best Regards. -- -Best Regards, 09 51 84 42 42 -Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06 +Gilles Lamiral. +add: La Billais 35580 Baulon, France +mob: +33 6 19 22 03 54 +fix: +33 9 51 84 42 42 } ; diff --git a/W/paypal_reply/paypal_bilan_1.79 b/W/paypal_reply/paypal_bilan_1.79 deleted file mode 100755 index 0d75d67..0000000 --- a/W/paypal_reply/paypal_bilan_1.79 +++ /dev/null @@ -1,1445 +0,0 @@ -#!/usr/bin/perl - -# $Id: paypal_bilan,v 1.79 2015/08/31 14:20:59 gilles Exp gilles $ - -use strict; -use warnings; -use Getopt::Long; -use Text::CSV_XS ; -use IO::Handle ; -use Data::Dumper ; -use Unicode::MapUTF8 qw(to_utf8 from_utf8 utf8_supported_charset); -use Test::More 'no_plan' ; - -die unless (utf8_supported_charset('ISO-8859-1')); - -my $rcs = '$Id: paypal_bilan,v 1.79 2015/08/31 14:20:59 gilles Exp gilles $ ' ; -$rcs =~ m/,v (\d+\.\d+)/ ; -my $VERSION = ($1) ? $1: "UNKNOWN" ; - - -my $total_usd_received = 0 ; -my $total_usd_invoice = 0 ; -my $total_HT_EUR_logi_exo = 0 ; -my $total_HT_EUR_logi_ass = 0 ; -my $total_TVA_EUR_logi = 0 ; - -my $total_HT_EUR_sup = 0 ; -my $total_TVA_EUR_sup = 0 ; -my $total_HT_EUR_sup_exo = 0 ; - -my $total_eur_received = 0 ; -my $total_eur_invoice = 0 ; -my $nb_invoice = 0 ; -my $nb_invoice_refund = 0 ; -my $nb_invoice_suspended = 0 ; -my $nb_invoice_canceled = 0 ; - -my ( $tests, $testeur ) ; -my $dry ; -my $debug ; -my $debug_csv ; -my $debug_dev ; -my $debug_invoice ; -my $debug_invoice_utf8 ; -my $debug_email; - -my $first_invoice = 1 ; -my $print_details = '' ; -my $bnc = '' ; -my $exportbnc = '' ; - -my $usdeur = 1.2981 ; -my $invoices ; -my %invoice_refund ; -my %invoice_canceled ; -my %invoice_suspended ; -my $write_invoices = 0 ; -my $avoid_numbers ; - -my $dir_invoices ; - -my $option_ret = GetOptions ( - 'tests' => \$tests, - 'dry' => \$dry, - 'debug' => \$debug, - 'debug_csv' => \$debug_csv, - 'debug_dev' => \$debug_dev, - 'debug_invoice' => \$debug_invoice, - 'debug_invoice_utf8' => \$debug_invoice_utf8, - 'debug_email' => \$debug_email, - - 'first_invoice=i' => \$first_invoice, - 'print_details|details' => \$print_details, - 'bnc' => \$bnc, - 'exportbnc=s' => \$exportbnc, - 'usdeur=f' => \$usdeur, - 'invoices=s' => \$invoices, - 'write_invoices!' => \$write_invoices, - 'dir_invoices=s' => \$dir_invoices, - 'avoid_numbers=s' => \$avoid_numbers, -); - -$dir_invoices ||= '/g/var/paypal_invoices' ; -if ( $write_invoices and not -d "$dir_invoices" ) { - $debug and print "mkdir $dir_invoices\n" ; - $dry or mkdir( $dir_invoices ) or die ; -} - - - -$debug and print "dir_invoices = $dir_invoices\n" ; - -$testeur = Test::More->builder ; -$testeur->no_ending(1) ; - -if ( $tests ) { - $testeur->no_ending( 0 ) ; - exit( tests( ) ) ; -} - - -my @files = @ARGV ; -my %action_invoice ; - -my %invoice_paypal ; - -my @invoices_wanted = split( /\s+/, $invoices ) if $invoices ; - -my @avoid_numbers = split( /\s+/, $avoid_numbers ) if $avoid_numbers ; -my %avoid_numbers ; -@avoid_numbers{ @avoid_numbers } = ( ) if @avoid_numbers ; - -#print "@invoices\n" ; - -my @actions ; - -foreach my $file ( @files ) { - - my @actions_file = parse_file( $file ) ; - push( @actions, @actions_file ) ; -} - -foreach my $action (@actions) { - # compute_line() adds $action->{ 'invoice' } if needed - compute_line( $action ) ; - - # index by invoice number - $action_invoice{ $action->{ 'invoice' } } = $action ; -} -delete $action_invoice{ 'NONE' } ; - - -my $last_invoice ; -my @invoice_paypal = sort { $a <=> $b } keys %invoice_paypal ; -$last_invoice = $invoice_paypal[-1] || 0 ; -my $first_invoice_paypal = $invoice_paypal[0] || 0 ; - -@invoices_wanted = ( $first_invoice .. $last_invoice ) if ( ! @invoices_wanted ) ; - -my @invoice_sent ; -my %invoice_sent ; -my @invoice_not_sent ; -my %invoice_not_sent ; - -foreach my $invoice ( @invoices_wanted ) { - - my $action = $action_invoice{ $invoice } ; - next if ! $action ; - my $email_address = $action->{ "De l'adresse email" } ; - - my $invoice_sent = invoice_sent( $dir_invoices, $invoice, $email_address ) ; - #print "$invoice $invoice_sent\n" ; - - if ( $invoice_sent ) { - $invoice_sent{ $invoice }++ ; - build_invoice( $invoice ) if ( $debug_invoice or $debug_invoice_utf8 ) ; - }elsif( not ( $invoice_canceled{ $invoice } or $invoice_refund{ $invoice } ) ) { - $invoice_not_sent{ $invoice }++ ; - build_invoice( $invoice ) ; - } -} - -@invoice_sent = sort { $a <=> $b } keys( %invoice_sent ) ; -my $nb_invoice_sent = scalar( @invoice_sent ) ; -@invoice_not_sent = sort { $a <=> $b } keys( %invoice_not_sent ) ; - -my @invoice_canceled = sort { $a <=> $b } keys( %invoice_canceled ) ; -my @invoice_suspended = sort { $a <=> $b } keys( %invoice_suspended ) ; -my @invoice_refund = sort { $a <=> $b } keys( %invoice_refund ) ; - - -print( "\n", "=" x 60, "\n" ) ; - -my $total_usd_paypal_cost ; -$total_usd_paypal_cost = sprintf('%2.2f', $total_usd_invoice - $total_usd_received ) ; -print "USD received $total_usd_received\n" ; -print "USD invoice $total_usd_invoice\n" ; -print "USD costs $total_usd_paypal_cost\n" ; - -my $total_eur_invoice_from_usd ; -my $total_eur_received_from_usd ; -my $total_eur_paypal_cost_from_usd ; - -# au 30 nov 2010 http://fr.finance.yahoo.com/devises/convertisseur/#from=EUR;to=USD;amt=1 -$total_eur_invoice_from_usd = sprintf('%2.2f', $total_usd_invoice / $usdeur ) ; -$total_eur_received_from_usd = sprintf('%2.2f', $total_usd_received / $usdeur ) ; -$total_eur_paypal_cost_from_usd = sprintf('%2.2f', $total_usd_paypal_cost / $usdeur ) ; - -# EUR -$total_eur_received = sprintf('%2.2f', $total_eur_received) ; -$total_eur_invoice = sprintf('%2.2f', $total_eur_invoice) ; -print "EUR invoice from USD $total_eur_invoice_from_usd\n" ; -print "EUR received from EUR $total_eur_received\n" ; -print "EUR invoice from EUR $total_eur_invoice\n" ; - -my $total_eur_invoice_from_eur_usd = $total_eur_invoice_from_usd + $total_eur_invoice ; -my $total_eur_received_from_eur_usd = $total_eur_received_from_usd + $total_eur_received ; -my $total_eur_paypal_cost = $total_eur_invoice - $total_eur_received + $total_eur_paypal_cost_from_usd ; - - -$total_HT_EUR_logi_exo = sprintf('%2.2f', $total_HT_EUR_logi_exo) ; -$total_HT_EUR_logi_ass = sprintf('%2.2f', $total_HT_EUR_logi_ass) ; -$total_TVA_EUR_logi = sprintf('%2.2f', $total_TVA_EUR_logi) ; - -$total_HT_EUR_sup = sprintf('%2.2f', $total_HT_EUR_sup) ; -$total_TVA_EUR_sup = sprintf('%2.2f', $total_TVA_EUR_sup) ; -$total_HT_EUR_sup_exo = sprintf('%2.2f', $total_HT_EUR_sup_exo) ; - -$total_eur_invoice_from_eur_usd = sprintf('%2.2f', $total_eur_invoice_from_eur_usd) ; -$total_eur_paypal_cost = sprintf('%2.2f', $total_eur_paypal_cost) ; - -print( "---- USD + EUR ----\n" ) ; -print "EUR total invoice $total_eur_invoice_from_eur_usd\n" ; -print "EUR total received $total_eur_received_from_eur_usd\n" ; -print "EUR total paypal cost $total_eur_paypal_cost\n" ; -print ; -print( "---- Assujeti TVA ----\n" ) ; -print "EUR total HT licen assuj $total_HT_EUR_logi_ass (autres operations imposables)\n" ; -#print "EUR total TVA licen assuj $total_TVA_EUR_logi\n" ; -print "EUR total HT supp assuj $total_HT_EUR_sup (ventes, prestations)\n" ; -#print "EUR total TVA supp assuj $total_TVA_EUR_sup\n" ; - -print( "---- Exonere TVA ----\n" ) ; -print "EUR total HT licen exo $total_HT_EUR_logi_exo (autres operations NON imposables)\n" ; -print "EUR total HT suppo exo $total_HT_EUR_sup_exo (autres operations NON imposables)\n" ; - -print( "---- Invoices ----\n" ) ; - -print "Nb invoice $nb_invoice ( from $first_invoice_paypal to $last_invoice )\n" ; -print "Nb invoice canceled ($nb_invoice_canceled) @invoice_canceled\n" ; -print "Nb invoice suspended ($nb_invoice_suspended) @invoice_suspended\n" ; -print "Nb invoice refund ($nb_invoice_refund) @invoice_refund\n" ; -print "Nb invoice sent $nb_invoice_sent\n" ; -print "Have to send invoices @invoice_not_sent\n" if ( @invoice_not_sent ) ; - -my $total_eur2 = $total_HT_EUR_logi_exo + $total_HT_EUR_logi_ass + $total_TVA_EUR_logi + $total_HT_EUR_sup + $total_TVA_EUR_sup + $total_HT_EUR_sup_exo ; -$total_eur2 = sprintf('%2.2f', $total_eur2) ; -print "$total_eur_invoice_from_eur_usd != $total_eur2 = $total_HT_EUR_logi_exo + $total_HT_EUR_logi_ass + $total_TVA_EUR_logi + $total_HT_EUR_sup + $total_TVA_EUR_sup + $total_HT_EUR_sup_exo\n" -if ( $total_eur_invoice_from_eur_usd != $total_eur2 ) ; - -sub parse_one_line_io { - my $csv = shift ; - my $io = shift ; - - my $line = $csv->getline($io) ; - - return if ( $csv->eof( ) ) ; - if ( not defined( $line ) ) { - my($cde, $str, $pos) = $csv->error_diag () ; - print "[$cde] [$str] [$pos]\n" ; - - } - return( $line ) ; -} - -sub hash_and_count_dupplicate { - my @columns = @_ ; - my %columns ; - - #@columns_def{ @columns_def } = ( ) ; - foreach my $col ( @columns ) { - $columns{ $col } += 1 ; - } - $debug_csv and print "Nb columns: ", scalar( keys %columns ), " ", scalar( @columns ), "\n" ; - # debug how many time a title is defined - foreach my $col (1 .. scalar( @columns )) { - $debug_csv and print "$col | ", - deci_to_AA( $col ) , " | ", - $columns{ $columns[ $col - 1 ] }, " | ", - $columns[ $col - 1 ], "\n" ; - } - - # exit in case two columns have the same name - die "Erreur : doublons dans les titres\n" if ( scalar( keys %columns ) != scalar( @columns ) ) ; - - return( %columns ) ; -} - -sub deci_to_AA { - my $deci = shift ; - my $AA = ''; - - while ( $deci > 0 ) { - my $quot = int( ( $deci - 1 ) / 26 ) ; - my $rest = $deci - 1 - ( 26 * $quot ) ; - my $char = chr ( ord('A') + $rest ) ; - $AA = $char . $AA ; - $deci = $quot ; - } - #print "col=$AA\n" ; - return( $AA ) ; -} - -sub remove_first_blank { - my $string = shift ; - - $string =~ s/^ +// ; - return( $string ) ; - -} - -sub parse_file { - my $file = shift ; - - open my $io, "<", $file or die "$file: $!" ; - - my $csv = Text::CSV_XS->new( { - sep_char => ',', - binary => 1, - keep_meta_info => 1, - eol => $/, - } ) ; - - my $line_1 = parse_one_line_io( $csv, $io ) ; - die if ( not defined $line_1 ) ; # first line must have no problem - - my @columns_def_orig = @$line_1 ; - my @columns_def = map { remove_first_blank( $_ ) } @columns_def_orig ; - $debug_csv and print "columns_def = ", map( { "[$_]" } @columns_def ), "\n"; - - my %columns_def = hash_and_count_dupplicate( @columns_def ) ; - my $nb_columns_def = scalar @columns_def ; - - my $line_counter = 2 ; - my @actions ; - while ( 1 ) { - $debug_csv and print "ligne $line_counter ", $csv->eof( ), "\n" ; - my $line = parse_one_line_io( $csv, $io ) ; - last if ( $csv->eof( ) ) ; - if ( not defined $line ) { - print "Erreur ligne $line_counter : ", $csv->error_diag, "\n\n"; - ++$line_counter ; - next ; - } - my @columns = @$line ; - - if ( $nb_columns_def != scalar @columns ) { - print "Erreur ligne $line_counter : nombre de colonnes = ", scalar @columns, " != $nb_columns_def\n" ; - ++$line_counter ; - next ; - } - my %columns ; - @columns{ @columns_def } = @columns ; - $columns{ 'file_csv' } = $file ; - $columns{ 'line_number' } = $line_counter ; - $csv->combine( @columns ) ; - my $line_csv = $csv->string(); - $columns{ 'line_csv' } = $line_csv ; - $debug_csv and print map( { "[$_] = [" . $columns{$_} . "]\n" } - @columns_def, 'line_number', 'line_csv', 'file_csv' ), - "\n"; - ++$line_counter ; - push( @actions, \%columns ) ; - } - close( $io ); - return( reverse @actions ) ; -} - -sub next_invoice { - my @current_numbers = sort { $a <=> $b } ( $first_invoice - 1, keys( %invoice_paypal ) ) ; - my $last_invoice = $current_numbers[ -1 ] || 0 ; - - #keys( %avoid_numbers ), - my $next_invoice = $last_invoice + 1 ; - while ( exists( $avoid_numbers{ $next_invoice } ) ) { $next_invoice++ ; } - $invoice_paypal{ $next_invoice } = 1 ; - #print "AAA [@current_numbers] [$last_invoice] [$next_invoice]\n" ; - - return( $next_invoice ) ; -} - -sub keyval { - my %hash = @_ ; - return( join( " ", map( { "$_ => " . $hash{ $_ } } keys %hash ) ) . "\n" ) ; -} - - -sub invoice_00000 { - my $invoice = shift ; - - return( sprintf( "%04d", $invoice ) ) ; -} - -sub tests_invoice_00000 { - - ok( '0000' eq invoice_00000( 0 ), 'invoice_00000: 0 -> 0000' ) ; - ok( '0147' eq invoice_00000( 147 ), 'invoice_00000: 147 -> 0147' ) ; - ok( '99999' eq invoice_00000( 99999 ), 'invoice_00000: 99999 -> 99999' ) ; -} - -sub tests_next_invoice { - ok( 1 == next_invoice( ), 'next_invoice: 1' ) ; - ok( 2 == next_invoice( ), 'next_invoice: 2' ) ; - @avoid_numbers{ (3, 4, 6, 8 ) } = ( ) ; - ok( 5 == next_invoice( ), 'next_invoice: 7' ) ; - ok( 7 == next_invoice( ), 'next_invoice: 8' ) ; - ok( 9 == next_invoice( ), 'next_invoice: 9' ) ; - %invoice_paypal = () ; - $first_invoice = 7 ; - ok( 7 == next_invoice( ), 'next_invoice: 7' ) ; -} - - -sub tests_exportbnc { - ok( 1 == 1, '1 == 1' ) ; - -} - - - -sub tests { - tests_next_invoice( ) ; - tests_cut( ) ; - tests_invoice_00000( ) ; - #tests_exportbnc( ) ; - tests_tva_rate( ) ; - tests_tva_rate_str( ) ; - tests_software_price( ) ; -} - -sub compute_line_debug { - - my $A = shift ; - - return( "#" x 78, "\n", - "[$A->{Date}] [$A->{Heure}] [$A->{Fuseau_horaire}] [$A->{Nom}] [$A->{Type}] [$A->{Etat}] ", - "[$A->{Devise}] [$A->{Hors_taxe_paypal}] [$A->{Montant}] [$A->{N_de_transaction}] [$A->{Solde}] [$A->{Impact_sur_le_solde}] ", - "[$A->{Pays}] [$A->{Nom_Option_1}] [$A->{Valeur_Option_1}] [$A->{Titre_de_l_objet}]\n" ) ; - -} - -sub bnc_first_line { - my $A = shift ; - $A->{MontantEUR} = $A->{Montant} ; - $A->{MontantEUR} = sprintf( "%.4f", $A->{Montant}/$usdeur ) if ($A->{Devise} eq 'USD') ; - return( "\n", "=" x 60, "\n", - "[$A->{Date}] [$A->{Nom}] [$A->{Type}] [$A->{Etat}] [$A->{Devise}] ", - "[$A->{Hors_taxe_paypal}] [$A->{Montant}] [EUR $A->{MontantEUR}] [$A->{Impact_sur_le_solde}]\n", - "[$A->{Pays}] [$A->{Nom_Option_1}] [$A->{Valeur_Option_1}] [$A->{Titre_de_l_objet}]\n" ) ; -} - -sub details { - - my $A = shift ; - - return( "[$A->{invoice}] [$A->{Date}] [$A->{Heure}] [$A->{Fuseau_horaire}] ", - "[$A->{Nom}] [$A->{Type}] [$A->{Etat}] [$A->{Devise}] [$A->{Montant}] ", - "[$A->{N_de_transaction}] [$A->{Solde}] [$A->{Impact_sur_le_solde}]\n" ) ; - -} - -sub paiement_usd_termine{ - - my $A = shift ; - - if ( - 'Paiement sur site marchand re�u' eq $A->{Type} - and 'USD' eq $A->{Devise} - and ( 'Termin�' eq $A->{Etat} or 'Compens�' eq $A->{Etat} ) - ) { - $A->{Montant} =~tr/,/./; - $A->{Montant2} = $A->{Hors_taxe_paypal} ; - $total_usd_received += $A->{Montant} ; - $total_usd_invoice += $A->{Montant2} ; - tva_line( $A ) ; - $total_HT_EUR_logi_exo += $A->{montant_HT_EUR_logi_exo} ; - $total_HT_EUR_logi_ass += $A->{montant_HT_EUR_logi_ass} ; - $total_TVA_EUR_logi += $A->{montant_TVA_EUR_logi} ; - - $A->{invoice} = next_invoice( ) ; - $nb_invoice++ ; - $print_details and print( details( $A ) ) ; - } -} - -sub paiement_eur_termine { - - my $A = shift ; - - if ( - 'Paiement sur site marchand re�u' eq $A->{Type} - and 'EUR' eq $A->{Devise} - and ( 'Termin�' eq $A->{Etat} or 'Compens�' eq $A->{Etat} ) - ) { - $A->{Montant} =~tr/,/./; - $A->{Montant2} = $A->{Hors_taxe_paypal} ; - $total_eur_received += $A->{Montant} ; - $total_eur_invoice += $A->{Montant2} ; - tva_line( $A ) ; - $total_HT_EUR_logi_exo += $A->{montant_HT_EUR_logi_exo} ; - $total_HT_EUR_logi_ass += $A->{montant_HT_EUR_logi_ass} ; - $total_TVA_EUR_logi += $A->{montant_TVA_EUR_logi} ; - $total_HT_EUR_sup += $A->{montant_HT_EUR_sup} ; - $total_TVA_EUR_sup += $A->{montant_TVA_EUR_sup} ; - $total_HT_EUR_sup_exo += $A->{montant_HT_EUR_sup_exo} ; - - $A->{invoice} = next_invoice( ) ; - $nb_invoice++ ; - $print_details and print( details( $A ) ) ; - } -} - -sub paiement_eur_rembourse { - - my $A = shift ; - - if ( - 'Paiement sur site marchand re�u' eq $A->{Type} - and 'EUR' eq $A->{Devise} - and 'Rembours�' eq $A->{Etat} - ) { - $A->{invoice} = next_invoice( ) ; - $nb_invoice++ ; - $nb_invoice_refund++; - $invoice_refund{ $A->{invoice} }++ ; - - $print_details and print( details( $A ) ) ; - } -} - -sub paiement_eur_annule { - - my $A = shift ; - - if ( - 'Paiement sur site marchand re�u' eq $A->{Type} - and 'EUR' eq $A->{Devise} - and 'Annul�' eq $A->{Etat} - ) { - $A->{invoice} = next_invoice( ) ; - $nb_invoice++ ; - $nb_invoice_canceled++; - $invoice_canceled{ $A->{invoice} }++ ; - - $print_details and print( details( $A ) ) ; - } -} - -sub paiement_eur_suspendu { - - my $A = shift ; - - if ( - 'Paiement sur site marchand re�u' eq $A->{Type} - and 'EUR' eq $A->{Devise} - and 'Suspendu' eq $A->{Etat} - ) { - $A->{invoice} = next_invoice( ) ; - $nb_invoice++ ; - $nb_invoice_suspended++; - $invoice_suspended{ $A->{invoice} }++ ; - - $print_details and print( details( $A ) ) ; - } -} - -sub paiement_eur_non_compense { - - my $A = shift ; - - if ( - 'Paiement sur site marchand re�u' eq $A->{Type} - and 'EUR' eq $A->{Devise} - and 'Non compens�' eq $A->{Etat} - ) { - $A->{invoice} = next_invoice( ) ; - $nb_invoice++ ; - $print_details and print( details( $A ) ) ; - } -} - - - -sub compute_line { - - my $action = shift ; - my %action = %$action ; - my $A ; - - @{$A}{ qw( - Date Heure Fuseau_horaire Nom Type Etat - Devise Montant N_de_transaction Solde - Pays Nom_Option_1 Valeur_Option_1 Hors_taxe_paypal - Titre_de_l_objet Nom_Option_2 Option_2_Valeur - Impact_sur_le_solde - ) } - = @action{ ( 'Date', 'Heure', 'Fuseau horaire', 'Nom', 'Type', 'Etat', - 'Devise', 'Montant', "N� de transaction", 'Solde', - 'Pays', 'Nom Option 1', 'Valeur Option 1', 'Hors taxe', - "Titre de l'objet", 'Nom Option 2', 'Option 2 Valeur', - 'Impact sur le solde') } ; - - ( $A->{Etat} ) = @action{ ( 'Etat' ) } || @action{ ( '�tat' ) } ; - ( $A->{Hors_taxe_paypal} ) = @action{ ( 'Hors taxe' ) } || @action{ ( 'Avant commission' ) } ; - $A->{Impact_sur_le_solde} ||= '' ; - $A->{invoice} = 'NONE' ; - $A->{Montant} = $action->{ 'Net' } if not defined $A->{Montant}; - - $debug and print( compute_line_debug( $A ) ) ; - - $A->{Montant} =~ s/[^0-9-,.]//g ; - $A->{Montant} =~ s/,/./g ; - $A->{Hors_taxe_paypal} =~ s/,/./g ; - - $bnc and print( bnc_first_line( $A ) ) ; - paiement_usd_termine( $A ) ; - paiement_eur_termine( $A ) ; - paiement_eur_rembourse( $A ) ; - paiement_eur_annule( $A ) ; - paiement_eur_suspendu( $A ) ; - paiement_eur_non_compense( $A ) ; - $bnc and print( BNC_output( $A->{invoice}, FR_flag( $A->{Pays} ), - IND_flag( $A->{Nom_Option_1}, $A->{Valeur_Option_1} ), - SUPPORT_flag( $A->{Titre_de_l_objet} ), - $A->{Nom}, $A->{Date}, $A->{MontantEUR}, $A->{Devise}, - $A->{Titre_de_l_objet}, $A->{Impact_sur_le_solde}, $A->{Type} ) ) ; - - $action->{ 'invoice' } = $A->{invoice} ; -} - -sub BNC_output { -# FE 1359 FR IND imapsync Bougon Edouard -# [12/01/2012] FR IND 28.73 EUR - my( $invoice, $FR_flag, $IND_flag, $SUPPORT_flag, - $Nom, $Date, $MontantEUR, $Devise, $Titre_de_l_objet, $Impact_sur_le_solde, $Type ) = @_ ; - - my $BNC_output ; - - if ( 'NONE' eq $invoice ) { - $BNC_output = "[$Date] $MontantEUR $Devise $Nom $Titre_de_l_objet [$Impact_sur_le_solde] [$Type]\n" ; - }else{ - $BNC_output = - "FE $invoice$FR_flag$IND_flag imapsync$SUPPORT_flag $Nom\n" - . "[$Date]$FR_flag$IND_flag $MontantEUR $Devise \n" ; - } - return( $BNC_output ) ; -} - -sub SUPPORT_flag { - my $Titre_de_l_objet = shift ; - my $SUPPORT_flag = '' ; - $SUPPORT_flag = ' support' if ( 'imapsync support' eq $Titre_de_l_objet ) ; -} - -sub IND_flag { - my( $Nom_Option_1, $Valeur_Option_1 ) = @_ ; - my $IND_flag = '' ; - $IND_flag = ' IND' if ('imapsync usage' eq $Nom_Option_1 and 'individual' eq $Valeur_Option_1 ) ; - return( $IND_flag ) ; -} - -sub FR_flag { - my $Pays = shift ; - my $FR_flag = '' ; - - $FR_flag = ' FR' if $Pays eq 'France' ; - return( $FR_flag ) ; -} - -sub escape_for_tex { - - my $F = shift ; - foreach my $str ( - $F->{De_l_adresse_email}, - $F->{Nom}, - $F->{clientAdrA}, - $F->{clientAdrB}, - $F->{clientAdrC}, - $F->{clientAdrD}, - $F->{clientAdrE}, - $F->{clientAdrF}, - ) { - $str =~ s{#}{\\#}g ; - $str =~ s{_}{\\_}g ; - $str =~ s{&}{\\&}g ; - } -} - -sub build_invoice { - my $invoice = shift ; - - return if ! $invoice ; - - my $F ; - $F->{invoice} = $invoice ; - - my $action = $action_invoice{ $F->{invoice} } ; - #print Data::Dumper->Dump( [$action] ) ; - - @{$F}{ qw( Date Heure Nom Type Etat Devise Hors_taxe Commission Net - De_l_adresse_email A_l_adresse_email N_de_transaction Titre_de_l_objet - TVA Nom_Option_1 Valeur_Option_1 N_de_transaction_de_reference - Adresse_1 Adresse_2_district_quartier Ville - Etat_Province Code_postal Pays line_number line_csv file_csv - Nom_Option_2 Option_2_Valeur ) } - = @{$action}{ ( 'Date', 'Heure', 'Nom', 'Type', 'Etat', 'Devise', 'Hors taxe', 'Commission', 'Net', - "De l'adresse email", "A l'adresse email", 'N� de transaction', "Titre de l'objet", - 'TVA', 'Nom Option 1', 'Valeur Option 1', 'N� de transaction de r�f�rence', - 'Adresse 1', 'Adresse 2/district/quartier', 'Ville', - 'Etat/Province/R�gion/Comt�/Territoire/Pr�fecture/R�publique', 'Code postal', 'Pays', 'line_number', 'line_csv', 'file_csv', - 'Nom Option 2', 'Option 2 Valeur' ) } ; - - $F->{Etat_Province} = $action->{'Etat/Province/R�gion/Comt�/Territoire/Pr�fecture/R�publique'} - || $action->{'�tat/Province/R�gion/Comt�/Territoire/Pr�fecture/R�publique'} - || '' ; - $F->{Hors_taxe} = $action->{'Hors taxe'} || $action->{'Avant commission'} ; - $F->{Hors_taxe_num} = $F->{Hors_taxe} ; - $F->{Hors_taxe_num} =~ s{,}{.} ; - if ($F->{Hors_taxe_num} > 100) { - print "invoice $F->{invoice} $F->{Hors_taxe_num} > 100\n" ; - #return() ; - } - - build_email_message( $F ) ; - $debug_email and print( "\n", $F->{email_message_header}, $F->{email_message_body} ) ; - - if ( $write_invoices and ! invoice_sent( $dir_invoices, $F->{invoice}, $F->{De_l_adresse_email} ) ) { - write_email_message( $dir_invoices, $F->{invoice}, - $F->{email_message_header}, $F->{email_message_body}, - $F->{De_l_adresse_email} ) ; - write_csv_info( $dir_invoices, $F->{invoice}, $F->{file_csv}, $F->{line_number}, $F->{line_csv} ) ; - } - - - build_address( $F ) ; - escape_for_tex( $F ) ; - client_type( $F ) ; - object_type( $F ) ; - description_stuff( $F ) ; - tva_stuff( $F ) ; - $F->{quantity} = '1' ; - - download_urls( $F ) ; - ( $F->{Nom1} ) = cut( $F->{Nom}, 42 ) ; - $F->{clientVAT} = '' ; - - if ( ( 'VAT if professional in Europe' eq $F->{Nom_Option_2} ) and $F->{Option_2_Valeur} ) { - $F->{clientVAT} = $F->{Option_2_Valeur} ; - } - - my $tex_variables = qq{ -%% Begin input from paypal_bilan $VERSION -\\providecommand{\\invoiceNumber}{$F->{invoice}} -\\providecommand{\\clientName}{$F->{Nom1}} -\\providecommand{\\clientEmail}{$F->{De_l_adresse_email}} -\\providecommand{\\clientAdrA}{$F->{clientAdrA}} -\\providecommand{\\clientAdrB}{$F->{clientAdrB}} -\\providecommand{\\clientAdrC}{$F->{clientAdrC}} -\\providecommand{\\clientAdrD}{$F->{clientAdrD}} -\\providecommand{\\clientAdrE}{$F->{clientAdrE}} -\\providecommand{\\clientAdrF}{$F->{clientAdrF}} -\\providecommand{\\clientVAT}{$F->{clientVAT}} -\\providecommand{\\invoiceDate}{$F->{Date}} -\\providecommand{\\invoiceHour}{$F->{Heure}} - -\\providecommand{\\descriptionFR}{$F->{descriptionFR}} -\\providecommand{\\descriptionEN}{$F->{descriptionEN}} -\\providecommand{\\descriptionBFR}{$F->{descriptionBFR}} -\\providecommand{\\descriptionBEN}{$F->{descriptionBEN}} -\\providecommand{\\usageFR}{$F->{usageFR}} -\\providecommand{\\usageEN}{$F->{usageEN}} -\\providecommand{\\quantity}{$F->{quantity}} -\\providecommand{\\quantityB}{$F->{quantityB}} - -\\providecommand{\\priceHT}{$F->{priceHT}} -\\providecommand{\\priceBHT}{$F->{priceBHT}} -\\providecommand{\\priceZHT}{$F->{priceZHT}} -\\providecommand{\\tvaFR}{$F->{tvaFR}} -\\providecommand{\\priceZTVA}{$F->{priceZTVA}} -\\providecommand{\\HTorTTC}{$F->{HTorTTC}} -\\providecommand{\\priceZTTC}{$F->{priceZTTC}} -\\providecommand{\\messageTVAFR}{$F->{messageTVAFR}} -\\providecommand{\\messageTVAEN}{$F->{messageTVAEN}} -\\providecommand{\\urlSrc}{\\url{$F->{urlSrc}}} -%% End input from paypal_bilan -} ; - - my $tex_variables_utf8 = to_utf8( { -string => $tex_variables, -charset => 'ISO-8859-1' } ) ; - - $debug_invoice_utf8 and print $tex_variables_utf8 ; - $debug_invoice and print $tex_variables ; - - #print "$F->{invoice} ", invoice_sent( $dir_invoices, $F->{invoice}, $F->{De_l_adresse_email} ), "\n" ; - if ( $write_invoices and ! invoice_sent( $dir_invoices, $F->{invoice}, $F->{De_l_adresse_email} ) ) { - write_tex_variables_file( $dir_invoices, $F->{invoice}, $F->{Date}, $tex_variables_utf8 ) ; - } - -} - -sub description_stuff { - my $F = shift ; - - $F->{descriptionFR} = $F->{descriptionEN} = '' ; - $F->{descriptionBFR} = $F->{descriptionBEN} = '' ; - $F->{quantityB} = '' ; - $F->{usageFR} = $F->{usageEN} = '' ; - - - if ( 'software' eq $F->{object_type} ) { - $F->{descriptionFR} = 'Logiciel imapsync. TOUS droits c�d�s, autoris�s.' ; - $F->{descriptionEN} = '(Imapsync software. ALL rights conceded, allowed.)' ; - } - - if ( 'professional' eq $F->{clientTypeEN} - and 'software' eq $F->{object_type} ) { - $F->{usageFR} = 'Usage � titre professionnel.' ; - $F->{usageEN} = '(professional usage.)' ; - } - - if ( 'individual' eq $F->{clientTypeEN} - and 'software' eq $F->{object_type} ) { - $F->{usageFR} = 'Usage � titre individuel.' ; - $F->{usageEN} = '(individual usage.)' ; - } - - if ( 'support' eq $F->{object_type} ) { - $F->{usageFR} = '' ; - $F->{usageEN} = '' ; - $F->{descriptionFR} = 'Support sur le logiciel imapsync.' ; - $F->{descriptionEN} = '(Imapsync support.)' ; - } - - if ( 'professional' eq $F->{clientTypeEN} - and 'software + support' eq $F->{object_type} ) { - $F->{usageFR} = 'Usage � titre professionnel.' ; - $F->{usageEN} = '(professional usage.)' ; - $F->{descriptionFR} = 'Logiciel imapsync. TOUS droits c�d�s, autoris�s.' ; - $F->{descriptionEN} = '(Imapsync software. ALL rights conceded, allowed.)' ; - $F->{descriptionBFR} = 'Support sur le logiciel imapsync.' ; - $F->{descriptionBEN} = '(Imapsync support.)' ; - $F->{quantityB} = '1' ; - } -} - - - -sub object_type { - my $F = shift ; - - $F->{object_type} = '' ; - - if ( 'imapsync' eq $F->{Titre_de_l_objet} - or 'imapsync.exe' eq $F->{Titre_de_l_objet} - or 'imapsync source' eq $F->{Titre_de_l_objet} - or 'imapsync source code' eq $F->{Titre_de_l_objet} - ) { - $F->{object_type} = 'software' ; - }elsif ( 'imapsync support' eq $F->{Titre_de_l_objet} ) { - $F->{object_type} = 'support' ; - }elsif ( ( 'imapsync all' eq $F->{Titre_de_l_objet} ) - and ( 'software only' eq $F->{Valeur_Option_1} ) ) { - $F->{object_type} = 'software' ; - }elsif ( ( 'imapsync all' eq $F->{Titre_de_l_objet} ) - and ( 'software + support' eq $F->{Valeur_Option_1} ) ) { - $F->{object_type} = 'software + support' ; - }elsif ( ( 'imapsync any' eq $F->{Titre_de_l_objet} ) - and ( 'Software only. For professional use.' eq $F->{Valeur_Option_1} ) ) { - $F->{object_type} = 'software' ; - }elsif ( ( 'imapsync any' eq $F->{Titre_de_l_objet} ) - and ( 'Software + Support. For professional use.' eq $F->{Valeur_Option_1} ) ) { - $F->{object_type} = 'software + support' ; - }elsif ( ( 'imapsync any' eq $F->{Titre_de_l_objet} ) - and ( 'Software only. For individual use.' eq $F->{Valeur_Option_1} ) ) { - $F->{object_type} = 'software' ; - } -} - -sub build_email_message { - - my $F = shift ; - - object_type( $F ) ; - my $invoice = $F->{invoice} ; - - my $message_header = qq{X-imapsync: invoice $invoice for imapsync $F->{object_type} -From: Gilles LAMIRAL -Bcc: gilles\@lamiral.info -Subject: [imapsync invoice] $invoice ($F->{Hors_taxe_num} EUR on $F->{Date}) for imapsync $F->{object_type}. -Disposition-Notification-To: Gilles LAMIRAL -} ; - - - my $message_body = qq{ -Hello $F->{Nom}, - -First of all, I'm sorry for the delay in getting back to you. - -Last imapsync release is available from the page -http://imapsync.lamiral.info/paypal_return.shtml - -You'll find in the attachment the invoice of imapsync -$F->{object_type} you bought and paid (dd/mm/yyyy $F->{Date}). -The invoice file is named facture_imapsync-${invoice}.pdf -This invoice is in PDF format, ready to be print. - -Should you need a hardcopy of this invoice, -I'll send it to you upon request by regular mail. - -As the law requires, this numeric invoice PDF file -is signed with my private gpg key. - -The resulting gpg signature is in the file named -facture_imapsync-${invoice}.pdf.asc -you will also find in the attachment. - -You can check I (Gilles LAMIRAL) really did generate -this invoice with the following command line: - - gpg --verify facture_imapsync-${invoice}.pdf.asc facture_imapsync-${invoice}.pdf - -or any other gpg graphical tool. - -Once more, thank you for buying and using imapsync $F->{object_type}. - -Any feedback is welcome. - --- -Best Regards, 09 51 84 42 42 -Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06 -} ; - - - my $message_body_blabla = qq{ -Here is the fingerprint of my public key -pub 1024D/FDA2B3DC 2002-05-08 - Key fingerprint = 7906 F53D 0D62 0C67 304A 4CF0 6928 869B FDA2 B3DC -uid Gilles LAMIRAL -sub 1024g/A2C4CB42 2002-05-08 - -Of course the verification doesn't prove anything until -all the following conditions are met: -- you met me, -- I agree that the fingerprint above is really mine -- I prove I'm Gilles LAMIRAL with an official paper. - -Normally we won't have to verify anything unless -I disagree with this invoice and the payment -you made for imapsync. -} ; - - $F->{email_message_header} = $message_header ; - $F->{email_message_body} = $message_body ; - return( ) ; - -} - -sub write_csv_info { - - my( $dir_invoices, $invoice, $file_csv, $line_number, $line_csv ) = @_ ; - - my $invoice_00000 = invoice_00000( $invoice ) ; - $debug and print "Writing $dir_invoices/$invoice_00000/csv_info.txt\n" ; - $dry and return( ) ; - - open( CSVINFO, "> $dir_invoices/$invoice_00000/csv_info.txt") or die ; - print CSVINFO join( "\n", $file_csv, $line_number, $line_csv ) ; - close( CSVINFO ) ; - -} - -sub invoice_sent { - - my ( $dir_invoices, $invoice, $email_address ) = @_ ; - my $invoice_00000 = invoice_00000( $invoice ) ; - return( 1 ) if ( -f "$dir_invoices/$invoice_00000/SENT_TO_$email_address" ) ; - return( 0 ) ; - -} - -sub write_email_message { - my ( $dir_invoices, $invoice, $message_header, $message_body, $email_address ) = @_ ; - - my $message_body_utf8 = to_utf8({ -string => $message_body, -charset => 'ISO-8859-1' }); - - my $invoice_00000 = invoice_00000( $invoice ) ; - - if ( ! -d "$dir_invoices/$invoice_00000" ) { - $debug and print "mkdir $dir_invoices/$invoice_00000\n" ; - $dry or mkdir( "$dir_invoices/$invoice_00000" ) or die ; - } - - $dry and return( ) ; - - open( HEADER, "> $dir_invoices/$invoice_00000/facture_message_header.txt") or die ; - print HEADER $message_header ; - close( HEADER ) ; - - open( BODY, "> $dir_invoices/$invoice_00000/facture_message_body.txt") or die ; - print BODY $message_body_utf8 ; - close( BODY ) ; - - open( ADDRESS, "> $dir_invoices/$invoice_00000/email_address.txt") or die ; - print ADDRESS "$email_address\n" ; - close( ADDRESS ) ; -} - - -sub write_tex_variables_file { - my ( $dir_invoices, $invoice, $Date, $tex_variables_utf8 ) = @_ ; - - my $invoice_00000 = invoice_00000( $invoice ) ; - - if ( ! -d "$dir_invoices/$invoice_00000" ) { - $debug and print "mkdir $dir_invoices/$invoice_00000\n" ; - $dry or mkdir( "$dir_invoices/$invoice_00000" ) or die ; - } - - $debug and print "Writing imapsync_var.tex $dir_invoices/$invoice_00000/imapsync_var.tex\n" ; - $dry and return( ) ; - - open( FILE, "> $dir_invoices/$invoice_00000/imapsync_var.tex") or die ; - print FILE $tex_variables_utf8 ; - close( FILE ) ; - - if ( ! -f "$dir_invoices/$invoice_00000/imapsync_var_manual.tex" ) { - open( FILE, "> $dir_invoices/$invoice_00000/imapsync_var_manual.tex") or die ; - print FILE "%% $0 created this file -%% Can be used to override imapsync_var.tex definitions\n" ; - print FILE $tex_variables_utf8 ; - close( FILE ) ; - } - -} - -sub download_urls { - my $F = shift ; - - $F->{date_aaaa_mm_jj} = date_aaaa_mm_jj( $F->{Date} ) ; - - if ( '2014_04_13' le $F->{date_aaaa_mm_jj} - and ( - ( 'software' eq $F->{object_type} ) - or - ( 'software + support' eq $F->{object_type} ) - ) - ) { - $F->{urlSrc} = 'http://imapsync.lamiral.info/paypal_return.shtml' ; - $F->{urlExe} = '' ; - return( ) ; - } - - if ('2011_05_01' le $F->{date_aaaa_mm_jj} - and 'software' eq $F->{object_type} ) { - $F->{urlSrc} = 'http://ks.lamiral.info/imapsync/paypal_return.shtml' ; - $F->{urlExe} = '' ; - return( ) ; - } - - if ('2011_05_01' le $F->{date_aaaa_mm_jj} - and 'support' eq $F->{object_type} ) { - $F->{urlSrc} = 'http://ks.lamiral.info/imapsync/paypal_return_support.shtml' ; - $F->{urlExe} = '' ; - return( ) ; - } - - if ('2011_03_24' le $F->{date_aaaa_mm_jj}) { - $F->{urlSrc} = 'http://www.linux-france.org/prj/imapsync/paypal_return.shtml' ; - $F->{urlExe} = '' ; - return( ) ; - } - if ('2011_02_21' le $F->{date_aaaa_mm_jj}) { - $F->{urlSrc} = 'http://www.linux-france.org/depot/2011_02_21/OUMbo7/' ; - $F->{urlExe} = 'http://www.linux-france.org/depot/2011_02_21/rHSVNs/' ; - return( ) ; - } - if ('2011_01_18' le $F->{date_aaaa_mm_jj}) { - $F->{urlSrc} = 'http://www.linux-france.org/depot/2011_01_18/zPRRNt/' ; - $F->{urlExe} = 'http://www.linux-france.org/depot/2011_01_18/FO1QzG/' ; - return( ) ; - } - if ('2011_01_18' le $F->{date_aaaa_mm_jj}) { - $F->{urlSrc} = 'http://www.linux-france.org/depot/2010_11_28/SiNdlZ/' ; - $F->{urlExe} = 'http://www.linux-france.org/depot/2010_11_28/R3ZAyr/' ; - return( ) ; - } - $F->{urlSrc} = 'http://www.linux-france.org/depot/2010_11_08/X2PWMe/' ; - $F->{urlExe} = 'http://www.linux-france.org/depot/2010_11_08/ZZ7zSc/' ; - return( ) ; -} - -sub date_aaaa_mm_jj { - my $date_jjSmmSaaaa = shift ; - - if ( $date_jjSmmSaaaa =~ m{(\d\d)/(\d\d)/(\d\d\d\d)} ) { - my( $jj, $mm, $aaaa ) = ( $1, $2, $3 ) ; - return( join( '_', $aaaa, $mm, $jj ) ) ; - }else{ - return( '9999_12_31' ) ; - } -} - - -sub tva_rate { - my $date_aaaa_mm_jj = shift ; - - if ( '2014_01_01' gt $date_aaaa_mm_jj ) { - #print "tva_rate 0.196\n" ; - #return( 0 ) ; - return( 0.196 ) ; - } - - if ( '2014_01_01' le $date_aaaa_mm_jj ) { - #print "tva_rate 0.2\n" ; - return( 0.2 ) ; - } - #print "tva_rate 0\n" ; - return( 0 ) ; -} - -sub tests_tva_rate { - ok( 0.196 == tva_rate( '2013_01_01' ), 'tva_rate: old 0.196' ) ; - ok( 0.196 == tva_rate( '2013_12_31' ), 'tva_rate: old 0.196' ) ; - ok( 0.2 == tva_rate( '2014_01_01' ), 'tva_rate: new 0.2' ) ; - ok( 0.2 == tva_rate( '2014_12_31' ), 'tva_rate: new 0.2' ) ; - ok( 0.2 == tva_rate( '2050_01_01' ), 'tva_rate: new 0.2' ) ; - ok( 0.2 == tva_rate( '2050_12_31' ), 'tva_rate: new 0.2' ) ; - return( 0 ) ; -} - - -sub tva_rate_str { - my $date_aaaa_mm_jj = shift ; - - if ( '2014_01_01' gt $date_aaaa_mm_jj ) { - #print "tva_rate 0.196\n" ; - return( '19,60\%' ) ; - } - - if ( '2014_01_01' le $date_aaaa_mm_jj ) { - return( '20\%' ) ; - } - #print "tva_rate 0\n" ; - return( '' ) ; -} - -sub tests_tva_rate_str { - ok( '19,60\%' eq tva_rate_str( '2013_01_01' ), 'tva_rate_str: old 0.196' ) ; - ok( '19,60\%' eq tva_rate_str( '2013_12_31' ), 'tva_rate_str: old 0.196' ) ; - ok( '20\%' eq tva_rate_str( '2014_01_01' ), 'tva_rate_str: new 0.2' ) ; - ok( '20\%' eq tva_rate_str( '2014_12_31' ), 'tva_rate_str: new 0.2' ) ; - ok( '20\%' eq tva_rate_str( '2050_01_01' ), 'tva_rate_str: new 0.2' ) ; - ok( '20\%' eq tva_rate_str( '2050_12_31' ), 'tva_rate_str: new 0.2' ) ; - return( 0 ) ; -} - - -sub software_price { - my $date_aaaa_mm_jj = shift ; - - if ( '2014_01_01' le $date_aaaa_mm_jj ) { - return( 50 ) ; - } - return( 0 ) ; -} - - -sub tests_software_price { - ok( 50 == software_price( '2014_01_01' ), 'software_price: 2014_01_01 => 50 ' ) ; - ok( 0 == software_price( '2000_01_01' ), 'software_price: 2000_01_01 => 0' ) ; - return( 0 ) ; -} - -sub tva_line_one_button_for_the_software { - - my $A = shift ; - - if ( 'imapsync' eq $A->{Titre_de_l_objet} - or 'imapsync.exe' eq $A->{Titre_de_l_objet} - or 'imapsync source' eq $A->{Titre_de_l_objet} - or 'imapsync source code' eq $A->{Titre_de_l_objet} - - ) { - if ( - ( 'individual' eq $A->{client_type} ) - or - ( 'France' eq $A->{Pays} ) - ) { - $A->{montant_HT_EUR_logi_ass} = $A->{Montant2} / ( 1 + tva_rate( $A->{date_aaaa_mm_jj} ) ) ; - $A->{montant_TVA_EUR_logi} = $A->{Montant2} / ( 1 + tva_rate( $A->{date_aaaa_mm_jj} ) ) * tva_rate( $A->{date_aaaa_mm_jj} ) ; - }else{ - $A->{montant_HT_EUR_logi_exo} = $A->{Montant2} ; - } - } - -} - -sub tva_line_one_button_for_the_support { - - my $A = shift ; - - if ( 'support' eq $A->{object_type} ) { - if ( - ( 'individual' eq $A->{client_type} ) - or - ( 'France' eq $A->{Pays} ) - or - ( '2013_02_19' gt $A->{date_aaaa_mm_jj} ) - ) - { - $A->{montant_HT_EUR_sup} = $A->{Montant2} / ( 1 + tva_rate( $A->{date_aaaa_mm_jj} ) ) ; - $A->{montant_TVA_EUR_sup} = $A->{Montant2} / ( 1 + tva_rate( $A->{date_aaaa_mm_jj} ) ) * tva_rate( $A->{date_aaaa_mm_jj} ) ; - }else{ - $A->{montant_HT_EUR_sup_exo} = $A->{Montant2} ; - } - } -} - -sub button_type { - my $A = shift ; - - if ( - 'imapsync all' eq $A->{Titre_de_l_objet} - or - 'imapsync any' eq $A->{Titre_de_l_objet} - ) { - $A->{button_type} = 'mixed' ; - }else{ - $A->{button_type} = 'single' ; - } -} - -sub tva_line_one_button_for_support_and_software { - - my $A = shift ; - - $A->{Montant2_logi} = software_price( $A->{date_aaaa_mm_jj} ) ; - $A->{Montant2_supp} = $A->{Montant2} - $A->{Montant2_logi} ; - - if ( 'mixed' eq $A->{button_type} ) { - if ( 'individual' eq $A->{client_type} - or - 'France' eq $A->{Pays} - ) - { - $A->{montant_HT_EUR_sup} = $A->{Montant2_supp} / ( 1 + tva_rate( $A->{date_aaaa_mm_jj} ) ) ; - $A->{montant_TVA_EUR_sup} = $A->{Montant2_supp} / ( 1 + tva_rate( $A->{date_aaaa_mm_jj} ) ) * tva_rate( $A->{date_aaaa_mm_jj} ) ; - $A->{montant_HT_EUR_logi_ass} = $A->{Montant2_logi} / ( 1 + tva_rate( $A->{date_aaaa_mm_jj} ) ) ; - $A->{montant_TVA_EUR_logi} = $A->{Montant2_logi} / ( 1 + tva_rate( $A->{date_aaaa_mm_jj} ) ) * tva_rate( $A->{date_aaaa_mm_jj} ) ; - }else{ - $A->{montant_HT_EUR_logi_exo} = $A->{Montant2_logi} ; - $A->{montant_HT_EUR_sup_exo} = $A->{Montant2_supp} ; - } - } -} - - -sub tva_line { - - my $A = shift ; - - $A->{montant_HT_EUR_logi_exo} = $A->{montant_HT_EUR_logi_ass} = $A->{montant_TVA_EUR_logi} = 0 ; - $A->{montant_HT_EUR_sup} = $A->{montant_TVA_EUR_sup} = $A->{montant_HT_EUR_sup_exo} = 0 ; - - client_type( $A ) ; - object_type( $A ) ; - button_type( $A ) ; - $A->{date_aaaa_mm_jj} = date_aaaa_mm_jj( $A->{Date} ) ; - $A->{Montant2} = $A->{Montant2}/$usdeur if 'USD' eq $A->{Devise} ; - - tva_line_one_button_for_the_software( $A ) ; - tva_line_one_button_for_the_support( $A ) ; - tva_line_one_button_for_support_and_software( $A ) ; - return( ) ; -} - - -sub tva_stuff_one_button_for_support_xor_software { - - my $F = shift ; - - if ( not ( 'software' eq $F->{object_type} - or 'support' eq $F->{object_type} - ) ) { - return( ) ; - } - - if ( ( 'individual' eq $F->{clientTypeEN}) - or - ( 'France' eq $F->{Pays} ) - ) { - $F->{priceHT} = sprintf('%2.2f', $F->{Hors_taxe} / ( 1 + tva_rate( $F->{date_aaaa_mm_jj} ) ) ) ; - $F->{priceBHT} = '' ; - $F->{priceZHT} = $F->{priceHT} ; - $F->{tvaFR} = tva_rate_str( $F->{date_aaaa_mm_jj} ) ; - $F->{priceZTVA} = sprintf('%2.2f', $F->{Hors_taxe} / ( 1 + tva_rate( $F->{date_aaaa_mm_jj} ) ) * tva_rate( $F->{date_aaaa_mm_jj} ) ) ; - $F->{priceZTTC} = sprintf('%2.2f', $F->{Hors_taxe}) ; - $F->{HTorTTC} = 'TTC' ; - $F->{messageTVAFR} = '' ; - $F->{messageTVAEN} = '' ; - }else{ - $F->{priceHT} = sprintf('%2.2f', $F->{Hors_taxe}) ; - $F->{priceBHT} = '' ; - $F->{priceZHT} = $F->{priceHT} ; - $F->{tvaFR} = '' ; - $F->{priceZTVA} = 'n�ant (none)' ; - $F->{priceZTTC} = $F->{priceHT} ; - $F->{HTorTTC} = 'HT' ; - $F->{messageTVAFR} = 'Exon�ration de TVA, articles 259 et 262 du Code G�n�ral des Imp�ts'; - $F->{messageTVAEN} = '(VAT tax-exempt, articles 259 and 262 of French General Tax Code)'; - } - - foreach my $price ( $F->{priceHT}, $F->{priceBHT}, $F->{priceZHT}, - $F->{priceZTVA}, $F->{priceZTTC} ) { - $price =~ s{\.}{, } ; - } - - return( ) ; -} - -sub tva_stuff_one_button_for_support_and_software { - - my $F = shift ; - - if ( not ( 'software + support' eq $F->{object_type} ) ) { - return( ) ; - } - - my $amountZ = $F->{Hors_taxe} ; - my $amountA = software_price( $F->{date_aaaa_mm_jj} ) ; - my $amountB = $amountZ - $amountA ; - - if ( ( 'individual' eq $F->{clientTypeEN}) - or - ( 'France' eq $F->{Pays} ) - ) { - $F->{priceHT} = sprintf('%2.2f', $amountA / ( 1 + tva_rate( $F->{date_aaaa_mm_jj} ) ) ) ; - $F->{priceBHT} = sprintf('%2.2f', $amountB / ( 1 + tva_rate( $F->{date_aaaa_mm_jj} ) ) ) ; - $F->{priceZHT} = $F->{Hors_taxe} ; - $F->{tvaFR} = tva_rate_str( $F->{date_aaaa_mm_jj} ) ; - $F->{priceZTVA} = sprintf('%2.2f', $F->{Hors_taxe} / ( 1 + tva_rate( $F->{date_aaaa_mm_jj} ) ) * tva_rate( $F->{date_aaaa_mm_jj} ) ) ; - $F->{priceZTTC} = sprintf('%2.2f', $F->{Hors_taxe}) ; - $F->{HTorTTC} = 'TTC' ; - $F->{messageTVAFR} = '' ; - $F->{messageTVAEN} = '' ; - }else{ - $F->{priceHT} = sprintf('%2.2f', $amountA ) ; - $F->{priceBHT} = sprintf('%2.2f', $amountB ) ; - $F->{priceZHT} = $F->{Hors_taxe} ; - $F->{tvaFR} = '' ; - $F->{priceZTVA} = 'n�ant (none)' ; - $F->{priceZTTC} = $F->{Hors_taxe} ; - $F->{HTorTTC} = 'HT' ; - $F->{messageTVAFR} = 'Exon�ration de TVA, articles 259 et 262 du Code G�n�ral des Imp�ts'; - $F->{messageTVAEN} = '(VAT tax-exempt, articles 259 and 262 of French General Tax Code)'; - } - - foreach my $price ( $F->{priceHT}, $F->{priceBHT}, $F->{priceZHT}, - $F->{priceZTVA}, $F->{priceZTTC} ) { - $price =~ s{\.}{, } ; - } - - return( ) ; -} - - - -sub tva_stuff { - my $F = shift ; - - $F->{priceTTCusd} = '' ; - $F->{Hors_taxe} =~ s{,}{.} ; - - $F->{date_aaaa_mm_jj} = date_aaaa_mm_jj( $F->{Date} ) ; - - tva_stuff_one_button_for_support_xor_software( $F ) ; - tva_stuff_one_button_for_support_and_software( $F ) ; - return( ) ; -} - -sub client_type { - my $F = shift ; - - $F->{client_type} = 'professional' ; - $F->{clientTypeEN} = 'professional' ; - $F->{clientTypeFR} = 'professionnel' ; - - if ('imapsync usage' eq $F->{Nom_Option_1} and 'individual' eq $F->{Valeur_Option_1} ) { - $F->{client_type} = 'individual' ; - $F->{clientTypeEN} = 'individual' ; - $F->{clientTypeFR} = 'individuel' ; - }elsif ('imapsync usage' eq $F->{Nom_Option_1} and 'professional' eq $F->{Valeur_Option_1} ) { - $F->{client_type} = 'professional' ; - $F->{clientTypeEN} = 'professional' ; - $F->{clientTypeFR} = 'professionnel' ; - }elsif('usage' eq $F->{Nom_Option_2} and 'individual' eq $F->{Option_2_Valeur} ) { - $F->{client_type} = 'individual' ; - $F->{clientTypeEN} = 'individual' ; - $F->{clientTypeFR} = 'individuel' ; - } - - return( ) ; -} - -sub build_address { - my $F = shift ; - - my $addr = " -=========================================================== -Nom $F->{Nom} -Adresse_1 $F->{Adresse_1} -Adresse_2_district_quartier $F->{Adresse_2_district_quartier} -Ville Code_postal $F->{Ville} $F->{Code_postal} -Etat_Province $F->{Etat_Province} -Pays $F->{Pays} -" ; - #print $addr ; - - my @address ; - $F->{Nom} = '' if ( $F->{Nom} =~ m/^\s+$/ ) ; - my( $Nom1, $Nom2 ) = cut( $F->{Nom}, 42 ) ; - push( @address, $Nom1 ) if $Nom1 ; - #push( @address, $Nom2 ) if $Nom2 ; - push( @address, $F->{Adresse_1} ) if $F->{Adresse_1} ; - push( @address, $F->{Adresse_2_district_quartier} ) if $F->{Adresse_2_district_quartier} ; - push( @address, "$F->{Ville} $F->{Code_postal}" ) if ( $F->{Ville} or $F->{Code_postal} ) ; - push( @address, $F->{Etat_Province} ) if $F->{Etat_Province} ; - push( @address, $F->{Pays}, ) if $F->{Pays} ; - - - $F->{clientAdrA} = shift( @address ) || '' ; - $F->{clientAdrB} = shift( @address ) || '' ; - $F->{clientAdrC} = shift( @address ) || '' ; - $F->{clientAdrD} = shift( @address ) || '' ; - $F->{clientAdrE} = shift( @address ) || '' ; - $F->{clientAdrF} = shift( @address ) || '' ; - - return( ) ; -} - - -sub cut { - my $string = shift ; - my $offset = shift ; - return( $string, '' ) if length( $string ) < $offset ; - my $first = substr( $string, 0, $offset ) ; - my $last = substr( $string, $offset ) ; - - return( $first, $last ) ; -} - -sub tests_cut { - my( $aa, $bb ) = cut("123456789", 4 ) ; - ok( '1234' eq $aa, 'cut 123456789 4 => first 1234' ) ; - ok( '56789' eq $bb, 'cut 123456789 4 => last 56789' ) ; -} diff --git a/W/paypal_reply/paypal_build_invoice_from_email b/W/paypal_reply/paypal_build_invoice_from_email index 8da459f..ebf1d62 100755 --- a/W/paypal_reply/paypal_build_invoice_from_email +++ b/W/paypal_reply/paypal_build_invoice_from_email @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: paypal_build_invoice_from_email,v 1.2 2013/02/08 14:59:34 gilles Exp gilles $ +# $Id: paypal_build_invoice_from_email,v 1.3 2016/08/18 09:51:17 gilles Exp gilles $ use warnings; use strict; @@ -136,7 +136,7 @@ while(<>) { my $address = 'gilles.lamiral@laposte.net'; my $address2 = 'gilles@lamiral.info'; -my $rcstag = '$Id: paypal_build_invoice_from_email,v 1.2 2013/02/08 14:59:34 gilles Exp gilles $'; +my $rcstag = '$Id: paypal_build_invoice_from_email,v 1.3 2016/08/18 09:51:17 gilles Exp gilles $'; my $download_info = "You will find the latest imapsync.exe binary (release $release_exe) and the latest imapsync source code (release $release) at the following link: @@ -160,8 +160,8 @@ my $support_info = 'Now you have access to imapsync professional support. You can contact me (Gilles LAMIRAL) by email or phone. Email address: gilles.lamiral@laposte.net. -Professionnal phone number: +33 951 84 42 42 (France) -Mobile phone number: +33 620 79 76 06 (France). +Professionnal phone number: +33 9 51 84 42 42 (France) +Mobile phone number: +33 6 19 22 03 54 (France). I can call you back for free in many countries on landline telephone numbers and to mobile numbers in the United States and France. So do not hesitate @@ -214,15 +214,15 @@ Gilles LAMIRAL 35580 Baulon FRANCE -Tel: +33 951 84 42 42 -Mob: +33 620 79 76 06 -Fax: +33 956 84 42 42 +Tel: +33 9 51 84 42 42 +Mob: +33 6 19 22 03 54 +Fax: +33 9 56 84 42 42 email: $address -- -Au revoir, 09 51 84 42 42 -Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06 +Au revoir, +Gilles Lamiral. EOM ; diff --git a/W/paypal_reply/paypal_build_invoices b/W/paypal_reply/paypal_build_invoices index e6a46ec..524763b 100755 --- a/W/paypal_reply/paypal_build_invoices +++ b/W/paypal_reply/paypal_build_invoices @@ -1,6 +1,6 @@ #!/bin/sh -# $Id: paypal_build_invoices,v 1.103 2016/03/17 20:37:06 gilles Exp gilles $ +# $Id: paypal_build_invoices,v 1.111 2016/08/09 02:10:07 gilles Exp gilles $ # usage: sh paypal_build_invoices /g/var/paypal_invoices/???? @@ -74,9 +74,14 @@ cp /home/gilles/public_html/AGIL/factures/000/facture_imapsync-000.tex /g/var/pa #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 4506 /g/paypal/paypal_2015_12_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 4575 /g/paypal/paypal_2016_01_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 4642 /g/paypal/paypal_2016_02_complet.csv +#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 4695 /g/paypal/paypal_2016_03_complet.csv +#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 4776 /g/paypal/paypal_2016_04_complet.csv +#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 4860 /g/paypal/paypal_2016_05_complet.csv +#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 4931 /g/paypal/paypal_2016_06_complet.csv +#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 5009 /g/paypal/paypal_2016_07_complet.csv set -x -/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 4695 /g/paypal/paypal_2016_03_complet.csv +/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 5081 /g/paypal/paypal_2016_08_complet.csv set +x @@ -131,24 +136,29 @@ set +x : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3614 /g/paypal/virements_2014_10.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3618 /g/paypal/paypal_2014_10_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3691 /g/paypal/paypal_2014_11_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3750 /g/paypal/paypal_2014_12_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3809 /g/paypal/paypal_2015_01_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3877 /g/paypal/paypal_2015_02_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3959 /g/paypal/paypal_2015_03_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4031 /g/paypal/paypal_2015_04_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4085 /g/paypal/paypal_2015_05_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4139 /g/paypal/paypal_2015_06_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4196 /g/paypal/paypal_2015_07_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4263 /g/paypal/paypal_2015_08_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4317 /g/paypal/paypal_2015_09_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4383 /g/paypal/paypal_2015_10_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4451 /g/paypal/paypal_2015_11_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4506 /g/paypal/paypal_2015_12_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4575 /g/paypal/paypal_2016_01_complet.csv -: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4642 /g/paypal/paypal_2016_02_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3750 /g/paypal/paypal_2014_12_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3809 /g/paypal/paypal_2015_01_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3877 /g/paypal/paypal_2015_02_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3959 /g/paypal/paypal_2015_03_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4031 /g/paypal/paypal_2015_04_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4085 /g/paypal/paypal_2015_05_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4139 /g/paypal/paypal_2015_06_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4196 /g/paypal/paypal_2015_07_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4263 /g/paypal/paypal_2015_08_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4317 /g/paypal/paypal_2015_09_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4383 /g/paypal/paypal_2015_10_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4451 /g/paypal/paypal_2015_11_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4506 /g/paypal/paypal_2015_12_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4575 /g/paypal/paypal_2016_01_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4642 /g/paypal/paypal_2016_02_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4695 /g/paypal/paypal_2016_03_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4776 /g/paypal/paypal_2016_04_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4860 /g/paypal/paypal_2016_05_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4931 /g/paypal/paypal_2016_06_complet.csv set -x -: g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 4695 /g/paypal/paypal_2016_03_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 5009 /g/paypal/paypal_2016_07_complet.csv +: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 5081 /g/paypal/paypal_2016_08_complet.csv set +x # La totale @@ -218,10 +228,10 @@ set +x : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 147 --avoid_numbers '' /g/paypal/paypal_2010_??_complet.csv -echo 'sh paypal_build_invoices /g/var/paypal_invoices/4???' +echo 'sh paypal_build_invoices /g/var/paypal_invoices/5???' -# USD de 147 � 340 -# EUR de 341 � ... +# USD de 147 \E0 340 +# EUR de 341 \E0 ... # 20110413 Found problems with 189 199 249 258 263 359 537 # 20110412 Found problems with 189 199 242 249 258 263 359 382 537 diff --git a/W/paypal_reply/paypal_build_reply b/W/paypal_reply/paypal_build_reply index 2ea1088..21a6636 100755 --- a/W/paypal_reply/paypal_build_reply +++ b/W/paypal_reply/paypal_build_reply @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: paypal_build_reply,v 1.28 2016/03/03 13:36:18 gilles Exp gilles $ +# $Id: paypal_build_reply,v 1.29 2016/08/18 09:48:27 gilles Exp gilles $ use warnings; use strict; @@ -107,7 +107,7 @@ while( my $line = shift @input ) { my $address = 'gilles.lamiral@laposte.net'; my $address2 = 'gilles@lamiral.info'; -my $rcstag = '$Id: paypal_build_reply,v 1.28 2016/03/03 13:36:18 gilles Exp gilles $'; +my $rcstag = '$Id: paypal_build_reply,v 1.29 2016/08/18 09:48:27 gilles Exp gilles $'; my $download_info = "You will find the latest imapsync.exe binary (release $release_exe) and the latest imapsync source code (release $release) at the following link: @@ -129,8 +129,8 @@ my $support_info = 'For imapsync professional support, contact me (Gilles LAMIRAL) by email or phone at: Email address: gilles.lamiral@laposte.net. -Professionnal phone number: +33 951 84 42 42 (France) -Mobile phone number: +33 620 79 76 06 (France). +Professionnal phone number: +33 9 51 84 42 42 (France) +Mobile phone number: +33 6 19 22 03 54 (France, SFR operator). I can call you back toll-free in many countries on landline telephone numbers and to mobile numbers in the United States and France. So do not hesitate @@ -178,15 +178,15 @@ La Billais 35580 Baulon FRANCE -Tel: +33 951 84 42 42 -Mob: +33 620 79 76 06 -Fax: +33 956 84 42 42 +Tel: +33 9 51 84 42 42 +Mob: +33 6 19 22 03 54 +Fax: +33 9 56 84 42 42 email: $address -- -Au revoir, 09 51 84 42 42 -Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06 +Au revoir, +Gilles Lamiral. EOM ; diff --git a/W/paypal_reply/postsave b/W/paypal_reply/postsave new file mode 100755 index 0000000..09f7a4f --- /dev/null +++ b/W/paypal_reply/postsave @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +# $Id: postsave,v 1.2 2016/08/08 15:22:57 gilles Exp gilles $ + +use strict ; +use warnings ; +use English ; +use CGI ; +use URL::Encode ; + +my $query = CGI->new( ) ; + +my $data = $query->param('POSTDATA') || q{} ; + +print "\n\n" ; +my $datadec = URL::Encode::url_decode($data); +#print $data ; +if ( ! -d "/var/tmp/postsave" ) { + mkdir '/var/tmp/postsave' or die $! ; +} + +open (OUT,'>', "/var/tmp/postsave/postsave.$BASETIME.txt") || die; +#open (OUT,'>>', "/var/tmp/postsave/postsave.dev.txt") || die; + +print OUT "$datadec\n" ; +close OUT ; + + diff --git a/W/paypal_reply/urldecode b/W/paypal_reply/urldecode new file mode 100755 index 0000000..1a1f9aa --- /dev/null +++ b/W/paypal_reply/urldecode @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +use strict ; +use warnings ; +use English ; +use URL::Encode ; + + +my $data = 'POSTDATA=%7B%22order%22%3A%7B%22id%22%3Anull%2C%22uuid%22%3A%223c632dae-c20e-5447-bcf8-418409f44cc4%22%2C%22resource_path%22%3A%22%2Fv2%2Forders%2F3c632dae-c20e-5447-bcf8-418409f44cc4%22%2C%22metadata%22%3Anull%2C%22created_at%22%3Anull%2C%22status%22%3A%22completed%22%2C%22event%22%3Anull%2C%22total_btc%22%3A%7B%22cents%22%3A100000000.0%2C%22currency_iso%22%3A%22BTC%22%7D%2C%22total_native%22%3A%7B%22cents%22%3A59430.0%2C%22currency_iso%22%3A%22EUR%22%7D%2C%22total_payout%22%3A%7B%22cents%22%3A59430.0%2C%22currency_iso%22%3A%22EUR%22%7D%2C%22custom%22%3A%22123456789%22%2C%22receive_address%22%3A%221GEZK4EuxmYKc22mTEYnZMUSpyjW9a52Hd%22%2C%22button%22%3A%7B%22type%22%3A%22buy_now%22%2C%22subscription%22%3Afalse%2C%22repeat%22%3Anull%2C%22name%22%3A%22Test%20Item%22%2C%22description%22%3Anull%2C%22id%22%3Anull%2C%22uuid%22%3A%22859232d4-b3bc-5240-b1cf-7b62566b6c54%22%2C%22resource_path%22%3A%22%2Fv2%2Fcheckouts%2F859232d4-b3bc-5240-b1cf-7b62566b6c54%22%7D%2C%22transaction%22%3A%7B%22id%22%3A%2257992060c04ee00001899f33%22%2C%22hash%22%3A%224a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b%22%2C%22confirmations%22%3A0%7D%7D%7D' ; + +print "\n\n" ; +print "$data\n" ; +print URL::Encode::url_decode($data), "\n" ; + + + diff --git a/W/perlcritic_1.out b/W/perlcritic_1.out index dc81033..f0e8079 100644 --- a/W/perlcritic_1.out +++ b/W/perlcritic_1.out @@ -1,2661 +1,934 @@ Code is not tidy at line 1, column 1. See page 33 of PBP. (Severity: 1) -Check the spelling in your POD: NAME imapsync IMAP sync copy tool mailboxes between two imap servers Good at than different server supported with success few failures INSTALL To get of each just run like this This is also available reproduced here Imapsync command allowing incremental recursive transfers from one mailbox to another By default all folders transferred recursively flags synced too We sometimes need transfer called reduces the amount by not transferring given it resides already both sides Same specific headers done only taken into account Message-Id Received header lines All preserved unread will stay read deleted You can any time restart later works well bad decide delete after successful be good feature when migrating since side that implies expunge so marked host really you noexpunge avoid don't see real world scenario combination synchronizing want keep has used deletes folder destroy then foldersonly foldersbutnot adequate maintaining accounts synchronization plays independently offlineimap written Goerzen mbsync Michael Elkins ways synchronizations invoke HISTORY wrote because enterprise basystemes paid install new without losing huge old located away remote low bandwidth link The imapcp could help had verify every was started its life patch comes perl tarball directory EXAMPLE While working parameters please induced Nothing way synchronize buddy password Then max's updated buddy's SECURITY passfile instead give safer With your using ps auxwwww Using dangerous auxwwwwe So saving protected rw best imasync totally against sniffers network passwords may plain text CRAM-MD ssl tls enable encryption authenticate typically admin authorized someone else which means know user's personal Specify authuser adminuser authmech PLAIN now SOMETHING work behavior Authenticate When proxyauth masquerade Can OAUTH transfering Google Apps key domain It does free edition STATUS status return everything went Otherwise exits non-zero unreliable connection loop Bourne shell LICENSE always cover NOLIMIT License See included limit anything license MAILING-LIST mailing-list write address subscribe send even empty reply unsubscribe person list consider anyone post pseudonym private Thank AUTHOR Feedback very often welcome earns his writing installing configuring teaching sold author maintening supporting over decades BUG GUIDELINES Help follow following guidelines bugs requests Before reporting FAQ TODO Upgrade last release maybe bug fixed Mail-IMAPClient Perl there Make title word my spam filters won't filter Try email words problem made keywords summary line include Most those found begining carbon easy debug One paper How Ask Way forget SERVERS HUGE Pay special subscribed maxage maxsize useuid usecache many migrate think little program Write file.txt example containing users separator contains Windows batch replaced nothing Welcome programming find Hacking Feel hack permits Entries SIMILAR Exp at line 1, column 1. See page 148 of PBP. (Severity: 1) -Main code has high complexity score (400) at line 1, column 1. Consider refactoring. (Severity: 3) +Check the spelling in your POD: NAME imapsync Email IMAP tool syncing copying migrating email mailboxes The command between two imap servers than different server supported with success few failures REQUIRED required argmuments the three each sides needed to login into host username password times INSTALL There is specific everything specified by line parameteres default behavior To get of just run like this This also available at reproduced here Imapsync allowing incremental recursive transfers from one mailbox another By all folders transferred recursively flags synced too We sometimes need transfer called reduces amount not transferring given it resides already both Same headers done only taken account Received header lines All preserved unread will stay read deleted You can any time restart later works well bad decide delete after successful be good feature when since side that implies expunge so marked really you noexpunge avoid don't see real world scenario combination synchronizing want keep copy has used deletes folder destroy then foldersonly foldersbutnot adequate maintaining accounts synchronization plays independently offlineimap written Goerzen mbsync Michael Elkins ways synchronizations invoke previous named HISTORY wrote because enterprise basystemes paid install new without losing huge old located away remote low bandwidth link imapcp could help had verify every was started its life patch comes perl tarball directory EXAMPLE While working parameters please induced Nothing way synchronize buddy Then updated SECURITY passfile instead give safer With your using ps auxwwww Using dangerous auxwwwwe So saving protected rw best imasync totally against sniffers network passwords may plain text CRAM MD ssl tls enable encryption authenticate typically admin authorized someone else which means know personal Specify authuser adminuser authmech PLAIN now SOMETHING work Authenticate When proxyauth masquerade Can OAUTH transfering Google Apps key domain It does free edition STATUS status return went Otherwise exits zero unreliable connection loop Bourne shell LICENSE always cover NOLIMIT License See included enough repeat LIST list write address subscribe send even empty reply unsubscribe person consider anyone post pseudonym private Thank AUTHOR Feedback very often welcome earns his writing installing configuring teaching sold author maintening supporting license over decades BUGS Help follow following guidelines bugs requests Before reporting FAQs TODO Upgrade last release maybe bug fixed IMAPClient Perl there Make title word my spam filters won't filter Try words problem made keywords summary include Most those found begining carbon easy debug One paper How Ask Way forget SERVERS HUGE Pay special subscribed maxage maxsize useuid usecache many migrate think little program Write file.txt example containing users separator contains Windows batch replaced nothing Welcome programming find HACKING Feel hack permits Entries SIMILAR Exp at line 1, column 1. See page 148 of PBP. (Severity: 1) +Main code has high complexity score (401) at line 1, column 1. Consider refactoring. (Severity: 3) POD before __END__ at line 18, column 1. See pages 139,140 of PBP. (Severity: 1) -Missing "REQUIRED ARGUMENTS" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) Missing "DIAGNOSTICS" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) -Missing "CONFIGURATION" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) Missing "DEPENDENCIES" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) Missing "INCOMPATIBILITIES" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) -Missing "BUGS AND LIMITATIONS" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) -Missing "LICENSE AND COPYRIGHT" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) -Magic punctuation variable $| used at line 680, column 3. See page 79 of PBP. (Severity: 2) -File lexical variable "$debugLIST" is not all lower case or all upper case at line 712, column 1. See pages 45,46 of PBP. (Severity: 1) -File lexical variable "$flagsCase" is not all lower case or all upper case at line 712, column 1. See pages 45,46 of PBP. (Severity: 1) -File lexical variable "$ssl1_SSL_version" is not all lower case or all upper case at line 712, column 1. See pages 45,46 of PBP. (Severity: 1) -File lexical variable "$ssl2_SSL_version" is not all lower case or all upper case at line 712, column 1. See pages 45,46 of PBP. (Severity: 1) -File lexical variable "$fixInboxINBOX" is not all lower case or all upper case at line 712, column 1. See pages 45,46 of PBP. (Severity: 1) -"$ssl1_SSL_version" is declared but not used at line 712, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) -"$ssl2_SSL_version" is declared but not used at line 712, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) -Found "\N{SPACE}" at the end of the line at line 714, column 34. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 719, column 44. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 723, column 28. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 731, column 28. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 734, column 37. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 740, column 40. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 742, column 25. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 749, column 29. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 750, column 25. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 761, column 29. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 764, column 43. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 766, column 39. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 771, column 22. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 816, column 8. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 854, column 15. Don't use whitespace at the end of lines. (Severity: 1) -64 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 857, column 10. Unnamed numeric literals make code less maintainable. (Severity: 2) -50 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 873, column 66. Unnamed numeric literals make code less maintainable. (Severity: 2) -Postfix control "if" used at line 878, column 31. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 884, column 1. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 885, column 1. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 886, column 1. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 886, column 114. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 897, column 65. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 926, column 15. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 926, column 36. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 927, column 21. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 927, column 44. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 933, column 25. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 941, column 24. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 941, column 46. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 946, column 1. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 948, column 1. See pages 208,278 of PBP. (Severity: 1) -Magic punctuation variable $! used in interpolated string at line 950, column 40. See page 79 of PBP. (Severity: 2) -Postfix control "if" used at line 951, column 27. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 960, column 9. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 960, column 15. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 963, column 9. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 963, column 15. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 968, column 9. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 972, column 25. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 975, column 17. See pages 93,94 of PBP. (Severity: 2) -100 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 978, column 13. Unnamed numeric literals make code less maintainable. (Severity: 2) -100 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 979, column 13. Unnamed numeric literals make code less maintainable. (Severity: 2) -Useless interpolation of literal string at line 981, column 26. See page 51 of PBP. (Severity: 1) -993 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 982, column 24. Unnamed numeric literals make code less maintainable. (Severity: 2) -143 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 982, column 30. Unnamed numeric literals make code less maintainable. (Severity: 2) -Useless interpolation of literal string at line 984, column 26. See page 51 of PBP. (Severity: 1) -993 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 985, column 24. Unnamed numeric literals make code less maintainable. (Severity: 2) -143 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 985, column 30. Unnamed numeric literals make code less maintainable. (Severity: 2) -Postfix control "if" used at line 987, column 31. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 988, column 12. See pages 93,94 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 1001, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 1002, column 5. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1002, column 10. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1002, column 46. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1009, column 26. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1010, column 26. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1020, column 9. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1021, column 3. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1024, column 3. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1028, column 9. See pages 208,278 of PBP. (Severity: 1) -3 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 1029, column 21. Unnamed numeric literals make code less maintainable. (Severity: 2) -Builtin function called with parentheses at line 1032, column 49. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1034, column 17. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1036, column 22. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1037, column 18. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1043, column 2. See pages 208,278 of PBP. (Severity: 1) -4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 1044, column 14. Unnamed numeric literals make code less maintainable. (Severity: 2) -Return value of flagged function ignored - print at line 1048, column 2. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1048, column 8. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1054, column 2. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1054, column 8. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1057, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1060, column 5. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1065, column 5. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1072, column 5. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1079, column 14. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1080, column 14. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1083, column 24. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1087, column 24. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1093, column 1. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1094, column 1. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1099, column 1. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1101, column 1. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1106, column 27. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1108, column 18. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1109, column 23. See page 13 of PBP. (Severity: 1) -Long number not separated with underscores at line 1119, column 20. See page 59 of PBP. (Severity: 2) -Useless interpolation of literal string at line 1121, column 16. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1121, column 30. See page 51 of PBP. (Severity: 1) -Postfix control "unless" used at line 1121, column 43. See pages 96,97 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1126, column 34. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1131, column 1. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1132, column 1. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1135, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1145, column 16. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1148, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1158, column 16. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1161, column 19. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 1162, column 50. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1164, column 22. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1165, column 22. See pages 93,94 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 1169, column 29. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1170, column 2. See page 13 of PBP. (Severity: 1) -String *may* require interpolation at line 1170, column 20. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1171, column 2. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1173, column 20. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1176, column 2. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1176, column 8. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1176, column 53. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1177, column 25. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1179, column 20. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1182, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1187, column 2. See pages 208,278 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1188, column 25. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1190, column 20. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1193, column 2. See pages 208,278 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1198, column 26. See page 53 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1199, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1201, column 20. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1202, column 21. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1204, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1208, column 2. See pages 208,278 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1209, column 24. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1211, column 20. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1212, column 21. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1214, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1218, column 2. See pages 208,278 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1219, column 28. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1221, column 13. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1222, column 14. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1224, column 2. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1227, column 86. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1232, column 86. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 1238, column 18. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1239, column 18. See page 51 of PBP. (Severity: 1) -Postfix control "unless" used at line 1242, column 43. See pages 96,97 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1243, column 1. See pages 208,278 of PBP. (Severity: 1) -Postfix control "unless" used at line 1244, column 43. See pages 96,97 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1245, column 1. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1247, column 1. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1247, column 7. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1247, column 34. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 1247, column 34. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1248, column 1. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1248, column 7. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1248, column 34. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 1248, column 34. See page 51 of PBP. (Severity: 1) -File lexical variable "%h2_folders_all_UPPER" is not all lower case or all upper case at line 1266, column 1. See pages 45,46 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1267, column 77. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1268, column 48. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1269, column 60. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1270, column 56. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1271, column 29. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1281, column 1. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1281, column 7. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1282, column 1. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1282, column 7. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1285, column 26. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1287, column 25. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1300, column 6. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1301, column 2. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1301, column 24. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 1302, column 3. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 1303, column 3. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1308, column 2. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1309, column 2. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1311, column 5. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1311, column 39. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1313, column 6. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 1316, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1319, column 29. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 1321, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1323, column 6. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1331, column 10. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1332, column 3. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1339, column 6. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 1341, column 33. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 1341, column 33. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 1341, column 33. See page 237 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1343, column 3. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1347, column 6. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1349, column 32. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 1350, column 33. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 1350, column 33. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 1350, column 33. See page 237 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1352, column 3. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1359, column 50. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1365, column 1. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1368, column 11. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1369, column 3. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1372, column 3. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1382, column 9. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1386, column 5. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1388, column 4. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1392, column 55. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1398, column 25. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 1402, column 41. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1402, column 51. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1403, column 41. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1403, column 51. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1405, column 31. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 1406, column 67. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1406, column 80. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1407, column 67. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1407, column 80. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1410, column 1. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1411, column 1. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1423, column 2. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1424, column 34. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1434, column 1. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1445, column 1. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1446, column 27. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1447, column 36. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1449, column 27. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1450, column 36. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1453, column 1. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1453, column 6. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 1454, column 3. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1454, column 37. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1455, column 23. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1455, column 60. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 1456, column 3. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1462, column 2. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1462, column 43. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1468, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1471, column 3. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1474, column 9. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1478, column 2. See pages 208,278 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1481, column 28. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1482, column 26. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1485, column 3. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1488, column 9. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 1491, column 17. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1492, column 17. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1496, column 2. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1503, column 58. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1504, column 58. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1507, column 30. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1507, column 39. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1511, column 11. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 1514, column 17. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1517, column 34. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1520, column 28. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1523, column 1. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1540, column 2. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1546, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1549, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1551, column 10. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1554, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1555, column 9. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 1558, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 1560, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1563, column 44. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1564, column 57. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 1568, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1574, column 3. See pages 208,278 of PBP. (Severity: 1) -"unless" block used at line 1575, column 3. See page 97 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 1577, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1579, column 22. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1580, column 3. See pages 208,278 of PBP. (Severity: 1) -"unless" block used at line 1581, column 3. See page 97 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 1583, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1592, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1593, column 26. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1598, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1602, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1603, column 26. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1608, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1612, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1613, column 50. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1614, column 50. See page 53 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1620, column 3. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1622, column 37. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1624, column 3. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1624, column 9. See page 51 of PBP. (Severity: 1) -Double-sigil dereference at line 1624, column 39. See page 228 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 1624, column 70. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 1626, column 50. See page 228 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 1628, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 1631, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 1635, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 1636, column 49. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 1637, column 30. See page 228 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 1638, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 1644, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 1648, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 1651, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 1655, column 57. See pages 93,94 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 1658, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 1661, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 1665, column 77. See pages 93,94 of PBP. (Severity: 2) -Double-sigil dereference at line 1668, column 2. See page 228 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 1669, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 1672, column 48. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1672, column 57. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1672, column 73. See page 51 of PBP. (Severity: 1) -Postfix control "if" used at line 1673, column 5. See pages 93,94 of PBP. (Severity: 2) -Useless interpolation of literal string at line 1677, column 55. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1677, column 64. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1677, column 80. See page 51 of PBP. (Severity: 1) -Postfix control "if" used at line 1678, column 3. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1681, column 2. See page 97 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1682, column 15. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1682, column 21. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 1683, column 22. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1683, column 54. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1691, column 9. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1692, column 38. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1693, column 4. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1700, column 4. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1702, column 38. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1709, column 36. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1711, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 1713, column 19. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1714, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1716, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 1718, column 79. See pages 93,94 of PBP. (Severity: 2) -Double-sigil dereference at line 1722, column 2. See page 228 of PBP. (Severity: 2) -Useless interpolation of literal string at line 1726, column 48. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1726, column 57. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1726, column 73. See page 51 of PBP. (Severity: 1) -Postfix control "if" used at line 1727, column 3. See pages 93,94 of PBP. (Severity: 2) -Useless interpolation of literal string at line 1731, column 55. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1731, column 64. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 1731, column 80. See page 51 of PBP. (Severity: 1) -Postfix control "if" used at line 1732, column 3. See pages 93,94 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 1736, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 1740, column 37. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1741, column 9. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1742, column 25. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1748, column 4. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1751, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1753, column 28. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1757, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1758, column 36. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1760, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1761, column 9. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1761, column 107. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 1762, column 10. See pages 93,94 of PBP. (Severity: 2) -Useless interpolation of literal string at line 1763, column 19. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 1767, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1768, column 32. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1769, column 53. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 1770, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 1772, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1773, column 32. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1774, column 53. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1776, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1777, column 33. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1781, column 4. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1782, column 4. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 1782, column 33. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1783, column 4. See page 97 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1790, column 4. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 1791, column 39. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1794, column 18. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 1795, column 38. See pages 93,94 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 1798, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1799, column 23. See page 13 of PBP. (Severity: 1) -"unless" block used at line 1804, column 4. See page 97 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1804, column 12. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1806, column 45. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 1806, column 45. See page 51 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 1807, column 31. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 1807, column 31. See page 237 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1808, column 5. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 1809, column 7. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1810, column 5. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 1810, column 32. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1811, column 5. See page 97 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1818, column 4. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1819, column 25. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 1819, column 52. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1820, column 4. See page 97 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 1826, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1828, column 4. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 1829, column 39. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1832, column 18. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 1833, column 38. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1837, column 19. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1838, column 10. See pages 208,278 of PBP. (Severity: 1) -"unless" block used at line 1842, column 4. See page 97 of PBP. (Severity: 2) -Builtin function called with parentheses at line 1842, column 13. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 1843, column 49. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 1843, column 49. See page 51 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 1844, column 31. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 1844, column 31. See page 237 of PBP. (Severity: 2) -"unless" block used at line 1845, column 5. See page 97 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1855, column 4. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1858, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1860, column 4. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1863, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1864, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1867, column 25. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1870, column 38. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1873, column 34. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1874, column 41. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 1874, column 70. See pages 93,94 of PBP. (Severity: 2) -Code structure is deeply nested at line 1875, column 41. Consider refactoring. (Severity: 3) -"unless" block used at line 1875, column 41. See page 97 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 1882, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1885, column 4. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 1886, column 39. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1889, column 18. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 1890, column 38. See pages 93,94 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 1893, column 59. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1909, column 14. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1909, column 43. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1910, column 28. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1915, column 42. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1916, column 26. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1924, column 30. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1929, column 73. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1932, column 33. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 1933, column 44. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 1940, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1941, column 22. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 1952, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 1970, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 1978, column 34. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 1979, column 18. See pages 208,278 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 1984, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 1986, column 3. See pages 208,278 of PBP. (Severity: 1) -"unless" block used at line 1987, column 3. See page 97 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 1990, column 3. See pages 208,278 of PBP. (Severity: 1) -"unless" block used at line 1991, column 3. See page 97 of PBP. (Severity: 2) -Useless interpolation of literal string at line 1994, column 19. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2002, column 10. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2004, column 10. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 2008, column 1. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2009, column 47. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2011, column 1. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 2011, column 30. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 2015, column 2. See pages 208,278 of PBP. (Severity: 1) -Postfix control "unless" used at line 2024, column 20. See pages 96,97 of PBP. (Severity: 2) -Postfix control "unless" used at line 2025, column 20. See pages 96,97 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 2027, column 1. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 2027, column 22. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 2030, column 1. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 2030, column 118. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2031, column 33. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2032, column 17. See pages 93,94 of PBP. (Severity: 2) -Reused variable name in lexical scope: $sync at line 2040, column 2. Invent unique variable names. (Severity: 3) -Found "\t" at the end of the line at line 2041, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 2043, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 2048, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Local lexical variable "$Side" is not all lower case or all upper case at line 2053, column 2. See pages 45,46 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 2054, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2055, column 12. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2056, column 25. See page 53 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 2060, column 18. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2062, column 39. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2063, column 3. See pages 208,278 of PBP. (Severity: 1) -Hard tabs used at line 2066, column 22. See page 20 of PBP. (Severity: 3) -Found "\t" at the end of the line at line 2066, column 22. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 2069, column 17. See pages 208,278 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 2079, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 2081, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 2089, column 35. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 2091, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 2098, column 35. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 2100, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2110, column 163. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2111, column 19. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2112, column 18. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2113, column 17. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2114, column 24. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2116, column 34. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 2123, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2124, column 15. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2131, column 4. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2132, column 4. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2135, column 2. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2136, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2136, column 35. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2136, column 46. See page 53 of PBP. (Severity: 2) -Reused variable name in lexical scope: $sync at line 2150, column 2. Invent unique variable names. (Severity: 3) -Found "\N{SPACE}" at the end of the line at line 2151, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Local lexical variable "$Side" is not all lower case or all upper case at line 2152, column 9. See pages 45,46 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2152, column 20. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2155, column 47. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 2159, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2164, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2172, column 27. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2172, column 36. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2176, column 9. See pages 208,278 of PBP. (Severity: 1) -Long number not separated with underscores at line 2191, column 13. See page 59 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 2197, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Local lexical variable "$limit_KB" is not all lower case or all upper case at line 2198, column 9. See pages 45,46 of PBP. (Severity: 1) -Use character classes for literal metachars instead of escapes at line 2199, column 29. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 2199, column 29. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 2199, column 29. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 2199, column 29. See page 237 of PBP. (Severity: 2) -Double-sigil dereference at line 2199, column 77. See page 228 of PBP. (Severity: 2) +Magic punctuation variable $| used at line 698, column 3. See page 79 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 771, column 26. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 772, column 31. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 774, column 51. Don't use whitespace at the end of lines. (Severity: 1) +Long number not separated with underscores at line 780, column 33. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 799, column 34. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 803, column 37. See page 59 of PBP. (Severity: 2) +File lexical variable "$fixInboxINBOX" is not all lower case or all upper case at line 814, column 1. See pages 45,46 of PBP. (Severity: 1) +"$ssl1_ssl_version" is declared but not used at line 814, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) +"$ssl2_ssl_version" is declared but not used at line 814, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) +String *may* require interpolation at line 916, column 8. See page 51 of PBP. (Severity: 1) +Magic punctuation variable $! used in interpolated string at line 966, column 47. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 967, column 32. See page 79 of PBP. (Severity: 2) +Postfix control "if" used at line 971, column 17. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1010, column 119. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1044, column 15. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1045, column 21. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1051, column 25. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1059, column 24. See pages 93,94 of PBP. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 1068, column 40. See page 79 of PBP. (Severity: 2) +Postfix control "if" used at line 1106, column 29. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1118, column 31. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1119, column 12. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1133, column 5. See pages 93,94 of PBP. (Severity: 2) +Postfix control "unless" used at line 1252, column 40. See pages 96,97 of PBP. (Severity: 2) +Postfix control "if" used at line 1302, column 22. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1303, column 22. See pages 93,94 of PBP. (Severity: 2) +String *may* require interpolation at line 1308, column 19. See page 51 of PBP. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 1314, column 47. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 1315, column 43. Don't use whitespace at the end of lines. (Severity: 1) +Postfix control "unless" used at line 1380, column 43. See pages 96,97 of PBP. (Severity: 2) +Postfix control "unless" used at line 1382, column 43. See pages 96,97 of PBP. (Severity: 2) +File lexical variable "%h2_folders_all_UPPER" is not all lower case or all upper case at line 1404, column 1. See pages 45,46 of PBP. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 1413, column 31. Don't use whitespace at the end of lines. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 1442, column 3. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 1442, column 3. See page 51 of PBP. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 1443, column 3. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 1443, column 3. See page 51 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 1481, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 1481, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 1481, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 1490, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 1490, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 1490, column 33. See page 237 of PBP. (Severity: 2) +Return value of flagged function ignored - print at line 1585, column 1. See pages 208,278 of PBP. (Severity: 1) +Return value of flagged function ignored - print at line 1593, column 1. See pages 208,278 of PBP. (Severity: 1) +Postfix control "if" used at line 1596, column 3. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1631, column 29. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1632, column 29. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1641, column 29. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1649, column 34. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1711, column 3. See page 97 of PBP. (Severity: 2) +"unless" block used at line 1717, column 3. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 1793, column 57. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1803, column 77. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1811, column 5. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1816, column 3. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1819, column 2. See page 97 of PBP. (Severity: 2) +Builtin function called with parentheses at line 1820, column 15. See page 13 of PBP. (Severity: 1) +Postfix control "if" used at line 1856, column 79. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1865, column 3. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1870, column 3. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1900, column 10. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1920, column 32. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1921, column 4. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 1929, column 39. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1933, column 38. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1942, column 4. See page 97 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 1945, column 31. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 1945, column 31. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 1947, column 7. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1948, column 31. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1949, column 5. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 1957, column 51. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1958, column 4. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 1967, column 39. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1971, column 38. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1980, column 4. See page 97 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 1982, column 31. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 1982, column 31. See page 237 of PBP. (Severity: 2) +"unless" block used at line 1983, column 5. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 2012, column 69. See pages 93,94 of PBP. (Severity: 2) +Code structure is deeply nested at line 2013, column 41. Consider refactoring. (Severity: 3) +"unless" block used at line 2013, column 41. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 2024, column 39. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 2028, column 38. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 2125, column 3. See page 97 of PBP. (Severity: 2) +"unless" block used at line 2129, column 3. See page 97 of PBP. (Severity: 2) +Postfix control "unless" used at line 2159, column 20. See pages 96,97 of PBP. (Severity: 2) +Postfix control "unless" used at line 2160, column 20. See pages 96,97 of PBP. (Severity: 2) +Postfix control "if" used at line 2163, column 66. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 2164, column 41. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 2165, column 40. See pages 93,94 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 2172, column 39. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 2173, column 39. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 2177, column 40. Don't use whitespace at the end of lines. (Severity: 1) Found "\N{SPACE}" at the end of the line at line 2219, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Local lexical variable "$current_KB" is not all lower case or all upper case at line 2220, column 9. See pages 45,46 of PBP. (Severity: 1) -Use character classes for literal metachars instead of escapes at line 2221, column 31. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 2221, column 31. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 2221, column 31. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 2221, column 31. See page 237 of PBP. (Severity: 2) -Double-sigil dereference at line 2221, column 79. See page 228 of PBP. (Severity: 2) -Reused variable name in lexical scope: $sync at line 2230, column 2. Invent unique variable names. (Severity: 3) -Found "\t" at the end of the line at line 2231, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 2233, column 3. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2235, column 3. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2238, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 2241, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2245, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Reused variable name in lexical scope: $sync at line 2253, column 2. Invent unique variable names. (Severity: 3) -Found "\t" at the end of the line at line 2254, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2255, column 36. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2261, column 26. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2267, column 36. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2273, column 26. See pages 208,278 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 2284, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 2286, column 30. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 2286, column 30. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 2286, column 30. See page 237 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 2288, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2289, column 63. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2290, column 57. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2291, column 13. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 2292, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Reused variable name in lexical scope: $sync at line 2297, column 53. Invent unique variable names. (Severity: 3) -Quotes used with a string containing no non-whitespace characters at line 2298, column 70. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2299, column 13. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2299, column 67. See page 53 of PBP. (Severity: 2) -Reused variable name in lexical scope: $sync at line 2305, column 2. Invent unique variable names. (Severity: 3) -Found "\t" at the end of the line at line 2306, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2313, column 19. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2320, column 19. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2322, column 80. Don't use whitespace at the end of lines. (Severity: 1) -Reused variable name in lexical scope: $sync at line 2353, column 2. Invent unique variable names. (Severity: 3) -Found "\t" at the end of the line at line 2356, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2357, column 63. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2358, column 63. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2362, column 76. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2370, column 71. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 2388, column 21. See page 228 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 2389, column 26. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 2389, column 26. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 2389, column 26. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2392, column 10. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2393, column 6. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2393, column 63. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2394, column 43. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2396, column 6. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2396, column 41. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2397, column 37. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2397, column 43. See page 53 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 2403, column 9. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 2403, column 20. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2411, column 3. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2411, column 22. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2411, column 28. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 2411, column 43. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 2412, column 17. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2415, column 3. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2416, column 3. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 2416, column 24. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2424, column 20. See page 53 of PBP. (Severity: 2) -Reused variable name in lexical scope: $nb_errors at line 2437, column 2. Invent unique variable names. (Severity: 3) -Return value of flagged function ignored - print at line 2439, column 3. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2441, column 3. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2452, column 27. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2454, column 33. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2456, column 51. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2457, column 51. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 2463, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Too many arguments at line 2473, column 1. See page 182 of PBP. (Severity: 3) -Builtin function called with parentheses at line 2476, column 11. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2477, column 11. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2478, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 2479, column 41. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2483, column 45. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2483, column 58. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 2484, column 45. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2484, column 58. See page 53 of PBP. (Severity: 2) -Too many arguments at line 2491, column 1. See page 182 of PBP. (Severity: 3) -Found "\N{SPACE}" at the end of the line at line 2493, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Too many arguments at line 2501, column 1. See page 182 of PBP. (Severity: 3) -Found "\N{SPACE}" at the end of the line at line 2504, column 31. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2511, column 31. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 2514, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2516, column 22. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2516, column 28. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2517, column 22. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2517, column 28. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 2520, column 37. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 2526, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2528, column 19. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2528, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2529, column 26. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2539, column 28. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 2539, column 28. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2541, column 19. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2543, column 27. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2544, column 27. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2545, column 31. See page 51 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 2547, column 17. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 2547, column 17. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2557, column 55. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 2557, column 55. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2558, column 74. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 2558, column 74. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2563, column 17. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2563, column 17. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 2563, column 58. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2564, column 17. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2564, column 17. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2574, column 28. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2576, column 10. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2580, column 21. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2581, column 21. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2582, column 21. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2583, column 12. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2583, column 34. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2584, column 28. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2585, column 28. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2586, column 32. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2587, column 23. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2587, column 34. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2588, column 18. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2588, column 25. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2588, column 36. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2595, column 23. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 2595, column 23. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2595, column 28. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2597, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 2603, column 3. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2603, column 9. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2608, column 16. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2615, column 12. See page 13 of PBP. (Severity: 1) -Subroutine "modules_VERSION" is not all lower case or all upper case at line 2619, column 1. See pages 45,46 of PBP. (Severity: 1) -Subroutine "modules_VERSION" with high complexity score (26) at line 2619, column 1. Consider refactoring. (Severity: 3) -Useless interpolation of literal string at line 2624, column 77. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2624, column 77. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2625, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2627, column 65. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2627, column 65. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2628, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2630, column 73. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2630, column 73. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2631, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2633, column 77. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2633, column 77. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2634, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2636, column 76. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2636, column 76. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2637, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2639, column 68. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2639, column 68. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2640, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2642, column 73. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2642, column 73. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2643, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2645, column 67. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2645, column 67. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2646, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2648, column 77. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2648, column 77. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2649, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2651, column 79. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2651, column 79. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2652, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2654, column 71. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2654, column 71. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2655, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2657, column 65. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2657, column 65. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2658, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2660, column 67. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2660, column 67. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2661, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2663, column 75. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2663, column 75. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2664, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2666, column 59. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2666, column 59. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2667, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2669, column 87. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2669, column 87. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2670, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2672, column 69. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2672, column 69. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2673, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2675, column 67. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2675, column 67. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2676, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2678, column 69. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2678, column 69. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2679, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2681, column 53. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2681, column 53. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2682, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2684, column 73. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2684, column 73. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2685, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2687, column 83. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2687, column 83. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2688, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2690, column 51. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2690, column 51. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2691, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2693, column 73. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2693, column 73. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2694, column 2. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2696, column 83. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 2696, column 83. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2697, column 2. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2707, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2710, column 13. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 2711, column 15. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 2711, column 15. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2712, column 4. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2713, column 4. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2713, column 33. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2715, column 4. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2723, column 5. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 2727, column 43. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2730, column 5. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 2734, column 44. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 2741, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2752, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2760, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2772, column 2. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2772, column 8. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2773, column 2. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2773, column 8. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2773, column 35. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 2773, column 35. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2775, column 2. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2775, column 8. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2776, column 2. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 2776, column 8. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2776, column 35. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 2776, column 35. See page 51 of PBP. (Severity: 1) -Too many arguments at line 2782, column 1. See page 182 of PBP. (Severity: 3) -Local lexical variable "$Side" is not all lower case or all upper case at line 2783, column 2. See pages 45,46 of PBP. (Severity: 1) -Magic punctuation variable $@ used in interpolated string at line 2792, column 18. See page 79 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 2796, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 2801, column 17. See pages 208,278 of PBP. (Severity: 1) -Local lexical variable "$Side" is not all lower case or all upper case at line 2810, column 2. See pages 45,46 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2810, column 5. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2811, column 43. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2812, column 37. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2816, column 13. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2817, column 2. See pages 208,278 of PBP. (Severity: 1) -Magic punctuation variable $@ used in interpolated string at line 2822, column 17. See page 79 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 2823, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 2826, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2831, column 4. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2841, column 17. See pages 208,278 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 2843, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 2845, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 2846, column 2. See pages 208,278 of PBP. (Severity: 1) -Subroutine "authenticate_imap" with high complexity score (21) at line 2851, column 1. Consider refactoring. (Severity: 3) -Too many arguments at line 2851, column 1. See page 182 of PBP. (Severity: 3) -Local lexical variable "$Side" is not all lower case or all upper case at line 2853, column 2. See pages 45,46 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2854, column 52. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2855, column 39. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2862, column 38. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 2862, column 38. See page 51 of PBP. (Severity: 1) -Postfix control "unless" used at line 2865, column 51. See pages 96,97 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 2868, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 2869, column 33. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2870, column 33. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2871, column 35. See pages 93,94 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 2872, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 2873, column 32. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2873, column 36. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 2876, column 1. Don't use whitespace at the end of lines. (Severity: 1) -"unless" block used at line 2877, column 2. See page 97 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2880, column 3. See page 13 of PBP. (Severity: 1) -File handle for "print" or "printf" is not braced at line 2885, column 4. See page 217 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2885, column 4. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2887, column 3. See pages 208,278 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 2888, column 24. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 2888, column 24. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2897, column 25. See page 13 of PBP. (Severity: 1) -Local lexical variable "$Side" is not all lower case or all upper case at line 2907, column 2. See pages 45,46 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2908, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2912, column 3. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2914, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2916, column 3. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 2919, column 4. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2942, column 23. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2942, column 54. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2944, column 48. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2945, column 17. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 2945, column 48. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2945, column 57. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2966, column 23. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 2966, column 54. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2968, column 48. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 2969, column 17. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 2969, column 48. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 2969, column 57. See page 13 of PBP. (Severity: 1) -Too many arguments at line 2981, column 1. See page 182 of PBP. (Severity: 3) -Local lexical variable "$Side" is not all lower case or all upper case at line 2982, column 2. See pages 45,46 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2983, column 45. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 2984, column 39. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 2989, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 2991, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3003, column 2. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 3005, column 41. See pages 93,94 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 3008, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3018, column 22. See page 13 of PBP. (Severity: 1) -Numeric escapes in interpolated string at line 3018, column 30. See pages 54,55 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3020, column 41. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 3020, column 41. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3052, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Use named character classes ([A-Za-z] vs. [[:alpha:]]) at line 3057, column 62. See page 248 of PBP. (Severity: 1) -Use character classes for literal metachars instead of escapes at line 3057, column 62. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3057, column 62. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3057, column 62. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3057, column 62. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 3060, column 33. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 3062, column 20. See page 13 of PBP. (Severity: 1) -Backtick operator used at line 3065, column 19. Use IPC::Open3 instead. (Severity: 3) -Builtin function called with parentheses at line 3067, column 20. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3070, column 20. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3084, column 1. Don't use whitespace at the end of lines. (Severity: 1) -"unless" block used at line 3089, column 9. See page 97 of PBP. (Severity: 2) -Builtin function called with parentheses at line 3090, column 17. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3099, column 44. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3099, column 68. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3099, column 111. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3099, column 119. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 3099, column 119. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3101, column 20. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3113, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 3115, column 22. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3116, column 19. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3116, column 27. See page 51 of PBP. (Severity: 1) -Local lexical variable "$URLparm" is not all lower case or all upper case at line 3117, column 9. See pages 45,46 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3117, column 23. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3117, column 31. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3118, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3121, column 26. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3121, column 32. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3121, column 32. See page 237 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3123, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3130, column 39. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3134, column 65. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 3134, column 65. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3135, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3137, column 25. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 3137, column 25. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3140, column 39. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 3140, column 39. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3142, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3145, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 3149, column 82. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 3149, column 82. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3150, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3152, column 63. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3153, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3156, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3158, column 32. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 3158, column 32. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3158, column 45. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 3158, column 45. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3158, column 61. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 3158, column 61. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3161, column 22. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 3161, column 22. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3164, column 39. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 3164, column 39. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3166, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3169, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3171, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3173, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3175, column 41. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 3175, column 41. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3188, column 24. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3188, column 29. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 3188, column 29. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3188, column 32. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 3189, column 5. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 3190, column 5. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 3191, column 5. See page 51 of PBP. (Severity: 1) -Magic punctuation variable $0 used in interpolated string at line 3194, column 5. See page 79 of PBP. (Severity: 2) -Return value of eval not tested at line 3203, column 2. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) -Found "\N{SPACE}" at the end of the line at line 3209, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 3211, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 3212, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3214, column 3. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3215, column 17. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3216, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 3218, column 3. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3220, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3221, column 42. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 3223, column 4. See pages 208,278 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 3226, column 1. Don't use whitespace at the end of lines. (Severity: 1) -File handle for "print" or "printf" is not braced at line 3227, column 2. See page 217 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3227, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of "close" ignored at line 3228, column 2. Check the return value of "close" for success. (Severity: 2) -Return value of flagged function ignored - close at line 3228, column 2. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3229, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3231, column 2. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3234, column 2. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3242, column 2. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3248, column 2. See page 13 of PBP. (Severity: 1) -"die" used instead of "croak" at line 3248, column 2. See page 283 of PBP. (Severity: 3) -Found "\N{SPACE}" at the end of the line at line 3249, column 2. Don't use whitespace at the end of lines. (Severity: 1) -Magic punctuation variable $0 used in interpolated string at line 3253, column 13. See page 79 of PBP. (Severity: 2) -Subroutine "fix_Inbox_INBOX_mapping" is not all lower case or all upper case at line 3258, column 1. See pages 45,46 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3261, column 14. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3263, column 79. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3264, column 79. See page 53 of PBP. (Severity: 2) -String *may* require interpolation at line 3265, column 79. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 3266, column 79. See page 51 of PBP. (Severity: 1) -Subroutine "tests_fix_Inbox_INBOX_mapping" is not all lower case or all upper case at line 3271, column 1. See pages 45,46 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3274, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3275, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3276, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3277, column 6. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3278, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3279, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3280, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3281, column 6. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3282, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3283, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3284, column 25. See page 53 of PBP. (Severity: 2) -String *may* require interpolation at line 3285, column 6. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3286, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3287, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3288, column 25. See page 53 of PBP. (Severity: 2) -String *may* require interpolation at line 3289, column 6. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3290, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3291, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3292, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3293, column 6. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3294, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3295, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3296, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3297, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3305, column 14. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3313, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3314, column 31. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3324, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3335, column 21. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3339, column 31. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 3342, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3349, column 23. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 3356, column 15. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3356, column 15. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3356, column 15. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3357, column 15. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3357, column 15. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3357, column 15. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3358, column 15. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3358, column 15. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3358, column 15. See page 237 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 3366, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Use character classes for literal metachars instead of escapes at line 3367, column 8. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3367, column 8. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3367, column 8. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3367, column 8. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3368, column 8. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3368, column 8. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3368, column 8. See page 237 of PBP. (Severity: 2) -Use character classes for literal metachars instead of escapes at line 3369, column 8. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3369, column 8. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3369, column 8. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3369, column 8. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 3379, column 15. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3379, column 21. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3379, column 24. Don't use whitespace at the end of lines. (Severity: 1) -Use character classes for literal metachars instead of escapes at line 3395, column 31. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3395, column 31. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3395, column 31. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3395, column 31. See page 237 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3402, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3408, column 15. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3408, column 21. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3408, column 24. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 3422, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 3423, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3424, column 27. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3426, column 17. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3431, column 16. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3431, column 22. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3431, column 25. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 3441, column 25. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3446, column 17. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3459, column 9. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3460, column 27. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3462, column 17. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3467, column 17. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3471, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 3473, column 17. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3477, column 18. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3477, column 25. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3477, column 25. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3477, column 25. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 3478, column 9. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3479, column 19. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3480, column 20. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3480, column 20. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3480, column 20. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3481, column 27. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 3481, column 27. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3487, column 16. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3487, column 22. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3487, column 25. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 3497, column 25. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3502, column 17. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3504, column 4. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3526, column 52. See page 51 of PBP. (Severity: 1) -List of quoted literal words at line 3538, column 17. Use 'qw()' instead. (Severity: 2) -List of quoted literal words at line 3539, column 17. Use 'qw()' instead. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3541, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3557, column 21. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 3566, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3567, column 10. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 3573, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3577, column 10. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 3582, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3586, column 10. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 3591, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3592, column 22. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3592, column 48. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3593, column 22. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3593, column 52. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3594, column 21. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 3595, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3596, column 10. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3597, column 10. See page 13 of PBP. (Severity: 1) -Double-sigil dereference at line 3604, column 28. See page 228 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 3606, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 3608, column 26. See page 228 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 3609, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 3617, column 36. See page 228 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 3618, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 3625, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 3627, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 3641, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 3642, column 46. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3643, column 46. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3644, column 46. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3645, column 46. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3646, column 46. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3647, column 46. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3648, column 46. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3651, column 43. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3652, column 43. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3653, column 43. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3654, column 43. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3655, column 43. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3657, column 50. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 3661, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 3662, column 26. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3662, column 33. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3663, column 26. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3663, column 33. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3664, column 26. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3664, column 34. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3665, column 26. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3665, column 33. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3666, column 26. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3666, column 33. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3667, column 26. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3667, column 33. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3667, column 38. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3668, column 26. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3668, column 32. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 3668, column 32. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3668, column 37. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3668, column 47. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3668, column 52. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3669, column 31. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3669, column 37. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 3669, column 37. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3669, column 42. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3669, column 52. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3669, column 57. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 3676, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "unless" used at line 3677, column 18. See pages 96,97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3679, column 23. See page 53 of PBP. (Severity: 2) -Use 'eq' or hash instead of fixed-pattern regexps at line 3681, column 24. See pages 271,272 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3681, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3681, column 24. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3681, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3682, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3682, column 19. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3682, column 19. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3683, column 22. See page 53 of PBP. (Severity: 2) -Use character classes for literal metachars instead of escapes at line 3686, column 19. See page 247 of PBP. (Severity: 1) -Use [\.\/] instead of \.|\/ at line 3686, column 19. See page 265 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3686, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3686, column 19. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3686, column 19. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 3695, column 11. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3696, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3697, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3698, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3704, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3705, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3706, column 6. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3711, column 17. Don't use whitespace at the end of lines. (Severity: 1) -Local lexical variable "$Side" is not all lower case or all upper case at line 3712, column 2. See pages 45,46 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 3714, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 3716, column 34. See page 228 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 3717, column 2. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 3719, column 30. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3722, column 17. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3723, column 8. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3724, column 18. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3733, column 15. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3734, column 18. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3738, column 4. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3738, column 9. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 3750, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "unless" used at line 3751, column 18. See pages 96,97 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3756, column 12. See page 53 of PBP. (Severity: 2) -Postfix control "while" used at line 3756, column 20. See page 96 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3756, column 39. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3756, column 39. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3756, column 39. See page 237 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3757, column 12. See page 53 of PBP. (Severity: 2) -Postfix control "while" used at line 3757, column 20. See page 96 of PBP. (Severity: 2) -Use character classes for literal metachars instead of escapes at line 3757, column 39. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3757, column 39. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3757, column 39. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3757, column 39. See page 237 of PBP. (Severity: 2) -Postfix control "while" used at line 3758, column 22. See page 96 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3758, column 41. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3758, column 41. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3758, column 41. See page 237 of PBP. (Severity: 2) -Forbid $b before $a in sort blocks at line 3760, column 20. See page 152 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3760, column 63. See page 13 of PBP. (Severity: 1) -Quotes used with a noisy string at line 3762, column 39. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 3768, column 11. See page 13 of PBP. (Severity: 1) -Quotes used with a noisy string at line 3769, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3770, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3771, column 6. See page 53 of PBP. (Severity: 2) -Hard tabs used at line 3772, column 106. See page 20 of PBP. (Severity: 3) -Found "\t" at the end of the line at line 3772, column 106. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3776, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Local lexical variable "$Side" is not all lower case or all upper case at line 3777, column 2. See pages 45,46 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 3779, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 3781, column 34. See page 228 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 3782, column 2. See pages 208,278 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 3783, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 3785, column 30. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3787, column 8. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3788, column 18. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3789, column 30. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3790, column 19. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3797, column 23. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3798, column 26. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3802, column 5. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3802, column 10. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3803, column 85. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3810, column 15. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3811, column 18. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 3815, column 4. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3816, column 84. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 3826, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 3830, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 3836, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 3840, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 3849, column 16. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3849, column 21. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 3856, column 11. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3857, column 11. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3857, column 38. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3858, column 38. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3858, column 42. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 3859, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3860, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3860, column 30. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3860, column 34. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3860, column 38. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3861, column 46. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3861, column 50. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3862, column 46. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3862, column 51. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3863, column 48. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3863, column 53. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3864, column 48. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3864, column 53. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3865, column 48. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3865, column 53. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3866, column 50. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3866, column 55. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3868, column 50. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3868, column 55. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3870, column 50. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3870, column 55. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 3878, column 27. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3878, column 54. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 3878, column 86. See page 13 of PBP. (Severity: 1) -Numeric escapes in interpolated string at line 3880, column 12. See pages 54,55 of PBP. (Severity: 2) -Use only '//' or '{}' to delimit regexps at line 3883, column 14. See page 246 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3883, column 14. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3883, column 14. See page 237 of PBP. (Severity: 2) -Use only '//' or '{}' to delimit regexps at line 3884, column 14. See page 246 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3884, column 14. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3884, column 14. See page 237 of PBP. (Severity: 2) -Use only '//' or '{}' to delimit regexps at line 3885, column 14. See page 246 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3885, column 14. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3885, column 14. See page 237 of PBP. (Severity: 2) -Use only '//' or '{}' to delimit regexps at line 3886, column 21. See page 246 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3886, column 21. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3886, column 21. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 3886, column 30. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3886, column 49. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3886, column 74. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 3888, column 2. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3893, column 27. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3894, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3895, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3906, column 4. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3906, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3919, column 4. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3919, column 28. See page 53 of PBP. (Severity: 2) -String *may* require interpolation at line 3929, column 17. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 3930, column 45. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 3934, column 4. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3934, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3941, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3942, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3943, column 4. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3943, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3952, column 14. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3957, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3958, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3960, column 14. See page 53 of PBP. (Severity: 2) -String *may* require interpolation at line 3961, column 17. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 3964, column 18. See page 51 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 3996, column 14. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3996, column 14. See page 237 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4001, column 34. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "unless" used at line 4002, column 4. See pages 96,97 of PBP. (Severity: 2) -Useless interpolation of literal string at line 4002, column 28. See page 51 of PBP. (Severity: 1) -Use 'eq' or hash instead of fixed-pattern regexps at line 4002, column 66. See pages 271,272 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4002, column 66. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4002, column 66. See page 237 of PBP. (Severity: 2) -Expression form of "eval" at line 4012, column 13. See page 161 of PBP. (Severity: 5) -Builtin function called with parentheses at line 4012, column 13. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4014, column 28. See page 13 of PBP. (Severity: 1) -Magic punctuation variable $@ used at line 4014, column 49. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4015, column 15. See page 79 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4024, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4024, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4024, column 57. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 4025, column 28. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4033, column 42. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4033, column 42. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4034, column 17. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4034, column 21. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 4045, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4046, column 19. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 4048, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4053, column 3. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4054, column 47. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4054, column 78. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4055, column 11. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 4055, column 11. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4058, column 47. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4059, column 11. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 4059, column 11. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4062, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4063, column 37. Don't use whitespace at the end of lines. (Severity: 1) -"unless" block used at line 4066, column 3. See page 97 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4067, column 16. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4067, column 22. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4067, column 25. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4077, column 14. See page 13 of PBP. (Severity: 1) -Double-sigil dereference at line 4079, column 3. See page 228 of PBP. (Severity: 2) -Postfix control "if" used at line 4079, column 35. See pages 93,94 of PBP. (Severity: 2) -Useless interpolation of literal string at line 4084, column 32. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 4084, column 71. See page 53 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4084, column 71. See page 79 of PBP. (Severity: 2) -Useless interpolation of literal string at line 4088, column 42. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 4088, column 83. See page 53 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4088, column 83. See page 79 of PBP. (Severity: 2) -Double-sigil dereference at line 4090, column 15. See page 228 of PBP. (Severity: 2) -Useless interpolation of literal string at line 4091, column 59. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4096, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4097, column 3. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4097, column 11. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4098, column 3. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4098, column 11. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4099, column 3. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4104, column 2. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4105, column 2. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4106, column 2. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4107, column 2. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4108, column 2. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4133, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4134, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4135, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4135, column 23. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 4135, column 28. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4136, column 5. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4136, column 42. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4139, column 19. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4139, column 41. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4140, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4142, column 5. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4142, column 35. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4142, column 59. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4143, column 16. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4144, column 37. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4144, column 61. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4144, column 91. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4145, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4147, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4148, column 5. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4148, column 37. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4148, column 92. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4149, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4151, column 5. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4151, column 41. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4151, column 120. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4152, column 5. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4152, column 43. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4152, column 133. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4154, column 16. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4155, column 67. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4157, column 59. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4158, column 59. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4159, column 64. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4160, column 51. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4161, column 43. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4163, column 16. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4164, column 55. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4165, column 64. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4166, column 52. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4168, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4169, column 16. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4169, column 49. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4170, column 2. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4171, column 63. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4172, column 59. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4173, column 59. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4174, column 59. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4175, column 83. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4176, column 61. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4177, column 72. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4178, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4179, column 16. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4180, column 77. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4182, column 78. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4183, column 1. Don't use whitespace at the end of lines. (Severity: 1) -List declaration without trailing comma at line 4184, column 15. See page 17 of PBP. (Severity: 1) -String *may* require interpolation at line 4185, column 2. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4186, column 2. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4186, column 42. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4187, column 2. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4190, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 4191, column 63. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4192, column 59. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4193, column 59. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4194, column 59. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4195, column 83. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4196, column 61. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4197, column 72. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4198, column 5. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 4198, column 48. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4199, column 1. Don't use whitespace at the end of lines. (Severity: 1) -List declaration without trailing comma at line 4200, column 15. See page 17 of PBP. (Severity: 1) -String *may* require interpolation at line 4201, column 2. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4202, column 2. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4202, column 80. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4203, column 2. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4206, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4207, column 28. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4208, column 17. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4208, column 67. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4209, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4209, column 23. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 4209, column 28. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4210, column 5. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4210, column 7. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4211, column 17. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4211, column 48. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4212, column 46. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 4213, column 65. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4214, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4215, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4217, column 2. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4219, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4220, column 28. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4221, column 17. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4221, column 67. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 4222, column 2. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4223, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4224, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4224, column 23. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 4224, column 28. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4225, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4226, column 5. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4226, column 7. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 4227, column 17. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4227, column 47. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 4228, column 2. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4229, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4230, column 46. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4231, column 64. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 4232, column 2. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4233, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Expression form of "eval" at line 4242, column 13. See page 161 of PBP. (Severity: 5) -Builtin function called with parentheses at line 4242, column 13. See page 13 of PBP. (Severity: 1) -Magic punctuation variable $@ used at line 4244, column 45. See page 79 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 4245, column 4. See pages 208,278 of PBP. (Severity: 1) -Magic punctuation variable $@ used in interpolated string at line 4245, column 10. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4256, column 14. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4258, column 14. See page 79 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4259, column 15. See page 13 of PBP. (Severity: 1) -Double-sigil dereference at line 4259, column 37. See page 228 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4259, column 49. See page 13 of PBP. (Severity: 1) -Double-sigil dereference at line 4259, column 54. See page 228 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4260, column 26. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4261, column 35. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 4262, column 4. See pages 208,278 of PBP. (Severity: 1) -"unless" block used at line 4265, column 4. See page 97 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 4266, column 5. See pages 208,278 of PBP. (Severity: 1) -Magic punctuation variable $@ used in interpolated string at line 4268, column 16. See page 79 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 4277, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4279, column 5. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4279, column 82. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4281, column 95. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4283, column 23. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4284, column 32. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4289, column 5. See page 53 of PBP. (Severity: 2) -Use character classes for literal metachars instead of escapes at line 4297, column 17. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 4297, column 17. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4297, column 17. See page 237 of PBP. (Severity: 2) -Use character classes for literal metachars instead of escapes at line 4300, column 28. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 4300, column 28. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4300, column 28. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4301, column 23. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4306, column 17. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4312, column 6. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4315, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4317, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4324, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4325, column 14. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 4325, column 21. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4325, column 21. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4326, column 38. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4326, column 44. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4329, column 18. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4329, column 24. See page 53 of PBP. (Severity: 2) -Subroutine "flagsCase" is not all lower case or all upper case at line 4334, column 1. See pages 45,46 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4336, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4337, column 14. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 4337, column 21. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4337, column 21. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4338, column 34. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4338, column 40. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4339, column 53. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4339, column 78. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4341, column 18. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4341, column 24. See page 53 of PBP. (Severity: 2) -Subroutine "tests_flagsCase" is not all lower case or all upper case at line 4346, column 1. See pages 45,46 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4352, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4363, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4364, column 31. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4365, column 41. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 4365, column 67. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4365, column 77. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4366, column 41. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4366, column 69. See page 13 of PBP. (Severity: 1) -String *may* require interpolation at line 4379, column 27. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4379, column 38. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4380, column 27. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 4380, column 38. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4389, column 24. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4401, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4407, column 9. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4408, column 18. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4408, column 45. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4408, column 72. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4414, column 49. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4415, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4416, column 22. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4420, column 26. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4420, column 53. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4420, column 80. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4424, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4425, column 14. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4439, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 4449, column 50. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4450, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4451, column 40. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4454, column 45. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4455, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4456, column 14. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4460, column 18. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4460, column 45. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4460, column 72. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4463, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4464, column 14. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 4465, column 3. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4472, column 7. See page 13 of PBP. (Severity: 1) -Long number not separated with underscores at line 4472, column 63. See page 59 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4473, column 7. See page 13 of PBP. (Severity: 1) -Long number not separated with underscores at line 4473, column 63. See page 59 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4477, column 8. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4478, column 4. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4480, column 8. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4481, column 4. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4490, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4492, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4493, column 7. See page 13 of PBP. (Severity: 1) -Long number not separated with underscores at line 4494, column 45. See page 59 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4496, column 7. See page 13 of PBP. (Severity: 1) -Long number not separated with underscores at line 4497, column 46. See page 59 of PBP. (Severity: 2) -Double-sigil dereference at line 4508, column 9. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 4509, column 9. See page 228 of PBP. (Severity: 2) -"unless" block used at line 4512, column 3. See page 97 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4512, column 11. See page 13 of PBP. (Severity: 1) -"unless" block used at line 4513, column 3. See page 97 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4513, column 11. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4514, column 26. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4516, column 31. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4517, column 31. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4522, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4550, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4561, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4564, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4565, column 7. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4575, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 4576, column 22. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 4578, column 3. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 4584, column 3. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4595, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Subroutine "copy_message" with high complexity score (25) at line 4603, column 1. Consider refactoring. (Severity: 3) -Too many arguments at line 4603, column 1. See page 182 of PBP. (Severity: 3) -Found "\t" at the end of the line at line 4605, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 4609, column 42. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 4610, column 42. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4610, column 54. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 4611, column 42. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4611, column 61. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 4612, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4613, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4618, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 4619, column 7. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 4619, column 41. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 4620, column 2. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 4620, column 95. See pages 93,94 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 4622, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4632, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4633, column 18. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4633, column 45. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 4634, column 3. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4640, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4642, column 14. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4642, column 44. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4644, column 12. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4654, column 31. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4659, column 31. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 4662, column 19. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4662, column 35. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 4662, column 35. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4663, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4670, column 23. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4671, column 10. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4673, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Too many arguments at line 4679, column 1. See page 182 of PBP. (Severity: 3) -Builtin function called with parentheses at line 4684, column 14. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4686, column 102. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4691, column 14. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4696, column 15. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 4697, column 5. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4698, column 83. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 4705, column 11. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4705, column 88. Don't use whitespace at the end of lines. (Severity: 1) -Too many arguments at line 4713, column 1. See page 182 of PBP. (Severity: 3) -Found "\N{SPACE}" at the end of the line at line 4715, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4717, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4718, column 60. See page 53 of PBP. (Severity: 2) -"unless" block used at line 4720, column 2. See page 97 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4720, column 11. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4720, column 49. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4722, column 15. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4722, column 21. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4722, column 24. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4724, column 25. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 4726, column 34. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 4734, column 28. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 4735, column 18. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4736, column 80. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 4742, column 18. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4743, column 80. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 4749, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4753, column 28. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 4754, column 18. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4755, column 80. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4760, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4764, column 28. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 4765, column 18. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4766, column 80. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4771, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4772, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 4774, column 62. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4781, column 25. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 4782, column 3. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 4782, column 3. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4782, column 17. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 4785, column 49. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 4785, column 49. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4793, column 16. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 4793, column 16. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 4801, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 4803, column 41. See page 51 of PBP. (Severity: 1) -Use only '//' or '{}' to delimit regexps at line 4815, column 15. See page 246 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 4815, column 15. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4815, column 15. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 4820, column 37. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 4821, column 64. See pages 93,94 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 4822, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4828, column 16. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4829, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4832, column 60. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4840, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4840, column 21. See page 53 of PBP. (Severity: 2) -String *may* require interpolation at line 4843, column 63. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4880, column 6. See page 53 of PBP. (Severity: 2) -Too many arguments at line 4902, column 1. See page 182 of PBP. (Severity: 3) -Found "\t" at the end of the line at line 4904, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 4911, column 63. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4922, column 20. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4922, column 20. See page 237 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4932, column 52. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 4935, column 4. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4935, column 80. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 4937, column 45. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 4940, column 75. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4940, column 75. See page 237 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 4942, column 44. Don't use whitespace at the end of lines. (Severity: 1) -Reused variable name in lexical scope: $total_bytes_transferred at line 4963, column 2. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $nb_msg_transferred at line 4963, column 2. Invent unique variable names. (Severity: 3) -Builtin function called with parentheses at line 4968, column 10. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 4969, column 17. See page 13 of PBP. (Severity: 1) -Reused variable name in lexical scope: $nb_msg_transferred at line 4976, column 9. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $maxmessagespersecond at line 4976, column 9. Invent unique variable names. (Severity: 3) -Builtin function called with parentheses at line 4977, column 20. See page 13 of PBP. (Severity: 1) -Reused variable name in lexical scope: $total_bytes_transferred at line 4997, column 9. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $maxbytespersecond at line 4997, column 9. Invent unique variable names. (Severity: 3) -Builtin function called with parentheses at line 4998, column 20. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5016, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5021, column 24. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 5022, column 21. See page 51 of PBP. (Severity: 1) -Postfix control "if" used at line 5022, column 36. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 5023, column 2. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 5027, column 30. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5035, column 10. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 5036, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 5040, column 17. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5040, column 26. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5054, column 41. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5055, column 42. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5056, column 42. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5064, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5067, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 5068, column 2. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5068, column 22. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5069, column 2. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5069, column 22. See page 228 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5070, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 5071, column 26. See page 228 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5074, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5075, column 72. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5080, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 5085, column 9. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 5088, column 6. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5096, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 5098, column 12. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5122, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5125, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 5128, column 37. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5129, column 37. See page 228 of PBP. (Severity: 2) -Use character classes for literal metachars instead of escapes at line 5142, column 23. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 5142, column 23. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5142, column 23. See page 237 of PBP. (Severity: 2) -Use [\[\]] instead of \[|\] at line 5162, column 23. See page 265 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 5162, column 23. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5162, column 23. See page 237 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 5176, column 16. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5183, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5184, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5192, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5195, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 5196, column 18. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5196, column 25. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5197, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5198, column 38. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5200, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5202, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5212, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5216, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5229, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5230, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5235, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5238, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 5241, column 37. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5242, column 37. See page 228 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5249, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5258, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5259, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 5263, column 15. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 5263, column 47. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 5263, column 72. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 5264, column 14. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 5264, column 38. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5265, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5278, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5283, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5284, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5284, column 43. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5284, column 54. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5284, column 65. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5284, column 76. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 43. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 54. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 65. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 76. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 87. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 5286, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 5287, column 33. See page 51 of PBP. (Severity: 1) -Double-sigil dereference at line 5288, column 34. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5289, column 34. See page 228 of PBP. (Severity: 2) -String *may* require interpolation at line 5292, column 9. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 5293, column 9. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 5294, column 11. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 5295, column 11. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5302, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 5304, column 16. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5304, column 16. See page 237 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5316, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5317, column 47. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5320, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5324, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5346, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5348, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 5349, column 78. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5350, column 21. See page 228 of PBP. (Severity: 2) -Builtin function called with parentheses at line 5353, column 19. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5353, column 102. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 5356, column 14. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 5357, column 14. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 5362, column 4. See page 13 of PBP. (Severity: 1) -Quotes used with a noisy string at line 5362, column 29. See page 53 of PBP. (Severity: 2) -Magic punctuation variable $! used in interpolated string at line 5362, column 29. See page 79 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5365, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5374, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5387, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5394, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5399, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5401, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5402, column 24. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 5404, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5406, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5407, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5408, column 24. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5411, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5425, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5438, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5445, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5450, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5452, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5453, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5454, column 24. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 5456, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5458, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5459, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5460, column 24. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 5462, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5463, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5464, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5466, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 5483, column 38. See pages 93,94 of PBP. (Severity: 2) -Useless interpolation of literal string at line 5484, column 24. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5486, column 58. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5488, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 5490, column 40. See pages 93,94 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 5491, column 93. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 5492, column 3. See pages 208,278 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5493, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 5494, column 43. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 5494, column 43. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 5494, column 50. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5494, column 77. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 5495, column 45. See page 51 of PBP. (Severity: 1) -Quotes used with a noisy string at line 5495, column 45. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 5495, column 52. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5495, column 79. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 5497, column 3. See pages 208,278 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5498, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5508, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 5509, column 3. See pages 208,278 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5514, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5533, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 5539, column 18. See pages 208,278 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5549, column 33. See page 53 of PBP. (Severity: 2) -String *may* require interpolation at line 5552, column 33. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 5552, column 46. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5553, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 5572, column 17. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 5582, column 17. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 5587, column 17. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 5591, column 17. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5592, column 77. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5593, column 24. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 5594, column 25. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 5599, column 25. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 5601, column 25. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 5605, column 25. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 5608, column 25. See pages 208,278 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5617, column 43. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5618, column 44. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5619, column 48. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5624, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5624, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5624, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5624, column 36. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5624, column 40. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5625, column 35. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5625, column 39. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5625, column 43. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5631, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a noisy string at line 5632, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5633, column 25. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5634, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5638, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5646, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Use character classes for literal metachars instead of escapes at line 5649, column 21. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 5649, column 21. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5649, column 21. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 5651, column 20. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5651, column 20. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 5665, column 31. See pages 93,94 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5668, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 5670, column 32. See pages 93,94 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5674, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5680, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 5681, column 13. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5681, column 13. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5687, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5687, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5687, column 36. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5688, column 46. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5689, column 54. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5692, column 54. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5693, column 60. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5699, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 5700, column 5. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5700, column 27. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5700, column 38. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 5703, column 11. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5703, column 30. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5703, column 45. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5704, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 5706, column 5. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5706, column 27. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 5706, column 38. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5707, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5709, column 35. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5710, column 51. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 5711, column 5. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5712, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5714, column 15. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 5714, column 17. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5715, column 15. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5717, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5718, column 46. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5721, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5722, column 53. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5725, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5726, column 62. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5729, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 5730, column 17. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5731, column 15. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 5731, column 17. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5732, column 15. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 5734, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5735, column 15. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 5735, column 17. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5738, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5739, column 53. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5742, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 5744, column 15. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 5744, column 15. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 5744, column 62. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 5747, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 5769, column 16. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 5850, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 6039, column 16. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 6040, column 16. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6040, column 112. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6126, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6173, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6174, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Expression form of "eval" at line 6186, column 13. See page 161 of PBP. (Severity: 5) -Builtin function called with parentheses at line 6186, column 13. See page 13 of PBP. (Severity: 1) -Magic punctuation variable $@ used at line 6188, column 38. See page 79 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 6189, column 4. See pages 208,278 of PBP. (Severity: 1) -Magic punctuation variable $@ used in interpolated string at line 6189, column 10. See page 79 of PBP. (Severity: 2) -Builtin function called with parentheses at line 6200, column 11. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6200, column 29. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6200, column 44. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6203, column 11. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6203, column 29. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6203, column 44. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6204, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 6206, column 11. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6206, column 29. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6206, column 44. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6207, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6209, column 20. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6209, column 31. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6210, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6212, column 20. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6212, column 31. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6213, column 1. Don't use whitespace at the end of lines. (Severity: 1) -String *may* require interpolation at line 6214, column 15. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 6215, column 21. See page 53 of PBP. (Severity: 2) -String *may* require interpolation at line 6222, column 15. See page 51 of PBP. (Severity: 1) -Numeric escapes in interpolated string at line 6224, column 21. See pages 54,55 of PBP. (Severity: 2) -String *may* require interpolation at line 6224, column 31. See page 51 of PBP. (Severity: 1) -Numeric escapes in interpolated string at line 6229, column 21. See pages 54,55 of PBP. (Severity: 2) -Useless interpolation of literal string at line 6231, column 21. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6232, column 21. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6233, column 21. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 6236, column 16. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6237, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6239, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6240, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6249, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6252, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6260, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6264, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6273, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6276, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6285, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6287, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6288, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6289, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6299, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6301, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6302, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6303, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6315, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6317, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6318, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6327, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6330, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6345, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6348, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6349, column 19. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6367, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6370, column 19. Don't use whitespace at the end of lines. (Severity: 1) -Long number not separated with underscores at line 6381, column 16. See page 59 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 6382, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6385, column 19. Don't use whitespace at the end of lines. (Severity: 1) -Long number not separated with underscores at line 6392, column 16. See page 59 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 6393, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6397, column 19. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6408, column 3. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6409, column 3. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6412, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 6421, column 22. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 6421, column 22. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 6421, column 22. See page 237 of PBP. (Severity: 2) -Magic punctuation variable $@ used at line 6422, column 8. See page 79 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 6422, column 15. See pages 208,278 of PBP. (Severity: 1) -Magic punctuation variable $@ used in interpolated string at line 6422, column 21. See page 79 of PBP. (Severity: 2) -Expression form of "eval" at line 6426, column 13. See page 161 of PBP. (Severity: 5) -Builtin function called with parentheses at line 6426, column 13. See page 13 of PBP. (Severity: 1) -Magic punctuation variable $@ used at line 6429, column 24. See page 79 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 6430, column 4. See pages 208,278 of PBP. (Severity: 1) -Magic punctuation variable $@ used in interpolated string at line 6430, column 10. See page 79 of PBP. (Severity: 2) -Long number not separated with underscores at line 6446, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6447, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6449, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6450, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6452, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6453, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6455, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6456, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6458, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6459, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6461, column 49. See page 59 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 6462, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6467, column 27. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 6470, column 23. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 6471, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 6474, column 29. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6474, column 38. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6474, column 66. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 6478, column 29. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6478, column 38. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6482, column 22. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6482, column 30. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6486, column 22. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6486, column 31. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6489, column 22. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6489, column 31. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6498, column 13. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6501, column 22. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6502, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6505, column 47. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6506, column 67. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6511, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6512, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6513, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6514, column 2. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6515, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6516, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6517, column 2. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 6517, column 65. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 6518, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6519, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6520, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6521, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6522, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6523, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6524, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6525, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6526, column 9. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6529, column 9. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6532, column 9. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6535, column 9. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6538, column 9. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6542, column 2. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6543, column 2. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6544, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6545, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6546, column 2. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6547, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6550, column 2. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6553, column 2. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6557, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6559, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6560, column 2. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6576, column 50. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6577, column 43. Don't use whitespace at the end of lines. (Severity: 1) -Too many arguments at line 6589, column 1. See page 182 of PBP. (Severity: 3) -Found "\t" at the end of the line at line 6591, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 6593, column 17. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6593, column 24. See page 13 of PBP. (Severity: 1) -Double-sigil dereference at line 6593, column 29. See page 228 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 6595, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 6597, column 3. See pages 208,278 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6598, column 24. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6600, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6603, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 6604, column 29. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6604, column 37. See page 13 of PBP. (Severity: 1) -Double-sigil dereference at line 6604, column 43. See page 228 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 6611, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6613, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6614, column 55. See page 51 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6616, column 3. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6617, column 15. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6618, column 22. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6622, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6623, column 33. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6624, column 33. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 6625, column 33. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6626, column 10. See page 13 of PBP. (Severity: 1) -Postfix control "unless" used at line 6626, column 29. See pages 96,97 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 6650, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 6652, column 23. See page 13 of PBP. (Severity: 1) -Double-sigil dereference at line 6652, column 29. See page 228 of PBP. (Severity: 2) -Builtin function called with parentheses at line 6653, column 31. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6653, column 51. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6654, column 31. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6657, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6659, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6662, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 6663, column 30. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6663, column 30. See page 237 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 6676, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 6678, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6678, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6681, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6681, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6684, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6684, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6687, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6687, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6690, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6690, column 24. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 6693, column 59. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 6693, column 98. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6693, column 98. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 6698, column 27. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 6705, column 37. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6705, column 41. See page 53 of PBP. (Severity: 2) -Numeric escapes in interpolated string at line 6711, column 51. See pages 54,55 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6721, column 21. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 6721, column 21. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6722, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 6723, column 9. See page 13 of PBP. (Severity: 1) -Magic punctuation variable $! used in interpolated string at line 6723, column 52. See page 79 of PBP. (Severity: 2) -Return value of "close" ignored at line 6725, column 9. Check the return value of "close" for success. (Severity: 2) -Return value of flagged function ignored - close at line 6725, column 9. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6734, column 2. See page 13 of PBP. (Severity: 1) -Magic punctuation variable $! used in interpolated string at line 6734, column 46. See page 79 of PBP. (Severity: 2) -Return value of "close" ignored at line 6736, column 2. Check the return value of "close" for success. (Severity: 2) -Return value of flagged function ignored - close at line 6736, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6737, column 9. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 6737, column 14. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 6743, column 2. See page 13 of PBP. (Severity: 1) -Magic punctuation variable $! used in interpolated string at line 6743, column 70. See page 79 of PBP. (Severity: 2) -File handle for "print" or "printf" is not braced at line 6744, column 2. See page 217 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6744, column 2. See pages 208,278 of PBP. (Severity: 1) -Return value of "close" ignored at line 6745, column 2. Check the return value of "close" for success. (Severity: 2) -Return value of flagged function ignored - close at line 6745, column 2. See pages 208,278 of PBP. (Severity: 1) -Backtick operator used at line 6756, column 4. Use IPC::Open3 instead. (Severity: 3) -Return value of flagged function ignored - print at line 6761, column 5. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6761, column 90. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 6763, column 5. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6769, column 2. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6774, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 6776, column 31. See pages 93,94 of PBP. (Severity: 2) -List of quoted literal words at line 6781, column 47. Use 'qw()' instead. (Severity: 2) -Useless interpolation of literal string at line 6783, column 9. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 6784, column 28. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 6785, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6787, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 6789, column 27. See pages 93,94 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 6792, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6794, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6797, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6801, column 9. See page 51 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 6802, column 28. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 6819, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Use character classes for literal metachars instead of escapes at line 6820, column 21. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 6820, column 21. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6820, column 21. See page 237 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 6830, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6832, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6836, column 10. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 6841, column 21. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6843, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Use character classes for literal metachars instead of escapes at line 6844, column 24. See page 247 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 6844, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6844, column 24. See page 237 of PBP. (Severity: 2) -Useless interpolation of literal string at line 6847, column 30. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6852, column 30. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 6853, column 29. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6853, column 29. See page 237 of PBP. (Severity: 2) -Magic punctuation variable $0 used at line 6860, column 18. See page 79 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 6865, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6868, column 42. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6869, column 13. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6869, column 34. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6875, column 17. Don't use whitespace at the end of lines. (Severity: 1) -File handle for "print" or "printf" is not braced at line 6878, column 2. See page 217 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 6878, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6883, column 2. See page 13 of PBP. (Severity: 1) -Return value of "close" ignored at line 6883, column 2. Check the return value of "close" for success. (Severity: 2) -Return value of flagged function ignored - close at line 6883, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6885, column 2. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6893, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6896, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6900, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6902, column 60. See page 51 of PBP. (Severity: 1) -Magic punctuation variable $! used in interpolated string at line 6903, column 20. See page 79 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 6905, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 6907, column 3. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6913, column 3. See page 13 of PBP. (Severity: 1) -Magic punctuation variable $@ used at line 6917, column 23. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used at line 6919, column 7. See page 79 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6919, column 13. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6919, column 13. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 6923, column 4. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6933, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 6934, column 15. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 6934, column 20. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 6934, column 20. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6934, column 23. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6935, column 37. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 6936, column 11. See page 53 of PBP. (Severity: 2) -Useless interpolation of literal string at line 6936, column 11. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6936, column 15. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6940, column 11. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 6940, column 24. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 6941, column 19. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 6956, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Backtick operator used at line 6963, column 12. Use IPC::Open3 instead. (Severity: 3) -Found "\N{SPACE}" at the end of the line at line 6966, column 13. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6979, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 6982, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Backtick operator used at line 6983, column 11. Use IPC::Open3 instead. (Severity: 3) -String delimiter used with "split" at line 6988, column 28. Express it as a regex instead. (Severity: 2) -Builtin function called with parentheses at line 6988, column 28. See page 13 of PBP. (Severity: 1) -Quotes used with a noisy string at line 6988, column 34. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 6993, column 4. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 6998, column 4. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7016, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 7018, column 34. See pages 93,94 of PBP. (Severity: 2) -Useless interpolation of literal string at line 7020, column 23. See page 51 of PBP. (Severity: 1) -Postfix control "if" used at line 7030, column 31. See pages 93,94 of PBP. (Severity: 2) -Useless interpolation of literal string at line 7032, column 23. See page 51 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 7044, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 7054, column 37. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7055, column 38. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7056, column 43. See page 51 of PBP. (Severity: 1) -Subroutine "remove_Ko" is not all lower case or all upper case at line 7060, column 1. See pages 45,46 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 7062, column 17. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7062, column 17. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7071, column 17. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7071, column 17. See page 237 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 7095, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 7105, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7105, column 19. See page 237 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 7119, column 33. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 7128, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 7131, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 7133, column 13. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7133, column 24. See page 13 of PBP. (Severity: 1) -Use character classes for literal metachars instead of escapes at line 7136, column 17. See page 247 of PBP. (Severity: 1) -Use [\+-] instead of \+|- at line 7136, column 17. See page 265 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 7136, column 17. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7136, column 17. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 7139, column 16. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7139, column 30. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 7140, column 22. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7140, column 29. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7144, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Split long regexps into smaller qr// chunks at line 7145, column 12. See page 261 of PBP. (Severity: 3) -Use character classes for literal metachars instead of escapes at line 7145, column 12. See page 247 of PBP. (Severity: 1) -Use [:\.] instead of :|\ at line 7145, column 12. See page 265 of PBP. (Severity: 1) -Use [:\.] instead of :|\ at line 7145, column 12. See page 265 of PBP. (Severity: 1) -Use [\+-] instead of \+|- at line 7145, column 12. See page 265 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 7145, column 12. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7145, column 12. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 7157, column 38. See pages 93,94 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7157, column 72. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7157, column 72. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 7158, column 38. See pages 93,94 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 7159, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 7160, column 46. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7161, column 24. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7161, column 32. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 7162, column 25. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7162, column 33. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 7163, column 24. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7163, column 32. See page 51 of PBP. (Severity: 1) -Postfix control "if" used at line 7164, column 30. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7164, column 37. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 7165, column 24. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7165, column 32. See page 51 of PBP. (Severity: 1) -Postfix control "if" used at line 7166, column 34. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7166, column 41. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7170, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Split long regexps into smaller qr// chunks at line 7171, column 12. See page 261 of PBP. (Severity: 3) -Regular expression without "/s" flag at line 7171, column 12. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7171, column 12. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7179, column 24. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7179, column 32. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 7180, column 25. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7180, column 33. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 7181, column 24. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7181, column 32. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 7182, column 24. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7182, column 32. See page 51 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 7188, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7188, column 19. See page 237 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 7199, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 7200, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7200, column 19. See page 237 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 7211, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Split long regexps into smaller qr// chunks at line 7212, column 12. See page 261 of PBP. (Severity: 3) -Regular expression without "/s" flag at line 7212, column 12. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7212, column 12. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 7218, column 29. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7219, column 24. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7219, column 32. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7223, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Split long regexps into smaller qr// chunks at line 7224, column 12. See page 261 of PBP. (Severity: 3) -Use character classes for literal metachars instead of escapes at line 7224, column 12. See page 247 of PBP. (Severity: 1) -Use [\+-] instead of \+|- at line 7224, column 12. See page 265 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 7224, column 12. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7224, column 12. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7230, column 24. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7230, column 32. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7234, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 7235, column 12. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7235, column 12. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7240, column 24. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7240, column 32. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7244, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7248, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7251, column 2. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 7256, column 5. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 7299, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 7308, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Double-sigil dereference at line 7309, column 33. See page 228 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7311, column 3. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 7323, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7327, column 35. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 7330, column 8. See page 13 of PBP. (Severity: 1) -Expression form of "eval" at line 7330, column 43. See page 161 of PBP. (Severity: 5) -Builtin function called with parentheses at line 7330, column 43. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 7331, column 4. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 7334, column 8. See page 13 of PBP. (Severity: 1) -Expression form of "eval" at line 7334, column 45. See page 161 of PBP. (Severity: 5) -Builtin function called with parentheses at line 7334, column 45. See page 13 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 7335, column 4. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 7339, column 34. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 7340, column 36. See pages 93,94 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 7342, column 4. See pages 208,278 of PBP. (Severity: 1) -Return value of flagged function ignored - print at line 7344, column 4. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7353, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 7354, column 26. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 7354, column 33. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7354, column 33. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7355, column 36. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 7362, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 7368, column 1. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7381, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7387, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7391, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 7393, column 20. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 7393, column 27. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7393, column 27. See page 237 of PBP. (Severity: 2) -Use 'eq' or hash instead of fixed-pattern regexps at line 7397, column 36. See pages 271,272 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7397, column 36. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7397, column 36. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7399, column 31. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7399, column 31. See page 237 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7403, column 25. See page 13 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 7405, column 34. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7405, column 34. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 7408, column 65. See pages 93,94 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 7424, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7440, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7441, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7444, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7447, column 26. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7450, column 37. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7453, column 28. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7456, column 21. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7461, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7470, column 60. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7481, column 12. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7482, column 105. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7513, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7514, column 20. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7517, column 26. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7520, column 37. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 7529, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 7534, column 17. See page 53 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7534, column 28. See page 13 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7538, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Split long regexps into smaller qr// chunks at line 7539, column 20. See page 261 of PBP. (Severity: 3) -Use named character classes ([A-Z] vs. [[:upper:]]) at line 7539, column 20. See page 248 of PBP. (Severity: 1) -Use character classes for literal metachars instead of escapes at line 7539, column 20. See page 247 of PBP. (Severity: 1) -Use [\+-] instead of \+|- at line 7539, column 20. See page 265 of PBP. (Severity: 1) -Regular expression without "/s" flag at line 7539, column 20. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7539, column 20. See page 237 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 7541, column 85. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7544, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 7545, column 28. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a noisy string at line 7545, column 33. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 7546, column 28. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a noisy string at line 7546, column 33. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 7547, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7548, column 88. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7550, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Local lexical variable "$header_Message_Id" is not all lower case or all upper case at line 7573, column 2. See pages 45,46 of PBP. (Severity: 1) -String *may* require interpolation at line 7573, column 58. See page 51 of PBP. (Severity: 1) -Long number not separated with underscores at line 7579, column 55. See page 59 of PBP. (Severity: 2) -Subroutine "tests_Banner" is not all lower case or all upper case at line 7584, column 1. See pages 45,46 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7587, column 50. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7588, column 42. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 7600, column 28. See page 13 of PBP. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 7606, column 28. See page 53 of PBP. (Severity: 2) -String *may* require interpolation at line 7607, column 36. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 7608, column 38. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 7609, column 42. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 7610, column 28. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 7611, column 38. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 7612, column 40. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 7613, column 41. See page 51 of PBP. (Severity: 1) -Long number not separated with underscores at line 7614, column 40. See page 59 of PBP. (Severity: 2) -String *may* require interpolation at line 7614, column 49. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 7615, column 44. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 7617, column 46. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 7618, column 48. See page 51 of PBP. (Severity: 1) -String *may* require interpolation at line 7619, column 96. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7626, column 99. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7634, column 23. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7639, column 83. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7644, column 83. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 7647, column 29. See page 53 of PBP. (Severity: 2) -Found "\N{SPACE}" at the end of the line at line 7649, column 70. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7654, column 80. Don't use whitespace at the end of lines. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7659, column 65. Don't use whitespace at the end of lines. (Severity: 1) -Found "\t" at the end of the line at line 7668, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Quotes used with a string containing no non-whitespace characters at line 7670, column 14. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7671, column 39. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7672, column 21. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 7673, column 27. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7673, column 33. See page 53 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 7674, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 7675, column 34. See page 51 of PBP. (Severity: 1) -Builtin function called with parentheses at line 7675, column 55. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 7685, column 66. See pages 93,94 of PBP. (Severity: 2) -Postfix control "unless" used at line 7688, column 18. See pages 96,97 of PBP. (Severity: 2) -Long number not separated with underscores at line 7692, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 7693, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 7694, column 57. See page 59 of PBP. (Severity: 2) -Useless interpolation of literal string at line 7694, column 69. See page 51 of PBP. (Severity: 1) -Postfix control "unless" used at line 7696, column 16. See pages 96,97 of PBP. (Severity: 2) -"grep" used in boolean context at line 7706, column 12. See pages 71,72 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7706, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 7706, column 19. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 7706, column 19. See page 237 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 7710, column 2. See pages 208,278 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 7715, column 12. Don't use whitespace at the end of lines. (Severity: 1) -Builtin function called with parentheses at line 7721, column 12. See page 13 of PBP. (Severity: 1) -Found "\t" at the end of the line at line 7740, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Magic punctuation variable $! used in interpolated string at line 7748, column 36. See page 79 of PBP. (Severity: 2) -Close filehandles as soon as possible after opening them at line 7750, column 2. See page 209 of PBP. (Severity: 4) -Found "\N{SPACE}" at the end of the line at line 7750, column 37. Don't use whitespace at the end of lines. (Severity: 1) -Magic punctuation variable $! used in interpolated string at line 7751, column 14. See page 79 of PBP. (Severity: 2) -Magic variable "*STDERR" should be assigned as "local" at line 7753, column 10. See pages 81,82 of PBP. (Severity: 4) -Double-sigil dereference at line 7753, column 12. See page 228 of PBP. (Severity: 2) -One-argument "select" used at line 7754, column 2. See page 224 of PBP. (Severity: 4) -Quotes used with a string containing no non-whitespace characters at line 7761, column 25. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 7762, column 43. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 7762, column 51. See page 13 of PBP. (Severity: 1) -Quotes used with a noisy string at line 7763, column 54. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 7763, column 60. See page 53 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 7764, column 9. See pages 208,278 of PBP. (Severity: 1) -Magic punctuation variable $0 used in interpolated here-document at line 7764, column 15. See page 79 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 8052, column 2. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 8078, column 15. See page 13 of PBP. (Severity: 1) -Builtin function called with parentheses at line 8079, column 15. See page 13 of PBP. (Severity: 1) -Numeric escapes in interpolated string at line 8079, column 21. See pages 54,55 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 8080, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Regular expression without "/s" flag at line 8081, column 16. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 8081, column 16. See page 237 of PBP. (Severity: 2) -Return value of flagged function ignored - print at line 8082, column 3. See pages 208,278 of PBP. (Severity: 1) -Builtin function called with parentheses at line 8083, column 3. See page 13 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8086, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8087, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8088, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8089, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8090, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8091, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8092, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8093, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8094, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8095, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8096, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8097, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8099, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8100, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8101, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8102, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8103, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8104, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8105, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8106, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8107, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8108, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8109, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8110, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8111, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8112, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8113, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8114, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8115, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8116, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8117, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8118, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8119, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8120, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8121, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8122, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8123, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8124, column 2. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8125, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8126, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8127, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8128, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8129, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8130, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8131, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8132, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8133, column 2. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 8133, column 38. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 8134, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8135, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8136, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8137, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8138, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8139, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8140, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8141, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8142, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8143, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8144, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8145, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8146, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8147, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8148, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8149, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8150, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8151, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8152, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8153, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8154, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8155, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8156, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8157, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8158, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8159, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8160, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8161, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8162, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8163, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8164, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8165, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8166, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8167, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8168, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8169, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8170, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8171, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8172, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8173, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8174, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8175, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8176, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8177, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8178, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8179, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8180, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8181, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8182, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8183, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8184, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8185, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8186, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8187, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8188, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8189, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8190, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8191, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8192, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8193, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8194, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8195, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8196, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8197, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8198, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8199, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8200, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8201, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8202, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8203, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8204, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8205, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8206, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8207, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8208, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8209, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8210, column 9. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 8210, column 47. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 8211, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8212, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8213, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8214, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8215, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8216, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8217, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8218, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8219, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8220, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8221, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8222, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8223, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8224, column 9. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 8224, column 46. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 8225, column 9. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 8225, column 52. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 8226, column 9. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 8226, column 52. Don't use whitespace at the end of lines. (Severity: 1) -Useless interpolation of literal string at line 8227, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8228, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8229, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8230, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8231, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8232, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8233, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8234, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8235, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8236, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8237, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8238, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8239, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8240, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8241, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8242, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8243, column 9. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8244, column 9. See page 51 of PBP. (Severity: 1) -Found "\N{SPACE}" at the end of the line at line 8248, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Return value of flagged function ignored - print at line 8250, column 9. See pages 208,278 of PBP. (Severity: 1) -Postfix control "if" used at line 8250, column 51. See pages 93,94 of PBP. (Severity: 2) -Found "\t" at the end of the line at line 8260, column 1. Don't use whitespace at the end of lines. (Severity: 1) -Postfix control "if" used at line 8261, column 12. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 8265, column 23. See page 13 of PBP. (Severity: 1) -Postfix control "if" used at line 8265, column 32. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 8268, column 9. See page 13 of PBP. (Severity: 1) -Postfix control "unless" used at line 8268, column 30. See pages 96,97 of PBP. (Severity: 2) -Postfix control "if" used at line 8271, column 16. See pages 93,94 of PBP. (Severity: 2) -Useless interpolation of literal string at line 8277, column 11. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8278, column 11. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8279, column 15. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8280, column 11. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8281, column 11. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8282, column 14. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8288, column 8. See page 51 of PBP. (Severity: 1) -Postfix control "if" used at line 8288, column 32. See pages 93,94 of PBP. (Severity: 2) -Useless interpolation of literal string at line 8316, column 22. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8324, column 22. See page 51 of PBP. (Severity: 1) -Postfix control "if" used at line 8324, column 46. See pages 93,94 of PBP. (Severity: 2) -Useless interpolation of literal string at line 8351, column 61. See page 51 of PBP. (Severity: 1) -Useless interpolation of literal string at line 8388, column 22. See page 51 of PBP. (Severity: 1) -Subroutine "Tls" is not all lower case or all upper case at line 8399, column 1. See pages 45,46 of PBP. (Severity: 1) -Builtin function called with parentheses at line 8402, column 7. See page 13 of PBP. (Severity: 1) -Subroutine "Reconnect_counter" is not all lower case or all upper case at line 8406, column 1. See pages 45,46 of PBP. (Severity: 1) -Postfix control "if" used at line 8409, column 33. See pages 93,94 of PBP. (Severity: 2) -Builtin function called with parentheses at line 8410, column 7. See page 13 of PBP. (Severity: 1) -Subroutine "Banner" is not all lower case or all upper case at line 8415, column 1. See pages 45,46 of PBP. (Severity: 1) +Reused variable name in lexical scope: $sync at line 2255, column 2. Invent unique variable names. (Severity: 3) +Local lexical variable "$Side" is not all lower case or all upper case at line 2268, column 2. See pages 45,46 of PBP. (Severity: 1) +String *may* require interpolation at line 2304, column 35. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 2313, column 35. See page 51 of PBP. (Severity: 1) +Quotes used with a noisy string at line 2351, column 37. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 2351, column 48. See page 53 of PBP. (Severity: 2) +Reused variable name in lexical scope: $sync at line 2365, column 2. Invent unique variable names. (Severity: 3) +Local lexical variable "$Side" is not all lower case or all upper case at line 2367, column 9. See pages 45,46 of PBP. (Severity: 1) +Use character classes for literal metachars instead of escapes at line 2414, column 29. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 2414, column 29. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 2414, column 29. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 2414, column 29. See page 237 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 2436, column 31. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 2436, column 31. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 2436, column 31. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 2436, column 31. See page 237 of PBP. (Severity: 2) +Reused variable name in lexical scope: $sync at line 2445, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2468, column 2. Invent unique variable names. (Severity: 3) +Regular expression without "/s" flag at line 2501, column 30. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 2501, column 30. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 2501, column 30. See page 237 of PBP. (Severity: 2) +Reused variable name in lexical scope: $sync at line 2512, column 53. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2520, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2570, column 2. Invent unique variable names. (Severity: 3) +Regular expression without "/s" flag at line 2607, column 26. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 2607, column 26. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 2607, column 26. See page 237 of PBP. (Severity: 2) +Builtin function called with parentheses at line 2615, column 37. See page 13 of PBP. (Severity: 1) +Postfix control "if" used at line 2621, column 25. See pages 93,94 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 2628, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 2633, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Builtin function called with parentheses at line 2655, column 37. See page 13 of PBP. (Severity: 1) +Too many arguments at line 2727, column 1. See page 182 of PBP. (Severity: 3) +Too many arguments at line 2745, column 1. See page 182 of PBP. (Severity: 3) +Too many arguments at line 2755, column 1. See page 182 of PBP. (Severity: 3) +Builtin function called with parentheses at line 2770, column 22. See page 13 of PBP. (Severity: 1) +Builtin function called with parentheses at line 2771, column 22. See page 13 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 2801, column 17. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 2801, column 17. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 2817, column 61. See pages 93,94 of PBP. (Severity: 2) +Subroutine "modulesversion" with high complexity score (27) at line 2868, column 1. Consider refactoring. (Severity: 3) +Regular expression without "/s" flag at line 2966, column 16. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 2966, column 16. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 2996, column 45. See page 53 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 3034, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 3051, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Too many arguments at line 3075, column 1. See page 182 of PBP. (Severity: 3) +Local lexical variable "$Side" is not all lower case or all upper case at line 3076, column 2. See pages 45,46 of PBP. (Severity: 1) +Magic punctuation variable $@ used in interpolated string at line 3085, column 18. See page 79 of PBP. (Severity: 2) +Local lexical variable "$Side" is not all lower case or all upper case at line 3103, column 2. See pages 45,46 of PBP. (Severity: 1) +Magic punctuation variable $@ used in interpolated string at line 3115, column 17. See page 79 of PBP. (Severity: 2) +Subroutine "authenticate_imap" with high complexity score (21) at line 3144, column 1. Consider refactoring. (Severity: 3) +Too many arguments at line 3144, column 1. See page 182 of PBP. (Severity: 3) +Local lexical variable "$Side" is not all lower case or all upper case at line 3146, column 2. See pages 45,46 of PBP. (Severity: 1) +Postfix control "unless" used at line 3158, column 51. See pages 96,97 of PBP. (Severity: 2) +Postfix control "if" used at line 3162, column 33. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 3163, column 33. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 3164, column 35. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 3166, column 32. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 3170, column 2. See page 97 of PBP. (Severity: 2) +Local lexical variable "$Side" is not all lower case or all upper case at line 3200, column 2. See pages 45,46 of PBP. (Severity: 1) +Postfix control "if" used at line 3238, column 45. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 3262, column 45. See pages 93,94 of PBP. (Severity: 2) +Too many arguments at line 3274, column 1. See page 182 of PBP. (Severity: 3) +Local lexical variable "$Side" is not all lower case or all upper case at line 3275, column 2. See pages 45,46 of PBP. (Severity: 1) +Postfix control "if" used at line 3298, column 43. See pages 93,94 of PBP. (Severity: 2) +Numeric escapes in interpolated string at line 3311, column 32. See pages 54,55 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 3358, column 32. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 3358, column 32. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3358, column 32. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3358, column 32. See page 237 of PBP. (Severity: 2) +Builtin function called with parentheses at line 3362, column 13. See page 13 of PBP. (Severity: 1) +Magic punctuation variable $! used in interpolated string at line 3362, column 60. See page 79 of PBP. (Severity: 2) +Use "local $/ = undef" or File::Slurp instead of joined readline at line 3363, column 43. See page 213 of PBP. (Severity: 3) +Return value of "close" ignored at line 3364, column 13. Check the return value of "close" for success. (Severity: 2) +Return value of flagged function ignored - close at line 3364, column 13. See pages 208,278 of PBP. (Severity: 1) +Use named character classes ([A-Za-z] vs. [[:alpha:]]) at line 3373, column 69. See page 248 of PBP. (Severity: 1) +Use character classes for literal metachars instead of escapes at line 3373, column 69. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 3373, column 69. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3373, column 69. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3373, column 69. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 3376, column 37. See pages 93,94 of PBP. (Severity: 2) +Backtick operator used at line 3381, column 20. Use IPC::Open3 instead. (Severity: 3) +"unless" block used at line 3406, column 9. See page 97 of PBP. (Severity: 2) +Useless interpolation of literal string at line 3416, column 69. See page 51 of PBP. (Severity: 1) +Useless interpolation of literal string at line 3416, column 112. See page 51 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 3440, column 32. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 3440, column 32. See page 237 of PBP. (Severity: 2) +String *may* require interpolation at line 3509, column 3. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 3510, column 3. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 3511, column 3. See page 51 of PBP. (Severity: 1) +Magic punctuation variable $0 used in interpolated string at line 3514, column 3. See page 79 of PBP. (Severity: 2) +Builtin function called with parentheses at line 3533, column 70. See page 13 of PBP. (Severity: 1) +Return value of eval not tested at line 3538, column 2. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) +Quotes used with a noisy string at line 3539, column 11. See page 53 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 3539, column 11. See page 79 of PBP. (Severity: 2) +Postfix control "if" used at line 3539, column 18. See pages 93,94 of PBP. (Severity: 2) +Magic punctuation variable $@ used at line 3539, column 23. See page 79 of PBP. (Severity: 2) +Constant "$NB_UNIX_tests_is_valid_directory" is not all upper case at line 3545, column 9. See pages 45,46 of PBP. (Severity: 1) +Postfix control "if" used at line 3547, column 68. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 3548, column 32. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 3551, column 32. See page 53 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 3561, column 1. Don't use whitespace at the end of lines. (Severity: 1) +File handle for "print" or "printf" is not braced at line 3577, column 2. See page 217 of PBP. (Severity: 1) +Return value of flagged function ignored - print at line 3577, column 2. See pages 208,278 of PBP. (Severity: 1) +Return value of "close" ignored at line 3578, column 2. Check the return value of "close" for success. (Severity: 2) +Return value of flagged function ignored - close at line 3578, column 2. See pages 208,278 of PBP. (Severity: 1) +Return value of "close" ignored at line 3598, column 17. Check the return value of "close" for success. (Severity: 2) +Return value of flagged function ignored - close at line 3598, column 17. See pages 208,278 of PBP. (Severity: 1) +"die" used instead of "croak" at line 3606, column 2. See page 283 of PBP. (Severity: 3) +Magic punctuation variable $0 used in interpolated string at line 3611, column 13. See page 79 of PBP. (Severity: 2) +Subroutine "fix_Inbox_INBOX_mapping" is not all lower case or all upper case at line 3616, column 1. See pages 45,46 of PBP. (Severity: 1) +String *may* require interpolation at line 3623, column 77. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 3624, column 77. See page 51 of PBP. (Severity: 1) +Subroutine "tests_fix_Inbox_INBOX_mapping" is not all lower case or all upper case at line 3629, column 1. See pages 45,46 of PBP. (Severity: 1) +String *may* require interpolation at line 3643, column 6. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 3647, column 6. See page 51 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 3714, column 15. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3714, column 15. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3714, column 15. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3715, column 15. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3715, column 15. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3715, column 15. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3716, column 15. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3716, column 15. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3716, column 15. See page 237 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 3725, column 8. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 3725, column 8. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3725, column 8. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3725, column 8. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3726, column 8. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3726, column 8. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3726, column 8. See page 237 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 3727, column 8. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 3727, column 8. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3727, column 8. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3727, column 8. See page 237 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 3770, column 31. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 3770, column 31. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3770, column 31. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3770, column 31. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3857, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3857, column 24. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3857, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3860, column 20. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3860, column 20. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3860, column 20. See page 237 of PBP. (Severity: 2) +Postfix control "unless" used at line 4057, column 18. See pages 96,97 of PBP. (Severity: 2) +Use 'eq' or hash instead of fixed-pattern regexps at line 4061, column 24. See pages 271,272 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4061, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4061, column 24. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4061, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4062, column 19. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4062, column 19. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4062, column 19. See page 237 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 4066, column 19. See page 247 of PBP. (Severity: 1) +Use [\.\/] instead of \.|\/ at line 4066, column 19. See page 265 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 4066, column 19. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4066, column 19. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4066, column 19. See page 237 of PBP. (Severity: 2) +Local lexical variable "$Side" is not all lower case or all upper case at line 4092, column 2. See pages 45,46 of PBP. (Severity: 1) +Quotes used with a noisy string at line 4136, column 12. See page 53 of PBP. (Severity: 2) +Postfix control "while" used at line 4136, column 20. See page 96 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4136, column 39. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4136, column 39. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4136, column 39. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4137, column 12. See page 53 of PBP. (Severity: 2) +Postfix control "while" used at line 4137, column 20. See page 96 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 4137, column 39. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 4137, column 39. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4137, column 39. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4137, column 39. See page 237 of PBP. (Severity: 2) +Postfix control "while" used at line 4138, column 22. See page 96 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4138, column 41. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4138, column 41. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4138, column 41. See page 237 of PBP. (Severity: 2) +Forbid $b before $a in sort blocks at line 4140, column 20. See page 152 of PBP. (Severity: 1) +Quotes used with a noisy string at line 4147, column 6. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4148, column 6. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4149, column 6. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4150, column 6. See page 53 of PBP. (Severity: 2) +Local lexical variable "$Side" is not all lower case or all upper case at line 4156, column 2. See pages 45,46 of PBP. (Severity: 1) +Quotes used with a noisy string at line 4241, column 46. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4241, column 51. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4242, column 48. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4242, column 53. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4243, column 48. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4243, column 53. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4244, column 48. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4244, column 53. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4245, column 50. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4245, column 55. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4247, column 50. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4247, column 55. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4249, column 50. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4249, column 55. See page 53 of PBP. (Severity: 2) +Numeric escapes in interpolated string at line 4259, column 14. See pages 54,55 of PBP. (Severity: 2) +Use only '//' or '{}' to delimit regexps at line 4262, column 14. See page 246 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 4262, column 14. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4262, column 14. See page 237 of PBP. (Severity: 2) +Use only '//' or '{}' to delimit regexps at line 4263, column 14. See page 246 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 4263, column 14. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4263, column 14. See page 237 of PBP. (Severity: 2) +Use only '//' or '{}' to delimit regexps at line 4264, column 14. See page 246 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 4264, column 14. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4264, column 14. See page 237 of PBP. (Severity: 2) +Use only '//' or '{}' to delimit regexps at line 4265, column 21. See page 246 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 4265, column 21. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4265, column 21. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 4265, column 30. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4265, column 49. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4265, column 74. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4273, column 11. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4274, column 11. See page 53 of PBP. (Severity: 2) +String *may* require interpolation at line 4308, column 18. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4309, column 48. See page 51 of PBP. (Severity: 1) +Quotes used with a noisy string at line 4320, column 11. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4321, column 11. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4336, column 11. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4337, column 11. See page 53 of PBP. (Severity: 2) +String *may* require interpolation at line 4340, column 18. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4343, column 18. See page 51 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 4375, column 14. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4375, column 14. See page 237 of PBP. (Severity: 2) +Postfix control "unless" used at line 4381, column 4. See pages 96,97 of PBP. (Severity: 2) +Use 'eq' or hash instead of fixed-pattern regexps at line 4381, column 66. See pages 271,272 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4381, column 66. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4381, column 66. See page 237 of PBP. (Severity: 2) +Expression form of "eval" at line 4391, column 13. See page 161 of PBP. (Severity: 5) +Magic punctuation variable $@ used at line 4393, column 48. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4394, column 15. See page 79 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4404, column 28. See page 53 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4412, column 42. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4412, column 42. See page 237 of PBP. (Severity: 2) +"unless" block used at line 4445, column 3. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 4458, column 39. See pages 93,94 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4464, column 53. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4472, column 53. See page 79 of PBP. (Severity: 2) +Single-quote used as quote-like operator delimiter at line 4522, column 6. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4522, column 6. See page 51 of PBP. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4522, column 45. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4522, column 45. See page 51 of PBP. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4528, column 6. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4528, column 6. See page 51 of PBP. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4528, column 38. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4528, column 38. See page 51 of PBP. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4529, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4529, column 17. See page 51 of PBP. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4530, column 39. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4530, column 39. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4530, column 65. See page 51 of PBP. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4534, column 6. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4534, column 6. See page 51 of PBP. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4534, column 40. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4534, column 40. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4537, column 6. See page 51 of PBP. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4537, column 45. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4537, column 45. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4537, column 84. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4538, column 6. See page 51 of PBP. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4538, column 45. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4538, column 45. See page 51 of PBP. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 4538, column 94. Don't use whitespace at the end of lines. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4539, column 22. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4539, column 22. See page 51 of PBP. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4541, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4541, column 17. See page 51 of PBP. (Severity: 1) +Found "\t" at the end of the line at line 4543, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4550, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4550, column 17. See page 51 of PBP. (Severity: 1) +Found "\t" at the end of the line at line 4554, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Single-quote used as quote-like operator delimiter at line 4556, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +String *may* require interpolation at line 4556, column 17. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4557, column 5. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4566, column 16. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4567, column 77. See page 51 of PBP. (Severity: 1) +List declaration without trailing comma at line 4571, column 15. See page 17 of PBP. (Severity: 1) +String *may* require interpolation at line 4572, column 2. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4573, column 2. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4574, column 2. See page 51 of PBP. (Severity: 1) +List declaration without trailing comma at line 4587, column 15. See page 17 of PBP. (Severity: 1) +String *may* require interpolation at line 4588, column 2. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4589, column 2. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4590, column 2. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4595, column 21. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4598, column 20. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4604, column 2. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4608, column 17. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4614, column 17. See page 51 of PBP. (Severity: 1) +Expression form of "eval" at line 4629, column 13. See page 161 of PBP. (Severity: 5) +Magic punctuation variable $@ used at line 4631, column 45. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4632, column 13. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4643, column 17. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4645, column 17. See page 79 of PBP. (Severity: 2) +"unless" block used at line 4652, column 4. See page 97 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4655, column 19. See page 79 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 4684, column 17. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 4684, column 17. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4684, column 17. See page 237 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 4687, column 28. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 4687, column 28. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4687, column 28. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4712, column 21. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4712, column 21. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4724, column 20. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4724, column 20. See page 237 of PBP. (Severity: 2) +Found "\t" at the end of the line at line 4752, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Builtin function called with parentheses at line 4753, column 14. See page 13 of PBP. (Severity: 1) +String *may* require interpolation at line 4766, column 27. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4766, column 38. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4767, column 27. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 4767, column 38. See page 51 of PBP. (Severity: 1) +"unless" block used at line 4899, column 3. See page 97 of PBP. (Severity: 2) +"unless" block used at line 4900, column 3. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 4963, column 22. See pages 93,94 of PBP. (Severity: 2) +Subroutine "copy_message" with high complexity score (25) at line 4990, column 1. Consider refactoring. (Severity: 3) +Too many arguments at line 4990, column 1. See page 182 of PBP. (Severity: 3) +Reused variable name in lexical scope: $sync at line 4993, column 2. Invent unique variable names. (Severity: 3) +Postfix control "if" used at line 5007, column 100. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 5057, column 19. See pages 93,94 of PBP. (Severity: 2) +Too many arguments at line 5074, column 1. See page 182 of PBP. (Severity: 3) +Subroutine "message_for_host2" with high complexity score (27) at line 5107, column 1. Consider refactoring. (Severity: 3) +Too many arguments at line 5107, column 1. See page 182 of PBP. (Severity: 3) +Reused variable name in lexical scope: $sync at line 5129, column 2. Invent unique variable names. (Severity: 3) +"unless" block used at line 5150, column 2. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 5156, column 34. See pages 93,94 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 5222, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Reused variable name in lexical scope: $sync at line 5223, column 9. Invent unique variable names. (Severity: 3) +Found "\N{SPACE}" at the end of the line at line 5224, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Local lexical variable "$imapT" is not all lower case or all upper case at line 5229, column 9. See pages 45,46 of PBP. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 5232, column 1. Don't use whitespace at the end of lines. (Severity: 1) +9 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5235, column 21. Unnamed numeric literals make code less maintainable. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 5235, column 24. Don't use whitespace at the end of lines. (Severity: 1) +Quotes used with a string containing no non-whitespace characters at line 5236, column 21. See page 53 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 5236, column 25. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 5240, column 41. Don't use whitespace at the end of lines. (Severity: 1) +Reused variable name in lexical scope: $string_ref at line 5242, column 25. Invent unique variable names. (Severity: 3) +9 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5247, column 13. Unnamed numeric literals make code less maintainable. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 5247, column 120. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 5250, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Constant "$NB_WIN_tests_message_for_host2" is not all upper case at line 5255, column 17. See pages 45,46 of PBP. (Severity: 1) +Postfix control "if" used at line 5256, column 61. See pages 93,94 of PBP. (Severity: 2) +Constant "$NB_UNX_tests_message_for_host2" is not all upper case at line 5264, column 17. See pages 45,46 of PBP. (Severity: 1) +Postfix control "if" used at line 5265, column 58. See pages 93,94 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 5267, column 1. Don't use whitespace at the end of lines. (Severity: 1) +9 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5270, column 21. Unnamed numeric literals make code less maintainable. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 5270, column 128. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 5274, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 5277, column 132. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 5283, column 132. Don't use whitespace at the end of lines. (Severity: 1) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5303, column 13. Unnamed numeric literals make code less maintainable. (Severity: 2) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5304, column 13. Unnamed numeric literals make code less maintainable. (Severity: 2) +Use only '//' or '{}' to delimit regexps at line 5333, column 15. See page 246 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 5333, column 15. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5333, column 15. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 5338, column 37. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 5339, column 64. See pages 93,94 of PBP. (Severity: 2) +String *may* require interpolation at line 5361, column 63. See page 51 of PBP. (Severity: 1) +Too many arguments at line 5419, column 1. See page 182 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 5445, column 20. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5445, column 20. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 5463, column 75. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5463, column 75. See page 237 of PBP. (Severity: 2) +Reused variable name in lexical scope: $total_bytes_transferred at line 5486, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $nb_msg_transferred at line 5486, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $nb_msg_transferred at line 5499, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $maxmessagespersecond at line 5499, column 9. Invent unique variable names. (Severity: 3) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5508, column 31. Unnamed numeric literals make code less maintainable. (Severity: 2) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5509, column 31. Unnamed numeric literals make code less maintainable. (Severity: 2) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5510, column 31. Unnamed numeric literals make code less maintainable. (Severity: 2) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5511, column 31. Unnamed numeric literals make code less maintainable. (Severity: 2) +8 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5512, column 31. Unnamed numeric literals make code less maintainable. (Severity: 2) +Reused variable name in lexical scope: $total_bytes_transferred at line 5520, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $maxbytespersecond at line 5520, column 9. Invent unique variable names. (Severity: 3) +Postfix control "if" used at line 5545, column 36. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 5550, column 30. See pages 93,94 of PBP. (Severity: 2) +Reused variable name in lexical scope: $h1_nb_msg_start at line 5557, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $h1_nb_msg_start at line 5568, column 2. Invent unique variable names. (Severity: 3) +Use character classes for literal metachars instead of escapes at line 5665, column 23. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 5665, column 23. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5665, column 23. See page 237 of PBP. (Severity: 2) +Use [\[\]] instead of \[|\] at line 5685, column 23. See page 265 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 5685, column 23. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5685, column 23. See page 237 of PBP. (Severity: 2) +String *may* require interpolation at line 5783, column 15. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 5783, column 47. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 5783, column 72. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 5784, column 14. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 5784, column 38. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 5807, column 33. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 5812, column 9. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 5813, column 9. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 5814, column 11. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 5815, column 11. See page 51 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 5824, column 16. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5824, column 16. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 5882, column 29. See page 53 of PBP. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 5882, column 29. See page 79 of PBP. (Severity: 2) +Postfix control "if" used at line 6003, column 38. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 6010, column 40. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6014, column 45. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6015, column 45. See page 53 of PBP. (Severity: 2) +String *may* require interpolation at line 6072, column 33. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 6072, column 46. See page 51 of PBP. (Severity: 1) +Quotes used with a noisy string at line 6144, column 6. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6152, column 25. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6153, column 25. See page 53 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 6169, column 21. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 6169, column 21. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 6169, column 21. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 6171, column 20. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 6171, column 20. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 6185, column 31. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 6190, column 32. See pages 93,94 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 6201, column 13. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 6201, column 13. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6207, column 38. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6208, column 46. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6209, column 54. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6212, column 54. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6213, column 60. See page 53 of PBP. (Severity: 2) +String *may* require interpolation at line 6250, column 17. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 6289, column 16. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 6559, column 16. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 6560, column 16. See page 51 of PBP. (Severity: 1) +Expression form of "eval" at line 6706, column 13. See page 161 of PBP. (Severity: 5) +Magic punctuation variable $@ used at line 6708, column 38. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 6709, column 13. See page 79 of PBP. (Severity: 2) +String *may* require interpolation at line 6734, column 15. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 6742, column 15. See page 51 of PBP. (Severity: 1) +Numeric escapes in interpolated string at line 6744, column 21. See pages 54,55 of PBP. (Severity: 2) +String *may* require interpolation at line 6744, column 31. See page 51 of PBP. (Severity: 1) +Numeric escapes in interpolated string at line 6749, column 21. See pages 54,55 of PBP. (Severity: 2) +String *may* require interpolation at line 6756, column 16. See page 51 of PBP. (Severity: 1) +Long number not separated with underscores at line 6901, column 16. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6912, column 16. See page 59 of PBP. (Severity: 2) +Magic punctuation variable $% used in interpolated string at line 6928, column 3. See page 79 of PBP. (Severity: 2) +Long number not separated with underscores at line 6928, column 87. See page 59 of PBP. (Severity: 2) +Expression form of "eval" at line 6942, column 13. See page 161 of PBP. (Severity: 5) +Magic punctuation variable $@ used at line 6945, column 24. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 6946, column 13. See page 79 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 6962, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Long number not separated with underscores at line 6966, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6967, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6969, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6970, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6972, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6973, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6975, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6976, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6978, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6979, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6981, column 49. See page 59 of PBP. (Severity: 2) +Builtin function called with parentheses at line 6992, column 16. See page 13 of PBP. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 7000, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 7033, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Postfix control "if" used at line 7053, column 69. See pages 93,94 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 7088, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 7092, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 7099, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Subroutine "diff_or_NA" is not all lower case or all upper case at line 7111, column 1. See pages 45,46 of PBP. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 7113, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 7117, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 7118, column 37. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 7122, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 7128, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Use named character classes ([0-9] vs. \d) at line 7132, column 21. See page 248 of PBP. (Severity: 1) +Use character classes for literal metachars instead of escapes at line 7132, column 21. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 7132, column 21. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7132, column 21. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7132, column 21. See page 237 of PBP. (Severity: 2) +Subroutine "tests_diff_or_NA" is not all lower case or all upper case at line 7155, column 1. See pages 45,46 of PBP. (Severity: 1) +Too many arguments at line 7204, column 1. See page 182 of PBP. (Severity: 3) +Postfix control "unless" used at line 7241, column 27. See pages 96,97 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7278, column 30. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7278, column 30. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7293, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7293, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7296, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7296, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7299, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7299, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7302, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7302, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7305, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7305, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7308, column 97. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7308, column 97. See page 237 of PBP. (Severity: 2) +Numeric escapes in interpolated string at line 7326, column 51. See pages 54,55 of PBP. (Severity: 2) +Close filehandles as soon as possible after opening them at line 7338, column 9. See page 209 of PBP. (Severity: 4) +Magic punctuation variable $! used in interpolated string at line 7339, column 26. See page 79 of PBP. (Severity: 2) +Return value of "close" ignored at line 7343, column 9. Check the return value of "close" for success. (Severity: 2) +Return value of flagged function ignored - close at line 7343, column 9. See pages 208,278 of PBP. (Severity: 1) +Magic punctuation variable $! used in interpolated string at line 7364, column 42. See page 79 of PBP. (Severity: 2) +Return value of "close" ignored at line 7366, column 2. Check the return value of "close" for success. (Severity: 2) +Return value of flagged function ignored - close at line 7366, column 2. See pages 208,278 of PBP. (Severity: 1) +Builtin function called with parentheses at line 7373, column 2. See page 13 of PBP. (Severity: 1) +Magic punctuation variable $! used in interpolated string at line 7373, column 70. See page 79 of PBP. (Severity: 2) +File handle for "print" or "printf" is not braced at line 7374, column 2. See page 217 of PBP. (Severity: 1) +Return value of flagged function ignored - print at line 7374, column 2. See pages 208,278 of PBP. (Severity: 1) +Return value of "close" ignored at line 7375, column 2. Check the return value of "close" for success. (Severity: 2) +Return value of flagged function ignored - close at line 7375, column 2. See pages 208,278 of PBP. (Severity: 1) +Literal line breaks in a string at line 7379, column 1. See pages 60,61 of PBP. (Severity: 3) +String *may* require interpolation at line 7379, column 1. See page 51 of PBP. (Severity: 1) +Postfix control "if" used at line 7393, column 3. See pages 93,94 of PBP. (Severity: 2) +Backtick operator used at line 7403, column 17. Use IPC::Open3 instead. (Severity: 3) +Builtin function called with parentheses at line 7406, column 17. See page 13 of PBP. (Severity: 1) +Builtin function called with parentheses at line 7408, column 34. See page 13 of PBP. (Severity: 1) +Constant "$NB_WIN_tests_pipemess" is not all upper case at line 7441, column 17. See pages 45,46 of PBP. (Severity: 1) +Postfix control "if" used at line 7442, column 52. See pages 93,94 of PBP. (Severity: 2) +Local lexical variable "$stringT" is not all lower case or all upper case at line 7454, column 9. See pages 45,46 of PBP. (Severity: 1) +Local lexical variable "$errorT" is not all lower case or all upper case at line 7454, column 9. See pages 45,46 of PBP. (Severity: 1) +Constant "$NB_UNX_tests_pipemess" is not all upper case at line 7457, column 17. See pages 45,46 of PBP. (Severity: 1) +Postfix control "if" used at line 7458, column 49. See pages 93,94 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 7486, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Split long regexps into smaller qr// chunks at line 7489, column 32. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7489, column 32. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7489, column 32. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7489, column 32. See page 237 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7493, column 32. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7493, column 32. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7493, column 32. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7493, column 32. See page 237 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 7499, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Regular expression without "/s" flag at line 7502, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7502, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7502, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7507, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7507, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7507, column 33. See page 237 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7511, column 33. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7511, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7511, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7511, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7514, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7514, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7515, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7515, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7515, column 33. See page 237 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7521, column 24. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7521, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7521, column 24. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7521, column 24. See page 237 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 7537, column 21. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 7537, column 21. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7537, column 21. See page 237 of PBP. (Severity: 2) +String *may* require interpolation at line 7558, column 21. See page 51 of PBP. (Severity: 1) +Use character classes for literal metachars instead of escapes at line 7561, column 24. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 7561, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7561, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7570, column 29. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7570, column 29. See page 237 of PBP. (Severity: 2) +Magic punctuation variable $0 used at line 7577, column 18. See page 79 of PBP. (Severity: 2) +File handle for "print" or "printf" is not braced at line 7595, column 2. See page 217 of PBP. (Severity: 1) +Return value of flagged function ignored - print at line 7595, column 2. See pages 208,278 of PBP. (Severity: 1) +Return value of "close" ignored at line 7600, column 2. Check the return value of "close" for success. (Severity: 2) +Return value of flagged function ignored - close at line 7600, column 2. See pages 208,278 of PBP. (Severity: 1) +Magic punctuation variable $! used in interpolated string at line 7620, column 23. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used at line 7634, column 23. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used at line 7636, column 7. See page 79 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7636, column 13. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7636, column 13. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7671, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7671, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7671, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7672, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7672, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7672, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7673, column 43. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7673, column 43. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7673, column 43. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7675, column 36. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7675, column 36. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7675, column 36. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7676, column 37. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7676, column 37. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7676, column 37. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7677, column 38. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7677, column 38. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7677, column 38. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7679, column 30. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7679, column 30. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7679, column 30. See page 237 of PBP. (Severity: 2) +Backtick operator used at line 7696, column 12. Use IPC::Open3 instead. (Severity: 3) +Found "\N{SPACE}" at the end of the line at line 7702, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Backtick operator used at line 7718, column 11. Use IPC::Open3 instead. (Severity: 3) +String delimiter used with "split" at line 7723, column 28. Express it as a regex instead. (Severity: 2) +Quotes used with a noisy string at line 7723, column 34. See page 53 of PBP. (Severity: 2) +Postfix control "if" used at line 7753, column 34. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 7765, column 31. See pages 93,94 of PBP. (Severity: 2) +Subroutine "remove_Ko" is not all lower case or all upper case at line 7795, column 1. See pages 45,46 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 7797, column 17. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7797, column 17. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7806, column 17. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7806, column 17. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7826, column 19. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7826, column 19. See page 237 of PBP. (Severity: 2) +Use character classes for literal metachars instead of escapes at line 7857, column 17. See page 247 of PBP. (Severity: 1) +Use [\+-] instead of \+|- at line 7857, column 17. See page 265 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 7857, column 17. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7857, column 17. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 7860, column 16. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 7861, column 22. See pages 93,94 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7866, column 12. See page 261 of PBP. (Severity: 3) +Use character classes for literal metachars instead of escapes at line 7866, column 12. See page 247 of PBP. (Severity: 1) +Use [:\.] instead of :|\ at line 7866, column 12. See page 265 of PBP. (Severity: 1) +Use [:\.] instead of :|\ at line 7866, column 12. See page 265 of PBP. (Severity: 1) +Use [\+-] instead of \+|- at line 7866, column 12. See page 265 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 7866, column 12. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7866, column 12. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 7878, column 38. See pages 93,94 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7878, column 72. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7878, column 72. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 7879, column 38. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 7881, column 46. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 7885, column 30. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 7887, column 33. See pages 93,94 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7892, column 12. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7892, column 12. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7892, column 12. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7909, column 19. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7909, column 19. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7921, column 19. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7921, column 19. See page 237 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7933, column 12. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7933, column 12. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7933, column 12. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 7939, column 29. See pages 93,94 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7945, column 12. See page 261 of PBP. (Severity: 3) +Use character classes for literal metachars instead of escapes at line 7945, column 12. See page 247 of PBP. (Severity: 1) +Use [\+-] instead of \+|- at line 7945, column 12. See page 265 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 7945, column 12. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7945, column 12. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7956, column 12. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7956, column 12. See page 237 of PBP. (Severity: 2) +Expression form of "eval" at line 8051, column 42. See page 161 of PBP. (Severity: 5) +Expression form of "eval" at line 8055, column 44. See page 161 of PBP. (Severity: 5) +Postfix control "if" used at line 8060, column 34. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 8061, column 36. See pages 93,94 of PBP. (Severity: 2) +Local lexical variable "$Side" is not all lower case or all upper case at line 8072, column 9. See pages 45,46 of PBP. (Severity: 1) +Reused variable name in lexical scope: $sync at line 8072, column 9. Invent unique variable names. (Severity: 3) +Found "\N{SPACE}" at the end of the line at line 8077, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Reused variable name in lexical scope: $sync at line 8093, column 9. Invent unique variable names. (Severity: 3) +Found "\N{SPACE}" at the end of the line at line 8099, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 8126, column 31. Don't use whitespace at the end of lines. (Severity: 1) +Reused variable name in lexical scope: $sync at line 8145, column 9. Invent unique variable names. (Severity: 3) +Found "\N{SPACE}" at the end of the line at line 8146, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Local lexical variable "$Side" is not all lower case or all upper case at line 8159, column 9. See pages 45,46 of PBP. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 8161, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Local lexical variable "$syncT" is not all lower case or all upper case at line 8173, column 9. See pages 45,46 of PBP. (Severity: 1) +Local lexical variable "$imapT" is not all lower case or all upper case at line 8175, column 9. See pages 45,46 of PBP. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 8178, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 8189, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 8210, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Local lexical variable "$syncT" is not all lower case or all upper case at line 8277, column 9. See pages 45,46 of PBP. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 8281, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Found "\N{SPACE}" at the end of the line at line 8286, column 1. Don't use whitespace at the end of lines. (Severity: 1) +Regular expression without "/s" flag at line 8296, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8296, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 8335, column 26. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8335, column 26. See page 237 of PBP. (Severity: 2) +Use 'eq' or hash instead of fixed-pattern regexps at line 8339, column 36. See pages 271,272 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 8339, column 36. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8339, column 36. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 8341, column 31. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8341, column 31. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 8347, column 34. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8347, column 34. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 8350, column 68. See pages 93,94 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 8481, column 20. See page 261 of PBP. (Severity: 3) +Use named character classes ([A-Z] vs. [[:upper:]]) at line 8481, column 20. See page 248 of PBP. (Severity: 1) +Use character classes for literal metachars instead of escapes at line 8481, column 20. See page 247 of PBP. (Severity: 1) +Use [\+-] instead of \+|- at line 8481, column 20. See page 265 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 8481, column 20. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8481, column 20. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 8487, column 28. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 8487, column 33. See page 53 of PBP. (Severity: 2) +Postfix control "if" used at line 8488, column 36. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 8488, column 41. See page 53 of PBP. (Severity: 2) +Local lexical variable "$header_Message_Id" is not all lower case or all upper case at line 8515, column 2. See pages 45,46 of PBP. (Severity: 1) +String *may* require interpolation at line 8515, column 58. See page 51 of PBP. (Severity: 1) +Long number not separated with underscores at line 8521, column 55. See page 59 of PBP. (Severity: 2) +Subroutine "tests_Banner" is not all lower case or all upper case at line 8526, column 1. See pages 45,46 of PBP. (Severity: 1) +String *may* require interpolation at line 8549, column 36. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 8550, column 38. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 8551, column 42. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 8553, column 38. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 8554, column 40. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 8555, column 41. See page 51 of PBP. (Severity: 1) +Long number not separated with underscores at line 8556, column 40. See page 59 of PBP. (Severity: 2) +String *may* require interpolation at line 8556, column 49. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 8557, column 44. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 8559, column 46. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 8560, column 48. See page 51 of PBP. (Severity: 1) +String *may* require interpolation at line 8561, column 96. See page 51 of PBP. (Severity: 1) +Quotes used with a noisy string at line 8615, column 27. See page 53 of PBP. (Severity: 2) +Postfix control "if" used at line 8627, column 66. See pages 93,94 of PBP. (Severity: 2) +Postfix control "unless" used at line 8630, column 18. See pages 96,97 of PBP. (Severity: 2) +Long number not separated with underscores at line 8634, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 8635, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 8636, column 57. See page 59 of PBP. (Severity: 2) +Postfix control "unless" used at line 8638, column 16. See pages 96,97 of PBP. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 8691, column 36. See page 79 of PBP. (Severity: 2) +Close filehandles as soon as possible after opening them at line 8693, column 2. See page 209 of PBP. (Severity: 4) +Magic punctuation variable $! used in interpolated string at line 8694, column 14. See page 79 of PBP. (Severity: 2) +Magic variable "*STDERR" should be assigned as "local" at line 8696, column 10. See pages 81,82 of PBP. (Severity: 4) +Double-sigil dereference at line 8696, column 12. See page 228 of PBP. (Severity: 2) +One-argument "select" used at line 8697, column 2. See page 224 of PBP. (Severity: 4) +Postfix control "if" used at line 8717, column 43. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 8718, column 54. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 8718, column 60. See page 53 of PBP. (Severity: 2) +Magic punctuation variable $0 used in interpolated here-document at line 8719, column 18. See page 79 of PBP. (Severity: 2) +Numeric escapes in interpolated string at line 9035, column 20. See pages 54,55 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9037, column 16. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 9037, column 16. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 9214, column 58. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 9230, column 29. See pages 93,94 of PBP. (Severity: 2) +Postfix control "unless" used at line 9233, column 24. See pages 96,97 of PBP. (Severity: 2) +Postfix control "if" used at line 9236, column 16. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 9253, column 46. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 9281, column 46. See pages 93,94 of PBP. (Severity: 2) +Found "\N{SPACE}" at the end of the line at line 9347, column 38. Don't use whitespace at the end of lines. (Severity: 1) +Subroutine "Tls" is not all lower case or all upper case at line 9364, column 1. See pages 45,46 of PBP. (Severity: 1) +Subroutine "Reconnect_counter" is not all lower case or all upper case at line 9371, column 1. See pages 45,46 of PBP. (Severity: 1) +Postfix control "if" used at line 9374, column 33. See pages 93,94 of PBP. (Severity: 2) +Subroutine "Banner" is not all lower case or all upper case at line 9380, column 1. See pages 45,46 of PBP. (Severity: 1) +Multiple "package" declarations at line 9395, column 1. Limit to one per file. (Severity: 4) +Subroutine "GetOptions" is not all lower case or all upper case at line 9407, column 1. See pages 45,46 of PBP. (Severity: 1) +Subroutine "GetOptions" with high complexity score (32) at line 9407, column 1. Consider refactoring. (Severity: 3) +Use character classes for literal metachars instead of escapes at line 9425, column 22. See page 247 of PBP. (Severity: 1) +Regular expression without "/s" flag at line 9425, column 22. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9425, column 22. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9425, column 22. See page 237 of PBP. (Severity: 2) +String delimiter used with "split" at line 9430, column 21. Express it as a regex instead. (Severity: 2) +Quotes used with a noisy string at line 9430, column 27. See page 53 of PBP. (Severity: 2) +Capture variable used outside conditional at line 9430, column 32. See page 253 of PBP. (Severity: 3) +Quotes used with a noisy string at line 9432, column 28. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 9437, column 32. See page 53 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9438, column 42. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9438, column 42. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9438, column 42. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9439, column 30. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9439, column 30. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9439, column 30. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9443, column 35. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9443, column 35. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9443, column 35. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9460, column 30. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9460, column 30. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9460, column 30. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9462, column 35. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9462, column 35. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9462, column 35. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 9465, column 36. See page 53 of PBP. (Severity: 2) + + 1 files. + 263 subroutines/methods. +8,603 statements. + +9,486 lines, consisting of: + 1,684 blank lines. + 551 comment lines. + 0 data lines. + 6,579 lines of Perl code. + 672 lines of POD. + +Average McCabe score of subroutines was 4.35. + +858 violations. +Violations per file was 858.000. +Violations per statement was 0.100. +Violations per line of code was 0.090. + + 6 severity 5 violations. + 5 severity 4 violations. +120 severity 3 violations. +475 severity 2 violations. +252 severity 1 violations. + + 1 violations of BuiltinFunctions::ProhibitReverseSortBlock. + 6 violations of BuiltinFunctions::ProhibitStringyEval. + 2 violations of BuiltinFunctions::ProhibitStringySplit. + 12 violations of CodeLayout::ProhibitParensWithBuiltins. + 57 violations of CodeLayout::ProhibitTrailingWhitespace. + 1 violations of CodeLayout::RequireTidyCode. + 2 violations of CodeLayout::RequireTrailingCommas. + 1 violations of ControlStructures::ProhibitDeepNests. +109 violations of ControlStructures::ProhibitPostfixControls. + 19 violations of ControlStructures::ProhibitUnlessBlocks. + 1 violations of Documentation::PodSpelling. + 1 violations of Documentation::RequirePodAtEnd. + 3 violations of Documentation::RequirePodSections. + 1 violations of ErrorHandling::RequireCarping. + 1 violations of ErrorHandling::RequireCheckingReturnValueOfEval. + 4 violations of InputOutput::ProhibitBacktickOperators. + 1 violations of InputOutput::ProhibitJoinedReadline. + 1 violations of InputOutput::ProhibitOneArgSelect. + 3 violations of InputOutput::RequireBracedFileHandleWithPrint. + 2 violations of InputOutput::RequireBriefOpen. + 7 violations of InputOutput::RequireCheckedClose. + 12 violations of InputOutput::RequireCheckedSyscalls. + 1 violations of Modules::ProhibitExcessMainComplexity. + 1 violations of Modules::ProhibitMultiplePackages. + 35 violations of NamingConventions::Capitalization. + 1 violations of References::ProhibitDoubleSigils. + 1 violations of RegularExpressions::ProhibitCaptureWithoutTest. + 9 violations of RegularExpressions::ProhibitComplexRegexes. + 3 violations of RegularExpressions::ProhibitEnumeratedClasses. + 21 violations of RegularExpressions::ProhibitEscapedMetacharacters. + 3 violations of RegularExpressions::ProhibitFixedStringMatches. + 8 violations of RegularExpressions::ProhibitSingleCharAlternation. + 5 violations of RegularExpressions::ProhibitUnusualDelimiters. +100 violations of RegularExpressions::RequireDotMatchAnything. + 44 violations of RegularExpressions::RequireExtendedFormatting. +100 violations of RegularExpressions::RequireLineBoundaryMatching. + 5 violations of Subroutines::ProhibitExcessComplexity. + 11 violations of Subroutines::ProhibitManyArgs. + 1 violations of ValuesAndExpressions::ProhibitEmptyQuotes. + 6 violations of ValuesAndExpressions::ProhibitEscapedCharacters. + 1 violations of ValuesAndExpressions::ProhibitImplicitNewlines. + 2 violations of ValuesAndExpressions::ProhibitInterpolationOfLiterals. + 10 violations of ValuesAndExpressions::ProhibitMagicNumbers. + 56 violations of ValuesAndExpressions::ProhibitNoisyQuotes. + 16 violations of ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters. + 88 violations of ValuesAndExpressions::RequireInterpolationOfMetachars. + 22 violations of ValuesAndExpressions::RequireNumberSeparators. + 36 violations of Variables::ProhibitPunctuationVars. + 22 violations of Variables::ProhibitReusedNames. + 2 violations of Variables::ProhibitUnusedVariables. + 1 violations of Variables::RequireLocalizedPunctuationVars. diff --git a/W/perlcritic_2.out b/W/perlcritic_2.out index 1e67cca..49d5616 100644 --- a/W/perlcritic_2.out +++ b/W/perlcritic_2.out @@ -1,796 +1,665 @@ -Main code has high complexity score (400) at line 1, column 1. Consider refactoring. (Severity: 3) -Missing "REQUIRED ARGUMENTS" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) +Main code has high complexity score (401) at line 1, column 1. Consider refactoring. (Severity: 3) Missing "DIAGNOSTICS" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) -Missing "CONFIGURATION" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) Missing "DEPENDENCIES" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) Missing "INCOMPATIBILITIES" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) -Missing "BUGS AND LIMITATIONS" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) -Missing "LICENSE AND COPYRIGHT" section in POD at line 18, column 1. See pages 133,138 of PBP. (Severity: 2) -Magic punctuation variable $| used at line 680, column 3. See page 79 of PBP. (Severity: 2) -"$ssl1_SSL_version" is declared but not used at line 712, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) -"$ssl2_SSL_version" is declared but not used at line 712, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) -64 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 857, column 10. Unnamed numeric literals make code less maintainable. (Severity: 2) -50 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 873, column 66. Unnamed numeric literals make code less maintainable. (Severity: 2) -Postfix control "if" used at line 878, column 31. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 886, column 114. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 897, column 65. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 926, column 15. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 927, column 21. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 933, column 25. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 941, column 24. See pages 93,94 of PBP. (Severity: 2) -Magic punctuation variable $! used in interpolated string at line 950, column 40. See page 79 of PBP. (Severity: 2) -Postfix control "if" used at line 951, column 27. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 975, column 17. See pages 93,94 of PBP. (Severity: 2) -100 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 978, column 13. Unnamed numeric literals make code less maintainable. (Severity: 2) -100 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 979, column 13. Unnamed numeric literals make code less maintainable. (Severity: 2) -993 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 982, column 24. Unnamed numeric literals make code less maintainable. (Severity: 2) -143 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 982, column 30. Unnamed numeric literals make code less maintainable. (Severity: 2) -993 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 985, column 24. Unnamed numeric literals make code less maintainable. (Severity: 2) -143 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 985, column 30. Unnamed numeric literals make code less maintainable. (Severity: 2) -Postfix control "if" used at line 987, column 31. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 988, column 12. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1002, column 5. See pages 93,94 of PBP. (Severity: 2) -3 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 1029, column 21. Unnamed numeric literals make code less maintainable. (Severity: 2) -4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 1044, column 14. Unnamed numeric literals make code less maintainable. (Severity: 2) -Long number not separated with underscores at line 1119, column 20. See page 59 of PBP. (Severity: 2) -Postfix control "unless" used at line 1121, column 43. See pages 96,97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1161, column 19. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 1162, column 50. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1164, column 22. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1165, column 22. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1177, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1188, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1198, column 26. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1209, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1219, column 28. See page 53 of PBP. (Severity: 2) -Postfix control "unless" used at line 1242, column 43. See pages 96,97 of PBP. (Severity: 2) -Postfix control "unless" used at line 1244, column 43. See pages 96,97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1247, column 34. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1248, column 34. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 1341, column 33. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 1341, column 33. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 1341, column 33. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 1350, column 33. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 1350, column 33. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 1350, column 33. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 1456, column 3. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1481, column 28. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 1491, column 17. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1492, column 17. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1514, column 17. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1517, column 34. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1575, column 3. See page 97 of PBP. (Severity: 2) -"unless" block used at line 1581, column 3. See page 97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1613, column 50. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1614, column 50. See page 53 of PBP. (Severity: 2) -Double-sigil dereference at line 1624, column 39. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 1626, column 50. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 1636, column 49. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 1637, column 30. See page 228 of PBP. (Severity: 2) -Postfix control "if" used at line 1655, column 57. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1665, column 77. See pages 93,94 of PBP. (Severity: 2) -Double-sigil dereference at line 1668, column 2. See page 228 of PBP. (Severity: 2) -Postfix control "if" used at line 1673, column 5. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1678, column 3. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1681, column 2. See page 97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1682, column 21. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1683, column 54. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 1718, column 79. See pages 93,94 of PBP. (Severity: 2) -Double-sigil dereference at line 1722, column 2. See page 228 of PBP. (Severity: 2) -Postfix control "if" used at line 1727, column 3. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1732, column 3. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1762, column 10. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1782, column 33. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1783, column 4. See page 97 of PBP. (Severity: 2) -Postfix control "if" used at line 1791, column 39. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1795, column 38. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1804, column 4. See page 97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1806, column 45. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 1807, column 31. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 1807, column 31. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 1809, column 7. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1810, column 32. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1811, column 5. See page 97 of PBP. (Severity: 2) -Postfix control "if" used at line 1819, column 52. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1820, column 4. See page 97 of PBP. (Severity: 2) -Postfix control "if" used at line 1829, column 39. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1833, column 38. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1842, column 4. See page 97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 1843, column 49. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 1844, column 31. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 1844, column 31. See page 237 of PBP. (Severity: 2) -"unless" block used at line 1845, column 5. See page 97 of PBP. (Severity: 2) -Postfix control "if" used at line 1874, column 70. See pages 93,94 of PBP. (Severity: 2) -Code structure is deeply nested at line 1875, column 41. Consider refactoring. (Severity: 3) -"unless" block used at line 1875, column 41. See page 97 of PBP. (Severity: 2) -Postfix control "if" used at line 1886, column 39. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 1890, column 38. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 1987, column 3. See page 97 of PBP. (Severity: 2) -"unless" block used at line 1991, column 3. See page 97 of PBP. (Severity: 2) -Postfix control "if" used at line 2011, column 30. See pages 93,94 of PBP. (Severity: 2) -Postfix control "unless" used at line 2024, column 20. See pages 96,97 of PBP. (Severity: 2) -Postfix control "unless" used at line 2025, column 20. See pages 96,97 of PBP. (Severity: 2) -Postfix control "if" used at line 2027, column 22. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2030, column 118. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2031, column 33. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2032, column 17. See pages 93,94 of PBP. (Severity: 2) -Reused variable name in lexical scope: $sync at line 2040, column 2. Invent unique variable names. (Severity: 3) -Quotes used with a string containing no non-whitespace characters at line 2055, column 12. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2056, column 25. See page 53 of PBP. (Severity: 2) -Hard tabs used at line 2066, column 22. See page 20 of PBP. (Severity: 3) -Quotes used with a string containing no non-whitespace characters at line 2124, column 15. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2136, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2136, column 35. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2136, column 46. See page 53 of PBP. (Severity: 2) -Reused variable name in lexical scope: $sync at line 2150, column 2. Invent unique variable names. (Severity: 3) -Long number not separated with underscores at line 2191, column 13. See page 59 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 2199, column 29. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 2199, column 29. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 2199, column 29. See page 237 of PBP. (Severity: 2) -Double-sigil dereference at line 2199, column 77. See page 228 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 2221, column 31. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 2221, column 31. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 2221, column 31. See page 237 of PBP. (Severity: 2) -Double-sigil dereference at line 2221, column 79. See page 228 of PBP. (Severity: 2) -Reused variable name in lexical scope: $sync at line 2230, column 2. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $sync at line 2253, column 2. Invent unique variable names. (Severity: 3) -Regular expression without "/s" flag at line 2286, column 30. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 2286, column 30. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 2286, column 30. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2291, column 13. See page 53 of PBP. (Severity: 2) -Reused variable name in lexical scope: $sync at line 2297, column 53. Invent unique variable names. (Severity: 3) -Quotes used with a string containing no non-whitespace characters at line 2298, column 70. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2299, column 13. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2299, column 67. See page 53 of PBP. (Severity: 2) -Reused variable name in lexical scope: $sync at line 2305, column 2. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $sync at line 2353, column 2. Invent unique variable names. (Severity: 3) -Double-sigil dereference at line 2388, column 21. See page 228 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 2389, column 26. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 2389, column 26. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 2389, column 26. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2394, column 43. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2397, column 43. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 2403, column 20. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2411, column 28. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 2411, column 43. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2416, column 24. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2424, column 20. See page 53 of PBP. (Severity: 2) -Reused variable name in lexical scope: $nb_errors at line 2437, column 2. Invent unique variable names. (Severity: 3) -Too many arguments at line 2473, column 1. See page 182 of PBP. (Severity: 3) -Quotes used with a string containing no non-whitespace characters at line 2483, column 58. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2484, column 58. See page 53 of PBP. (Severity: 2) -Too many arguments at line 2491, column 1. See page 182 of PBP. (Severity: 3) -Too many arguments at line 2501, column 1. See page 182 of PBP. (Severity: 3) -Quotes used with a string containing no non-whitespace characters at line 2516, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2517, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2528, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2529, column 26. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2539, column 28. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 2547, column 17. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 2547, column 17. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2557, column 55. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2558, column 74. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 2563, column 58. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2595, column 23. See page 53 of PBP. (Severity: 2) -Subroutine "modules_VERSION" with high complexity score (26) at line 2619, column 1. Consider refactoring. (Severity: 3) -Quotes used with a noisy string at line 2624, column 77. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2627, column 65. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2630, column 73. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2633, column 77. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2636, column 76. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2639, column 68. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2642, column 73. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2645, column 67. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2648, column 77. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2651, column 79. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2654, column 71. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2657, column 65. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2660, column 67. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2663, column 75. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2666, column 59. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2669, column 87. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2672, column 69. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2675, column 67. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2678, column 69. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2681, column 53. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2684, column 73. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2687, column 83. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2690, column 51. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2693, column 73. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 2696, column 83. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 2711, column 15. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 2711, column 15. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2723, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2730, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2773, column 35. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2776, column 35. See page 53 of PBP. (Severity: 2) -Too many arguments at line 2782, column 1. See page 182 of PBP. (Severity: 3) -Magic punctuation variable $@ used in interpolated string at line 2792, column 18. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 2822, column 17. See page 79 of PBP. (Severity: 2) -Subroutine "authenticate_imap" with high complexity score (21) at line 2851, column 1. Consider refactoring. (Severity: 3) -Too many arguments at line 2851, column 1. See page 182 of PBP. (Severity: 3) -Quotes used with a string containing no non-whitespace characters at line 2862, column 38. See page 53 of PBP. (Severity: 2) -Postfix control "unless" used at line 2865, column 51. See pages 96,97 of PBP. (Severity: 2) -Postfix control "if" used at line 2869, column 33. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2870, column 33. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2871, column 35. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2873, column 32. See pages 93,94 of PBP. (Severity: 2) -"unless" block used at line 2877, column 2. See page 97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 2888, column 24. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 2945, column 48. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 2969, column 48. See pages 93,94 of PBP. (Severity: 2) -Too many arguments at line 2981, column 1. See page 182 of PBP. (Severity: 3) -Postfix control "if" used at line 3005, column 41. See pages 93,94 of PBP. (Severity: 2) -Numeric escapes in interpolated string at line 3018, column 30. See pages 54,55 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3020, column 41. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3057, column 62. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3057, column 62. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3057, column 62. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 3060, column 33. See pages 93,94 of PBP. (Severity: 2) -Backtick operator used at line 3065, column 19. Use IPC::Open3 instead. (Severity: 3) -"unless" block used at line 3089, column 9. See page 97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3099, column 119. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3121, column 32. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3121, column 32. See page 237 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3134, column 65. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3137, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3140, column 39. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3149, column 82. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3158, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3158, column 45. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3158, column 61. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3161, column 22. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3164, column 39. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3175, column 41. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3188, column 29. See page 53 of PBP. (Severity: 2) -Magic punctuation variable $0 used in interpolated string at line 3194, column 5. See page 79 of PBP. (Severity: 2) -Return value of eval not tested at line 3203, column 2. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) -Return value of "close" ignored at line 3228, column 2. Check the return value of "close" for success. (Severity: 2) -"die" used instead of "croak" at line 3248, column 2. See page 283 of PBP. (Severity: 3) -Magic punctuation variable $0 used in interpolated string at line 3253, column 13. See page 79 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3261, column 14. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3263, column 79. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3264, column 79. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3275, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3276, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3277, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3279, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3280, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3281, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3283, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3284, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3287, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3288, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3291, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3292, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3293, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3295, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3296, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3297, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3305, column 14. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3313, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3314, column 31. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3339, column 31. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3356, column 15. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3356, column 15. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3356, column 15. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3357, column 15. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3357, column 15. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3357, column 15. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3358, column 15. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3358, column 15. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3358, column 15. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3367, column 8. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3367, column 8. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3367, column 8. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3368, column 8. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3368, column 8. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3368, column 8. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3369, column 8. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3369, column 8. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3369, column 8. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3379, column 21. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3395, column 31. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3395, column 31. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3395, column 31. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3408, column 21. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3431, column 22. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3477, column 25. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3477, column 25. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3477, column 25. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3480, column 20. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3480, column 20. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3480, column 20. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3481, column 27. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3487, column 22. See page 53 of PBP. (Severity: 2) -List of quoted literal words at line 3538, column 17. Use 'qw()' instead. (Severity: 2) -List of quoted literal words at line 3539, column 17. Use 'qw()' instead. (Severity: 2) -Double-sigil dereference at line 3604, column 28. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 3608, column 26. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 3617, column 36. See page 228 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3668, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3669, column 37. See page 53 of PBP. (Severity: 2) -Postfix control "unless" used at line 3677, column 18. See pages 96,97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3679, column 23. See page 53 of PBP. (Severity: 2) -Use 'eq' or hash instead of fixed-pattern regexps at line 3681, column 24. See pages 271,272 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3681, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3681, column 24. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3681, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3682, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3682, column 19. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3682, column 19. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3683, column 22. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3686, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3686, column 19. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3686, column 19. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3696, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3697, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3698, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3704, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3705, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3706, column 6. See page 53 of PBP. (Severity: 2) -Double-sigil dereference at line 3716, column 34. See page 228 of PBP. (Severity: 2) -Postfix control "unless" used at line 3751, column 18. See pages 96,97 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3756, column 12. See page 53 of PBP. (Severity: 2) -Postfix control "while" used at line 3756, column 20. See page 96 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3756, column 39. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3756, column 39. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3756, column 39. See page 237 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3757, column 12. See page 53 of PBP. (Severity: 2) -Postfix control "while" used at line 3757, column 20. See page 96 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3757, column 39. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3757, column 39. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3757, column 39. See page 237 of PBP. (Severity: 2) -Postfix control "while" used at line 3758, column 22. See page 96 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3758, column 41. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 3758, column 41. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 3758, column 41. See page 237 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3762, column 39. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3769, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3770, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3771, column 6. See page 53 of PBP. (Severity: 2) -Hard tabs used at line 3772, column 106. See page 20 of PBP. (Severity: 3) -Double-sigil dereference at line 3781, column 34. See page 228 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3849, column 21. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3857, column 38. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3858, column 38. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3858, column 42. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3860, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3860, column 30. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3860, column 34. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3860, column 38. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3861, column 46. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3861, column 50. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3862, column 46. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3862, column 51. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3863, column 48. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3863, column 53. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3864, column 48. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3864, column 53. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3865, column 48. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3865, column 53. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3866, column 50. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3866, column 55. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3868, column 50. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3868, column 55. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3870, column 50. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3870, column 55. See page 53 of PBP. (Severity: 2) -Numeric escapes in interpolated string at line 3880, column 12. See pages 54,55 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3883, column 14. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3883, column 14. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3884, column 14. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3884, column 14. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3885, column 14. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3885, column 14. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3886, column 21. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3886, column 21. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 3886, column 30. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3886, column 49. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3886, column 74. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3893, column 27. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3894, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3895, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3906, column 4. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3906, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3919, column 4. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3919, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3934, column 4. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3934, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3941, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3942, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3943, column 4. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3943, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3952, column 14. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3957, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 3958, column 11. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 3960, column 14. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 3996, column 14. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 3996, column 14. See page 237 of PBP. (Severity: 2) -Postfix control "unless" used at line 4002, column 4. See pages 96,97 of PBP. (Severity: 2) -Use 'eq' or hash instead of fixed-pattern regexps at line 4002, column 66. See pages 271,272 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4002, column 66. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4002, column 66. See page 237 of PBP. (Severity: 2) -Expression form of "eval" at line 4012, column 13. See page 161 of PBP. (Severity: 5) -Magic punctuation variable $@ used at line 4014, column 49. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4015, column 15. See page 79 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4024, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4024, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4024, column 57. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 4025, column 28. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4033, column 42. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4033, column 42. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4034, column 17. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4034, column 21. See page 53 of PBP. (Severity: 2) -"unless" block used at line 4066, column 3. See page 97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4067, column 22. See page 53 of PBP. (Severity: 2) -Double-sigil dereference at line 4079, column 3. See page 228 of PBP. (Severity: 2) -Postfix control "if" used at line 4079, column 35. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a noisy string at line 4084, column 71. See page 53 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4084, column 71. See page 79 of PBP. (Severity: 2) -Quotes used with a noisy string at line 4088, column 83. See page 53 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4088, column 83. See page 79 of PBP. (Severity: 2) -Double-sigil dereference at line 4090, column 15. See page 228 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4135, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4135, column 23. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4139, column 41. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4198, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4209, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4209, column 23. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4210, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4224, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4224, column 23. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4226, column 5. See page 53 of PBP. (Severity: 2) -Expression form of "eval" at line 4242, column 13. See page 161 of PBP. (Severity: 5) -Magic punctuation variable $@ used at line 4244, column 45. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4245, column 10. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4256, column 14. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4258, column 14. See page 79 of PBP. (Severity: 2) -Double-sigil dereference at line 4259, column 37. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 4259, column 54. See page 228 of PBP. (Severity: 2) -"unless" block used at line 4265, column 4. See page 97 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 4268, column 16. See page 79 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4279, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4289, column 5. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4297, column 17. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4297, column 17. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4300, column 28. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4300, column 28. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4301, column 23. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4306, column 17. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4312, column 6. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4325, column 21. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4325, column 21. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4326, column 44. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4329, column 24. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4337, column 21. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4337, column 21. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4338, column 40. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4341, column 24. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 4365, column 67. See pages 93,94 of PBP. (Severity: 2) -Long number not separated with underscores at line 4472, column 63. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 4473, column 63. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 4494, column 45. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 4497, column 46. See page 59 of PBP. (Severity: 2) -Double-sigil dereference at line 4508, column 9. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 4509, column 9. See page 228 of PBP. (Severity: 2) -"unless" block used at line 4512, column 3. See page 97 of PBP. (Severity: 2) -"unless" block used at line 4513, column 3. See page 97 of PBP. (Severity: 2) -Postfix control "if" used at line 4576, column 22. See pages 93,94 of PBP. (Severity: 2) -Subroutine "copy_message" with high complexity score (25) at line 4603, column 1. Consider refactoring. (Severity: 3) -Too many arguments at line 4603, column 1. See page 182 of PBP. (Severity: 3) -Quotes used with a string containing no non-whitespace characters at line 4610, column 54. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4611, column 61. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 4619, column 41. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 4620, column 95. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 4662, column 19. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4662, column 35. See page 53 of PBP. (Severity: 2) -Too many arguments at line 4679, column 1. See page 182 of PBP. (Severity: 3) -Too many arguments at line 4713, column 1. See page 182 of PBP. (Severity: 3) -Quotes used with a string containing no non-whitespace characters at line 4718, column 60. See page 53 of PBP. (Severity: 2) -"unless" block used at line 4720, column 2. See page 97 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4722, column 21. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4724, column 25. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 4726, column 34. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a noisy string at line 4782, column 3. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 4785, column 49. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4793, column 16. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4815, column 15. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4815, column 15. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 4820, column 37. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 4821, column 64. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4828, column 16. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4840, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4840, column 21. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 4880, column 6. See page 53 of PBP. (Severity: 2) -Too many arguments at line 4902, column 1. See page 182 of PBP. (Severity: 3) -Quotes used with a string containing no non-whitespace characters at line 4911, column 63. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4922, column 20. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4922, column 20. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 4940, column 75. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 4940, column 75. See page 237 of PBP. (Severity: 2) -Reused variable name in lexical scope: $total_bytes_transferred at line 4963, column 2. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $nb_msg_transferred at line 4963, column 2. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $nb_msg_transferred at line 4976, column 9. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $maxmessagespersecond at line 4976, column 9. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $total_bytes_transferred at line 4997, column 9. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $maxbytespersecond at line 4997, column 9. Invent unique variable names. (Severity: 3) -Quotes used with a string containing no non-whitespace characters at line 5021, column 24. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 5022, column 36. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 5027, column 30. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5035, column 10. See page 53 of PBP. (Severity: 2) -Double-sigil dereference at line 5068, column 2. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5068, column 22. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5069, column 2. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5069, column 22. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5071, column 26. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5128, column 37. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5129, column 37. See page 228 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 5142, column 23. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5142, column 23. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 5162, column 23. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5162, column 23. See page 237 of PBP. (Severity: 2) -Double-sigil dereference at line 5241, column 37. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5242, column 37. See page 228 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5284, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5284, column 43. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5284, column 54. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5284, column 65. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5284, column 76. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 43. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 54. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 65. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 76. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5285, column 87. See page 53 of PBP. (Severity: 2) -Double-sigil dereference at line 5288, column 34. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5289, column 34. See page 228 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 5304, column 16. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5304, column 16. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5317, column 47. See page 53 of PBP. (Severity: 2) -Double-sigil dereference at line 5349, column 78. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 5350, column 21. See page 228 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5353, column 102. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5362, column 29. See page 53 of PBP. (Severity: 2) -Magic punctuation variable $! used in interpolated string at line 5362, column 29. See page 79 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5401, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5402, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5406, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5407, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5408, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5452, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5453, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5454, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5458, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5459, column 24. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5460, column 24. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 5483, column 38. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 5490, column 40. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5494, column 43. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5495, column 45. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5549, column 33. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5617, column 43. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5618, column 44. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5619, column 48. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5624, column 6. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5624, column 28. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5624, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5624, column 36. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5624, column 40. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5625, column 35. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5625, column 39. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5625, column 43. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5632, column 25. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5633, column 25. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 5649, column 21. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5649, column 21. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 5651, column 20. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5651, column 20. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 5665, column 31. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 5670, column 32. See pages 93,94 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 5681, column 13. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 5681, column 13. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5687, column 5. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5687, column 32. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5687, column 36. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5688, column 46. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5689, column 54. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5692, column 54. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 5693, column 60. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5714, column 15. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5715, column 15. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5731, column 15. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5732, column 15. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5735, column 15. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 5744, column 15. See page 53 of PBP. (Severity: 2) -Expression form of "eval" at line 6186, column 13. See page 161 of PBP. (Severity: 5) -Magic punctuation variable $@ used at line 6188, column 38. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 6189, column 10. See page 79 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6215, column 21. See page 53 of PBP. (Severity: 2) -Numeric escapes in interpolated string at line 6224, column 21. See pages 54,55 of PBP. (Severity: 2) -Numeric escapes in interpolated string at line 6229, column 21. See pages 54,55 of PBP. (Severity: 2) -Long number not separated with underscores at line 6381, column 16. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6392, column 16. See page 59 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6421, column 22. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 6421, column 22. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 6421, column 22. See page 237 of PBP. (Severity: 2) -Magic punctuation variable $@ used at line 6422, column 8. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 6422, column 21. See page 79 of PBP. (Severity: 2) -Expression form of "eval" at line 6426, column 13. See page 161 of PBP. (Severity: 5) -Magic punctuation variable $@ used at line 6429, column 24. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used in interpolated string at line 6430, column 10. See page 79 of PBP. (Severity: 2) -Long number not separated with underscores at line 6446, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6447, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6449, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6450, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6452, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6453, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6455, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6456, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6458, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6459, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 6461, column 49. See page 59 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6470, column 23. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 6517, column 65. See pages 93,94 of PBP. (Severity: 2) -Too many arguments at line 6589, column 1. See page 182 of PBP. (Severity: 3) -Double-sigil dereference at line 6593, column 29. See page 228 of PBP. (Severity: 2) -Double-sigil dereference at line 6604, column 43. See page 228 of PBP. (Severity: 2) -Postfix control "unless" used at line 6626, column 29. See pages 96,97 of PBP. (Severity: 2) -Double-sigil dereference at line 6652, column 29. See page 228 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6663, column 30. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6663, column 30. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6678, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6678, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6681, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6681, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6684, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6684, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6687, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6687, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6690, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6690, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6693, column 98. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6693, column 98. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6705, column 37. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6705, column 41. See page 53 of PBP. (Severity: 2) -Numeric escapes in interpolated string at line 6711, column 51. See pages 54,55 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6721, column 21. See page 53 of PBP. (Severity: 2) -Magic punctuation variable $! used in interpolated string at line 6723, column 52. See page 79 of PBP. (Severity: 2) -Return value of "close" ignored at line 6725, column 9. Check the return value of "close" for success. (Severity: 2) -Magic punctuation variable $! used in interpolated string at line 6734, column 46. See page 79 of PBP. (Severity: 2) -Return value of "close" ignored at line 6736, column 2. Check the return value of "close" for success. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6737, column 14. See page 53 of PBP. (Severity: 2) -Magic punctuation variable $! used in interpolated string at line 6743, column 70. See page 79 of PBP. (Severity: 2) -Return value of "close" ignored at line 6745, column 2. Check the return value of "close" for success. (Severity: 2) -Backtick operator used at line 6756, column 4. Use IPC::Open3 instead. (Severity: 3) -Postfix control "if" used at line 6776, column 31. See pages 93,94 of PBP. (Severity: 2) -List of quoted literal words at line 6781, column 47. Use 'qw()' instead. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6784, column 28. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 6789, column 27. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6802, column 28. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6820, column 21. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6820, column 21. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6844, column 24. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6844, column 24. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6853, column 29. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6853, column 29. See page 237 of PBP. (Severity: 2) -Magic punctuation variable $0 used at line 6860, column 18. See page 79 of PBP. (Severity: 2) -Return value of "close" ignored at line 6883, column 2. Check the return value of "close" for success. (Severity: 2) -Magic punctuation variable $! used in interpolated string at line 6903, column 20. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used at line 6917, column 23. See page 79 of PBP. (Severity: 2) -Magic punctuation variable $@ used at line 6919, column 7. See page 79 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 6919, column 13. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 6919, column 13. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6934, column 20. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 6936, column 11. See page 53 of PBP. (Severity: 2) -Backtick operator used at line 6963, column 12. Use IPC::Open3 instead. (Severity: 3) -Backtick operator used at line 6983, column 11. Use IPC::Open3 instead. (Severity: 3) -String delimiter used with "split" at line 6988, column 28. Express it as a regex instead. (Severity: 2) -Quotes used with a noisy string at line 6988, column 34. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 7018, column 34. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 7030, column 31. See pages 93,94 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7062, column 17. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7062, column 17. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7071, column 17. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7071, column 17. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7105, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7105, column 19. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7133, column 13. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7136, column 17. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7136, column 17. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 7139, column 16. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7139, column 30. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 7140, column 22. See pages 93,94 of PBP. (Severity: 2) -Split long regexps into smaller qr// chunks at line 7145, column 12. See page 261 of PBP. (Severity: 3) -Regular expression without "/s" flag at line 7145, column 12. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7145, column 12. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 7157, column 38. See pages 93,94 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7157, column 72. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7157, column 72. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 7158, column 38. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 7160, column 46. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 7164, column 30. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 7166, column 34. See pages 93,94 of PBP. (Severity: 2) -Split long regexps into smaller qr// chunks at line 7171, column 12. See page 261 of PBP. (Severity: 3) -Regular expression without "/s" flag at line 7171, column 12. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7171, column 12. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7188, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7188, column 19. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7200, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7200, column 19. See page 237 of PBP. (Severity: 2) -Split long regexps into smaller qr// chunks at line 7212, column 12. See page 261 of PBP. (Severity: 3) -Regular expression without "/s" flag at line 7212, column 12. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7212, column 12. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 7218, column 29. See pages 93,94 of PBP. (Severity: 2) -Split long regexps into smaller qr// chunks at line 7224, column 12. See page 261 of PBP. (Severity: 3) -Regular expression without "/s" flag at line 7224, column 12. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7224, column 12. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7235, column 12. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7235, column 12. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7256, column 5. See page 53 of PBP. (Severity: 2) -Double-sigil dereference at line 7309, column 33. See page 228 of PBP. (Severity: 2) -Expression form of "eval" at line 7330, column 43. See page 161 of PBP. (Severity: 5) -Expression form of "eval" at line 7334, column 45. See page 161 of PBP. (Severity: 5) -Postfix control "if" used at line 7339, column 34. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 7340, column 36. See pages 93,94 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7354, column 33. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7354, column 33. See page 237 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7355, column 36. See page 53 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7393, column 27. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7393, column 27. See page 237 of PBP. (Severity: 2) -Use 'eq' or hash instead of fixed-pattern regexps at line 7397, column 36. See pages 271,272 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7397, column 36. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7397, column 36. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7399, column 31. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7399, column 31. See page 237 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7405, column 34. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7405, column 34. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 7408, column 65. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7534, column 17. See page 53 of PBP. (Severity: 2) -Split long regexps into smaller qr// chunks at line 7539, column 20. See page 261 of PBP. (Severity: 3) -Regular expression without "/s" flag at line 7539, column 20. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 7539, column 20. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 7545, column 28. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a noisy string at line 7545, column 33. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 7546, column 28. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a noisy string at line 7546, column 33. See page 53 of PBP. (Severity: 2) -Long number not separated with underscores at line 7579, column 55. See page 59 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7606, column 28. See page 53 of PBP. (Severity: 2) -Long number not separated with underscores at line 7614, column 40. See page 59 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7647, column 29. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7670, column 14. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7671, column 39. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7672, column 21. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 7673, column 27. See page 53 of PBP. (Severity: 2) -Quotes used with a string containing no non-whitespace characters at line 7673, column 33. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 7685, column 66. See pages 93,94 of PBP. (Severity: 2) -Postfix control "unless" used at line 7688, column 18. See pages 96,97 of PBP. (Severity: 2) -Long number not separated with underscores at line 7692, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 7693, column 46. See page 59 of PBP. (Severity: 2) -Long number not separated with underscores at line 7694, column 57. See page 59 of PBP. (Severity: 2) -Postfix control "unless" used at line 7696, column 16. See pages 96,97 of PBP. (Severity: 2) -"grep" used in boolean context at line 7706, column 12. See pages 71,72 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 7706, column 19. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/x" flag at line 7706, column 19. See page 236 of PBP. (Severity: 3) -Regular expression without "/m" flag at line 7706, column 19. See page 237 of PBP. (Severity: 2) -Magic punctuation variable $! used in interpolated string at line 7748, column 36. See page 79 of PBP. (Severity: 2) -Close filehandles as soon as possible after opening them at line 7750, column 2. See page 209 of PBP. (Severity: 4) -Magic punctuation variable $! used in interpolated string at line 7751, column 14. See page 79 of PBP. (Severity: 2) -Magic variable "*STDERR" should be assigned as "local" at line 7753, column 10. See pages 81,82 of PBP. (Severity: 4) -Double-sigil dereference at line 7753, column 12. See page 228 of PBP. (Severity: 2) -One-argument "select" used at line 7754, column 2. See page 224 of PBP. (Severity: 4) -Quotes used with a string containing no non-whitespace characters at line 7761, column 25. See page 53 of PBP. (Severity: 2) -Postfix control "if" used at line 7762, column 43. See pages 93,94 of PBP. (Severity: 2) -Quotes used with a noisy string at line 7763, column 54. See page 53 of PBP. (Severity: 2) -Quotes used with a noisy string at line 7763, column 60. See page 53 of PBP. (Severity: 2) -Magic punctuation variable $0 used in interpolated here-document at line 7764, column 15. See page 79 of PBP. (Severity: 2) -Numeric escapes in interpolated string at line 8079, column 21. See pages 54,55 of PBP. (Severity: 2) -Regular expression without "/s" flag at line 8081, column 16. See pages 240,241 of PBP. (Severity: 2) -Regular expression without "/m" flag at line 8081, column 16. See page 237 of PBP. (Severity: 2) -Postfix control "if" used at line 8250, column 51. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 8261, column 12. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 8265, column 32. See pages 93,94 of PBP. (Severity: 2) -Postfix control "unless" used at line 8268, column 30. See pages 96,97 of PBP. (Severity: 2) -Postfix control "if" used at line 8271, column 16. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 8288, column 32. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 8324, column 46. See pages 93,94 of PBP. (Severity: 2) -Postfix control "if" used at line 8409, column 33. See pages 93,94 of PBP. (Severity: 2) +Magic punctuation variable $| used at line 698, column 3. See page 79 of PBP. (Severity: 2) +Long number not separated with underscores at line 780, column 33. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 799, column 34. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 803, column 37. See page 59 of PBP. (Severity: 2) +"$ssl1_ssl_version" is declared but not used at line 814, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) +"$ssl2_ssl_version" is declared but not used at line 814, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) +Magic punctuation variable $! used in interpolated string at line 966, column 47. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 967, column 32. See page 79 of PBP. (Severity: 2) +Postfix control "if" used at line 971, column 17. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1010, column 119. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1044, column 15. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1045, column 21. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1051, column 25. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1059, column 24. See pages 93,94 of PBP. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 1068, column 40. See page 79 of PBP. (Severity: 2) +Postfix control "if" used at line 1106, column 29. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1118, column 31. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1119, column 12. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1133, column 5. See pages 93,94 of PBP. (Severity: 2) +Postfix control "unless" used at line 1252, column 40. See pages 96,97 of PBP. (Severity: 2) +Postfix control "if" used at line 1302, column 22. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1303, column 22. See pages 93,94 of PBP. (Severity: 2) +Postfix control "unless" used at line 1380, column 43. See pages 96,97 of PBP. (Severity: 2) +Postfix control "unless" used at line 1382, column 43. See pages 96,97 of PBP. (Severity: 2) +Single-quote used as quote-like operator delimiter at line 1442, column 3. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 1443, column 3. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Regular expression without "/s" flag at line 1481, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 1481, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 1481, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 1490, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 1490, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 1490, column 33. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 1596, column 3. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1631, column 29. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1632, column 29. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1641, column 29. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1649, column 34. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1711, column 3. See page 97 of PBP. (Severity: 2) +"unless" block used at line 1717, column 3. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 1793, column 57. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1803, column 77. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1811, column 5. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1816, column 3. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1819, column 2. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 1856, column 79. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1865, column 3. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1870, column 3. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1900, column 10. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1920, column 32. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1921, column 4. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 1929, column 39. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1933, column 38. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1942, column 4. See page 97 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 1945, column 31. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 1945, column 31. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 1947, column 7. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1948, column 31. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1949, column 5. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 1957, column 51. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1958, column 4. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 1967, column 39. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 1971, column 38. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 1980, column 4. See page 97 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 1982, column 31. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 1982, column 31. See page 237 of PBP. (Severity: 2) +"unless" block used at line 1983, column 5. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 2012, column 69. See pages 93,94 of PBP. (Severity: 2) +Code structure is deeply nested at line 2013, column 41. Consider refactoring. (Severity: 3) +"unless" block used at line 2013, column 41. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 2024, column 39. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 2028, column 38. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 2125, column 3. See page 97 of PBP. (Severity: 2) +"unless" block used at line 2129, column 3. See page 97 of PBP. (Severity: 2) +Postfix control "unless" used at line 2159, column 20. See pages 96,97 of PBP. (Severity: 2) +Postfix control "unless" used at line 2160, column 20. See pages 96,97 of PBP. (Severity: 2) +Postfix control "if" used at line 2163, column 66. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 2164, column 41. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 2165, column 40. See pages 93,94 of PBP. (Severity: 2) +Reused variable name in lexical scope: $sync at line 2255, column 2. Invent unique variable names. (Severity: 3) +Quotes used with a noisy string at line 2351, column 37. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 2351, column 48. See page 53 of PBP. (Severity: 2) +Reused variable name in lexical scope: $sync at line 2365, column 2. Invent unique variable names. (Severity: 3) +Regular expression without "/s" flag at line 2414, column 29. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 2414, column 29. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 2414, column 29. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 2436, column 31. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 2436, column 31. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 2436, column 31. See page 237 of PBP. (Severity: 2) +Reused variable name in lexical scope: $sync at line 2445, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2468, column 2. Invent unique variable names. (Severity: 3) +Regular expression without "/s" flag at line 2501, column 30. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 2501, column 30. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 2501, column 30. See page 237 of PBP. (Severity: 2) +Reused variable name in lexical scope: $sync at line 2512, column 53. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2520, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2570, column 2. Invent unique variable names. (Severity: 3) +Regular expression without "/s" flag at line 2607, column 26. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 2607, column 26. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 2607, column 26. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 2621, column 25. See pages 93,94 of PBP. (Severity: 2) +Too many arguments at line 2727, column 1. See page 182 of PBP. (Severity: 3) +Too many arguments at line 2745, column 1. See page 182 of PBP. (Severity: 3) +Too many arguments at line 2755, column 1. See page 182 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 2801, column 17. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 2801, column 17. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 2817, column 61. See pages 93,94 of PBP. (Severity: 2) +Subroutine "modulesversion" with high complexity score (27) at line 2868, column 1. Consider refactoring. (Severity: 3) +Regular expression without "/s" flag at line 2966, column 16. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 2966, column 16. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 2996, column 45. See page 53 of PBP. (Severity: 2) +Too many arguments at line 3075, column 1. See page 182 of PBP. (Severity: 3) +Magic punctuation variable $@ used in interpolated string at line 3085, column 18. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 3115, column 17. See page 79 of PBP. (Severity: 2) +Subroutine "authenticate_imap" with high complexity score (21) at line 3144, column 1. Consider refactoring. (Severity: 3) +Too many arguments at line 3144, column 1. See page 182 of PBP. (Severity: 3) +Postfix control "unless" used at line 3158, column 51. See pages 96,97 of PBP. (Severity: 2) +Postfix control "if" used at line 3162, column 33. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 3163, column 33. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 3164, column 35. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 3166, column 32. See pages 93,94 of PBP. (Severity: 2) +"unless" block used at line 3170, column 2. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 3238, column 45. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 3262, column 45. See pages 93,94 of PBP. (Severity: 2) +Too many arguments at line 3274, column 1. See page 182 of PBP. (Severity: 3) +Postfix control "if" used at line 3298, column 43. See pages 93,94 of PBP. (Severity: 2) +Numeric escapes in interpolated string at line 3311, column 32. See pages 54,55 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3358, column 32. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3358, column 32. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3358, column 32. See page 237 of PBP. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 3362, column 60. See page 79 of PBP. (Severity: 2) +Use "local $/ = undef" or File::Slurp instead of joined readline at line 3363, column 43. See page 213 of PBP. (Severity: 3) +Return value of "close" ignored at line 3364, column 13. Check the return value of "close" for success. (Severity: 2) +Regular expression without "/s" flag at line 3373, column 69. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3373, column 69. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3373, column 69. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 3376, column 37. See pages 93,94 of PBP. (Severity: 2) +Backtick operator used at line 3381, column 20. Use IPC::Open3 instead. (Severity: 3) +"unless" block used at line 3406, column 9. See page 97 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3440, column 32. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 3440, column 32. See page 237 of PBP. (Severity: 2) +Magic punctuation variable $0 used in interpolated string at line 3514, column 3. See page 79 of PBP. (Severity: 2) +Return value of eval not tested at line 3538, column 2. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) +Quotes used with a noisy string at line 3539, column 11. See page 53 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 3539, column 11. See page 79 of PBP. (Severity: 2) +Postfix control "if" used at line 3539, column 18. See pages 93,94 of PBP. (Severity: 2) +Magic punctuation variable $@ used at line 3539, column 23. See page 79 of PBP. (Severity: 2) +Postfix control "if" used at line 3547, column 68. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 3548, column 32. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 3551, column 32. See page 53 of PBP. (Severity: 2) +Return value of "close" ignored at line 3578, column 2. Check the return value of "close" for success. (Severity: 2) +Return value of "close" ignored at line 3598, column 17. Check the return value of "close" for success. (Severity: 2) +"die" used instead of "croak" at line 3606, column 2. See page 283 of PBP. (Severity: 3) +Magic punctuation variable $0 used in interpolated string at line 3611, column 13. See page 79 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3714, column 15. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3714, column 15. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3714, column 15. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3715, column 15. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3715, column 15. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3715, column 15. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3716, column 15. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3716, column 15. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3716, column 15. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3725, column 8. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3725, column 8. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3725, column 8. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3726, column 8. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3726, column 8. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3726, column 8. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3727, column 8. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3727, column 8. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3727, column 8. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3770, column 31. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3770, column 31. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3770, column 31. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3857, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3857, column 24. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3857, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 3860, column 20. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 3860, column 20. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 3860, column 20. See page 237 of PBP. (Severity: 2) +Postfix control "unless" used at line 4057, column 18. See pages 96,97 of PBP. (Severity: 2) +Use 'eq' or hash instead of fixed-pattern regexps at line 4061, column 24. See pages 271,272 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4061, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4061, column 24. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4061, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4062, column 19. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4062, column 19. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4062, column 19. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4066, column 19. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4066, column 19. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4066, column 19. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4136, column 12. See page 53 of PBP. (Severity: 2) +Postfix control "while" used at line 4136, column 20. See page 96 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4136, column 39. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4136, column 39. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4136, column 39. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4137, column 12. See page 53 of PBP. (Severity: 2) +Postfix control "while" used at line 4137, column 20. See page 96 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4137, column 39. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4137, column 39. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4137, column 39. See page 237 of PBP. (Severity: 2) +Postfix control "while" used at line 4138, column 22. See page 96 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4138, column 41. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 4138, column 41. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 4138, column 41. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4147, column 6. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4148, column 6. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4149, column 6. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4150, column 6. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4241, column 46. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4241, column 51. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4242, column 48. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4242, column 53. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4243, column 48. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4243, column 53. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4244, column 48. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4244, column 53. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4245, column 50. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4245, column 55. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4247, column 50. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4247, column 55. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4249, column 50. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4249, column 55. See page 53 of PBP. (Severity: 2) +Numeric escapes in interpolated string at line 4259, column 14. See pages 54,55 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4262, column 14. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4262, column 14. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4263, column 14. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4263, column 14. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4264, column 14. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4264, column 14. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4265, column 21. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4265, column 21. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 4265, column 30. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4265, column 49. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4265, column 74. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4273, column 11. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4274, column 11. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4320, column 11. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4321, column 11. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4336, column 11. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4337, column 11. See page 53 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4375, column 14. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4375, column 14. See page 237 of PBP. (Severity: 2) +Postfix control "unless" used at line 4381, column 4. See pages 96,97 of PBP. (Severity: 2) +Use 'eq' or hash instead of fixed-pattern regexps at line 4381, column 66. See pages 271,272 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4381, column 66. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4381, column 66. See page 237 of PBP. (Severity: 2) +Expression form of "eval" at line 4391, column 13. See page 161 of PBP. (Severity: 5) +Magic punctuation variable $@ used at line 4393, column 48. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4394, column 15. See page 79 of PBP. (Severity: 2) +Quotes used with a noisy string at line 4404, column 28. See page 53 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4412, column 42. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4412, column 42. See page 237 of PBP. (Severity: 2) +"unless" block used at line 4445, column 3. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 4458, column 39. See pages 93,94 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4464, column 53. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4472, column 53. See page 79 of PBP. (Severity: 2) +Single-quote used as quote-like operator delimiter at line 4522, column 6. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4522, column 45. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4528, column 6. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4528, column 38. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4529, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4530, column 39. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4534, column 6. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4534, column 40. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4537, column 45. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4538, column 45. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4539, column 22. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4541, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4550, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4556, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Expression form of "eval" at line 4629, column 13. See page 161 of PBP. (Severity: 5) +Magic punctuation variable $@ used at line 4631, column 45. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4632, column 13. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4643, column 17. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4645, column 17. See page 79 of PBP. (Severity: 2) +"unless" block used at line 4652, column 4. See page 97 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 4655, column 19. See page 79 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4684, column 17. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4684, column 17. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4687, column 28. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4687, column 28. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4712, column 21. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4712, column 21. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 4724, column 20. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 4724, column 20. See page 237 of PBP. (Severity: 2) +"unless" block used at line 4899, column 3. See page 97 of PBP. (Severity: 2) +"unless" block used at line 4900, column 3. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 4963, column 22. See pages 93,94 of PBP. (Severity: 2) +Subroutine "copy_message" with high complexity score (25) at line 4990, column 1. Consider refactoring. (Severity: 3) +Too many arguments at line 4990, column 1. See page 182 of PBP. (Severity: 3) +Reused variable name in lexical scope: $sync at line 4993, column 2. Invent unique variable names. (Severity: 3) +Postfix control "if" used at line 5007, column 100. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 5057, column 19. See pages 93,94 of PBP. (Severity: 2) +Too many arguments at line 5074, column 1. See page 182 of PBP. (Severity: 3) +Subroutine "message_for_host2" with high complexity score (27) at line 5107, column 1. Consider refactoring. (Severity: 3) +Too many arguments at line 5107, column 1. See page 182 of PBP. (Severity: 3) +Reused variable name in lexical scope: $sync at line 5129, column 2. Invent unique variable names. (Severity: 3) +"unless" block used at line 5150, column 2. See page 97 of PBP. (Severity: 2) +Postfix control "if" used at line 5156, column 34. See pages 93,94 of PBP. (Severity: 2) +Reused variable name in lexical scope: $sync at line 5223, column 9. Invent unique variable names. (Severity: 3) +9 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5235, column 21. Unnamed numeric literals make code less maintainable. (Severity: 2) +Quotes used with a string containing no non-whitespace characters at line 5236, column 21. See page 53 of PBP. (Severity: 2) +Reused variable name in lexical scope: $string_ref at line 5242, column 25. Invent unique variable names. (Severity: 3) +9 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5247, column 13. Unnamed numeric literals make code less maintainable. (Severity: 2) +Postfix control "if" used at line 5256, column 61. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 5265, column 58. See pages 93,94 of PBP. (Severity: 2) +9 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5270, column 21. Unnamed numeric literals make code less maintainable. (Severity: 2) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5303, column 13. Unnamed numeric literals make code less maintainable. (Severity: 2) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5304, column 13. Unnamed numeric literals make code less maintainable. (Severity: 2) +Regular expression without "/s" flag at line 5333, column 15. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5333, column 15. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 5338, column 37. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 5339, column 64. See pages 93,94 of PBP. (Severity: 2) +Too many arguments at line 5419, column 1. See page 182 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 5445, column 20. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5445, column 20. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 5463, column 75. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5463, column 75. See page 237 of PBP. (Severity: 2) +Reused variable name in lexical scope: $total_bytes_transferred at line 5486, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $nb_msg_transferred at line 5486, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $nb_msg_transferred at line 5499, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $maxmessagespersecond at line 5499, column 9. Invent unique variable names. (Severity: 3) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5508, column 31. Unnamed numeric literals make code less maintainable. (Severity: 2) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5509, column 31. Unnamed numeric literals make code less maintainable. (Severity: 2) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5510, column 31. Unnamed numeric literals make code less maintainable. (Severity: 2) +4 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5511, column 31. Unnamed numeric literals make code less maintainable. (Severity: 2) +8 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 5512, column 31. Unnamed numeric literals make code less maintainable. (Severity: 2) +Reused variable name in lexical scope: $total_bytes_transferred at line 5520, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $maxbytespersecond at line 5520, column 9. Invent unique variable names. (Severity: 3) +Postfix control "if" used at line 5545, column 36. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 5550, column 30. See pages 93,94 of PBP. (Severity: 2) +Reused variable name in lexical scope: $h1_nb_msg_start at line 5557, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $h1_nb_msg_start at line 5568, column 2. Invent unique variable names. (Severity: 3) +Regular expression without "/s" flag at line 5665, column 23. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5665, column 23. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 5685, column 23. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5685, column 23. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 5824, column 16. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 5824, column 16. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 5882, column 29. See page 53 of PBP. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 5882, column 29. See page 79 of PBP. (Severity: 2) +Postfix control "if" used at line 6003, column 38. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 6010, column 40. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6014, column 45. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6015, column 45. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6144, column 6. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6152, column 25. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6153, column 25. See page 53 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 6169, column 21. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 6169, column 21. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 6171, column 20. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 6171, column 20. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 6185, column 31. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 6190, column 32. See pages 93,94 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 6201, column 13. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 6201, column 13. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6207, column 38. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6208, column 46. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6209, column 54. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6212, column 54. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 6213, column 60. See page 53 of PBP. (Severity: 2) +Expression form of "eval" at line 6706, column 13. See page 161 of PBP. (Severity: 5) +Magic punctuation variable $@ used at line 6708, column 38. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 6709, column 13. See page 79 of PBP. (Severity: 2) +Numeric escapes in interpolated string at line 6744, column 21. See pages 54,55 of PBP. (Severity: 2) +Numeric escapes in interpolated string at line 6749, column 21. See pages 54,55 of PBP. (Severity: 2) +Long number not separated with underscores at line 6901, column 16. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6912, column 16. See page 59 of PBP. (Severity: 2) +Magic punctuation variable $% used in interpolated string at line 6928, column 3. See page 79 of PBP. (Severity: 2) +Long number not separated with underscores at line 6928, column 87. See page 59 of PBP. (Severity: 2) +Expression form of "eval" at line 6942, column 13. See page 161 of PBP. (Severity: 5) +Magic punctuation variable $@ used at line 6945, column 24. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used in interpolated string at line 6946, column 13. See page 79 of PBP. (Severity: 2) +Long number not separated with underscores at line 6966, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6967, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6969, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6970, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6972, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6973, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6975, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6976, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6978, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6979, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 6981, column 49. See page 59 of PBP. (Severity: 2) +Postfix control "if" used at line 7053, column 69. See pages 93,94 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7132, column 21. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7132, column 21. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7132, column 21. See page 237 of PBP. (Severity: 2) +Too many arguments at line 7204, column 1. See page 182 of PBP. (Severity: 3) +Postfix control "unless" used at line 7241, column 27. See pages 96,97 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7278, column 30. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7278, column 30. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7293, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7293, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7296, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7296, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7299, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7299, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7302, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7302, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7305, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7305, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7308, column 97. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7308, column 97. See page 237 of PBP. (Severity: 2) +Numeric escapes in interpolated string at line 7326, column 51. See pages 54,55 of PBP. (Severity: 2) +Close filehandles as soon as possible after opening them at line 7338, column 9. See page 209 of PBP. (Severity: 4) +Magic punctuation variable $! used in interpolated string at line 7339, column 26. See page 79 of PBP. (Severity: 2) +Return value of "close" ignored at line 7343, column 9. Check the return value of "close" for success. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 7364, column 42. See page 79 of PBP. (Severity: 2) +Return value of "close" ignored at line 7366, column 2. Check the return value of "close" for success. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 7373, column 70. See page 79 of PBP. (Severity: 2) +Return value of "close" ignored at line 7375, column 2. Check the return value of "close" for success. (Severity: 2) +Literal line breaks in a string at line 7379, column 1. See pages 60,61 of PBP. (Severity: 3) +Postfix control "if" used at line 7393, column 3. See pages 93,94 of PBP. (Severity: 2) +Backtick operator used at line 7403, column 17. Use IPC::Open3 instead. (Severity: 3) +Postfix control "if" used at line 7442, column 52. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 7458, column 49. See pages 93,94 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7489, column 32. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7489, column 32. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7489, column 32. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7489, column 32. See page 237 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7493, column 32. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7493, column 32. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7493, column 32. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7493, column 32. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7502, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7502, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7502, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7507, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7507, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7507, column 33. See page 237 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7511, column 33. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7511, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7511, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7511, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7514, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7514, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7515, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7515, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7515, column 33. See page 237 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7521, column 24. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7521, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7521, column 24. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7521, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7537, column 21. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7537, column 21. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7561, column 24. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7561, column 24. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7570, column 29. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7570, column 29. See page 237 of PBP. (Severity: 2) +Magic punctuation variable $0 used at line 7577, column 18. See page 79 of PBP. (Severity: 2) +Return value of "close" ignored at line 7600, column 2. Check the return value of "close" for success. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 7620, column 23. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used at line 7634, column 23. See page 79 of PBP. (Severity: 2) +Magic punctuation variable $@ used at line 7636, column 7. See page 79 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7636, column 13. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7636, column 13. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7671, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7671, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7671, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7672, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7672, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7672, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7673, column 43. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7673, column 43. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7673, column 43. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7675, column 36. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7675, column 36. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7675, column 36. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7676, column 37. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7676, column 37. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7676, column 37. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7677, column 38. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7677, column 38. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7677, column 38. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7679, column 30. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 7679, column 30. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 7679, column 30. See page 237 of PBP. (Severity: 2) +Backtick operator used at line 7696, column 12. Use IPC::Open3 instead. (Severity: 3) +Backtick operator used at line 7718, column 11. Use IPC::Open3 instead. (Severity: 3) +String delimiter used with "split" at line 7723, column 28. Express it as a regex instead. (Severity: 2) +Quotes used with a noisy string at line 7723, column 34. See page 53 of PBP. (Severity: 2) +Postfix control "if" used at line 7753, column 34. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 7765, column 31. See pages 93,94 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7797, column 17. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7797, column 17. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7806, column 17. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7806, column 17. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7826, column 19. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7826, column 19. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7857, column 17. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7857, column 17. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 7860, column 16. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 7861, column 22. See pages 93,94 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7866, column 12. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7866, column 12. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7866, column 12. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 7878, column 38. See pages 93,94 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7878, column 72. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7878, column 72. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 7879, column 38. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 7881, column 46. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 7885, column 30. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 7887, column 33. See pages 93,94 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7892, column 12. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7892, column 12. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7892, column 12. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7909, column 19. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7909, column 19. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7921, column 19. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7921, column 19. See page 237 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7933, column 12. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7933, column 12. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7933, column 12. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 7939, column 29. See pages 93,94 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 7945, column 12. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 7945, column 12. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7945, column 12. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 7956, column 12. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 7956, column 12. See page 237 of PBP. (Severity: 2) +Expression form of "eval" at line 8051, column 42. See page 161 of PBP. (Severity: 5) +Expression form of "eval" at line 8055, column 44. See page 161 of PBP. (Severity: 5) +Postfix control "if" used at line 8060, column 34. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 8061, column 36. See pages 93,94 of PBP. (Severity: 2) +Reused variable name in lexical scope: $sync at line 8072, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 8093, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 8145, column 9. Invent unique variable names. (Severity: 3) +Regular expression without "/s" flag at line 8296, column 33. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8296, column 33. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 8335, column 26. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8335, column 26. See page 237 of PBP. (Severity: 2) +Use 'eq' or hash instead of fixed-pattern regexps at line 8339, column 36. See pages 271,272 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 8339, column 36. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8339, column 36. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 8341, column 31. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8341, column 31. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 8347, column 34. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8347, column 34. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 8350, column 68. See pages 93,94 of PBP. (Severity: 2) +Split long regexps into smaller qr// chunks at line 8481, column 20. See page 261 of PBP. (Severity: 3) +Regular expression without "/s" flag at line 8481, column 20. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 8481, column 20. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 8487, column 28. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 8487, column 33. See page 53 of PBP. (Severity: 2) +Postfix control "if" used at line 8488, column 36. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 8488, column 41. See page 53 of PBP. (Severity: 2) +Long number not separated with underscores at line 8521, column 55. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 8556, column 40. See page 59 of PBP. (Severity: 2) +Quotes used with a noisy string at line 8615, column 27. See page 53 of PBP. (Severity: 2) +Postfix control "if" used at line 8627, column 66. See pages 93,94 of PBP. (Severity: 2) +Postfix control "unless" used at line 8630, column 18. See pages 96,97 of PBP. (Severity: 2) +Long number not separated with underscores at line 8634, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 8635, column 46. See page 59 of PBP. (Severity: 2) +Long number not separated with underscores at line 8636, column 57. See page 59 of PBP. (Severity: 2) +Postfix control "unless" used at line 8638, column 16. See pages 96,97 of PBP. (Severity: 2) +Magic punctuation variable $! used in interpolated string at line 8691, column 36. See page 79 of PBP. (Severity: 2) +Close filehandles as soon as possible after opening them at line 8693, column 2. See page 209 of PBP. (Severity: 4) +Magic punctuation variable $! used in interpolated string at line 8694, column 14. See page 79 of PBP. (Severity: 2) +Magic variable "*STDERR" should be assigned as "local" at line 8696, column 10. See pages 81,82 of PBP. (Severity: 4) +Double-sigil dereference at line 8696, column 12. See page 228 of PBP. (Severity: 2) +One-argument "select" used at line 8697, column 2. See page 224 of PBP. (Severity: 4) +Postfix control "if" used at line 8717, column 43. See pages 93,94 of PBP. (Severity: 2) +Quotes used with a noisy string at line 8718, column 54. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 8718, column 60. See page 53 of PBP. (Severity: 2) +Magic punctuation variable $0 used in interpolated here-document at line 8719, column 18. See page 79 of PBP. (Severity: 2) +Numeric escapes in interpolated string at line 9035, column 20. See pages 54,55 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9037, column 16. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/m" flag at line 9037, column 16. See page 237 of PBP. (Severity: 2) +Postfix control "if" used at line 9214, column 58. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 9230, column 29. See pages 93,94 of PBP. (Severity: 2) +Postfix control "unless" used at line 9233, column 24. See pages 96,97 of PBP. (Severity: 2) +Postfix control "if" used at line 9236, column 16. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 9253, column 46. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 9281, column 46. See pages 93,94 of PBP. (Severity: 2) +Postfix control "if" used at line 9374, column 33. See pages 93,94 of PBP. (Severity: 2) +Multiple "package" declarations at line 9395, column 1. Limit to one per file. (Severity: 4) +Subroutine "GetOptions" with high complexity score (32) at line 9407, column 1. Consider refactoring. (Severity: 3) +Regular expression without "/s" flag at line 9425, column 22. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9425, column 22. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9425, column 22. See page 237 of PBP. (Severity: 2) +String delimiter used with "split" at line 9430, column 21. Express it as a regex instead. (Severity: 2) +Quotes used with a noisy string at line 9430, column 27. See page 53 of PBP. (Severity: 2) +Capture variable used outside conditional at line 9430, column 32. See page 253 of PBP. (Severity: 3) +Quotes used with a noisy string at line 9432, column 28. See page 53 of PBP. (Severity: 2) +Quotes used with a noisy string at line 9437, column 32. See page 53 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9438, column 42. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9438, column 42. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9438, column 42. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9439, column 30. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9439, column 30. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9439, column 30. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9443, column 35. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9443, column 35. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9443, column 35. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9460, column 30. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9460, column 30. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9460, column 30. See page 237 of PBP. (Severity: 2) +Regular expression without "/s" flag at line 9462, column 35. See pages 240,241 of PBP. (Severity: 2) +Regular expression without "/x" flag at line 9462, column 35. See page 236 of PBP. (Severity: 3) +Regular expression without "/m" flag at line 9462, column 35. See page 237 of PBP. (Severity: 2) +Quotes used with a noisy string at line 9465, column 36. See page 53 of PBP. (Severity: 2) + + 1 files. + 263 subroutines/methods. +8,603 statements. + +9,486 lines, consisting of: + 1,684 blank lines. + 551 comment lines. + 0 data lines. + 6,579 lines of Perl code. + 672 lines of POD. + +Average McCabe score of subroutines was 4.35. + +606 violations. +Violations per file was 606.000. +Violations per statement was 0.070. +Violations per line of code was 0.064. + + 6 severity 5 violations. + 5 severity 4 violations. +120 severity 3 violations. +475 severity 2 violations. + + 6 violations of BuiltinFunctions::ProhibitStringyEval. + 2 violations of BuiltinFunctions::ProhibitStringySplit. + 1 violations of ControlStructures::ProhibitDeepNests. +109 violations of ControlStructures::ProhibitPostfixControls. + 19 violations of ControlStructures::ProhibitUnlessBlocks. + 3 violations of Documentation::RequirePodSections. + 1 violations of ErrorHandling::RequireCarping. + 1 violations of ErrorHandling::RequireCheckingReturnValueOfEval. + 4 violations of InputOutput::ProhibitBacktickOperators. + 1 violations of InputOutput::ProhibitJoinedReadline. + 1 violations of InputOutput::ProhibitOneArgSelect. + 2 violations of InputOutput::RequireBriefOpen. + 7 violations of InputOutput::RequireCheckedClose. + 1 violations of Modules::ProhibitExcessMainComplexity. + 1 violations of Modules::ProhibitMultiplePackages. + 1 violations of References::ProhibitDoubleSigils. + 1 violations of RegularExpressions::ProhibitCaptureWithoutTest. + 9 violations of RegularExpressions::ProhibitComplexRegexes. + 3 violations of RegularExpressions::ProhibitFixedStringMatches. +100 violations of RegularExpressions::RequireDotMatchAnything. + 44 violations of RegularExpressions::RequireExtendedFormatting. +100 violations of RegularExpressions::RequireLineBoundaryMatching. + 5 violations of Subroutines::ProhibitExcessComplexity. + 11 violations of Subroutines::ProhibitManyArgs. + 1 violations of ValuesAndExpressions::ProhibitEmptyQuotes. + 6 violations of ValuesAndExpressions::ProhibitEscapedCharacters. + 1 violations of ValuesAndExpressions::ProhibitImplicitNewlines. + 10 violations of ValuesAndExpressions::ProhibitMagicNumbers. + 56 violations of ValuesAndExpressions::ProhibitNoisyQuotes. + 16 violations of ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters. + 22 violations of ValuesAndExpressions::RequireNumberSeparators. + 36 violations of Variables::ProhibitPunctuationVars. + 22 violations of Variables::ProhibitReusedNames. + 2 violations of Variables::ProhibitUnusedVariables. + 1 violations of Variables::RequireLocalizedPunctuationVars. diff --git a/W/perlcritic_3.out b/W/perlcritic_3.out index 8bb377d..cb94ade 100644 --- a/W/perlcritic_3.out +++ b/W/perlcritic_3.out @@ -1,78 +1,174 @@ -Main code has high complexity score (400) at line 1, column 1. Consider refactoring. (Severity: 3) -"$ssl1_SSL_version" is declared but not used at line 712, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) -"$ssl2_SSL_version" is declared but not used at line 712, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) -Regular expression without "/x" flag at line 1341, column 33. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 1350, column 33. See page 236 of PBP. (Severity: 3) -Code structure is deeply nested at line 1875, column 41. Consider refactoring. (Severity: 3) -Reused variable name in lexical scope: $sync at line 2040, column 2. Invent unique variable names. (Severity: 3) -Hard tabs used at line 2066, column 22. See page 20 of PBP. (Severity: 3) -Reused variable name in lexical scope: $sync at line 2150, column 2. Invent unique variable names. (Severity: 3) -Regular expression without "/x" flag at line 2199, column 29. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 2221, column 31. See page 236 of PBP. (Severity: 3) -Reused variable name in lexical scope: $sync at line 2230, column 2. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $sync at line 2253, column 2. Invent unique variable names. (Severity: 3) -Regular expression without "/x" flag at line 2286, column 30. See page 236 of PBP. (Severity: 3) -Reused variable name in lexical scope: $sync at line 2297, column 53. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $sync at line 2305, column 2. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $sync at line 2353, column 2. Invent unique variable names. (Severity: 3) -Regular expression without "/x" flag at line 2389, column 26. See page 236 of PBP. (Severity: 3) -Reused variable name in lexical scope: $nb_errors at line 2437, column 2. Invent unique variable names. (Severity: 3) -Too many arguments at line 2473, column 1. See page 182 of PBP. (Severity: 3) -Too many arguments at line 2491, column 1. See page 182 of PBP. (Severity: 3) -Too many arguments at line 2501, column 1. See page 182 of PBP. (Severity: 3) -Subroutine "modules_VERSION" with high complexity score (26) at line 2619, column 1. Consider refactoring. (Severity: 3) -Too many arguments at line 2782, column 1. See page 182 of PBP. (Severity: 3) -Subroutine "authenticate_imap" with high complexity score (21) at line 2851, column 1. Consider refactoring. (Severity: 3) -Too many arguments at line 2851, column 1. See page 182 of PBP. (Severity: 3) -Too many arguments at line 2981, column 1. See page 182 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3057, column 62. See page 236 of PBP. (Severity: 3) -Backtick operator used at line 3065, column 19. Use IPC::Open3 instead. (Severity: 3) -Return value of eval not tested at line 3203, column 2. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) -"die" used instead of "croak" at line 3248, column 2. See page 283 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3356, column 15. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3357, column 15. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3358, column 15. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3367, column 8. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3368, column 8. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3369, column 8. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3395, column 31. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3477, column 25. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3480, column 20. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3681, column 24. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3682, column 19. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3686, column 19. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3756, column 39. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3757, column 39. See page 236 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 3758, column 41. See page 236 of PBP. (Severity: 3) -Hard tabs used at line 3772, column 106. See page 20 of PBP. (Severity: 3) -Expression form of "eval" at line 4012, column 13. See page 161 of PBP. (Severity: 5) -Expression form of "eval" at line 4242, column 13. See page 161 of PBP. (Severity: 5) -Subroutine "copy_message" with high complexity score (25) at line 4603, column 1. Consider refactoring. (Severity: 3) -Too many arguments at line 4603, column 1. See page 182 of PBP. (Severity: 3) -Too many arguments at line 4679, column 1. See page 182 of PBP. (Severity: 3) -Too many arguments at line 4713, column 1. See page 182 of PBP. (Severity: 3) -Too many arguments at line 4902, column 1. See page 182 of PBP. (Severity: 3) -Reused variable name in lexical scope: $total_bytes_transferred at line 4963, column 2. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $nb_msg_transferred at line 4963, column 2. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $nb_msg_transferred at line 4976, column 9. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $maxmessagespersecond at line 4976, column 9. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $total_bytes_transferred at line 4997, column 9. Invent unique variable names. (Severity: 3) -Reused variable name in lexical scope: $maxbytespersecond at line 4997, column 9. Invent unique variable names. (Severity: 3) -Expression form of "eval" at line 6186, column 13. See page 161 of PBP. (Severity: 5) -Regular expression without "/x" flag at line 6421, column 22. See page 236 of PBP. (Severity: 3) -Expression form of "eval" at line 6426, column 13. See page 161 of PBP. (Severity: 5) -Too many arguments at line 6589, column 1. See page 182 of PBP. (Severity: 3) -Backtick operator used at line 6756, column 4. Use IPC::Open3 instead. (Severity: 3) -Backtick operator used at line 6963, column 12. Use IPC::Open3 instead. (Severity: 3) -Backtick operator used at line 6983, column 11. Use IPC::Open3 instead. (Severity: 3) -Split long regexps into smaller qr// chunks at line 7145, column 12. See page 261 of PBP. (Severity: 3) -Split long regexps into smaller qr// chunks at line 7171, column 12. See page 261 of PBP. (Severity: 3) -Split long regexps into smaller qr// chunks at line 7212, column 12. See page 261 of PBP. (Severity: 3) -Split long regexps into smaller qr// chunks at line 7224, column 12. See page 261 of PBP. (Severity: 3) -Expression form of "eval" at line 7330, column 43. See page 161 of PBP. (Severity: 5) -Expression form of "eval" at line 7334, column 45. See page 161 of PBP. (Severity: 5) -Split long regexps into smaller qr// chunks at line 7539, column 20. See page 261 of PBP. (Severity: 3) -Regular expression without "/x" flag at line 7706, column 19. See page 236 of PBP. (Severity: 3) -Close filehandles as soon as possible after opening them at line 7750, column 2. See page 209 of PBP. (Severity: 4) -Magic variable "*STDERR" should be assigned as "local" at line 7753, column 10. See pages 81,82 of PBP. (Severity: 4) -One-argument "select" used at line 7754, column 2. See page 224 of PBP. (Severity: 4) +Main code has high complexity score (401) at line 1, column 1. Consider refactoring. (Severity: 3) +"$ssl1_ssl_version" is declared but not used at line 814, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) +"$ssl2_ssl_version" is declared but not used at line 814, column 1. Unused variables clutter code and make it harder to read. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 1442, column 3. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 1443, column 3. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Regular expression without "/x" flag at line 1481, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 1490, column 33. See page 236 of PBP. (Severity: 3) +Code structure is deeply nested at line 2013, column 41. Consider refactoring. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2255, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2365, column 2. Invent unique variable names. (Severity: 3) +Regular expression without "/x" flag at line 2414, column 29. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 2436, column 31. See page 236 of PBP. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2445, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2468, column 2. Invent unique variable names. (Severity: 3) +Regular expression without "/x" flag at line 2501, column 30. See page 236 of PBP. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2512, column 53. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2520, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 2570, column 2. Invent unique variable names. (Severity: 3) +Regular expression without "/x" flag at line 2607, column 26. See page 236 of PBP. (Severity: 3) +Too many arguments at line 2727, column 1. See page 182 of PBP. (Severity: 3) +Too many arguments at line 2745, column 1. See page 182 of PBP. (Severity: 3) +Too many arguments at line 2755, column 1. See page 182 of PBP. (Severity: 3) +Subroutine "modulesversion" with high complexity score (27) at line 2868, column 1. Consider refactoring. (Severity: 3) +Too many arguments at line 3075, column 1. See page 182 of PBP. (Severity: 3) +Subroutine "authenticate_imap" with high complexity score (21) at line 3144, column 1. Consider refactoring. (Severity: 3) +Too many arguments at line 3144, column 1. See page 182 of PBP. (Severity: 3) +Too many arguments at line 3274, column 1. See page 182 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 3358, column 32. See page 236 of PBP. (Severity: 3) +Use "local $/ = undef" or File::Slurp instead of joined readline at line 3363, column 43. See page 213 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 3373, column 69. See page 236 of PBP. (Severity: 3) +Backtick operator used at line 3381, column 20. Use IPC::Open3 instead. (Severity: 3) +Return value of eval not tested at line 3538, column 2. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) +"die" used instead of "croak" at line 3606, column 2. See page 283 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 3714, column 15. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 3715, column 15. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 3716, column 15. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 3725, column 8. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 3726, column 8. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 3727, column 8. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 3770, column 31. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 3857, column 24. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 3860, column 20. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 4061, column 24. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 4062, column 19. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 4066, column 19. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 4136, column 39. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 4137, column 39. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 4138, column 41. See page 236 of PBP. (Severity: 3) +Expression form of "eval" at line 4391, column 13. See page 161 of PBP. (Severity: 5) +Single-quote used as quote-like operator delimiter at line 4522, column 6. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4522, column 45. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4528, column 6. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4528, column 38. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4529, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4530, column 39. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4534, column 6. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4534, column 40. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4537, column 45. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4538, column 45. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4539, column 22. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4541, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4550, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Single-quote used as quote-like operator delimiter at line 4556, column 17. Using quotes as delimiters for quote-like operators obfuscates code. (Severity: 3) +Expression form of "eval" at line 4629, column 13. See page 161 of PBP. (Severity: 5) +Subroutine "copy_message" with high complexity score (25) at line 4990, column 1. Consider refactoring. (Severity: 3) +Too many arguments at line 4990, column 1. See page 182 of PBP. (Severity: 3) +Reused variable name in lexical scope: $sync at line 4993, column 2. Invent unique variable names. (Severity: 3) +Too many arguments at line 5074, column 1. See page 182 of PBP. (Severity: 3) +Subroutine "message_for_host2" with high complexity score (27) at line 5107, column 1. Consider refactoring. (Severity: 3) +Too many arguments at line 5107, column 1. See page 182 of PBP. (Severity: 3) +Reused variable name in lexical scope: $sync at line 5129, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 5223, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $string_ref at line 5242, column 25. Invent unique variable names. (Severity: 3) +Too many arguments at line 5419, column 1. See page 182 of PBP. (Severity: 3) +Reused variable name in lexical scope: $total_bytes_transferred at line 5486, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $nb_msg_transferred at line 5486, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $nb_msg_transferred at line 5499, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $maxmessagespersecond at line 5499, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $total_bytes_transferred at line 5520, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $maxbytespersecond at line 5520, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $h1_nb_msg_start at line 5557, column 2. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $h1_nb_msg_start at line 5568, column 2. Invent unique variable names. (Severity: 3) +Expression form of "eval" at line 6706, column 13. See page 161 of PBP. (Severity: 5) +Expression form of "eval" at line 6942, column 13. See page 161 of PBP. (Severity: 5) +Regular expression without "/x" flag at line 7132, column 21. See page 236 of PBP. (Severity: 3) +Too many arguments at line 7204, column 1. See page 182 of PBP. (Severity: 3) +Close filehandles as soon as possible after opening them at line 7338, column 9. See page 209 of PBP. (Severity: 4) +Literal line breaks in a string at line 7379, column 1. See pages 60,61 of PBP. (Severity: 3) +Backtick operator used at line 7403, column 17. Use IPC::Open3 instead. (Severity: 3) +Split long regexps into smaller qr// chunks at line 7489, column 32. See page 261 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7489, column 32. See page 236 of PBP. (Severity: 3) +Split long regexps into smaller qr// chunks at line 7493, column 32. See page 261 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7493, column 32. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7502, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7507, column 33. See page 236 of PBP. (Severity: 3) +Split long regexps into smaller qr// chunks at line 7511, column 33. See page 261 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7511, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7515, column 33. See page 236 of PBP. (Severity: 3) +Split long regexps into smaller qr// chunks at line 7521, column 24. See page 261 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7521, column 24. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7671, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7672, column 33. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7673, column 43. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7675, column 36. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7676, column 37. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7677, column 38. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 7679, column 30. See page 236 of PBP. (Severity: 3) +Backtick operator used at line 7696, column 12. Use IPC::Open3 instead. (Severity: 3) +Backtick operator used at line 7718, column 11. Use IPC::Open3 instead. (Severity: 3) +Split long regexps into smaller qr// chunks at line 7866, column 12. See page 261 of PBP. (Severity: 3) +Split long regexps into smaller qr// chunks at line 7892, column 12. See page 261 of PBP. (Severity: 3) +Split long regexps into smaller qr// chunks at line 7933, column 12. See page 261 of PBP. (Severity: 3) +Split long regexps into smaller qr// chunks at line 7945, column 12. See page 261 of PBP. (Severity: 3) +Expression form of "eval" at line 8051, column 42. See page 161 of PBP. (Severity: 5) +Expression form of "eval" at line 8055, column 44. See page 161 of PBP. (Severity: 5) +Reused variable name in lexical scope: $sync at line 8072, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 8093, column 9. Invent unique variable names. (Severity: 3) +Reused variable name in lexical scope: $sync at line 8145, column 9. Invent unique variable names. (Severity: 3) +Split long regexps into smaller qr// chunks at line 8481, column 20. See page 261 of PBP. (Severity: 3) +Close filehandles as soon as possible after opening them at line 8693, column 2. See page 209 of PBP. (Severity: 4) +Magic variable "*STDERR" should be assigned as "local" at line 8696, column 10. See pages 81,82 of PBP. (Severity: 4) +One-argument "select" used at line 8697, column 2. See page 224 of PBP. (Severity: 4) +Multiple "package" declarations at line 9395, column 1. Limit to one per file. (Severity: 4) +Subroutine "GetOptions" with high complexity score (32) at line 9407, column 1. Consider refactoring. (Severity: 3) +Regular expression without "/x" flag at line 9425, column 22. See page 236 of PBP. (Severity: 3) +Capture variable used outside conditional at line 9430, column 32. See page 253 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 9438, column 42. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 9439, column 30. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 9443, column 35. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 9460, column 30. See page 236 of PBP. (Severity: 3) +Regular expression without "/x" flag at line 9462, column 35. See page 236 of PBP. (Severity: 3) + + 1 files. + 263 subroutines/methods. +8,603 statements. + +9,486 lines, consisting of: + 1,684 blank lines. + 551 comment lines. + 0 data lines. + 6,579 lines of Perl code. + 672 lines of POD. + +Average McCabe score of subroutines was 4.35. + +131 violations. +Violations per file was 131.000. +Violations per statement was 0.015. +Violations per line of code was 0.014. + + 6 severity 5 violations. + 5 severity 4 violations. +120 severity 3 violations. + + 6 violations of BuiltinFunctions::ProhibitStringyEval. + 1 violations of ControlStructures::ProhibitDeepNests. + 1 violations of ErrorHandling::RequireCarping. + 1 violations of ErrorHandling::RequireCheckingReturnValueOfEval. + 4 violations of InputOutput::ProhibitBacktickOperators. + 1 violations of InputOutput::ProhibitJoinedReadline. + 1 violations of InputOutput::ProhibitOneArgSelect. + 2 violations of InputOutput::RequireBriefOpen. + 1 violations of Modules::ProhibitExcessMainComplexity. + 1 violations of Modules::ProhibitMultiplePackages. + 1 violations of RegularExpressions::ProhibitCaptureWithoutTest. + 9 violations of RegularExpressions::ProhibitComplexRegexes. +44 violations of RegularExpressions::RequireExtendedFormatting. + 5 violations of Subroutines::ProhibitExcessComplexity. +11 violations of Subroutines::ProhibitManyArgs. + 1 violations of ValuesAndExpressions::ProhibitImplicitNewlines. +16 violations of ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters. +22 violations of Variables::ProhibitReusedNames. + 2 violations of Variables::ProhibitUnusedVariables. + 1 violations of Variables::RequireLocalizedPunctuationVars. diff --git a/W/perlcritic_4.out b/W/perlcritic_4.out index f47dbfe..cc4d3a0 100644 --- a/W/perlcritic_4.out +++ b/W/perlcritic_4.out @@ -1,9 +1,38 @@ -Expression form of "eval" at line 4012, column 13. See page 161 of PBP. (Severity: 5) -Expression form of "eval" at line 4242, column 13. See page 161 of PBP. (Severity: 5) -Expression form of "eval" at line 6186, column 13. See page 161 of PBP. (Severity: 5) -Expression form of "eval" at line 6426, column 13. See page 161 of PBP. (Severity: 5) -Expression form of "eval" at line 7330, column 43. See page 161 of PBP. (Severity: 5) -Expression form of "eval" at line 7334, column 45. See page 161 of PBP. (Severity: 5) -Close filehandles as soon as possible after opening them at line 7750, column 2. See page 209 of PBP. (Severity: 4) -Magic variable "*STDERR" should be assigned as "local" at line 7753, column 10. See pages 81,82 of PBP. (Severity: 4) -One-argument "select" used at line 7754, column 2. See page 224 of PBP. (Severity: 4) +Expression form of "eval" at line 4391, column 13. See page 161 of PBP. (Severity: 5) +Expression form of "eval" at line 4629, column 13. See page 161 of PBP. (Severity: 5) +Expression form of "eval" at line 6706, column 13. See page 161 of PBP. (Severity: 5) +Expression form of "eval" at line 6942, column 13. See page 161 of PBP. (Severity: 5) +Close filehandles as soon as possible after opening them at line 7338, column 9. See page 209 of PBP. (Severity: 4) +Expression form of "eval" at line 8051, column 42. See page 161 of PBP. (Severity: 5) +Expression form of "eval" at line 8055, column 44. See page 161 of PBP. (Severity: 5) +Close filehandles as soon as possible after opening them at line 8693, column 2. See page 209 of PBP. (Severity: 4) +Magic variable "*STDERR" should be assigned as "local" at line 8696, column 10. See pages 81,82 of PBP. (Severity: 4) +One-argument "select" used at line 8697, column 2. See page 224 of PBP. (Severity: 4) +Multiple "package" declarations at line 9395, column 1. Limit to one per file. (Severity: 4) + + 1 files. + 263 subroutines/methods. +8,603 statements. + +9,486 lines, consisting of: + 1,684 blank lines. + 551 comment lines. + 0 data lines. + 6,579 lines of Perl code. + 672 lines of POD. + +Average McCabe score of subroutines was 4.35. + +11 violations. +Violations per file was 11.000. +Violations per statement was 0.001. +Violations per line of code was 0.001. + +6 severity 5 violations. +5 severity 4 violations. + +6 violations of BuiltinFunctions::ProhibitStringyEval. +1 violations of InputOutput::ProhibitOneArgSelect. +2 violations of InputOutput::RequireBriefOpen. +1 violations of Modules::ProhibitMultiplePackages. +1 violations of Variables::RequireLocalizedPunctuationVars. diff --git a/W/prereq.Ubuntu b/W/prereq.Ubuntu index 93e93f2..df759c7 100644 --- a/W/prereq.Ubuntu +++ b/W/prereq.Ubuntu @@ -1,17 +1,17 @@ $SHELL says /bin/bash $0 gives ./INSTALL.d/prerequisites_imapsync -ps -ef gives gilles 1314 1313 0 09:43 pts/31 00:00:00 /bin/sh ./INSTALL.d/prerequisites_imapsync +ps -ef gives gilles 11305 11304 0 12:55 pts/27 00:00:00 /bin/sh ./INSTALL.d/prerequisites_imapsync Distributor ID: Ubuntu -Description: Ubuntu 12.04.5 LTS -Release: 12.04 -Codename: precise -Linux petite 3.2.0-97-generic #137-Ubuntu SMP Thu Dec 17 21:14:00 UTC 2015 i686 i686 i386 GNU/Linux -Ok: Found Perl 5.14.2 -Ok: Found Perl module Digest::HMAC_MD5 +Description: Ubuntu 14.04.5 LTS +Release: 14.04 +Codename: trusty +Linux petite 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:32 UTC 2016 i686 i686 i686 GNU/Linux +Ok: Found Perl 5.18.2 Ok: Found Perl module Authen::NTLM Ok: Found Perl module Compress::Zlib Ok: Found Perl module Data::Dumper Ok: Found Perl module Data::Uniqid +Ok: Found Perl module Digest::HMAC_MD5 Ok: Found Perl module Digest::HMAC Ok: Found Perl module Digest::MD5 Ok: Found Perl module File::Copy::Recursive @@ -19,9 +19,12 @@ Ok: Found Perl module IO::Socket::INET Ok: Found Perl module IO::Socket::INET6 Ok: Found Perl module IO::Socket::SSL Ok: Found Perl module IO::Tee +Ok: Found Perl module JSON::WebToken Ok: Found Perl module Mail::IMAPClient Ok: Found Perl module Parse::RecDescent +Ok: Found Perl module Readonly Ok: Found Perl module Term::ReadKey +Ok: Found Perl module Test::MockObject Ok: Found Perl module Test::More Ok: Found Perl module Test::Pod Ok: Found Perl module Unicode::String diff --git a/W/prereq.scandeps b/W/prereq.scandeps index 846ef56..405331b 100644 --- a/W/prereq.scandeps +++ b/W/prereq.scandeps @@ -36,8 +36,8 @@ See all possibilities in the new() method of IO::Socket::SSL http://search.cpan.org/perldoc?IO::Socket::SSL#Description_Of_Methods --sslargs2 str : Pass any ssl parameter for host2 ssl or tls connection. - See --sslargs1 - + See --sslargs1 + --timeout1 int : Connection timeout in seconds for host1. Default is 120 and 0 means no timeout at all. --timeout2 int : Connection timeout in seconds for host2. @@ -91,9 +91,9 @@ It does it by adding two --regextrans2 options before all others. Add --debug to see what's really going on. - --automap : guesses folders mapping, for folders like + --automap : guesses folders mapping, for folders like "Sent", "Junk", "Drafts", "All", "Archive", "Flagged". - --f1f2 str1=str2 : Force folder str1 to be synced to str2, + --f1f2 str1=str2 : Force folder str1 to be synced to str2, --f1f2 overrides --automap and --regextrans2. --regextrans2 reg : Apply the whole regex to each destination folders. --regextrans2 reg : and this one. etc. @@ -134,7 +134,7 @@ --pipemess cmd : Apply this cmd command to each message content before the copy. --pipemess cmd : and this one, etc. - + --disarmreadreceipts : Disarms read receipts (host2 Exchange issue) --regexmess reg : Apply the whole regex to each message before transfer. @@ -274,65 +274,52 @@ --host1 test1.lamiral.info --user1 test1 --password1 secret1 \ --host2 test2.lamiral.info --user2 test2 --password2 secret2 -Here is a [linux] system (Linux petite 3.2.0-97-generic #137-Ubuntu SMP Thu Dec 17 21:14:00 UTC 2015 i686) -With perl 5.14.2 Mail::IMAPClient 3.30 -$Id: imapsync,v 1.684 2016/03/17 08:35:03 gilles Exp gilles $ -This current imapsync is up to date +Here is a [linux] system (Linux petite 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:32 UTC 2016 i686) +with Perl 5.18.2 Mail::IMAPClient 3.35 +$Id: prereq.scandeps,v 1.4 2016/08/19 10:55:47 gilles Exp gilles $ +This imapsync is up to date Homepage: http://imapsync.lamiral.info/ [MSG] No '/home/gilles/.cpanplus/custom-sources' dir, skipping custom sources [MSG] No '/home/gilles/.cpanplus/custom-sources' dir, skipping custom sources [MSG] No '/home/gilles/.cpanplus/custom-sources' dir, skipping custom sources -'Tie::Hash::NamedCapture' => '0.08', +'Tie::Hash::NamedCapture' => '0.09', 'Authen::NTLM::DES' => '1.02', 'Authen::NTLM::MD4' => '1.02', -'IO::Compress::Gzip' => '2.048', -'IO::Uncompress::Gunzip' => '2.048', -'IO::Compress::Gzip::Constants' => '2.048', -'IO::Compress::Base::Common' => '2.048', -'Compress::Raw::Zlib' => '2.048', -'Convert::ASN1::IO' => 'undef', -'Convert::ASN1::_decode' => 'undef', -'Convert::ASN1::_encode' => 'undef', -'Convert::ASN1::parser' => 'undef', +'IO::Compress::Gzip' => '2.063', +'IO::Compress::Base::Common' => '2.063', +'IO::Compress::Gzip::Constants' => '2.063', +'IO::Uncompress::Gunzip' => '2.063', +'Compress::Raw::Zlib' => '2.063', +'Convert::ASN1::IO' => '0.26', +'Convert::ASN1::_decode' => '0.26', +'Convert::ASN1::_encode' => '0.26', +'Convert::ASN1::parser' => '0.26', 'Crypt::SSLeay::X509' => 'undef', 'Crypt::SSLeay::CTX' => 'undef', 'Digest::HMAC' => '1.03', 'Encode::HanExtra' => '0.23', -'Cwd' => '3.33', -'HTML::Parser' => '3.69', +'HTML::Parser' => '3.71', 'HTTP::Cookies::Netscape' => '6.00', 'Time::Zone' => '2.24', -'IO::Compress::Bzip2' => '2.048', -'IO::Compress::Deflate' => '2.048', -'IO::Uncompress::Bunzip2' => '2.048', -'IO::Uncompress::Inflate' => '2.048', -'IO::Uncompress::RawInflate' => '2.048', -'HTTP::Message' => '6.01', +'IO::Compress::Bzip2' => '2.063', +'IO::Compress::Deflate' => '2.063', +'IO::HTML' => '1.00', +'IO::Uncompress::Bunzip2' => '2.063', +'IO::Uncompress::Inflate' => '2.063', +'IO::Uncompress::RawInflate' => '2.063', +'HTTP::Message' => '6.06', 'File::GlobMapper' => '1.000', -'IO::Compress::Base' => '2.048', -'IO::Compress::Adapter::Bzip2' => '2.048', -'IO::Compress::RawDeflate' => '2.048', -'IO::Compress::Adapter::Deflate' => '2.048', -'IO::Compress::Zlib::Extra' => '2.048', -'Socket6' => '0.23', -'IO::Socket::INET6' => '2.69', -'Net::SSLeay' => '1.42', -'Compress::Raw::Bzip2' => '2.048', -'IO::Uncompress::Adapter::Bunzip2' => '2.048', -'IO::Uncompress::Base' => '2.048', -'IO::Compress::Zlib::Constants' => '2.048', -'IO::Uncompress::Adapter::Inflate' => '2.048', -'JSON::WebToken::Constants' => 'undef', -'JSON::WebToken::Exception' => 'undef', -'Module::Runtime' => '0.011', -'JSON::WebToken::Crypt' => 'undef', -'common::sense' => '3.4', -'Authen::NTLM' => '1.09', -'CPAN::Config' => 'undef', -'URI' => '1.59', +'IO::Compress::Base' => '2.063', +'IO::Compress::Adapter::Bzip2' => '2.063', +'IO::Compress::Zlib::Constants' => '2.063', +'IO::Compress::RawDeflate' => '2.063', +'IO::Compress::Adapter::Deflate' => '2.063', +'Socket6' => '0.25', 'URI::data' => 'undef', +'URI::_idna' => 'undef', +'URI::_generic' => 'undef', 'URI::mailto' => 'undef', 'URI::_query' => 'undef', 'URI::QueryParam' => 'undef', @@ -369,72 +356,90 @@ Homepage: http://imapsync.lamiral.info/ 'URI::news' => 'undef', 'URI::rtsp' => 'undef', 'URI::Heuristic' => '4.20', -'URI::_userpass' => 'undef', 'URI::sip' => '0.11', +'URI::_userpass' => 'undef', 'URI::_login' => 'undef', -'URI::_idna' => 'undef', -'URI::_generic' => 'undef', -'LWP::MediaTypes' => '6.01', -'File::Listing' => '6.03', -'HTTP::Negotiate' => '6.00', -'Net::HTTP' => '6.02', -'Net::HTTPS' => '6.02', -'LWP::Debug' => 'undef', -'Net::LDAP' => '0.43', -'Net::LDAP::LDIF' => '0.18', -'Mail::Internet' => '2.08', -'HTTP::Status' => '6.00', +'URI::file' => '4.21', +'URI::WithBase' => '2.20', +'URI' => '1.60', +'URI::_server' => 'undef', +'Net::SSLeay' => '1.58', +'Compress::Raw::Bzip2' => '2.063', +'IO::Uncompress::Adapter::Bunzip2' => '2.063', +'IO::Uncompress::Base' => '2.063', +'IO::Compress::Zlib::Extra' => '2.063', +'IO::Uncompress::Adapter::Inflate' => '2.063', +'JSON::WebToken::Constants' => 'undef', +'JSON::WebToken::Exception' => 'undef', +'Module::Runtime' => '0.013', +'JSON::WebToken::Crypt' => 'undef', +'common::sense' => '3.72', +'Authen::NTLM' => '1.09', +'HTTP::Status' => '6.03', 'LWP::Protocol' => '6.00', -'HTTP::Response' => '6.01', +'HTTP::Response' => '6.04', +'CPAN::Config' => 'undef', +'LWP::MediaTypes' => '6.02', 'HTTP::Request' => '6.00', -'HTML::HeadParser' => '3.69', +'HTTP::Date' => '6.02', +'File::Listing' => '6.04', +'HTTP::Negotiate' => '6.00', +'Net::HTTP' => '6.06', +'Net::HTTPS' => '6.04', +'Net::SSL' => '2.85', +'LWP::Debug' => 'undef', +'Net::LDAP::DSML' => '0.16', +'Net::LDAP' => '0.58', +'Net::LDAP::LDIF' => '0.22', +'Mail::Internet' => '2.12', +'HTML::HeadParser' => '3.71', 'HTTP::Config' => '6.00', -'HTTP::Request::Common' => '6.00', +'HTTP::Request::Common' => '6.04', 'LWP::ConnCache' => '6.02', 'HTTP::Cookies' => '6.00', -'HTTP::Headers' => '6.00', -'Encode::Locale' => '1.02', -'HTTP::Headers::Util' => '6.00', +'HTTP::Headers' => '6.05', +'Encode::Locale' => '1.03', +'HTTP::Headers::Util' => '6.03', 'LWP::MemberMixin' => 'undef', -'LWP' => '6.03', -'HTTP::Date' => '6.00', -'Compress::Zlib' => '2.048', +'LWP' => '6.05', +'Compress::Zlib' => '2.063', 'Mail::IMAPClient::MessageSet' => 'undef', 'Digest::HMAC_MD5' => '1.01', -'Mail::Address' => '2.08', -'Mail::Header' => '2.08', -'Mail::Mailer' => '2.08', -'Mail::Util' => '2.08', -'Params::Classify' => '0.013', -'Net::HTTP::Methods' => '6.00', -'Net::SSL' => '2.84', -'Net::LDAP::Bind' => '1.03', -'Net::LDAP::Extension' => '1.02', -'Net::LDAP::RootDSE' => '0.01', -'Net::LDAP::Schema' => '0.9905', -'Net::LDAP::Search' => '0.13', -'Convert::ASN1::Debug' => 'undef', -'Convert::ASN1' => '0.22', -'Net::LDAP::Entry' => '0.24', -'Net::LDAP::ASN' => '0.08', -'Net::LDAP::Constant' => '0.08', -'Net::LDAP::Filter' => '0.15', -'Net::LDAP::Message' => '1.11', -'Net::LDAP::Util' => '0.11', -'Net::LDAP::Control' => '0.09', -'Net::LDAP::Intermediate' => '0.02', +'Mail::Address' => '2.12', +'Mail::Header' => '2.12', +'Mail::Mailer' => '2.12', +'Mail::Util' => '2.12', +'Net::HTTP::Methods' => '6.06', +'Net::LDAP::Bind' => '1.04', +'Net::LDAP::Extension' => '1.03', +'Net::LDAP::RootDSE' => '0.02', +'Net::LDAP::Search' => '0.14', +'Convert::ASN1::Debug' => '0.26', +'Convert::ASN1' => '0.26', +'Net::LDAP::Constant' => '0.22', +'Net::LDAP::ASN' => '0.11', +'Net::LDAP::Message' => '1.12', +'Net::LDAP::Filter' => '0.19', +'XML::SAX::Base' => '1.07', +'Net::LDAP::Schema' => '0.9908', +'Net::LDAP::Entry' => '0.26', +'Net::LDAP::Control' => '0.15', +'Net::LDAP::Util' => '0.18', +'Net::LDAP::Intermediate' => '0.04', 'Crypt::SSLeay::Conn' => 'undef', 'Crypt::SSLeay::Err' => 'undef', 'Crypt::SSLeay::MainContext' => 'undef', -'Crypt::SSLeay' => '0.57', +'Crypt::SSLeay' => '0.58', +'Readonly::Array' => '1.04', +'Readonly::Hash' => '1.04', +'Readonly::Scalar' => '1.04', 'Test::Builder::IO::Scalar' => '2.110', -'threads::shared' => '1.40', -'Test::Builder' => '0.98', -'Test::Builder::Module' => '0.98', -'URI::WithBase' => '2.20', -'URI::file' => '4.21', -'URI::_server' => 'undef', +'UNIVERSAL::can' => '1.20140124', +'UNIVERSAL::isa' => '1.20120726', +'Test::Builder' => '1.001002', +'Test::Builder::Module' => '1.001002', 'Unicode::CharName' => '1.07', +'XML::SAX::Exception' => '1.07', 'Crypt::OpenSSL::Bignum' => '0.04', 'Crypt::OpenSSL::Random' => '0.04', 'Data::Uniqid' => '0.12', @@ -443,20 +448,26 @@ Homepage: http://imapsync.lamiral.info/ 'IO::Tee' => '0.64', 'JSON::WebToken' => '0.10', 'JSON::WebToken::Crypt::RSA' => 'undef', -'Term::ReadKey' => '2.30', -'Test::More' => '0.98', +'Readonly' => '1.04', +'Term::ReadKey' => '2.31', +'Test::MockObject' => '1.20120301', +'Test::More' => '1.001002', 'Unicode::String' => '2.09', -'File::Spec::Unix' => '3.33', -'File::Spec' => '3.33', -'JSON::PP' => '2.27203', -'JSON::PP::Boolean' => 'undef', +'File::Spec::Unix' => '3.40', +'File::Spec' => '3.40', +'Cwd' => '3.40', +'URI::http' => 'undef', +'URI::URL' => '5.04', +'URI::Escape' => '3.31', +'JSON' => '2.61', 'JSON::XS::Boolean' => 'undef', -'JSON' => '2.53', -'Crypt::OpenSSL::RSA' => '0.27', -'JSON::XS' => '2.32', -'LWP::UserAgent' => '6.03', +'JSON::XS' => '2.34', +'Crypt::OpenSSL::RSA' => '0.28', +'LWP::UserAgent' => '6.05', 'HTML::Entities' => '3.69', -'URI::Escape' => '3.31', +'LWP::Protocol::http' => 'undef', +'IO::Socket::SSL' => '1.965', +'LWP::Protocol::ldap' => '1.25', 'LWP::Authen::Digest' => 'undef', 'LWP::Authen::Ntlm' => '6.00', 'LWP::Protocol::GHTTP' => 'undef', @@ -465,15 +476,11 @@ Homepage: http://imapsync.lamiral.info/ 'LWP::Protocol::file' => 'undef', 'LWP::Protocol::ftp' => 'undef', 'LWP::Protocol::gopher' => 'undef', -'LWP::Protocol::https' => '6.02', +'LWP::Protocol::https' => '6.04', +'LWP::Protocol::ldapi' => 'undef', 'LWP::Protocol::ldaps' => 'undef', 'LWP::Protocol::loopback' => 'undef', 'LWP::Protocol::mailto' => 'undef', 'LWP::Protocol::nntp' => 'undef', 'LWP::Protocol::nogo' => 'undef', 'LWP::Authen::Basic' => 'undef', -'URI::URL' => '5.04', -'URI::http' => 'undef', -'LWP::Protocol::http' => 'undef', -'LWP::Protocol::ldap' => '1.11', -'IO::Socket::SSL' => '1.53', diff --git a/W/test2.bat b/W/test2.bat index ac8eeec..5f54f9c 100644 --- a/W/test2.bat +++ b/W/test2.bat @@ -1,11 +1,12 @@ -@REM $Id: test2.bat,v 1.20 2015/11/23 16:47:01 gilles Exp gilles $ +@REM $Id: test2.bat,v 1.21 2016/05/27 23:05:23 gilles Exp gilles $ @REM cd /D %~dp0 @REM @ECHO off -.\imapsync.exe --modules_version -@PAUSE -.\imapsync.exe --testslive -@PAUSE + +@REM perl .\imapsync --host1 p --ssl1 --user1 tata --passfile1 secret.tata --host2 p --ssl2 --user2 titi --passfile2 secret.titi --justfoldersizes | findstr /C:"Host2 Total size:" + + +findstr /l /C:"Error login" LOG_imapsync\*.txt diff --git a/W/test3.bat b/W/test3.bat index 83c345f..fad65c6 100644 --- a/W/test3.bat +++ b/W/test3.bat @@ -1,16 +1,12 @@ -@REM $Id: test3.bat,v 1.23 2015/12/14 15:15:12 gilles Exp gilles $ +@REM $Id: test3.bat,v 1.24 2016/08/05 14:22:42 gilles Exp gilles $ cd /D %~dp0 @REM \$1 must be $1 on Windows @REM ==== password within double-quotes -perl ./imapsync ^ - --host1 p --user1 tata ^ - --password1 """(secret)""" ^ - --host2 p --user2 titi ^ - --passfile2 secret.titi ^ - --justlogin --debugimap1 --showpassword +perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi ^ + --debugimap2 --debugcontent --folder INBOX --maxage 1 @EXIT diff --git a/W/test3_gmail.bat b/W/test3_gmail.bat index d461981..b55eb8a 100644 --- a/W/test3_gmail.bat +++ b/W/test3_gmail.bat @@ -1,9 +1,9 @@ -@REM $Id: test3_gmail.bat,v 1.3 2015/09/19 08:23:14 gilles Exp gilles $ +@REM $Id: test3_gmail.bat,v 1.4 2016/08/19 14:11:00 gilles Exp gilles $ cd /D %~dp0 -@REM ./imapsync.exe --modules_version +@REM ./imapsync.exe --justbanner @REM perl .\imapsync --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com --passfile1 secret.gilles_gmail ^ @REM --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com --passfile2 secret.gilles_gmail ^ @@ -13,4 +13,4 @@ cd /D %~dp0 perl .\imapsync --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com --passfile1 secret.gilles_gmail ^ --host2 p --user2 tata --passfile2 secret.tata ^ - --regextrans2 "s,\[Gmail\].,," --dry --justfolders \ No newline at end of file + --regextrans2 "s,\[Gmail\].,," --dry --justfolders diff --git a/W/test_exe.bat b/W/test_exe.bat index c46c29e..0ce95af 100644 --- a/W/test_exe.bat +++ b/W/test_exe.bat @@ -1,42 +1,60 @@ -REM $Id: test_exe.bat,v 1.11 2014/05/22 10:13:34 gilles Exp gilles $ +REM $Id: test_exe.bat,v 1.15 2016/08/19 14:09:56 gilles Exp gilles $ -cd /D %~dp0 +@SETLOCAL +@ECHO OFF +ECHO Currently running through %0 %* -@REM EXIT +cd /D %~dp0 -.\imapsync.exe +REM Remove the error file because its existence means an error occured during this script execution +IF EXIST LOG_bat\%~nx0.txt DEL LOG_bat\%~nx0.txt +REM CALL :handle_error .\imapsync.exe --thisoptionnoexists +CALL :handle_error perl imapsync --tests +CALL :handle_error .\imapsync.exe --tests +CALL :handle_error .\imapsync.exe --testslive +EXIT /B @ECHO ==== All 8 combinaisons between ssl1/tls1 ssl2/tls2 justconnect/justlogin -@ECHO -@ECHO ==== 1 --SSL1 --SSL2 --JUSTCONNECT -.\imapsync.exe --host1 p --ssl1 --user1 tata --passfile1 secret.tata --host2 p --ssl2 --user2 titi --passfile2 secret.titi --justconnect - -@ECHO ==== 2 --SSL1 --SSL2 --JUSTLOGIN -.\imapsync.exe --host1 p --ssl1 --user1 tata --passfile1 secret.tata --host2 p --ssl2 --user2 titi --passfile2 secret.titi --justlogin - -@ECHO ==== 3 --TLS1 --TLS2 --JUSTCONNECT -.\imapsync.exe --host1 p --tls1 --user1 tata --passfile1 secret.tata --host2 p --tls2 --user2 titi --passfile2 secret.titi --justconnect - -@ECHO ==== 4 --TLS1 --TLS2 --JUSTLOGIN -.\imapsync.exe --host1 p --tls1 --user1 tata --passfile1 secret.tata --host2 p --tls2 --user2 titi --passfile2 secret.titi --justlogin - -@ECHO ==== 5 --SSL1 --TLS2 --JUSTCONNECT -.\imapsync.exe --host1 p --ssl1 --user1 tata --passfile1 secret.tata --host2 p --tls2 --user2 titi --passfile2 secret.titi --justconnect - -@ECHO ==== 6 --SSL1 --TLS2 --JUSTLOGIN -.\imapsync.exe --host1 p --ssl1 --user1 tata --passfile1 secret.tata --host2 p --tls2 --user2 titi --passfile2 secret.titi --justlogin - -@ECHO ==== 7 --TLS1 --SSL2 --JUSTCONNECT -.\imapsync.exe --host1 p --tls1 --user1 tata --passfile1 secret.tata --host2 p --ssl2 --user2 titi --passfile2 secret.titi --justconnect - -@ECHO ==== 8 --TLS1 --SSL2 --JUSTLOGIN -.\imapsync.exe --host1 p --tls1 --user1 tata --passfile1 secret.tata --host2 p --ssl2 --user2 titi --passfile2 secret.titi --justlogin - - - -.\imapsync.exe --host1 p --user1 toto --passfile1 secret.toto --host2 p --user2 titi --passfile2 secret.titi --ssl1 --ssl1_SSL_version SSLv3 --ssl2 --justconnect -.\imapsync.exe --host1 p --user1 toto --passfile1 secret.toto --host2 p --user2 titi --passfile2 secret.titi --ssl1 --ssl1_SSL_version SSLv3 --ssl2 --justlogin -.\imapsync.exe --host1 p --user1 toto --passfile1 secret.toto --host2 p --user2 titi --passfile2 secret.titi --ssl1 --ssl2 --delete2 -.\imapsync.exe --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --ssl1 --ssl2 --delete2 --folder INBOX -.\imapsync.exe --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --ssl1 --ssl2 --delete2 --folder INBOX --usecache +CALL :handle_error CALL :launch_imapsync --justconnect --ssl1 --ssl2 +CALL :handle_error CALL :launch_imapsync --justconnect --tls1 --tls2 +CALL :handle_error CALL :launch_imapsync --justconnect --ssl1 --tls2 +CALL :handle_error CALL :launch_imapsync --justconnect --tls1 --ssl2 +CALL :handle_error CALL :launch_imapsync --justlogin --ssl1 --ssl2 +CALL :handle_error CALL :launch_imapsync --justlogin --tls1 --tls2 +CALL :handle_error CALL :launch_imapsync --justlogin --ssl1 --tls2 +CALL :handle_error CALL :launch_imapsync --justlogin --tls1 --ssl2 +@ECHO ==== various calls +CALL :handle_error CALL :launch_imapsync --ssl1 --ssl1_SSL_version SSLv3 --ssl2 --justconnect +CALL :handle_error CALL :launch_imapsync --ssl1 --ssl1_SSL_version SSLv3 --ssl2 --justlogin +CALL :handle_error CALL :launch_imapsync --ssl1 --ssl2 --delete2 +CALL :handle_error CALL :launch_imapsync --ssl1 --ssl2 --delete2 --folder INBOX +CALL :handle_error CALL :launch_imapsync --ssl1 --ssl2 --delete2 --folder INBOX --usecache + +ENDLOCAL +EXIT /B + + +:handle_error +SETLOCAL +ECHO IN %0 %* +%* +SET CMD_RETURN=%ERRORLEVEL% +ECHO CMD_RETURN=%CMD_RETURN% +IF %CMD_RETURN% EQU 0 ( + ECHO GOOD END +) ELSE ( + ECHO BAD END + IF NOT EXIST LOG_bat MKDIR LOG_bat + ECHO Failure calling %* >> LOG_bat\%~nx0.txt +) +ENDLOCAL +EXIT /B + + +:launch_imapsync +@SETLOCAL +ECHO IN %0 %* +.\imapsync.exe --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi %* +@ENDLOCAL +@EXIT /B diff --git a/W/test_exe_2.bat b/W/test_exe_2.bat index 1c9cb18..5c25a77 100644 --- a/W/test_exe_2.bat +++ b/W/test_exe_2.bat @@ -1,6 +1,6 @@ @REM -@REM $Id: test_exe_2.bat,v 1.9 2015/12/14 15:15:01 gilles Exp gilles $ +@REM $Id: test_exe_2.bat,v 1.10 2016/07/20 12:48:28 gilles Exp gilles $ @REM cd C:\msys\1.0\home\Admin\imapsync cd /D %~dp0 @@ -18,6 +18,8 @@ cd /D %~dp0 @REM perl .\imapsync --tests @REM .\imapsync.exe --testslive --authmech2 XOAUTH2 -.\imapsync.exe --host1 p --user1 tata --passfile1 secret.tata --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com --passfile2 secret.gilles_gmail --authmech2 XOAUTH2 + +@REM .\imapsync.exe --host1 p --user1 tata --passfile1 secret.tata --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com --passfile2 secret.gilles_gmail --authmech2 XOAUTH2 @REM .\imapsync.exe --host1 mail2.name-services.com --user1 jessica@champlaindoor.com --passfile1 secret.mail2World --host2 mail.emailsrvr.com --user2 jessica@champlaindoor.com --passfile2 secret.mail2World --sep1 / --prefix1 "" --noabletosearch --fetch_hash_set "1:*" --delete2duplicates + diff --git a/W/test_tests.bat b/W/test_tests.bat index 2c697ab..0076df5 100644 --- a/W/test_tests.bat +++ b/W/test_tests.bat @@ -1,9 +1,37 @@ -@REM $Id: test_tests.bat,v 1.3 2015/09/19 08:46:11 gilles Exp gilles $ +@REM $Id: test_tests.bat,v 1.5 2016/08/19 14:08:01 gilles Exp gilles $ -@REM cd C:\msys\1.0\home\Admin\imapsync -cd /D %~dp0 +@SETLOCAL +@ECHO OFF -perl .\imapsync --modules_version -perl .\imapsync --tests +ECHO Currently running through %0 %* + +CD /D %~dp0 + +REM Remove the error file because its existence means an error occured during this script execution +IF EXIST LOG_bat\%~nx0.txt DEL LOG_bat\%~nx0.txt + +CALL :handle_error perl .\imapsync --justbanner +CALL :handle_error perl .\imapsync --testsdebug +CALL :handle_error perl .\imapsync --tests @REM @PAUSE +@ENDLOCAL +@EXIT /B + + +:handle_error +SETLOCAL +ECHO IN %0 with parameters %* +%* +SET CMD_RETURN=%ERRORLEVEL% + +IF %CMD_RETURN% EQU 0 ( + ECHO GOOD END +) ELSE ( + ECHO BAD END + IF NOT EXIST LOG_bat MKDIR LOG_bat + ECHO Failure running %* >> LOG_bat\%~nx0.txt +) +ENDLOCAL +EXIT /B + diff --git a/W/test_testsdebug.bat b/W/test_testsdebug.bat new file mode 100644 index 0000000..c3efdeb --- /dev/null +++ b/W/test_testsdebug.bat @@ -0,0 +1,37 @@ +@REM $Id: test_testsdebug.bat,v 1.1 2016/08/19 08:20:53 gilles Exp gilles $ + +@SETLOCAL +@ECHO OFF + +ECHO Currently running through %0 %* + +CD /D %~dp0 + +REM Remove the error file because its existence means an error occured during this script execution +IF EXIST LOG_bat\%~nx0.txt DEL LOG_bat\%~nx0.txt + +@REM CALL :handle_error perl .\imapsync --justbanner +CALL :handle_error perl .\imapsync --testsdebug +@REM CALL :handle_error perl .\imapsync --tests + +@REM @PAUSE +@ENDLOCAL +@EXIT /B + + +:handle_error +SETLOCAL +ECHO IN %0 with parameters %* +%* +SET CMD_RETURN=%ERRORLEVEL% + +IF %CMD_RETURN% EQU 0 ( + ECHO GOOD END +) ELSE ( + ECHO BAD END + IF NOT EXIST LOG_bat MKDIR LOG_bat + ECHO Failure running %* >> LOG_bat\%~nx0.txt +) +ENDLOCAL +EXIT /B + diff --git a/W/test_xoauth2.bat b/W/test_xoauth2.bat index 6a14c60..66088cc 100644 --- a/W/test_xoauth2.bat +++ b/W/test_xoauth2.bat @@ -1,11 +1,11 @@ -@REM $Id: test_xoauth2.bat,v 1.1 2015/12/26 02:11:27 gilles Exp gilles $ +@REM $Id: test_xoauth2.bat,v 1.2 2016/08/19 14:07:40 gilles Exp gilles $ @REM cd /D %~dp0 @REM @ECHO off -@REM .\imapsync.exe --modules_version +@REM .\imapsync.exe --justbanner @REM @PAUSE @REM .\imapsync.exe --tests @REM @PAUSE diff --git a/W/tools/fixup_email.py b/W/tools/fixup_email.py new file mode 100755 index 0000000..25879aa --- /dev/null +++ b/W/tools/fixup_email.py @@ -0,0 +1,107 @@ +#!/usr/bin/python + +NUKE_HDRS = [ + # (hdr, max_lines, max_items, max_bytes). (-1 => unlimited). + ("References", 485, 485, 40000), +] +MAX_LINE_LENGTH = 996 +NUKE_8BIT = True +FORCE_REWRITE = False + +import sys +from email.parser import Parser +from email.generator import Generator +from email import utils +from cStringIO import StringIO + +# NB: utils._qencode() replaces ALL ' ' with '=20', as required by QP +# header strings. We only need to encode trailing whitespace in message +# body. quopri.encodestring (used by utils._qencode()) does this already. +from quopri import encodestring as qp_encode + +fp = open(sys.argv[1], "rb") if len(sys.argv) > 1 else sys.stdin +msg_text_crnl = fp.read(); fp.close() +msg_text_nl = msg_text_crnl.replace("\r\n", "\n") + +# We want to preserve CRLF and any leading "From" from source message +CRLF = "\r\n" if (len(msg_text_nl) < len(msg_text_crnl)) else "\n" +UNIXFROM = msg_text_nl.startswith("From ") + +def rewrite(part): + need_rewrite = False + + for hdr in part.values(): + if max([len(i) for i in hdr.split('\n')]) > MAX_LINE_LENGTH: + need_rewrite = True # Force MIME rewrite if we have long headers + sys.stderr.write("FIXUP NEXT: Rewrite forced by long header line\n") + + for hdr, max_lines, max_items, max_bytes in NUKE_HDRS: + (hdr, val) = (hdr.lower(), msg.get(hdr)) + if (val and ((max_lines >= 0 and len(val.split('\n')) > max_lines) or + (max_items >= 0 and len(val.split()) > max_items) or + (max_bytes >= 0 and len(val) > max_bytes))): + del msg[hdr] + sys.stderr.write("FIXUP NEXT: Removed long header line: "+hdr+"\n") + need_rewrite = True + + if part.is_multipart(): + for subpart in part.get_payload(): + if rewrite(subpart): + need_rewrite = True + return need_rewrite + + payload = part.get_payload() + max_line_length = max([ len(i) for i in payload.split('\n') ]) + + cte = part.get('content-transfer-encoding', '').lower().strip() + if cte in ['8bit', '7bit', 'binary', '']: + # Encode unencoded forms which contain 8bit characters or long lines + update_cte = part.replace_header if (cte != '') else part.add_header + nonascii_count = [(ord(c) >= 128) for c in payload].count(True) + if ((NUKE_8BIT and nonascii_count > 0) or + max_line_length > MAX_LINE_LENGTH): + if nonascii_count < 100: + part.set_payload(qp_encode(payload)) + update_cte('Content-Transfer-Encoding', "quoted-printable") + else: + part.set_payload(utils._bencode(payload)) + update_cte('Content-Transfer-Encoding', "base64") + need_rewrite = True + elif cte in ['quoted-printable', 'base64']: + # Recode quoted-printable or base64 with long lines + if max_line_length > MAX_LINE_LENGTH: + if cte == 'quoted-printable': + raw=utils._qdecode(payload) + part.set_payload(qp_encode(raw)) + need_rewrite = True + elif cte == 'base64': + try: + raw=utils._bdecode(payload) + part.set_payload(utils._bencode(raw)) + need_rewrite = True + except binascii.Error: + pass + + newcte = part.get('content-transfer-encoding', '').lower().strip() + if (newcte != cte): + part.add_header('X-Mime-Autoconverted', + "from " + (cte or "none") + " to " + newcte) + sys.stderr.write("FIXUP NEXT: Attachment converted " + + "from " + (cte or "none") + " to " + newcte + "\n") + return need_rewrite + +msg=Parser().parsestr(msg_text_nl) + +if not rewrite(msg) and not FORCE_REWRITE: + sys.stdout.write(msg_text_crnl) + sys.exit(0) + +buffer = StringIO() +gen=Generator(buffer, mangle_from_=False, maxheaderlen=MAX_LINE_LENGTH) +gen.flatten(msg, unixfrom=UNIXFROM) + +buffer.seek(0) +for line in buffer.readlines(): + sys.stdout.write(line.rstrip('\n')); sys.stdout.write(CRLF) +buffer.close() +sys.exit(0) diff --git a/W/tools/html5check.py b/W/tools/html5check.py new file mode 100755 index 0000000..5efe1a4 --- /dev/null +++ b/W/tools/html5check.py @@ -0,0 +1,186 @@ +#!/usr/bin/python + +# Copyright (c) 2007-2008 Mozilla Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +import httplib +import os +import sys +import re +import urlparse +import string +import gzip +import StringIO + +extPat = re.compile(r'^.*\.([A-Za-z]+)$') +extDict = { + "html" : "text/html", + "htm" : "text/html", + "xhtml" : "application/xhtml+xml", + "xht" : "application/xhtml+xml", + "xml" : "application/xml", +} + +argv = sys.argv[1:] + +forceXml = 0 +forceHtml = 0 +gnu = 0 +errorsOnly = 0 +encoding = None +fileName = None +contentType = None +inputHandle = None +service = 'http://html5.validator.nu/' + +for arg in argv: + if '--help' == arg: + print '-h : force text/html' + print '-x : force application/xhtml+xml' + print '-g : GNU output' + print '-e : errors only (no info or warnings)' + print '--encoding=foo : declare encoding foo' + print '--service=url : the address of the HTML5 validator' + print 'One file argument allowed. Leave out to read from stdin.' + sys.exit(0) + elif arg.startswith("--encoding="): + encoding = arg[11:] + elif arg.startswith("--service="): + service = arg[10:] + elif arg.startswith("--"): + sys.stderr.write('Unknown argument %s.\n' % arg) + sys.exit(2) + elif arg.startswith("-"): + for c in arg[1:]: + if 'x' == c: + forceXml = 1 + elif 'h' == c: + forceHtml = 1 + elif 'g' == c: + gnu = 1 + elif 'e' == c: + errorsOnly = 1 + else: + sys.stderr.write('Unknown argument %s.\n' % arg) + sys.exit(3) + else: + if fileName: + sys.stderr.write('Cannot have more than one input file.\n') + sys.exit(1) + fileName = arg + +if forceXml and forceHtml: + sys.stderr.write('Cannot force HTML and XHTML at the same time.\n') + sys.exit(2) + +if forceXml: + contentType = 'application/xhtml+xml' +elif forceHtml: + contentType = 'text/html' +elif fileName: + m = extPat.match(fileName) + if m: + ext = m.group(1) + ext = ext.translate(string.maketrans(string.ascii_uppercase, string.ascii_lowercase)) + if extDict.has_key(ext): + contentType = extDict[ext] + else: + sys.stderr.write('Unable to guess Content-Type from file name. Please force the type.\n') + sys.exit(3) + else: + sys.stderr.write('Could not extract a filename extension. Please force the type.\n') + sys.exit(6) +else: + sys.stderr.write('Need to force HTML or XHTML when reading from stdin.\n') + sys.exit(4) + +if encoding: + contentType = '%s; charset=%s' % (contentType, encoding) + +if fileName: + inputHandle = open(fileName, "rb") +else: + inputHandle = sys.stdin + +data = inputHandle.read() + +buf = StringIO.StringIO() +gzipper = gzip.GzipFile(fileobj=buf, mode='wb') +gzipper.write(data) +gzipper.close() +gzippeddata = buf.getvalue() +buf.close() + +connection = None +response = None +status = 302 +redirectCount = 0 + +url = service +if gnu: + url = url + '?out=gnu' +else: + url = url + '?out=text' + +if errorsOnly: + url = url + '&level=error' + +while (status == 302 or status == 301 or status == 307) and redirectCount < 10: + if redirectCount > 0: + url = response.getheader('Location') + parsed = urlparse.urlsplit(url) + if parsed[0] != 'http': + sys.stderr.write('URI scheme %s not supported.\n' % parsed[0]) + sys.exit(7) + if redirectCount > 0: + connection.close() # previous connection + print 'Redirecting to %s' % url + print 'Please press enter to continue or type "stop" followed by enter to stop.' + if raw_input() != "": + sys.exit(0) + connection = httplib.HTTPConnection(parsed[1]) + connection.connect() + connection.putrequest("POST", "%s?%s" % (parsed[2], parsed[3]), skip_accept_encoding=1) + connection.putheader("Accept-Encoding", 'gzip') + connection.putheader("Content-Type", contentType) + connection.putheader("Content-Encoding", 'gzip') + connection.putheader("Content-Length", len(gzippeddata)) + connection.endheaders() + connection.send(gzippeddata) + response = connection.getresponse() + status = response.status + redirectCount += 1 + +if status != 200: + sys.stderr.write('%s %s\n' % (status, response.reason)) + sys.exit(5) + +if response.getheader('Content-Encoding', 'identity').lower() == 'gzip': + response = gzip.GzipFile(fileobj=StringIO.StringIO(response.read())) + +if fileName and gnu: + quotedName = '"%s"' % fileName.replace('"', '\\042') + for line in response: + sys.stdout.write(quotedName) + sys.stdout.write(line) +else: + sys.stdout.write(response.read()) + +connection.close() diff --git a/W/tools/validate_xml_html5 b/W/tools/validate_xml_html5 new file mode 100755 index 0000000..09caa69 --- /dev/null +++ b/W/tools/validate_xml_html5 @@ -0,0 +1,34 @@ +#!/bin/sh + +# $Id: validate_xml_html5,v 1.3 2016/08/05 19:34:46 gilles Exp gilles $ + +#set -x + +validate_xml_html5_one() { + type=`file -b -i "$1"` + echo $1 : $type + if expr match "$type" '.*text/html.*' > /dev/null; then + echo html5check.py -h "$1" + html5check.py -h "$1" + return $? + fi + if expr match "$type" '.*application/xml.*' > /dev/null; then + echo validate --verbose "$1" + validate --verbose "$1" + return $? + fi + echo Unknown type + return 1 +} + + +for f in "$@"; do + validate_xml_html5_one "$f" + cmd_status=$? + echo cmd_status = $cmd_status + test 0 != $cmd_status && return $cmd_status +done + +: # if here then good return + + diff --git a/examples/imapsync_example.bat b/examples/imapsync_example.bat index 70b5f6a..ea17498 100644 --- a/examples/imapsync_example.bat +++ b/examples/imapsync_example.bat @@ -1,4 +1,4 @@ -@REM $Id: imapsync_example.bat,v 1.9 2016/01/21 03:34:51 gilles Exp gilles $ +@REM $Id: imapsync_example.bat,v 1.10 2016/04/07 23:14:09 gilles Exp gilles $ @REM imapsync example batch for Windows users @REM lines beginning with @REM are just comments @@ -11,13 +11,13 @@ @REM with your own values @REM Double quotes are necessary if a value contain one or more blanks. -@REM value for --host1 is the IMAP source server hostname or IP address -@REM value for --user1 is the IMAP source user login -@REM value for --password1 is the IMAP source user password +@REM value "test1.lamiral.info" for --host1 is the IMAP source server hostname or IP address +@REM value "test1" for --user1 is the IMAP source user login +@REM value "secret1" for --password1 is the IMAP source user password -@REM value for --host2 is the IMAP destination server hostname or IP address -@REM value for --user2 is the IMAP destination user login -@REM value for --password2 is the IMAP destination user password +@REM value "test2.lamiral.info" for --host2 is the IMAP destination server hostname or IP address +@REM value "test2" for --user2 is the IMAP destination user login +@REM value "secret2" for --password2 is the IMAP destination user password @REM Character ^ at the end of the first line is essential and means @REM "this command continues on the next line". You can add other lines diff --git a/imapsync b/imapsync index 53dfdf5..6954aaa 100755 --- a/imapsync +++ b/imapsync @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: imapsync,v 1.684 2016/03/17 08:35:03 gilles Exp gilles $ +# $Id: imapsync,v 1.727 2016/08/19 10:30:36 gilles Exp gilles $ # structure # pod documentation # pragmas @@ -17,20 +17,21 @@ =pod -=head1 NAME +=head1 NAME -imapsync - IMAP synchronisation, sync, copy or migration tool. -Synchronises mailboxes between two imap servers. -Good at IMAP migration. More than 66 different IMAP server softwares -supported with success, few failures. +imapsync - Email IMAP tool for syncing, copying and migrating email mailboxes. -$Revision: 1.684 $ +The imapsync command synchronises mailboxes between two imap servers. +More than 69 different IMAP server softwares supported with success, +few failures. + +$Revision: 1.727 $ =head1 SYNOPSIS - To synchronize the source imap account - "test1" on server "test1.lamiral.info" with password "secret1" - to the destination imap account + To synchronize the source imap account + "test1" on server "test1.lamiral.info" with password "secret1" + to the destination imap account "test2" on server "test2.lamiral.info" with password "secret2" do: @@ -38,12 +39,18 @@ $Revision: 1.684 $ --host1 test1.lamiral.info --user1 test1 --password1 secret1 \ --host2 test2.lamiral.info --user2 test2 --password2 secret2 +=head1 REQUIRED ARGUMENTS + +The required argmuments are the six values, three on each sides, +needed to login into the IMAP servers, +a host, a username, and a password, two times. + =head1 INSTALL Imapsync works under any Unix with perl. - Imapsync works under Windows (2000, XP, Vista, Seven) + Imapsync works under Windows (2000, XP, Vista, Seven) as a standalone binary software called imapsync.exe - Imapsync works under OS X as a standalone binary + Imapsync works under OS X as a standalone binary software called imapsync_bin_Darwin. Purchase latest imapsync at @@ -57,34 +64,39 @@ $Revision: 1.684 $ Go into the directory imapsync-x.xx and read the INSTALL file. As mentioned at http://imapsync.lamiral.info/#install - the INSTALL file can also be found at + the INSTALL file can also be found at http://imapsync.lamiral.info/INSTALL It is now split in several files for each system http://imapsync.lamiral.info/INSTALL.d/ +=head1 CONFIGURATION + +There is no specific configuration file for imapsync, +everything is specified by the command line parameteres +and the default behavior. =head1 USAGE -To get a description of each option just run imapsync +To get a description of each option just run imapsync with no argument, like this: - imapsync + imapsync This description of options is also available at http://imapsync.lamiral.info/OPTIONS and is reproduced here: - + usage: ./imapsync [options] - - Several options are mandatory. + + Several options are mandatory. str means string int means integer reg means regular expression cmd means command - - --dry : Makes imapsync doing nothing, just print what would + + --dry : Makes imapsync doing nothing, just print what would be done without --dry. - + --host1 str : Source or "from" imap server. Mandatory. --port1 int : Port to connect on host1. Default is 143, 993 if --ssl1 --user1 str : User to login on host1. Mandatory. @@ -95,12 +107,12 @@ reproduced here: --port2 int : Port to connect on host2. Default is 143, 993 if --ssl2 --user2 str : User to login on host2. Mandatory. --password2 str : Password for the user2. - - --passfile1 str : Password file for the user1. It must contain the + + --passfile1 str : Password file for the user1. It must contain the password on the first line. This option avoids to show the password on the command line like --password1 does. --passfile2 str : Password file for the user2. Contains the password. - + --ssl1 : Use a SSL connection on host1. --ssl2 : Use a SSL connection on host2. --tls1 : Use a TLS connection on host1. @@ -111,45 +123,45 @@ reproduced here: See all possibilities in the new() method of IO::Socket::SSL http://search.cpan.org/perldoc?IO::Socket::SSL#Description_Of_Methods --sslargs2 str : Pass any ssl parameter for host2 ssl or tls connection. - See --sslargs1 - - --timeout1 int : Connection timeout in seconds for host1. + See --sslargs1 + + --timeout1 int : Connection timeout in seconds for host1. Default is 120 and 0 means no timeout at all. - --timeout2 int : Connection timeout in seconds for host2. + --timeout2 int : Connection timeout in seconds for host2. Default is 120 and 0 means no timeout at all. - + --authmech1 str : Auth mechanism to use with host1: PLAIN, LOGIN, CRAM-MD5 etc. Use UPPERCASE. --authmech2 str : Auth mechanism to use with host2. See --authmech1 - --authuser1 str : User to auth with on host1 (admin user). + --authuser1 str : User to auth with on host1 (admin user). Avoid using --authmech1 SOMETHING with --authuser1. --authuser2 str : User to auth with on host2 (admin user). --proxyauth1 : Use proxyauth on host1. Requires --authuser1. Required by Sun/iPlanet/Netscape IMAP servers to be able to use an administrative user. --proxyauth2 : Use proxyauth on host2. Requires --authuser2. - + --authmd51 : Use MD5 authentification for host1. --authmd52 : Use MD5 authentification for host2. --domain1 str : Domain on host1 (NTLM authentication). --domain2 str : Domain on host2 (NTLM authentication). - - + + --folder str : Sync this folder. --folder str : and this one, etc. --folderrec str : Sync this folder recursively. --folderrec str : and this one, etc. - + --folderfirst str : Sync this folder first. --folderfirst "Work" --folderfirst str : then this one, etc. --folderlast str : Sync this folder last. --folderlast "[Gmail]/All Mail" --folderlast str : then this one, etc. - + --nomixfolders : Do not merge folders when host1 is case sensitive while host2 is not (like Exchange). Only the first similar folder is synced (ex: Sent SENT sent -> Sent). - + --skipemptyfolders : Empty host1 folders are not created on host2. --f1f2 str1=str2 : Force folder str1 to be synced to str2. @@ -161,12 +173,12 @@ reproduced here: Several folders to avoid: --exclude 'fold1|fold2|f3' skips fold1, fold2 and f3. --exclude reg : or this one, etc. - - --subfolder2 str : Move whole host1 folders hierarchy under this + + --subfolder2 str : Move whole host1 folders hierarchy under this host2 folder str . It does it by adding two --regextrans2 options before all others. Add --debug to see what's really going on. - + --regextrans2 reg : Apply the whole regex to each destination folders. --regextrans2 reg : and this one. etc. When you play with the --regextrans2 option, first @@ -174,21 +186,21 @@ reproduced here: Then, when happy, remove --dry, remove --justfolders. Have in mind that --regextrans2 is applied after prefix and separator inversion. - + --tmpdir str : Where to store temporary files and subdirectories. Will be created if it doesn't exist. Default is system specific, Unix is /tmp but it's often small and deleted at reboot. --tmpdir /var/tmp should be better. --pidfile str : The file where imapsync pid is written. - --pidfilelocking : Abort if pidfile already exists. Usefull to avoid + --pidfilelocking : Abort if pidfile already exists. Usefull to avoid concurrent transfers on the same mailbox. - + --nolog : Turn off logging on file --logfile str : Change the default log filename (can be dirname/filename). --logdir str : Change the default log directory. Default is LOG_imapsync - --prefix1 str : Remove prefix to all destination folders + --prefix1 str : Remove prefix to all destination folders (usually INBOX. or INBOX/ or an empty string "") you have to use --prefix1 if host1 imap server does not have NAMESPACE capability, so imapsync @@ -196,16 +208,16 @@ reproduced here: --prefix2 str : Add prefix to all host2 folders. See --prefix1 --sep1 str : Host1 separator in case NAMESPACE is not supported. --sep2 str : Host2 separator in case NAMESPACE is not supported. - + --skipmess reg : Skips messages maching the regex. Example: 'm/[\x80-ff]/' # to avoid 8bits messages. --skipmess is applied before --regexmess --skipmess reg : or this one, etc. - --pipemess cmd : Apply this cmd command to each message content + --pipemess cmd : Apply this cmd command to each message content before the copy. --pipemess cmd : and this one, etc. - + --disarmreadreceipts : Disarms read receipts (host2 Exchange issue) --regexmess reg : Apply the whole regex to each message before transfer. @@ -215,20 +227,20 @@ reproduced here: --regexflag reg : Apply the whole regex to each flags list. Example: 's/"Junk"//g' # to remove "Junk" flag. --regexflag reg : and this one, etc. - - --delete : Deletes messages on host1 server after a successful - transfer. Option --delete has the following behavior: - it marks messages as deleted with the IMAP flag - \Deleted, then messages are really deleted with an + + --delete : Deletes messages on host1 server after a successful + transfer. Option --delete has the following behavior: + it marks messages as deleted with the IMAP flag + \Deleted, then messages are really deleted with an EXPUNGE IMAP command. --delete2 : Delete messages in host2 that are not in host1 server. Useful for backup or pre-sync. --delete2duplicates : Delete messages in host2 that are duplicates. - Works only without --useuid since duplicates are + Works only without --useuid since duplicates are detected with an header part of each message. - --delete2folders : Delete folders in host2 that are not in host1 server. + --delete2folders : Delete folders in host2 that are not in host1 server. For safety, first try it like this (it is safe): --delete2folders --dry --justfolders --nofoldersizes --delete2foldersonly reg : Deleted only folders matching regex. @@ -237,8 +249,8 @@ reproduced here: Example: --delete2foldersbutnot "/Tasks$|Contacts$|Foo$/" --noexpunge : Do not expunge messages on host1. Expunge really deletes messages marked deleted. - Expunge is made at the beginning, on host1 only. - Newly transferred messages are also expunged if + Expunge is made at the beginning, on host1 only. + Newly transferred messages are also expunged if option --delete is given. No expunge is done on host2 account (unless --expunge2) --expunge1 : Expunge messages on host1 after messages transfer. @@ -246,13 +258,13 @@ reproduced here: --uidexpunge2 : uidexpunge messages on the host2 account that are not on the host1 account, requires --delete2 --nomixfolders : Avoid merging folders that are considered different on - host1 but the same on destination host2 because of + host1 but the same on destination host2 because of case sensitivities and insensitivities. - + --syncinternaldates : Sets the internal dates on host2 same as host1. Turned on by default. Internal date is the date a message arrived on a host (mtime). - --idatefromheader : Sets the internal dates on host2 same as the + --idatefromheader : Sets the internal dates on host2 same as the "Date:" headers. --maxsize int : Skip messages larger (or equal) than int bytes @@ -267,48 +279,48 @@ reproduced here: past|+++++++++++++++minage---->now past|----maxage+++++minage---->now (intersection) past|++++minage-----maxage++++>now (union) - - --search str : Selects only messages returned by this IMAP SEARCH + + --search str : Selects only messages returned by this IMAP SEARCH command. Applied on both sides. --search1 str : Same as --search for selecting host1 messages only. --search2 str : Same as --search for selecting host2 messages only. --search CRIT equals --search1 CRIT --search2 CRIT - + --exitwhenover int : Stop syncing when total bytes transferred reached. - Gmail per day allows + Gmail per day allows 2500000000 = 2.5 GB downloaded from Gmail as host2 500000000 = 500 MB uploaded to Gmail as host1. - + --maxlinelength int : skip messages with a line length longer than int bytes. RFC 2822 says it must be no more than 1000 bytes. --useheader str : Use this header to compare messages on both sides. Ex: Message-ID or Subject or Date. --useheader str and this one, etc. - + --subscribed : Transfers subscribed folders. - --subscribe : Subscribe to the folders transferred on the + --subscribe : Subscribe to the folders transferred on the host2 that are subscribed on host1. On by default. - --subscribeall : Subscribe to the folders transferred on the + --subscribeall : Subscribe to the folders transferred on the host2 even if they are not subscribed on host1. - + --nofoldersizes : Do not calculate the size of each folder in bytes and message counts. Default is to calculate them. --nofoldersizesatend: Do not calculate the size of each folder in bytes and message counts at the end. Default is on. --justfoldersizes : Exit after having printed the folder sizes. - + --syncacls : Synchronises acls (Access Control Lists). --nosyncacls : Does not synchronize acls. This is the default. Acls in IMAP are not standardized, be careful. - + --usecache : Use cache to speedup. --nousecache : Do not use cache. Caveat: --useuid --nousecache creates duplicates on multiple runs. - --useuid : Use uid instead of header as a criterium to recognize - messages. Option --usecache is then implied unless - --nousecache is used. - + --useuid : Use uid instead of header as a criterium to recognize + messages. Option --usecache is then implied unless + --nousecache is used. + --debug : Debug mode. --debugfolders : Debug mode for the folders part only. --debugcontent : Debug content of the messages transfered. Huge ouput. @@ -321,7 +333,7 @@ reproduced here: --errorsmax int : Exit when int number of errors is reached. Default is 50. --tests : Run local non-regression tests. Exit code 0 means all ok. - --testslive : Run a live test with test1.lamiral.info imap server. + --testslive : Run a live test with test1.lamiral.info imap server. Useful to check the basics. Needs internet connexion. --version : Print only software version. @@ -330,19 +342,19 @@ reproduced here: --noid : Do not send/receive ID command to imap servers. --justconnect : Just connect to both servers and print useful information. Need only --host1 and --host2 options. - --justlogin : Just login to both host1 and host2 with users + --justlogin : Just login to both host1 and host2 with users credentials, then exit. --justfolders : Do only things about folders (ignore messages). --help : print this help. - Example: - To synchronize the source imap account - "test1" on server "test1.lamiral.info" with password "secret1" - to the destination imap account + Example: + To synchronize the source imap account + "test1" on server "test1.lamiral.info" with password "secret1" + to the destination imap account "test2" on server "test2.lamiral.info" with password "secret2" do: - + imapsync \ --host1 test1.lamiral.info --user1 test1 --password1 secret1 \ --host2 test2.lamiral.info --user2 test2 --password2 secret2 @@ -355,53 +367,55 @@ reproduced here: =head1 DESCRIPTION Imapsync command is a tool allowing incremental and -recursive imap transfers from one mailbox to another. +recursive imap transfers from one mailbox to another. -By default all folders are transferred, recursively, all +By default all folders are transferred, recursively, all possible flags (\Seen \Answered \Flagged etc.) are synced too. We sometimes need to transfer mailboxes from one imap server to another. This is called migration. Imapsync reduces the amount -of data transferred by not transferring a given message +of data transferred by not transferring a given message if it resides already on both sides. Same specific headers -and the transfer is done only once; taken into account are by default -Message-Id and Received header lines. +and the transfer is done only once; taken into account are by default +Message-Id and Received header lines. All flags are preserved, unread will stay unread, read will stay read, deleted will stay deleted. You can stop the transfer at any -time and restart it later, imapsync works well with bad +time and restart it later, imapsync works well with bad connections and interruptions. You can decide to delete the messages from the source mailbox after a successful transfer, it can be a good feature when migrating live mailboxes since messages will be only on one side. -In that case, use the --delete option. Option --delete implies -also option --expunge so all messages marked deleted on host1 +In that case, use the --delete option. Option --delete implies +also option --expunge so all messages marked deleted on host1 will be really deleted. (you can use --noexpunge to avoid this but I don't see any good real world scenario for the combination --delete --noexpunge). A different scenario is synchronizing a mailbox B from another mailbox A -in case you just want to keep a "live" copy of A in B. +in case you just want to keep a "live" copy of A in B. In that case --delete2 has to be used, it deletes messages in host2 -folder B that are not in host1 folder A. If you also need to destroy -host2 folders that are not in host1 then use --delete2folders (see also +folder B that are not in host1 folder A. If you also need to destroy +host2 folders that are not in host1 then use --delete2folders (see also --delete2foldersonly and --delete2foldersbutnot). -Imapsync is not adequate for maintaining two active imap accounts +Imapsync is not adequate for maintaining two active imap accounts in synchronization when the user plays independently on both sides. -Use offlineimap (written by John Goerzen) or mbsync (written by +Use offlineimap (written by John Goerzen) or mbsync (written by Michael R. Elkins) for 2 ways synchronizations. =head1 OPTIONS -To get a description of each option just invoke: +To get a description of each option just invoke: imapsync +or read the previous section named USAGE, + or read http://imapsync.lamiral.info/OPTIONS =head1 HISTORY @@ -421,8 +435,8 @@ While working on imapsync parameters please run imapsync in dry mode (no modification induced) with the --dry option. Nothing bad can be done this way. -To synchronize the imap account "buddy" (with password "secret1") -on host "imap.src.fr" to the imap account "max" (with password "secret2") +To synchronize the imap account "buddy" (with password "secret1") +on host "imap.src.fr" to the imap account "max" (with password "secret2") on host "imap.dest.fr": imapsync --host1 imap.src.fr --user1 buddy --password1 secret1 \ @@ -434,7 +448,7 @@ mailbox. =head1 SECURITY You can use --passfile1 instead of --password1 to give the -password since it is safer. With --password1 option any user +password since it is safer. With --password1 option any user on your host can see the password by using the 'ps auxwwww' command. Using a variable (like $PASSWORD1) is also dangerous because of the 'ps auxwwwwe' command. So, saving @@ -444,7 +458,7 @@ the best solution. imasync is not totally protected against sniffers on the network since passwords may be transferred in plain text if CRAM-MD5 is not supported by your imap servers. Use ---ssl1 (or --tls1) and --ssl2 (or --tls2) to enable +--ssl1 (or --tls1) and --ssl2 (or --tls2) to enable encryption on host1 and host2. You may authenticate as one user (typically an admin user), @@ -458,34 +472,39 @@ Same behavior with the --authuser2 option. Authenticate with an admin account must be supported by your imap server to work with imapsync. -When working on Sun/iPlanet/Netscape IMAP servers you must use ---proxyauth1 to enable administrative user to masquerade as another user. -Can also be used on destination server with --proxyauth2 +When working on Sun/iPlanet/Netscape IMAP servers you must use +--proxyauth1 to enable administrative user to masquerade as another user. +Can also be used on destination server with --proxyauth2 You can authenticate with OAUTH when transfering from Google Apps. The consumer key will be the domain part of the --user, and the --password will be used as the consumer secret. It does not work -with Google Apps free edition. +with Google Apps free edition. =head1 EXIT STATUS imapsync will exit with a 0 status (return code) if everything went good. Otherwise, it exits with a non-zero status. -So if you have an unreliable internet connection, you can use this loop +So if you have an unreliable internet connection, you can use this loop in a Bourne shell: - while ! imapsync ...; do + while ! imapsync ...; do echo imapsync not complete done -=head1 LICENSE +=head1 LICENSE AND COPYRIGHT -imapsync is free, open, public but not always gratis software +imapsync is free, open, public but not always gratis software cover by the NOLIMIT Public License. See the LICENSE file included in the distribution or just read this simple sentence as it is the licence text: -No limit to do anything with this work and this license. + + "No limit to do anything with this work and this license." + +In case it is not long enough I repeat: + + "No limit to do anything with this work and this license." =head1 MAILING-LIST @@ -522,17 +541,17 @@ Gilles LAMIRAL earns his living by writing, installing, configuring and teaching free, open and often gratis softwares. It used to be "always gratis" but now it is "often" because imapsync is sold by its author, a good -way to stay maintening and supporting free open public +way to stay maintening and supporting free open public softwares (see the license) over decades. -=head1 BUG REPORT GUIDELINES +=head1 BUGS AND LIMITATIONS Help me to help you: follow the following guidelines. -Report any bugs or feature requests to the public mailing-list +Report any bugs or feature requests to the public mailing-list or to the author. -Before reporting bugs, read the FAQ, the README and the +Before reporting bugs, read the FAQs, the README and the TODO files. http://imapsync.lamiral.info/ Upgrade to last imapsync release, maybe the bug @@ -542,7 +561,7 @@ Upgrade to last Mail-IMAPClient Perl module. http://search.cpan.org/dist/Mail-IMAPClient/ maybe the bug is already fixed there. -Make a good title with word "imapsync" in it (my spam filters won't filter it), +Make a good title with word "imapsync" in it (my spam filters won't filter it), Try to write an email title with more words than just "imapsync" or "problem", a good title is made of keywords summary, but not too long (one visible line). @@ -551,23 +570,23 @@ Help us to help you: in your report, please include: - imapsync version. - output near the first failures, a few lines before is good to get the context - of the issue. First failures messages are often more significant than - the last ones. - - - if the issue is always related to the same messages, include the output + of the issue. First failures messages are often more significant than + the last ones. + + - if the issue is always related to the same messages, include the output with --debug --debugimap, near the failure point. For example, - Isolate a buggy message or two in a folder 'BUG' and use + Isolate a buggy message or two in a folder 'BUG' and use - imapsync ... --folder 'BUG' --debug --debugimap + imapsync ... --folder 'BUG' --debug --debugimap - imap server softwares on both sides and their version number. - imapsync with all the options you use, the full command line - you use (except the passwords of course). + you use (except the passwords of course). - IMAPClient.pm version. - - the run context. Do you run imapsync.exe, a unix binary + - the run context. Do you run imapsync.exe, a unix binary or the perl script imapsync. - operating system running imapsync. @@ -580,18 +599,18 @@ Help us to help you: in your report, please include: Most of those values can be found as a copy/paste at the begining of the output, so a carbon copy of the output is a very easy and very good debug report for me. -One time in your life, read the paper +One time in your life, read the paper "How To Ask Questions The Smart Way" http://www.catb.org/~esr/faqs/smart-questions.html and then forget it. -=head1 IMAP SERVERS +=head1 IMAP SERVERS See http://imapsync.lamiral.info/S/imapservers.shtml =head1 HUGE MIGRATION -Pay special attention to options +Pay special attention to options --subscribed --subscribe --delete @@ -619,7 +638,7 @@ user005_1;password005_1;user005_2;password005_2 On Unix the shell program can be: - { while IFS=';' read u1 p1 u2 p2; do + { while IFS=';' read u1 p1 u2 p2; do imapsync --host1 imap.side1.org --user1 "$u1" --password1 "$p1" \ --host2 imap.side2.org --user2 "$u2" --password2 "$p2" ... done ; } < file.txt @@ -633,16 +652,15 @@ On Windows the batch program can be: The ... have to be replaced by nothing or any imapsync option. Welcome in shell programming ! -You will find already written scripts at +You will find already written scripts at http://imapsync.lamiral.info/examples/ - -=head1 Hacking +=head1 HACKING Feel free to hack imapsync as the NOLIMIT license permits it. -=head1 Links +=head1 LINKS Entries for imapsync: https://web.archive.org/web/20070202005121/http://www.imap.org/products/showall.php @@ -668,7 +686,7 @@ https://web.archive.org/web/20070202005121/http://www.imap.org/products/showall. Feedback (good or bad) will often be welcome. -$Id: imapsync,v 1.684 2016/03/17 08:35:03 gilles Exp gilles $ +$Id: imapsync,v 1.727 2016/08/19 10:30:36 gilles Exp gilles $ =cut @@ -683,7 +701,7 @@ use Carp ; use Data::Dumper ; use Digest::HMAC_SHA1 qw( hmac_sha1 ) ; use Digest::MD5 qw( md5 md5_hex md5_base64 ) ; -use English '-no_match_vars' ; +use English qw( -no_match_vars ) ; use Errno qw(EAGAIN EPIPE ECONNRESET) ; use Fcntl ; use File::Basename ; @@ -691,7 +709,8 @@ use File::Copy::Recursive ; use File::Glob qw( :glob ) ; use File::Path qw( mkpath rmtree ) ; use File::Spec ; -use Getopt::Long ; +use File::stat ; +#use Imapsync::Getopt::Long ; use IO::File ; use IO::Socket qw(:crlf SOL_SOCKET SO_KEEPALIVE) ; #use IO::Socket::SSL ; @@ -705,49 +724,131 @@ use Test::More ; use Time::HiRes qw( time sleep ) ; use Time::Local ; use Unicode::String ; +use Cwd ; +use Readonly ; + +# constants + +# Let us do like sysexits.h +# /usr/include/sysexits.h + +Readonly my $EX_OK => 0 ; #/* successful termination */ +Readonly my $EX_USAGE => 64 ; #/* command line usage error */ +#Readonly my $EX_DATAERR => 65 ; #/* data format error */ +#Readonly my $EX_NOINPUT => 66 ; #/* cannot open input */ +#Readonly my $EX_NOUSER => 67 ; #/* addressee unknown */ +#Readonly my $EX_NOHOST => 68 ; #/* host name unknown */ +#Readonly my $EX_UNAVAILABLE => 69 ; #/* service unavailable */ +Readonly my $EX_SOFTWARE => 70 ; #/* internal software error */ +#Readonly my $EX_OSERR => 71 ; #/* system error (e.g., can't fork) */ +#Readonly my $EX_OSFILE => 72 ; #/* critical OS file missing */ +#Readonly my $EX_CANTCREAT => 73 ; #/* can't create (user) output file */ +#Readonly my $EX_IOERR => 74 ; #/* input/output error */ +#Readonly my $EX_TEMPFAIL => 75 ; #/* temp failure; user is invited to retry */ +#Readonly my $EX_PROTOCOL => 76 ; #/* remote error in protocol */ +#Readonly my $EX_NOPERM => 77 ; #/* permission denied */ +#Readonly my $EX_CONFIG => 78 ; #/* configuration error */ + +# Mine +Readonly my $EXIT_BY_SIGNAL => 6 ; +Readonly my $EXIT_PID_FILE_ALREADY_EXIST => 8 ; +Readonly my $EXIT_WITH_ERRORS => 111 ; +Readonly my $EXIT_WITH_ERRORS_MAX => 112 ; +Readonly my $EXIT_UNKNOWN => 126 ; + +Readonly my $ERRORS_MAX => 50 ; # exit after 50 errors. + + +Readonly my $INTERVAL_TO_EXIT => 2 ; # interval max to exit instead of reconnect + +Readonly my $SPLIT => 100 ; # By default, 100 at a time, not more. +Readonly my $SPLIT_FACTOR => 10 ; # init_imap() calls Maxcommandlength( $SPLIT_FACTOR * $split ) + # which means default Maxcommandlength is 10*100 = 1000 characters ; + +Readonly my $IMAP_PORT => 143 ; # Well know port for IMAP +Readonly my $IMAP_SSL_PORT => 993 ; # Well know port for IMAP over SSL + +Readonly my $LAST => -1 ; +Readonly my $MINUS_ONE => -1 ; + +Readonly my $RELEASE_NUMBER_EXAMPLE_1 => '1.351' ; +Readonly my $RELEASE_NUMBER_EXAMPLE_2 => 42.4242 ; + +Readonly my $DEFAULT_TIMEOUT => 120 ; +Readonly my $DEFAULT_NB_RECONNECT_PER_IMAP_COMMAND => 3 ; +Readonly my $DEFAULT_UIDNEXT => 999999 ; +Readonly my $DEFAULT_BUFFER_SIZE => 4096 ; + +Readonly my $DEFAULT_EXPIRATION_TIME_OAUTH2_PK12 => 3600 ; + +Readonly my $PERMISSION_FILTER => 7777 ; + +Readonly my $KIBI => 1024 ; + +Readonly my $NUMBER_10 => 10 ; +Readonly my $NUMBER_42 => 42 ; +Readonly my $NUMBER_100 => 100 ; +Readonly my $NUMBER_200 => 200 ; +Readonly my $NUMBER_300 => 300 ; + +Readonly my $NUMBER_20_000 => 20_000 ; + +Readonly my $QUOTA_PERCENT_LIMIT => 90 ; + +Readonly my $NUMBER_104857600 => 104857600 ; + +Readonly my $SIZE_MAX_STR => 64 ; + +Readonly my $NB_SECONDS_IN_A_DAY => 86400 ; + +Readonly my $STD_CHAR_PER_LINE => 80 ; + +Readonly my $TRUE => 1 ; +Readonly my $FALSE => 0 ; + +Readonly my $LAST_RESSORT_SEPARATOR => q{/} ; # global variables my( $sync, - $rcs, $pidfile, $pidfilelocking, + $rcs, $debug, $debugimap, $debugimap1, $debugimap2, $debugcontent, $debugflags, - $debugLIST, $debugsleep, $debugdev, $debugmemory, $debugmaxlinelength, - $nb_errors, $errorsmax, $errorsdump, @errors_log, + $debuglist, $debugdev, $debugmaxlinelength, @debugbasket, $debugcgi, $host1, $host2, $port1, $port2, - $user1, $user2, $domain1, $domain2, + $user1, $user2, $domain1, $domain2, $password1, $password2, $passfile1, $passfile2, @folder, @include, @exclude, @folderrec, @folderfirst, @folderlast, - $prefix1, $prefix2, + $prefix1, $prefix2, $subfolder2, @regextrans2, @regexmess, @regexflag, @skipmess, @pipemess, $pipemesscheck, - $flagsCase, $filterflags, $syncflagsaftercopy, + $flagscase, $filterflags, $syncflagsaftercopy, $sep1, $sep2, $syncinternaldates, $idatefromheader, $syncacls, - $fastio1, $fastio2, + $fastio1, $fastio2, $maxsize, $minsize, $maxage, $minage, $exitwhenover, - $search, $search1, $search2, + $search, $search1, $search2, $skipheader, @useheader, $skipsize, $allowsizemismatch, $foldersizes, $foldersizesatend, $buffersize, $delete, $delete2, $delete2duplicates, $expunge, $expunge1, $expunge2, $uidexpunge2, $dry, $justfoldersizes, - $authmd5, $authmd51, $authmd52, + $authmd5, $authmd51, $authmd52, $subscribed, $subscribe, $subscribeall, - $version, $help, + $version, $help, $justconnect, $justfolders, $justbanner, $fast, $total_bytes_transferred, $total_bytes_skipped, $total_bytes_error, - $nb_msg_transferred, - $nb_msg_skipped, + $nb_msg_transferred, + $nb_msg_skipped, $nb_msg_skipped_dry_mode, $h1_nb_msg_duplicate, $h2_nb_msg_duplicate, @@ -758,18 +859,18 @@ my( $h1_nb_msg_deleted, $h2_nb_msg_deleted, - $h1_bytes_processed, + $h1_bytes_processed, $h1_nb_msg_processed, - $h1_nb_msg_at_start, $h1_bytes_start, - $h2_nb_msg_start, $h2_bytes_start, + $h1_nb_msg_start, $h1_bytes_start, + $h2_nb_msg_start, $h2_bytes_start, $h1_nb_msg_end, $h1_bytes_end, - $h2_nb_msg_end, $h2_bytes_end, + $h2_nb_msg_end, $h2_bytes_end, $timeout, $timestart_int, $timeend, $timebefore, - $ssl1, $ssl2, - $ssl1_SSL_version, $ssl2_SSL_version, + $ssl1, $ssl2, + $ssl1_ssl_version, $ssl2_ssl_version, $tls1, $tls2, $uid1, $uid2, $authuser1, $authuser2, @@ -782,7 +883,7 @@ my( $tmpdir, $releasecheck, $max_msg_size_in_bytes, - $modules_version, + $modulesversion, $delete2folders, $delete2foldersonly, $delete2foldersbutnot, $usecache, $debugcache, $cacheaftercopy, $wholeheaderifneeded, %h1_msgs_copy_by_uid, $useuid, $h2_uidguess, @@ -803,7 +904,6 @@ my( $maxmessagespersecond, $maxbytespersecond, $skipcrossduplicates, $debugcrossduplicates, - $log, $disarmreadreceipts, $mixfolders, $skipemptyfolders, $fetch_hash_set, @@ -813,7 +913,7 @@ my( # global variables initialisation -$rcs = '$Id: imapsync,v 1.684 2016/03/17 08:35:03 gilles Exp gilles $ '; +$rcs = q{$Id: imapsync,v 1.727 2016/08/19 10:30:36 gilles Exp gilles $} ; $total_bytes_transferred = 0; $total_bytes_skipped = 0; @@ -826,14 +926,14 @@ $h1_nb_msg_noheader = $h2_nb_msg_noheader = 0; $h1_total_bytes_duplicate = $h2_total_bytes_duplicate = 0; -$h1_nb_msg_at_start = $h1_bytes_start = 0 ; +$h1_nb_msg_start = $h1_bytes_start = 0 ; $h2_nb_msg_start = $h2_bytes_start = 0 ; $h1_nb_msg_processed = $h1_bytes_processed = 0 ; -$h1_nb_msg_end = $h1_bytes_end = 0 ; -$h2_nb_msg_end = $h2_bytes_end = 0 ; +#$h1_nb_msg_end = $h1_bytes_end = 0 ; +#$h2_nb_msg_end = $h2_bytes_end = 0 ; -$nb_errors = 0; +$sync->{nb_errors} = 0; $max_msg_size_in_bytes = 0; my %month_abrev = ( @@ -851,288 +951,319 @@ my %month_abrev = ( Dec => '11', ); -sub EX_USAGE { - # 64 on my linux box. - # See http://search.cpan.org/~jmates/Unix-Sysexits-0.02/lib/Unix/Sysexits.pm - return( 64 ) ; -} + # @ARGV will be eat by get_options() my @argv_copy = @ARGV; +my $cgi_dir = '/var/tmp/imapsync_cgi' ; + +# Under CGI environment +if ( $ENV{SERVER_SOFTWARE} ) { + myprint( "\n" ) ; + myprint( "
      \n" ) ;
      +        -d $cgi_dir or mkpath $cgi_dir or die "Can not create $cgi_dir: $!\n" ;
      +        chdir  $cgi_dir or die "Can not cd to $cgi_dir: $!\n" ;
      +}
      +
       get_options(  ) ;
      +unsetunsafe(  ) if ( $ENV{SERVER_SOFTWARE} ) ;
      +
      +# Under CGI environment
      +if ( $ENV{SERVER_SOFTWARE} ) {
      +        myprint( 'Current directory is ' . getcwd(  ) . "\n" ) ;
      +        myprint( 'Real user id is ' . getpwuid_any_os( $REAL_USER_ID ) . " (uid $REAL_USER_ID)\n" ) ;
      +        myprint( 'Effective user id is ' . getpwuid_any_os( $EFFECTIVE_USER_ID ). " (euid $EFFECTIVE_USER_ID)\n" ) ;
      +}
      +
      +local $SIG{ INT } = sub {
      +        my $signame = shift ;
      +        catch_reconnect( $sync, $signame ) ;
      +} ;
      +
      +local $SIG{ QUIT } = local $SIG{ TERM } = sub {
      +	my $signame = shift ;
      +        catch_exit( $sync, $signame ) ;
      +} ;
       
      -# $SIG{ INT } = \&catch_continue ;
      -local $SIG{ INT } = local $SIG{ QUIT } = local $SIG{ TERM } = \&catch_exit ;
       
      -$sync->{timestart} = $BASETIME ; # Never too let reading books and perlvar 
      +$sync->{timestart} = $BASETIME ; # Never too let reading books and perlvar
       
      -$log             = defined $log             ? $log             :  1 ;
      -$errorsdump      = defined $errorsdump      ? $errorsdump      :  1 ;
      -$errorsmax       = defined $errorsmax       ? $errorsmax       : 50 ; # exit after 50 errors.
      +$sync->{log}        = defined $sync->{log}        ? $sync->{log}        :  1 ;
      +$sync->{errorsdump} = defined $sync->{errorsdump} ? $sync->{errorsdump} :  1 ;
      +$sync->{errorsmax}  = defined $sync->{errorsmax}  ? $sync->{errorsmax}  : $ERRORS_MAX ;
       
       $sync->{user2} = $user2 ;
      -setlogfile( $sync ) ;
       
      -teelaunch( $sync->{logfile} ) if ( $log ) ;
      +if ( $sync->{log} ) {
      +        setlogfile( $sync ) ;
      +        teelaunch( $sync ) ;
      +}
       
       $timestart_int = int( $sync->{timestart} ) ;
      -$timebefore = $sync->{timestart} ;
      +$timebefore =    $sync->{timestart} ;
       
       my $timestart_str = localtime( $sync->{timestart} ) ;
      -print "Transfer started at $timestart_str\n" ;
      -print "PID is $PROCESS_ID\n" ;
      -print "Log file is $sync->{logfile} ( to change it, use --logfile path ; or use --nolog to turn off logging )\n" if ( $log ) ;
      -$modules_version = defined( $modules_version ) ? $modules_version : 1 ;
      +myprint( "Transfer started at $timestart_str\n" ) ;
      +myprint( "PID is $PROCESS_ID\n" ) ;
      +myprint( "Log file is $sync->{logfile} ( to change it, use --logfile path ; or use --nolog to turn off logging )\n" ) if ( $sync->{log} ) ;
      +$modulesversion = defined  $modulesversion  ? $modulesversion : 1 ;
       
       # If you want releasecheck not to be done by default (like the github maintainer),
       # then uncomment the first "$releasecheck =" line, the line ending with "0 ;".
      -# The second line (ending with "1 ;") can stay active or be commented, 
      +# The second line (ending with "1 ;") can stay active or be commented,
       # the result will be the same: no releasecheck by default.
       
      -$releasecheck = defined( $releasecheck ) ? $releasecheck : 0 ;
      -#$releasecheck = defined( $releasecheck ) ? $releasecheck : 1 ;
      +#$releasecheck = defined  $releasecheck  ? $releasecheck : 0 ;
      +$releasecheck = defined  $releasecheck  ? $releasecheck : 1 ;
       
      -my $warn_release = ( $releasecheck ) ? check_last_release(  ) : '' ;
      +my $warn_release = ( $releasecheck ) ? check_last_release(  ) : q{} ;
       
       # default values
       
      -$pidfile =  defined( $pidfile ) ? $pidfile : $tmpdir . '/imapsync.pid' ;
      +$sync->{pidfile} =  defined  $sync->{pidfile}  ? $sync->{pidfile} : $tmpdir . '/imapsync.pid' ;
       
      -$pidfilelocking = defined( $pidfilelocking ) ? $pidfilelocking : 0 ;
      +$sync->{pidfilelocking} = defined  $sync->{pidfilelocking}  ? $sync->{pidfilelocking} : 0 ;
       
      -$wholeheaderifneeded  = defined( $wholeheaderifneeded )  ? $wholeheaderifneeded  : 1;
      +$wholeheaderifneeded  = defined  $wholeheaderifneeded   ? $wholeheaderifneeded  : 1;
       
       # turn on RFC standard flags correction like \SEEN -> \Seen
      -$flagsCase = defined( $flagsCase ) ? $flagsCase : 1 ;
      +$flagscase = defined  $flagscase  ? $flagscase : 1 ;
       
       # Use PERMANENTFLAGS if available
      -$filterflags = defined( $filterflags ) ? $filterflags : 1 ;
      +$filterflags = defined  $filterflags  ? $filterflags : 1 ;
       
       # sync flags just after an APPEND, some servers ignore the flags given in the APPEND
       # like MailEnable IMAP server.
       # Off by default since it takes time.
      -$syncflagsaftercopy = defined( $syncflagsaftercopy ) ? $syncflagsaftercopy : 0 ;
      -
      +$syncflagsaftercopy = defined  $syncflagsaftercopy   ? $syncflagsaftercopy : 0 ;
       
      -if ( $fast ) {
      -	# $useuid = 1 ;
      -	# $foldersizes      = 0 ;
      -	# $foldersizesatend = 0 ;
      -}
       
       # Activate --usecache if --useuid is set and no --nousecache
      -$usecache = 1 if ( $useuid and ( ! defined( $usecache ) ) ) ;
      -$cacheaftercopy = 1 if ( $usecache and ( ! defined( $cacheaftercopy ) ) ) ;
      +$usecache = 1 if ( $useuid and ( ! defined  $usecache   ) ) ;
      +$cacheaftercopy = 1 if ( $usecache and ( ! defined  $cacheaftercopy  ) ) ;
       
      -$checkselectable    = defined( $checkselectable ) ? $checkselectable : 1 ;
      -$checkmessageexists = defined( $checkmessageexists ) ? $checkmessageexists : 0 ;
      -$expungeaftereach   = defined( $expungeaftereach ) ? $expungeaftereach : 1 ;
      -$abletosearch       = defined( $abletosearch ) ? $abletosearch : 1 ;
      +$checkselectable    = defined  $checkselectable  ? $checkselectable : 1 ;
      +$checkmessageexists = defined  $checkmessageexists  ? $checkmessageexists : 0 ;
      +$expungeaftereach   = defined  $expungeaftereach  ? $expungeaftereach : 1 ;
      +$abletosearch       = defined  $abletosearch  ? $abletosearch : 1 ;
       $checkmessageexists = 0 if ( not $abletosearch ) ;
      -$showpasswords      = defined( $showpasswords ) ? $showpasswords : 0 ;
      -$fixslash2          = defined( $fixslash2 ) ? $fixslash2 : 1 ;
      -$fixInboxINBOX      = defined( $fixInboxINBOX ) ? $fixInboxINBOX : 1 ;
      -$create_folder_old  = defined( $create_folder_old ) ? $create_folder_old : 0 ;
      -$mixfolders         = defined( $mixfolders ) ? $mixfolders : 1 ;
      -$sync->{automap}    = defined( $sync->{automap} ) ? $sync->{automap} : 0 ;
      +$showpasswords      = defined  $showpasswords  ? $showpasswords : 0 ;
      +$fixslash2          = defined  $fixslash2  ? $fixslash2 : 1 ;
      +$fixInboxINBOX      = defined  $fixInboxINBOX  ? $fixInboxINBOX : 1 ;
      +$create_folder_old  = defined  $create_folder_old  ? $create_folder_old : 0 ;
      +$mixfolders         = defined  $mixfolders  ? $mixfolders : 1 ;
      +$sync->{automap}    = defined  $sync->{automap}  ? $sync->{automap} : 0 ;
       
      -$delete2duplicates = 1 if ( $delete2 and ( ! defined( $delete2duplicates ) ) ) ;
      +$delete2duplicates = 1 if ( $delete2 and ( ! defined  $delete2duplicates  ) ) ;
       
      -$maxmessagespersecond = defined( $maxmessagespersecond ) ? $maxmessagespersecond : 0 ;
      -$maxbytespersecond    = defined( $maxbytespersecond )    ? $maxbytespersecond    : 0 ;
      +$maxmessagespersecond = defined  $maxmessagespersecond  ? $maxmessagespersecond : 0 ;
      +$maxbytespersecond    = defined  $maxbytespersecond     ? $maxbytespersecond    : 0 ;
       
      -print banner_imapsync( @argv_copy ) ;
      +myprint( banner_imapsync( @argv_copy ) ) ;
       
      -print "Temp directory is $tmpdir  ( to change it use --tmpdir dirpath )\n";
      +myprint( "Temp directory is $tmpdir  ( to change it use --tmpdir dirpath )\n") ;
       
       is_valid_directory( $tmpdir ) || croak "Error creating tmpdir $tmpdir : $!" ;
      -write_pidfile( $pidfile ) if ( $pidfile ) ;
       
      -$fixcolonbug = defined( $fixcolonbug ) ? $fixcolonbug : 1 ;
      +if ( $sync->{pidfile} ) {
      +        write_pidfile( $sync->{pidfile}, $sync->{pidfilelocking} ) ;
      +}
      +
      +$fixcolonbug = defined  $fixcolonbug  ? $fixcolonbug : 1 ;
       
       if ( $usecache and $fixcolonbug ) { tmpdir_fix_colon_bug(  ) } ;
       
      -$modules_version and print "Modules version list:\n", modules_VERSION(), "( use --no-modules_version to turn off printing this Perl modules list )\n" ;
      +$modulesversion and myprint( "Modules version list:\n", modulesversion(), "( use --no-modulesversion to turn off printing this Perl modules list )\n" ) ;
      +
      +my $DEFAULT_SSL_VERIFY ;
      +my %SSL_VERIFY_STR ;
      +
      +if ( $ssl1 or $ssl2 or $tls1 or $tls2) {
      +        Readonly $DEFAULT_SSL_VERIFY => IO::Socket::SSL::SSL_VERIFY_NONE(  ) ;
      +        Readonly %SSL_VERIFY_STR => (
      +                IO::Socket::SSL::SSL_VERIFY_NONE(  ) => 'SSL_VERIFY_NONE' ,
      +                IO::Socket::SSL::SSL_VERIFY_PEER(  ) => 'SSL_VERIFY_PEER' ,
      +        ) ;
      +        $IO::Socket::SSL::DEBUG = $sync->{debugssl} || 1 ;
      +        myprint( "SSL debug mode level is --debugssl $IO::Socket::SSL::DEBUG (can be set from 0 meaning no debug to 4 meaning max debug)\n" ) ;
      +}
       
       if ( $ssl1 ) {
      -        print "Use --sslargs1 SSL_verify_mode=" . IO::Socket::SSL::SSL_VERIFY_PEER(  ) . " for SSL_VERIFY_PEER on host1\n" ;
      +        myprint( 'Host1: SSL default mode is like --sslargs1 SSL_verify_mode=' . $DEFAULT_SSL_VERIFY . " meaning $SSL_VERIFY_STR{$DEFAULT_SSL_VERIFY} on host1 (do not check the certificate server)\n" ) ;
      +        myprint( 'Host1: Use --sslargs1 SSL_verify_mode=' . IO::Socket::SSL::SSL_VERIFY_PEER(  ) . " for $SSL_VERIFY_STR{IO::Socket::SSL::SSL_VERIFY_PEER(  )} on host1\n" ) ;
       }
       if ( $ssl2 ) {
      -        print "Use --sslargs2 SSL_verify_mode=" . IO::Socket::SSL::SSL_VERIFY_PEER(  ) . " for SSL_VERIFY_PEER on host2\n" ;
      +        myprint( 'Host2: SSL default mode is like --sslargs2 SSL_verify_mode=' . $DEFAULT_SSL_VERIFY . " meaning $SSL_VERIFY_STR{$DEFAULT_SSL_VERIFY} on host2 (do not check the certificate server)\n" ) ;
      +        myprint( 'Host2: Use --sslargs2 SSL_verify_mode=' . IO::Socket::SSL::SSL_VERIFY_PEER(  ) . " for $SSL_VERIFY_STR{IO::Socket::SSL::SSL_VERIFY_PEER(  )} on host2\n" ) ;
       }
       
      -if ( $ssl1 or $ssl2 or $tls1 or $tls2) {
      -        $IO::Socket::SSL::DEBUG = $sync->{debugssl} || 1 ;
      -        print "ssl debug mode level is --debugssl $IO::Socket::SSL::DEBUG (can be set from 0 meaning no debug to 4 meaning max debug)\n" ;
      -}
       
      +check_lib_version(  ) or
      +  croak "imapsync needs perl lib Mail::IMAPClient release 3.30 or superior.\n";
       
      -check_lib_version(  ) or 
      -  croak "imapsync needs perl lib Mail::IMAPClient release 3.30 or superior \n";
      +exit_clean( $sync, $EX_OK ) if ( $justbanner ) ;
       
      -exit_clean( 0 ) if ( $justbanner ) ;
       
      -# By default, 100 at a time, not more.
      -$split1 ||= 100;
      -$split2 ||= 100;
      +$split1 ||= $SPLIT ;
      +$split2 ||= $SPLIT ;
       
      -$host1 || missing_option("--host1") ;
      -$port1 ||= ( $ssl1 ) ? 993 : 143;
      +$host1 || missing_option( '--host1' ) ;
      +$port1 ||= ( $ssl1 ) ? $IMAP_SSL_PORT : $IMAP_PORT ;
       
      -$host2 || missing_option("--host2") ;
      -$port2 ||= ( $ssl2 ) ? 993 : 143;
      +$host2 || missing_option( '--host2' ) ;
      +$port2 ||= ( $ssl2 ) ? $IMAP_SSL_PORT : $IMAP_PORT ;
       
       $debugimap1 = $debugimap2 = 1 if ( $debugimap ) ;
       $debug = 1 if ( $debugimap1 or $debugimap2 ) ;
       
      -# By default, don't take size to compare 
      +# By default, don't take size to compare
       $skipsize = (defined $skipsize) ? $skipsize : 1;
       
      -$uid1 = defined($uid1) ? $uid1 : 1;
      -$uid2 = defined($uid2) ? $uid2 : 1;
      +$uid1 = defined $uid1 ? $uid1 : 1;
      +$uid2 = defined $uid2 ? $uid2 : 1;
       
      -$subscribe = defined($subscribe) ? $subscribe : 1;
      +$subscribe = defined $subscribe ? $subscribe : 1;
       
       # Allow size mismatch by default
      -$allowsizemismatch = defined($allowsizemismatch) ? $allowsizemismatch : 1;
      +$allowsizemismatch = defined $allowsizemismatch ? $allowsizemismatch : 1;
       
      -$delete2folders = 1 
      -    if ( defined( $delete2foldersbutnot ) or defined( $delete2foldersonly ) ) ;
      +$delete2folders = 1
      +    if ( defined  $delete2foldersbutnot  or defined  $delete2foldersonly  ) ;
       
       if ( $justconnect ) {
       	justconnect(  ) ;
      -	exit_clean( 0 ) ;
      +	exit_clean( $sync, $EX_OK ) ;
       }
       
      -$user1 || missing_option("--user1");
      -$user2 || missing_option("--user2");
      +$user1 || missing_option( '--user1' ) ;
      +$user2 || missing_option( '--user2' ) ;
       
      -$syncinternaldates = defined($syncinternaldates) ? $syncinternaldates : 1;
      +$syncinternaldates = defined $syncinternaldates ? $syncinternaldates : 1;
       
      -# Turn on expunge if there is not explicit option --noexpunge and option 
      +# Turn on expunge if there is not explicit option --noexpunge and option
       # --delete is given.
       # Done because --delete --noexpunge is very dangerous on the second run:
       # the Deleted flag is then synced to all previously transfered messages.
       # So --delete implies --expunge is a better usability default behaviour.
       if ( $delete ) {
      -	if ( ! defined( $expunge ) ) {
      -		print "Info: turning on --expunge1 because --delete --noexpunge1 is very dangerous on the second run.\n" ;
      +	if ( ! defined  $expunge  ) {
      +		myprint( "Info: turning on --expunge1 because --delete --noexpunge1 is very dangerous on the second run.\n" ) ;
       		$expunge = 1 ;
       	}
      -		print "Info: if expunging after each message slows down too much the sync then use --noexpungeaftereach to speed up\n" ;
      +		myprint( "Info: if expunging after each message slows down too much the sync then use --noexpungeaftereach to speed up\n" ) ;
       }
       
       if ( $uidexpunge2 and not Mail::IMAPClient->can( 'uidexpunge' ) ) {
      -        print "Failure: uidexpunge not supported (IMAPClient release < 3.17), use --expunge2 instead\n" ;
      -        exit_clean( 3 ) ;
      +        myprint( "Failure: uidexpunge not supported (IMAPClient release < 3.17), use --expunge2 instead\n" ) ;
      +        exit_clean( $sync, $EX_SOFTWARE ) ;
       }
       
      -if ( ( $delete2 or $delete2duplicates ) and not defined( $uidexpunge2 ) ) {
      +if ( ( $delete2 or $delete2duplicates ) and not defined  $uidexpunge2  ) {
               if ( Mail::IMAPClient->can( 'uidexpunge' ) ) {
      -                print "Info: will act as --uidexpunge2\n" ;
      +                myprint( "Info: will act as --uidexpunge2\n" ) ;
       		$uidexpunge2 = 1 ;
      -        }elsif ( not defined( $expunge2 ) ) {
      -                 print "Info: will act as --expunge2 (no uidexpunge support)\n" ;
      +        }elsif ( not defined  $expunge2  ) {
      +                 myprint( "Info: will act as --expunge2 (no uidexpunge support)\n" ) ;
                       $expunge2 = 1 ;
               }
       }
       
       if ( $delete and $delete2 ) {
      -	print "Warning: using --delete and --delete2 together is almost always a bad idea, exiting imapsync\n" ;
      -	exit_clean( 4 ) ;
      +	myprint( "Warning: using --delete and --delete2 together is almost always a bad idea, exiting imapsync\n" ) ;
      +	exit_clean( $sync, $EX_USAGE ) ;
       }
       
       if ( $idatefromheader ) {
      -	print "Turned ON idatefromheader, ",
      -	      "will set the internal dates on host2 from the 'Date:' header line.\n" ;
      +	myprint( 'Turned ON idatefromheader, ',
      +	      "will set the internal dates on host2 from the 'Date:' header line.\n" ) ;
       	$syncinternaldates = 0 ;
       }
       
       if ( $syncinternaldates ) {
      -	print "Info: turned ON syncinternaldates, ",
      -	      "will set the internal dates (arrival dates) on host2 same as host1.\n" ;
      +	myprint( 'Info: turned ON syncinternaldates, ',
      +	      "will set the internal dates (arrival dates) on host2 same as host1.\n" ) ;
       }else{
      -	print "Info: turned OFF syncinternaldates\n" ;
      +        myprint( "Info: turned OFF syncinternaldates\n" ) ;
       }
       
      -if (defined($authmd5) and ($authmd5)) {
      +if ( defined $authmd5 and $authmd5 ) {
       	$authmd51 = 1 ;
       	$authmd52 = 1 ;
       }
       
      -if (defined($authmd51) and ($authmd51)) {
      +if ( defined $authmd51 and $authmd51 ) {
       	$authmech1 ||= 'CRAM-MD5';
       }
       else{
       	$authmech1 ||= $authuser1 ? 'PLAIN' : 'LOGIN';
       }
       
      -if (defined($authmd52) and ($authmd52)) {
      +if ( defined $authmd52 and $authmd52 ) {
       	$authmech2 ||= 'CRAM-MD5';
       }
       else{
       	$authmech2 ||= $authuser2 ? 'PLAIN' : 'LOGIN';
       }
       
      -$authmech1 = uc($authmech1);
      -$authmech2 = uc($authmech2);
      +$authmech1 = uc $authmech1;
      +$authmech2 = uc $authmech2;
       
       if (defined $proxyauth1 && !$authuser1) {
      -        missing_option("With --proxyauth1, --authuser1");
      +        missing_option( 'With --proxyauth1, --authuser1' ) ;
       }
       
       if (defined $proxyauth2 && !$authuser2) {
      -        missing_option("With --proxyauth2, --authuser2");
      +        missing_option( 'With --proxyauth2, --authuser2' ) ;
       }
       
       $authuser1 ||= $user1;
       $authuser2 ||= $user2;
       
      -print "Host1: will try to use $authmech1 authentication on host1\n";
      -print "Host2: will try to use $authmech2 authentication on host2\n";
      +myprint( "Host1: will try to use $authmech1 authentication on host1\n") ;
      +myprint( "Host2: will try to use $authmech2 authentication on host2\n") ;
       
      -$timeout = defined( $timeout ) ? $timeout : 120 ;
      +$timeout = defined  $timeout  ? $timeout : $DEFAULT_TIMEOUT ;
       
      -$sync->{h1}->{timeout} = defined( $sync->{h1}->{timeout} ) ? $sync->{h1}->{timeout} : $timeout ;
      -print "Host1: imap connexion timeout is $sync->{h1}->{timeout} seconds\n";
      -$sync->{h2}->{timeout} = defined( $sync->{h2}->{timeout} ) ? $sync->{h2}->{timeout} : $timeout ;
      -print "Host2: imap connexion timeout is $sync->{h2}->{timeout} seconds\n";
      +$sync->{h1}->{timeout} = defined  $sync->{h1}->{timeout}  ? $sync->{h1}->{timeout} : $timeout ;
      +myprint( "Host1: imap connexion timeout is $sync->{h1}->{timeout} seconds\n") ;
      +$sync->{h2}->{timeout} = defined  $sync->{h2}->{timeout}  ? $sync->{h2}->{timeout} : $timeout ;
      +myprint( "Host2: imap connexion timeout is $sync->{h2}->{timeout} seconds\n" ) ;
       
      -$syncacls = defined( $syncacls ) ? $syncacls : 0 ;
      +$syncacls = defined  $syncacls  ? $syncacls : 0 ;
       
       # No folders sizes if --justfolders, unless really wanted.
      -if ( $justfolders and not defined( $foldersizes ) ) { $foldersizes = 0 ; }
      +if ( $justfolders and not defined  $foldersizes  ) { $foldersizes = 0 ; }
       
      -$foldersizes = ( defined( $foldersizes ) ) ? $foldersizes : 1 ;
      -$foldersizesatend = ( defined( $foldersizesatend ) ) ? $foldersizesatend : $foldersizes ;
      +$foldersizes      = ( defined  $foldersizes       ) ? $foldersizes      : 1 ;
      +$foldersizesatend = ( defined  $foldersizesatend  ) ? $foldersizesatend : $foldersizes ;
       
      -$fastio1 = defined( $fastio1 ) ? $fastio1 : 0 ;
      -$fastio2 = defined( $fastio2 ) ? $fastio2 : 0 ;
      +$fastio1 = defined  $fastio1  ? $fastio1 : 0 ;
      +$fastio2 = defined  $fastio2  ? $fastio2 : 0 ;
       
      -$reconnectretry1 = defined( $reconnectretry1 ) ? $reconnectretry1 : 3;
      -$reconnectretry2 = defined( $reconnectretry2 ) ? $reconnectretry2 : 3;
      +$reconnectretry1 = defined  $reconnectretry1  ? $reconnectretry1 : $DEFAULT_NB_RECONNECT_PER_IMAP_COMMAND ;
      +$reconnectretry2 = defined  $reconnectretry2  ? $reconnectretry2 : $DEFAULT_NB_RECONNECT_PER_IMAP_COMMAND ;
       
       # Since select_msgs() returns no messages when uidnext does not return something
       # then $uidnext_default is never used. So I have to remove it.
      -$uidnext_default = 999999 ;
      +$uidnext_default = $DEFAULT_UIDNEXT ;
       
      -@useheader = ( "Message-Id", "Received" ) unless ( @useheader ) ;
      +@useheader = qw( Message-Id Received ) unless ( @useheader ) ;
       
       my %useheader ;
       
       # Make a hash %useheader of each --useheader 'key' in uppercase
      -for ( @useheader ) { $useheader{ uc( $_ ) } = undef } ;
      +for ( @useheader ) { $useheader{ uc  $_  } = undef } ;
       
      -#print Data::Dumper->Dump( [ \%useheader ] ) ;
      +#myprint( Data::Dumper->Dump( [ \%useheader ] )  ) ;
       #exit ;
       
      -print "Host1: IMAP server [$host1] port [$port1] user [$user1]\n";
      -print "Host2: IMAP server [$host2] port [$port2] user [$user2]\n";
      +myprint( "Host1: IMAP server [$host1] port [$port1] user [$user1]\n" ) ;
      +myprint( "Host2: IMAP server [$host2] port [$port2] user [$user2]\n" ) ;
       
       $password1 || $passfile1 || 'PREAUTH' eq $authmech1 || 'EXTERNAL' eq $authmech1 || do {
      -	print << 'FIN_PASSFILE' ;
      +	myprint( << 'FIN_PASSFILE'  ) ;
       
       If you are afraid of giving password on the command line arguments, you can put the
       password of user1 in a file named file1 and use "--passfile1 file1" instead of typing it.
      @@ -1142,12 +1273,13 @@ FIN_PASSFILE
       	$password1 = ask_for_password( $authuser1 || $user1, $host1 ) ;
       } ;
       
      -$password1 = ( defined( $passfile1 ) ) ? firstline ( $passfile1 ) : $password1 ;
      +$password1 = ( defined  $passfile1  ) ? firstline ( $passfile1 ) : $password1 ;
      +
       
       $password2 || $passfile2 || 'PREAUTH' eq $authmech2 || 'EXTERNAL' eq $authmech2 || do {
      -	print << 'FIN_PASSFILE' ;
      +	myprint( << 'FIN_PASSFILE'  ) ;
       
      -If you are afraid of giving password on the command line arguments, you can put the 
      +If you are afraid of giving password on the command line arguments, you can put the
       password of user2 in a file named file2 and use "--passfile2 file2" instead of typing it.
       Then give this file restrictive permissions with the command "chmod 600 file2".
       FIN_PASSFILE
      @@ -1155,97 +1287,103 @@ FIN_PASSFILE
       	$password2 = ask_for_password( $authuser2 || $user2, $host2 ) ;
       } ;
       
      -$password2 = ( defined( $passfile2 ) ) ? firstline ( $passfile2 ) : $password2 ;
      +$password2 = ( defined  $passfile2  ) ? firstline ( $passfile2 ) : $password2 ;
       
       
      -my $dry_message = '' ;
      -$dry_message = "\t(not really since --dry mode)" if $dry ;
      +# need clean up => write methods dry() and dry_message()
      +$sync->{dry} = $dry ;
      +my $dry_message = q{} ;
      +if( $sync->{dry} ) {
      +        $dry_message = "\t(not really since --dry mode)" ;
      +}
      +$sync->{dry_message} = $dry_message ;
      +
       
       $search1 ||= $search if ( $search ) ;
       $search2 ||= $search if ( $search ) ;
       
       
       
      -if ( $disarmreadreceipts ) {  
      -	push( @regexmess, 's{\A((?:[^\n]+\r\n)+|)(^Disposition-Notification-To:[^\n]*\n)(\r?\n|.*\n\r?\n)}{$1X-$2$3}ims' ) ;
      -} 
      +if ( $disarmreadreceipts ) {
      +	push @regexmess, q{s{\A((?:[^\n]+\r\n)+|)(^Disposition-Notification-To:[^\n]*\n)(\r?\n|.*\n\r?\n)}{$1X-$2$3}ims} ;
      +}
       
      -$pipemesscheck = ( defined( $pipemesscheck ) ) ? $pipemesscheck : 1 ;
      +$pipemesscheck = ( defined  $pipemesscheck  ) ? $pipemesscheck : 1 ;
       
       if ( @pipemess and $pipemesscheck ) {
      -	print "Checking each --pipemess command, " . join( ", ", @pipemess ) . ", with an empty string. ( Can avoid this check with --nopipemesscheck )\n" ;
      -	my $string = pipemess( '', @pipemess ) ;
      +	myprint( 'Checking each --pipemess command, ' 
      +                . join( q{, }, @pipemess ) 
      +                . ", with an space string. ( Can avoid this check with --nopipemesscheck )\n" ) ;
      +	my $string = pipemess( q{ }, @pipemess ) ;
               # string undef means something was bad.
      -        if ( not ( defined( $string ) ) ) {
      +        if ( not ( defined  $string  ) ) {
               	die_clean( "Error: one of --pipemess command is bad, check it\n" ) ;
               }
      -	print "Ok with each --pipemess @pipemess\n" ;
      +	myprint( "Ok with each --pipemess @pipemess\n"  ) ;
       }
       
      -
       if ( $maxlinelengthcmd ) {
      -	print "Checking  --maxlinelengthcmd command,  $maxlinelengthcmd, with an empty string.\n" ;
      -	my $string = pipemess( '', $maxlinelengthcmd ) ;
      +	myprint( "Checking  --maxlinelengthcmd command,  $maxlinelengthcmd, with an space string.\n"  ) ;
      +	my $string = pipemess( q{ }, $maxlinelengthcmd ) ;
               # string undef means something was bad.
      -        if ( not ( defined( $string ) ) ) {
      +        if ( not ( defined  $string  ) ) {
               	die_clean( "Error: --maxlinelengthcmd command is bad, check it\n" ) ;
               }
      -	print "Ok with --maxlinelengthcmd $maxlinelengthcmd\n" ;
      +	myprint( "Ok with --maxlinelengthcmd $maxlinelengthcmd\n"  ) ;
       }
       
      -
       if ( @regexmess ) {
      -	my $string = regexmess( '' ) ;
      -	print "Checking each --regexmess command with an empty string.\n" ;
      +	my $string = regexmess( q{ } ) ;
      +	myprint( "Checking each --regexmess command with an space string.\n"  ) ;
               # string undef means one of the eval regex was bad.
      -        if ( not ( defined( $string ) ) ) {
      -        	die_clean( "Error: one of --regexmess option is bad, check it" ) ;
      +        if ( not ( defined  $string  ) ) {
      +        	die_clean( 'Error: one of --regexmess option is bad, check it' ) ;
               }
      -	print "Ok with each --regexmess\n" ;
      +	myprint( "Ok with each --regexmess\n"  ) ;
       }
       
       if ( @skipmess ) {
      -	print "Checking each --skipmess command with an empty string.\n" ;
      -	my $match = skipmess( '' ) ;
      +	myprint( "Checking each --skipmess command with an space string.\n"  ) ;
      +	my $match = skipmess( q{ } ) ;
               # match undef means one of the eval regex was bad.
      -        if ( not ( defined( $match ) ) ) {
      -        	die_clean( "Error: one of --skipmess option is bad, check it" ) ;
      +        if ( not ( defined  $match  ) ) {
      +        	die_clean( 'Error: one of --skipmess option is bad, check it' ) ;
               }
      -	print "Ok with each --skipmess\n" ;
      +	myprint( "Ok with each --skipmess\n"  ) ;
       }
       
       if ( @regexflag ) {
      -	print "Checking each --regexflag command with an empty string.\n" ;
      -	my $string = flags_regex( '' ) ;
      +	myprint( "Checking each --regexflag command with an space string.\n"  ) ;
      +	my $string = flags_regex( q{ } ) ;
       	# string undef means one of the eval regex was bad.
      -	if ( not ( defined( $string ) ) ) {
      -		die_clean( "Error: one of --regexflag option is bad, check it" ) ;
      +	if ( not ( defined  $string  ) ) {
      +		die_clean( 'Error: one of --regexflag option is bad, check it' ) ;
       	}
      -	print "Ok with each --regexflag\n" ;
      +	myprint( "Ok with each --regexflag\n"  ) ;
       }
       
      -$sync->{imap1} = my $imap1 = login_imap($host1, $port1, $user1, $domain1, $password1, 
      +$sync->{imap1} = my $imap1 = login_imap($host1, $port1, $user1, $domain1, $password1,
       		   $debugimap1, $sync->{h1}->{timeout}, $fastio1, $ssl1, $tls1,
       		   $authmech1, $authuser1, $reconnectretry1,
       		   $proxyauth1, $uid1, $split1, 'Host1', $sync->{h1} ) ;
       
      -$sync->{imap2} = my $imap2 = login_imap($host2, $port2, $user2, $domain2, $password2, 
      +$sync->{imap2} = my $imap2 = login_imap($host2, $port2, $user2, $domain2, $password2,
       		 $debugimap2, $sync->{h2}->{timeout}, $fastio2, $ssl2, $tls2,
       		 $authmech2, $authuser2, $reconnectretry2,
       		 $proxyauth2, $uid2, $split2, 'Host2', $sync->{h2} ) ;
       
       
      -$debug and print "Host1 Buffer I/O: ", $imap1->Buffer(), "\n";
      -$debug and print "Host2 Buffer I/O: ", $imap2->Buffer(), "\n";
      +$debug and myprint( 'Host1 Buffer I/O: ', $imap1->Buffer(), "\n" ) ;
      +$debug and myprint( 'Host2 Buffer I/O: ', $imap2->Buffer(), "\n" ) ;
       
       
       die_clean( 'Not authenticated on host1' ) unless $imap1->IsAuthenticated( ) ;
      -print "Host1: state Authenticated\n";
      +myprint( "Host1: state Authenticated\n" ) ;
       die_clean( 'Not authenticated on host2' ) unless   $imap2->IsAuthenticated( ) ;
      -print "Host2: state Authenticated\n";
      +myprint( "Host2: state Authenticated\n" ) ;
       
      -print "Host1 capability: ", join(" ", @{ $imap1->capability_update() || [] }), "\n";
      -print "Host2 capability: ", join(" ", @{ $imap2->capability_update() || [] }), "\n";
      +myprint( 'Host1 capability: ', join(q{ }, @{ $imap1->capability_update() || [] }), "\n" ) ;
      +myprint( 'Host2 capability: ', join(q{ }, @{ $imap2->capability_update() || [] }), "\n" ) ;
       
       imap_id_stuff( $sync ) ;
       
      @@ -1255,36 +1393,38 @@ quota( $imap2, 'host2', $sync ) ;
       if ( $justlogin ) {
       	$imap1->logout(  ) ;
       	$imap2->logout(  ) ;
      -	exit_clean( 0 ) ;
      +	exit_clean( $sync, $EX_OK ) ;
       }
       
       
      -# 
      +#
       # Folder stuff
       #
       
       my (
      -@h1_folders_all , %h1_folders_all , @h1_folders_wanted , %requested_folder , 
      -%h1_subscribed_folder , %h2_subscribed_folder , 
      -@h2_folders_all , %h2_folders_all , %h2_folders_all_UPPER , 
      -@h2_folders_from_1_wanted , %h2_folders_from_1_wanted , 
      -%h2_folders_from_1_several , 
      -%h2_folders_from_1_all ,
      +        @h1_folders_all , %h1_folders_all , @h1_folders_wanted , %requested_folder ,
      +        %h1_subscribed_folder , %h2_subscribed_folder ,
      +        @h2_folders_all , %h2_folders_all , %h2_folders_all_UPPER ,
      +        @h2_folders_from_1_wanted , %h2_folders_from_1_wanted ,
      +        %h2_folders_from_1_several ,
      +        %h2_folders_from_1_all ,
       ) ;
       
      +my $h1_folders_wanted_nb = 0 ; 
      +my $h1_folders_wanted_ct = 0 ; # counter of folders done.
       
       # All folders on host1 and host2
       
      -@h1_folders_all = sort $imap1->folders();
      -@h2_folders_all = sort $imap2->folders();
      +@h1_folders_all = sort $imap1->folders(  ) ;
      +@h2_folders_all = sort $imap2->folders(  ) ;
       
      -print "Host1: found ", scalar( @h1_folders_all ), " folders.\n" ;
      -print "Host2: found ", scalar( @h2_folders_all ), " folders.\n" ;
      +myprint( 'Host1: found ', scalar  @h1_folders_all , " folders.\n"  ) ;
      +myprint( 'Host2: found ', scalar  @h2_folders_all , " folders.\n"  ) ;
       
       for ( @h1_folders_all ) { $h1_folders_all{ $_ } = 1 } ;
      -for ( @h2_folders_all ) { 
      +for ( @h2_folders_all ) {
       	$h2_folders_all{ $_ } = 1 ;
      -	$h2_folders_all_UPPER{ uc( $_ ) } = 1 ;
      +	$h2_folders_all_UPPER{ uc  $_  } = 1 ;
       } ;
       
       $sync->{h1_folders_all} = \%h1_folders_all ;
      @@ -1297,30 +1437,30 @@ for ( $imap1->subscribed(  ) ) { $h1_subscribed_folder{ $_ } = 1 } ;
       for ( $imap2->subscribed(  ) ) { $h2_subscribed_folder{ $_ } = 1 } ;
       
       
      -if ( defined( $subfolder2 ) ) {
      -	unshift( @regextrans2, 
      -		's,^${h2_prefix}(.*),${h2_prefix}${subfolder2}${h2_sep}$1,',
      -		's,^INBOX$,${h2_prefix}${subfolder2}${h2_sep}INBOX,'
      -	) ;
      +if ( defined  $subfolder2  ) {
      +	unshift @regextrans2,
      +		q's,^${h2_prefix}(.*),${h2_prefix}${subfolder2}${h2_sep}$1,',
      +		q's,^INBOX$,${h2_prefix}${subfolder2}${h2_sep}INBOX,' ;
      +
       }
       
       if ( $fixInboxINBOX and ( my $reg = fix_Inbox_INBOX_mapping( \%h1_folders_all, \%h2_folders_all ) ) ) {
      -	push( @regextrans2, $reg ) ;
      -} 
      +	push @regextrans2, $reg ;
      +}
       
      -if (scalar(@folder) or $subscribed or scalar(@folderrec)) {
      +if (scalar @folder or $subscribed or scalar @folderrec) {
       	# folders given by option --folder
      -	if (scalar(@folder)) {
      +	if (scalar @folder) {
       		add_to_requested_folders(@folder);
       	}
      -	
      +
       	# option --subscribed
       	if ( $subscribed ) {
      -		add_to_requested_folders( keys ( %h1_subscribed_folder ) ) ;
      +		add_to_requested_folders( keys  %h1_subscribed_folder  ) ;
       	}
      -	
      +
       	# option --folderrec
      -	if (scalar(@folderrec)) {
      +	if (scalar @folderrec) {
       		foreach my $folderrec (@folderrec) {
       			add_to_requested_folders($imap1->folders($folderrec));
       		}
      @@ -1328,48 +1468,48 @@ if (scalar(@folder) or $subscribed or scalar(@folderrec)) {
       }
       else {
       	# no include, no folder/subscribed/folderrec options => all folders
      -	if (not scalar(@include)) {
      -		print "Including all folders found by default. Use --subscribed or --folder or --folderrec or --include to select specific folders. Use --exclude to unselect specific folders.\n" ;
      +	if (not scalar @include) {
      +		myprint( "Including all folders found by default. Use --subscribed or --folder or --folderrec or --include to select specific folders. Use --exclude to unselect specific folders.\n"  ) ;
       		add_to_requested_folders(@h1_folders_all);
       	}
       }
       
       
       # consider (optional) includes and excludes
      -if ( scalar( @include ) ) {
      +if ( scalar  @include  ) {
       	foreach my $include ( @include ) {
       		my @included_folders = grep { /$include/ } @h1_folders_all ;
       		add_to_requested_folders( @included_folders ) ;
      -		print "Including folders matching pattern $include\n" . jux_utf8_list( @included_folders )  . "\n" ;
      +		myprint( "Including folders matching pattern $include\n" . jux_utf8_list( @included_folders )  . "\n"  ) ;
       	}
       }
       
      -if ( scalar( @exclude ) ) {
      +if ( scalar  @exclude  ) {
       	foreach my $exclude ( @exclude ) {
      -		my @requested_folder = sort( keys( %requested_folder ) ) ;
      +		my @requested_folder = sort keys %requested_folder ;
       		my @excluded_folders = grep { /$exclude/ } @requested_folder ;
       		remove_from_requested_folders( @excluded_folders ) ;
      -		print "Excluding folders matching pattern $exclude\n" . jux_utf8_list( @excluded_folders ) . "\n" ;
      +		myprint( "Excluding folders matching pattern $exclude\n" . jux_utf8_list( @excluded_folders ) . "\n"  ) ;
       	}
       }
       
       
       # sort before is not very powerful
       # it adds --folderfirst and --folderlast even if they don't exist on host1
      -@h1_folders_wanted = sort_requested_folders(  ) ; 
      +@h1_folders_wanted = sort_requested_folders(  ) ;
       
       # Remove no selectable folders
       
       
       my @h1_folders_wanted_exist ;
      -print "Host1: checking all wanted folders exist.\n" ;
      +myprint( "Host1: checking all wanted folders exist.\n"  ) ;
       foreach my $folder ( @h1_folders_wanted ) {
      -	( $debug or $sync->{debugfolders} ) and print "Checking $folder exists on host1\n" ;
      -	if ( not exists( $h1_folders_all{ $folder } ) ) {
      -		print "Host1: warning! ignoring folder $folder because it is not in host1 whole folders list.\n" ;
      +	( $debug or $sync->{debugfolders} ) and myprint( "Checking $folder exists on host1\n"  ) ;
      +	if ( ! exists  $h1_folders_all{ $folder }  ) {
      +                myprint( "Host1: warning! ignoring folder $folder because it is not in host1 whole folders list.\n" ) ;
       		next ;
       	}else{
      -		push( @h1_folders_wanted_exist, $folder ) ;
      +		push  @h1_folders_wanted_exist, $folder  ;
       	}
       }
       
      @@ -1379,36 +1519,36 @@ foreach my $folder ( @h1_folders_wanted ) {
       
       $checkselectable and do {
       	my @h1_folders_wanted_selectable ;
      -        print "Host1: checking all wanted folders are selectable. Use --nocheckselectable to avoid this check.\n" ;
      +        myprint( "Host1: checking all wanted folders are selectable. Use --nocheckselectable to avoid this check.\n"  ) ;
       	foreach my $folder ( @h1_folders_wanted ) {
      -        	( $debug or $sync->{debugfolders} ) and print "Checking $folder is selectable on host1\n" ;
      -        	if ( not $imap1->selectable( $folder ) ) {
      -				print "Host1: warning! ignoring folder $folder because it is not selectable\n" ;
      +        	( $debug or $sync->{debugfolders} ) and myprint( "Checking $folder is selectable on host1\n"  ) ;
      +        	if ( ! $imap1->selectable( $folder ) ) {
      +                                myprint( "Host1: warning! ignoring folder $folder because it is not selectable\n" ) ;
               	}else{
      -			push( @h1_folders_wanted_selectable, $folder ) ;
      +			push  @h1_folders_wanted_selectable, $folder  ;
       		}
       	}
       	@h1_folders_wanted = @h1_folders_wanted_selectable ;
      -        ( $debug or $sync->{debugfolders} ) and print "Host1: checking folders took ", timenext(  ), " s\n";
      +        ( $debug or $sync->{debugfolders} ) and myprint( 'Host1: checking folders took ', timenext(  ), " s\n"  ) ;
       } ;
       
       $sync->{h1_folders_wanted} = \@h1_folders_wanted ;
       
       
      -my( $h1_sep, $h2_sep ) ; 
      +my( $h1_sep, $h2_sep ) ;
       # what are the private folders separators for each server ?
       
      -( $debug or $sync->{debugfolders} ) and print "Getting separators\n" ;
      -$h1_sep = get_separator( $imap1, $sep1, "--sep1", "Host1", \@h1_folders_all ) ;
      -$h2_sep = get_separator( $imap2, $sep2, "--sep2", "Host2", \@h2_folders_all ) ;
      +( $debug or $sync->{debugfolders} ) and myprint( "Getting separators\n"  ) ;
      +$h1_sep = get_separator( $imap1, $sep1, '--sep1', 'Host1', \@h1_folders_all ) ;
      +$h2_sep = get_separator( $imap2, $sep2, '--sep2', 'Host2', \@h2_folders_all ) ;
       
      -my( $h1_prefix, $h2_prefix ) ; 
      -$sync->{ h1_prefix } = $h1_prefix = get_prefix( $imap1, $prefix1, "--prefix1", "Host1", \@h1_folders_all ) ;
      -$sync->{ h2_prefix } = $h2_prefix = get_prefix( $imap2, $prefix2, "--prefix2", "Host2", \@h2_folders_all ) ;
      +my( $h1_prefix, $h2_prefix ) ;
      +$sync->{ h1_prefix } = $h1_prefix = get_prefix( $imap1, $prefix1, '--prefix1', 'Host1', \@h1_folders_all ) ;
      +$sync->{ h2_prefix } = $h2_prefix = get_prefix( $imap2, $prefix2, '--prefix2', 'Host2', \@h2_folders_all ) ;
       
       
      -print "Host1 separator and prefix: [$h1_sep][$h1_prefix]\n" ;
      -print "Host2 separator and prefix: [$h2_sep][$h2_prefix]\n" ;
      +myprint( "Host1 separator and prefix: [$h1_sep][$h1_prefix]\n"  ) ;
      +myprint( "Host2 separator and prefix: [$h2_sep][$h2_prefix]\n"  ) ;
       
       automap( $sync ) ;
       
      @@ -1420,8 +1560,8 @@ foreach my $h1_fold ( @h1_folders_wanted ) {
               if ( 1 < $h2_folders_from_1_wanted{ $h2_fold } ) {
               	$h2_folders_from_1_several{ $h2_fold }++ ;
               }
      -} 
      -@h2_folders_from_1_wanted = sort keys(%h2_folders_from_1_wanted);
      +}
      +@h2_folders_from_1_wanted = sort keys %h2_folders_from_1_wanted;
       
       foreach my $h1_fold ( @h1_folders_all ) {
       	my $h2_fold ;
      @@ -1431,7 +1571,7 @@ foreach my $h1_fold ( @h1_folders_all ) {
       
       
       
      -print << 'END_LISTING' ;
      +myprint( << 'END_LISTING'  ) ;
       
       ++++ Listing folders
       All foldernames are presented between brackets like [X] where X is the foldername.
      @@ -1443,84 +1583,75 @@ Y is the uft8 output just printed for convenience, to recognize it.
       END_LISTING
       
       print
      -  "Host1 folders list:\n", 
      -  jux_utf8_list( @h1_folders_all ), 
      +  "Host1 folders list:\n",
      +  jux_utf8_list( @h1_folders_all ),
         "\n",
      -  "Host2 folders list:\n", 
      -  jux_utf8_list( @h2_folders_all ), 
      +  "Host2 folders list:\n",
      +  jux_utf8_list( @h2_folders_all ),
         "\n" ;
       
      -print 
      -  "Host1 subscribed folders list: ", 
      -  jux_utf8_list( sort keys( %h1_subscribed_folder ) ), "\n" 
      +print
      +  'Host1 subscribed folders list: ',
      +  jux_utf8_list( sort keys  %h1_subscribed_folder  ), "\n"
         if ( $subscribed ) ;
       
       my @h2_folders_not_in_1;
       @h2_folders_not_in_1 = list_folders_in_2_not_in_1(  ) ;
       
       if ( @h2_folders_not_in_1 ) {
      -	print "Folders in host2 not in host1:\n", 
      -	jux_utf8_list( @h2_folders_not_in_1 ), "\n" ;
      +	myprint( "Folders in host2 not in host1:\n",
      +	jux_utf8_list( @h2_folders_not_in_1 ), "\n" ) ;
       }
       
       
      -if ( defined( $sync->{f1f2auto} ) ) {
      -	print "Folders mapping from --automap feature (use --f1f2 to override any mapping):\n" ;
      +if ( defined  $sync->{f1f2auto}  ) {
      +	myprint( "Folders mapping from --automap feature (use --f1f2 to override any mapping):\n"  ) ;
       	foreach my $h1_fold ( keys %{$sync->{f1f2auto}} ) {
               	my $h2_fold = $sync->{f1f2auto}{$h1_fold} ;
      -		printf( "%-40s -> %-40s\n",
      +		myprintf( "%-40s -> %-40s\n",
       		       jux_utf8( $h1_fold ), jux_utf8( $h2_fold ) ) ;
               }
      -        print "\n" ;
      +        myprint( "\n"  ) ;
       }
       
      -if ( defined( $sync->{f1f2} ) ) {
      -	print "Folders mapping from --f1f2 options, it overrides --automap:\n" ;
      +if ( defined  $sync->{f1f2}  ) {
      +	myprint( "Folders mapping from --f1f2 options, it overrides --automap:\n"  ) ;
       	foreach my $h1_fold ( keys %{$sync->{f1f2}} ) {
               	my $h2_fold = $sync->{f1f2}{$h1_fold} ;
      -                my $warn = '' ;
      -                if ( not exists( $h1_folders_all{ $h1_fold } ) ) {
      +                my $warn = q{} ;
      +                if ( not exists  $h1_folders_all{ $h1_fold }  ) {
                               $warn = "BUT $h1_fold does NOT exist on host1!" ;
                       }
      -		printf( "%-40s -> %-40s %s\n",
      +		myprintf( "%-40s -> %-40s %s\n",
       		       jux_utf8( $h1_fold ), jux_utf8( $h2_fold ), $warn ) ;
               }
      -        print "\n" ;
      +        myprint( "\n"  ) ;
       }
       
      -exit_clean( 0 ) if ( $sync->{justfolderlists} ) ;
      -exit_clean( 0 ) if ( $sync->{justautomap} ) ;
      +exit_clean( $sync, $EX_OK ) if ( $sync->{justfolderlists} ) ;
      +exit_clean( $sync, $EX_OK ) if ( $sync->{justautomap} ) ;
       
      +debugsleep( $sync ) ;
       
       if ( $foldersizes ) {
      -	print << 'END_SIZE' ;
      +        foldersizes_on_h1h2(  ) ;
      +}
       
      -Folders sizes before the synchronization.
      -You can remove foldersizes listings by using "--nofoldersizes" and  "--nofoldersizesatend"
      -but then you will also loose the ETA (Estimation Time of Arrival) given after each message copy.
      -END_SIZE
       
      -	( $h1_nb_msg_at_start, $h1_bytes_start ) = foldersizes( "Host1", $imap1, $search1, @h1_folders_wanted ) ;
      -	( $h2_nb_msg_start,    $h2_bytes_start ) = foldersizes( "Host2", $imap2, $search2, @h2_folders_from_1_wanted ) ;
      -        my $h2_bytes_limit = $sync->{host2}->{quota_limit_bytes} || 0 ;
      -        if ( $h2_bytes_limit and ( $h2_bytes_limit < $h1_bytes_start ) ) {
      -        	my $quota_percent = sprintf( "%.0f", $h1_bytes_start/$h2_bytes_limit ) ;
      -                my $error = "Host2: Quota limit will be exceeded! Over $quota_percent % ( $h1_bytes_start bytes / $h2_bytes_limit bytes )\n" ;
      -                errors_incr( $error ) ;
      -        }
      -	$fast or sleep( 2 ) ;
      -}
      +exit_clean( $sync, $EX_OK ) if ( $justfoldersizes ) ;
       
      -exit_clean( 0 ) if ( $justfoldersizes ) ;
      +$sync->{stats} = 1 ;
       
      +if ( $sync->{'delete1emptyfolders'} ) {
      +        delete1emptyfolders( $sync ) ;
      +}
       
      -delete_folders_in_2_not_in_1(  ) if $delete2folders;
      +delete_folders_in_2_not_in_1(  ) if $delete2folders ;
       
       # folder loop
      -my $h1_folders_wanted_nb = scalar( @h1_folders_wanted ) ;
      -my $h1_folders_wanted_ct = 0 ; # folder counter.
      +$h1_folders_wanted_nb = scalar  @h1_folders_wanted  ;
       
      -print "++++ Looping on each one of $h1_folders_wanted_nb folders to sync\n";
      +myprint( "++++ Looping on each one of $h1_folders_wanted_nb folders to sync\n" ) ;
       
       my $begin_transfer_time = time ;
       
      @@ -1537,50 +1668,55 @@ FOLDER: foreach my $h1_fold ( @h1_folders_wanted ) {
       	my $h2_fold = imap2_folder_name( $h1_fold ) ;
       
       	$h1_folders_wanted_ct++ ;
      -	printf( "%7s %-35s -> %-35s\n", "$h1_folders_wanted_ct/$h1_folders_wanted_nb",
      +	myprintf( "Folder %7s %-35s -> %-35s\n", "$h1_folders_wanted_ct/$h1_folders_wanted_nb",
       		jux_utf8( $h1_fold ), jux_utf8( $h2_fold ) ) ;
      -
      +        if ( $sync->{debugmemory} ) {
      +                myprintf("FL: Memory consumption: %.1f MiB\n", memory_consumption(  ) / $KIBI / $KIBI) ;
      +        }
       	# host1 can not be fetched read only, select is needed because of expunge.
       	select_folder( $imap1, $h1_fold, 'Host1' ) or next FOLDER ;
      -	#print $imap1->History(  ) ;
      -        
      -	my $messages_count =  count_from_select( $imap1->History ) ;
      -        $debug and print "Host1 messages count = [$messages_count]\n" ;
      -        
      -        if ( $skipemptyfolders and 0 == $messages_count ) {
      -        	print "Skipping empty host1 folder [$h1_fold]\n" ;
      +
      +        debugsleep( $sync ) ;
      +
      +	my $h1_fold_nb_messages = count_from_select( $imap1->History ) ;
      +        myprint( "Host1 folder [$h1_fold] has $h1_fold_nb_messages messages in total (mentioned by SELECT)\n" ) ;
      +
      +        if ( $skipemptyfolders and 0 == $h1_fold_nb_messages ) {
      +        	myprint( "Skipping empty host1 folder [$h1_fold]\n"  ) ;
                       next FOLDER ;
               }
      -        
      -	if ( ! exists( $h2_folders_all{ $h2_fold } ) ) {
      +
      +	if ( ! exists  $h2_folders_all{ $h2_fold }  ) {
       		create_folder( $imap2, $h2_fold, $h1_fold ) or next FOLDER ;
       	}
      -	
      +
       	acls_sync( $h1_fold, $h2_fold ) ;
      -	
      +
               # Sometimes the folder on host2 is listed (it exists) but is
               # not selectable but becomes selectable by a create (Gmail)
      -	select_folder( $imap2, $h2_fold, 'Host2' ) 
      -        or ( create_folder( $imap2, $h2_fold, $h1_fold ) 
      +	select_folder( $imap2, $h2_fold, 'Host2' )
      +        or ( create_folder( $imap2, $h2_fold, $h1_fold )
                    and select_folder( $imap2, $h2_fold, 'Host2' ) )
               or next FOLDER ;
       	my @select_results = $imap2->Results(  ) ;
      -	
      -	#print "%%% @select_results\n" ;
      +
      +	my $h2_fold_nb_messages = count_from_select( @select_results ) ;
      +        myprint( "Host2 folder [$h2_fold] has $h2_fold_nb_messages messages in total (mentioned by SELECT)\n" ) ;
      +
       	my $permanentflags2 = permanentflags( @select_results ) ;
      -	( $debug or $debugflags ) and print "Host2 permanentflags: $permanentflags2\n" ;
      +	( $debug or $debugflags ) and myprint( "Host2 folder [$h2_fold] permanentflags: $permanentflags2\n"  ) ;
       
       	if ( $expunge or $expunge1 ){
      -		print "Host1: Expunging $h1_fold $dry_message\n" ;
      +		myprint( "Host1: Expunging $h1_fold $dry_message\n"  ) ;
       		unless( $dry ) { $imap1->expunge(  ) } ;
       	}
      -	
      +
       	if ( ( ( $subscribe and exists $h1_subscribed_folder{ $h1_fold } ) or $subscribeall )
      -             and not exists( $h2_subscribed_folder{ $h2_fold } ) ) {
      -		print "Host2: Subscribing to folder $h2_fold\n" ;
      +             and not exists  $h2_subscribed_folder{ $h2_fold }  ) {
      +		myprint( "Host2: Subscribing to folder $h2_fold\n"  ) ;
       		unless( $dry ) { $imap2->subscribe( $h2_fold ) } ;
       	}
      -	
      +
       	next FOLDER if ( $justfolders ) ;
       
               last FOLDER if $imap1->IsUnconnected(  ) ;
      @@ -1589,197 +1725,199 @@ FOLDER: foreach my $h1_fold ( @h1_folders_wanted ) {
               my $h1_msgs_all_hash_ref = {  } ;
       	my @h1_msgs = select_msgs( $imap1, $h1_msgs_all_hash_ref, $search1, $h1_fold );
       	last FOLDER if $imap1->IsUnconnected(  ) ;
      -        
      -        my $h1_msgs_nb = scalar( @h1_msgs ) ;
      +
      +        my $h1_msgs_nb = scalar  @h1_msgs  ;
               $h1{ $h1_fold }{ 'messages_nb' } = $h1_msgs_nb ;
       
      -	( $debug or $debugLIST ) and print "Host1 LIST [$h1_fold] $h1_msgs_nb messages [@h1_msgs]\n" ;
      -        $debug and print "Host1 selecting messages of folder [$h1_fold] took ", timenext(), " s\n";
      -        
      +	myprint( "Host1 folder [$h1_fold] considering $h1_msgs_nb messages\n"  ) ;
      +	( $debug or $debuglist ) and myprint( "Host1 folder [$h1_fold] considering $h1_msgs_nb messages, LIST gives: @h1_msgs\n" ) ;
      +        $debug and myprint( "Host1 selecting messages of folder [$h1_fold] took ", timenext(), " s\n" ) ;
      +
               my $h2_msgs_all_hash_ref = {  } ;
       	my @h2_msgs = select_msgs( $imap2, $h2_msgs_all_hash_ref, $search2, $h2_fold ) ;
       	last FOLDER if $imap2->IsUnconnected(  ) ;
      -        
      -        my $h2_msgs_nb = scalar( @h2_msgs ) ;
      +
      +        my $h2_msgs_nb = scalar  @h2_msgs  ;
               $h2{ $h2_fold }{ 'messages_nb' } = $h2_msgs_nb ;
       
      -	( $debug or $debugLIST ) and print "Host2 LIST [$h2_fold] $h2_msgs_nb messages [@h2_msgs]\n";
      -        $debug and print "Host2 selecting messages of folder [$h2_fold] took ", timenext(), " s\n";
      -        
      +	myprint( "Host2 folder [$h2_fold] considering $h2_msgs_nb messages\n" ) ;
      +	( $debug or $debuglist ) and myprint( "Host2 folder [$h2_fold] considering $h2_msgs_nb messages, LIST gives: @h2_msgs\n" ) ;
      +        $debug and myprint( "Host2 selecting messages of folder [$h2_fold] took ", timenext(), " s\n" ) ;
      +
       	my $cache_base = "$tmpdir/imapsync_cache/" ;
       	my $cache_dir = cache_folder( $cache_base, "$host1/$user1/$host2/$user2", $h1_fold, $h2_fold ) ;
       	my ( $cache_1_2_ref, $cache_2_1_ref ) = ( {}, {} ) ;
      -        
      -	my $h1_uidvalidity = $imap1->uidvalidity(  ) || '' ;
      -	my $h2_uidvalidity = $imap2->uidvalidity(  ) || '' ;
      +
      +	my $h1_uidvalidity = $imap1->uidvalidity(  ) || q{} ;
      +	my $h2_uidvalidity = $imap2->uidvalidity(  ) || q{} ;
       
               last FOLDER if $imap1->IsUnconnected(  ) ;
               last FOLDER if $imap2->IsUnconnected(  ) ;
       
       	if ( $usecache ) {
      -		print "cache directory: $cache_dir\n" ;
      +		myprint( "cache directory: $cache_dir\n"  ) ;
       		mkpath( "$cache_dir" ) ;
      -		( $cache_1_2_ref, $cache_2_1_ref ) 
      +		( $cache_1_2_ref, $cache_2_1_ref )
                       = get_cache( $cache_dir, \@h1_msgs, \@h2_msgs, $h1_msgs_all_hash_ref, $h2_msgs_all_hash_ref ) ;
      -		print "CACHE h1 h2: ", scalar( keys %$cache_1_2_ref ), " files\n" ; 
      -		$debug and print '[',
      -		    map ( { "$_->$cache_1_2_ref->{$_} " } keys %$cache_1_2_ref ), " ]\n";
      +		myprint( 'CACHE h1 h2: ', scalar  keys %{ $cache_1_2_ref } , " files\n"  ) ;
      +		$debug and myprint( '[',
      +		    map ( { "$_->$cache_1_2_ref->{$_} " } keys %{ $cache_1_2_ref } ), " ]\n" ) ;
       	}
      -	
      +
       	my %h1_hash = () ;
       	my %h2_hash = () ;
      -	
      +
       	my ( %h1_msgs, %h2_msgs ) ;
       	@h1_msgs{ @h1_msgs } = ();
       	@h2_msgs{ @h2_msgs } = ();
      -	
      -	my @h1_msgs_in_cache = sort { $a <=> $b } keys %$cache_1_2_ref ;
      -	my @h2_msgs_in_cache = keys %$cache_2_1_ref ;
      -	
      +
      +	my @h1_msgs_in_cache = sort { $a <=> $b } keys %{ $cache_1_2_ref } ;
      +	my @h2_msgs_in_cache = keys %{ $cache_2_1_ref } ;
      +
       	my ( %h1_msgs_not_in_cache, %h2_msgs_not_in_cache ) ;
       	%h1_msgs_not_in_cache = %h1_msgs ;
       	%h2_msgs_not_in_cache = %h2_msgs ;
       	delete @h1_msgs_not_in_cache{ @h1_msgs_in_cache } ;
       	delete @h2_msgs_not_in_cache{ @h2_msgs_in_cache } ;
      -	
      +
       	my @h1_msgs_not_in_cache = keys %h1_msgs_not_in_cache ;
      -	#print "h1_msgs_not_in_cache: [@h1_msgs_not_in_cache]\n" ;
      +	#myprint( "h1_msgs_not_in_cache: [@h1_msgs_not_in_cache]\n"  ) ;
       	my @h2_msgs_not_in_cache = keys %h2_msgs_not_in_cache ;
      -	
      +
       	my @h2_msgs_delete2_not_in_cache = () ;
       	%h1_msgs_copy_by_uid = (  ) ;
      -	
      +
       	if ( $useuid ) {
       		# use uid so we have to avoid getting header
       		@h1_msgs_copy_by_uid{ @h1_msgs_not_in_cache } = (  ) ;
       		@h2_msgs_delete2_not_in_cache = @h2_msgs_not_in_cache if $usecache ;
       		@h1_msgs_not_in_cache = (  ) ;
       		@h2_msgs_not_in_cache = (  ) ;
      -		
      -		#print "delete2: @h2_msgs_delete2_not_in_cache\n";
      +
      +		#myprint( "delete2: @h2_msgs_delete2_not_in_cache\n" ) ;
       	}
      -	
      -	$debug and print "Host1 parsing headers of folder [$h1_fold]\n";
      +
      +	$debug and myprint( "Host1 parsing headers of folder [$h1_fold]\n" ) ;
       
       	my ($h1_heads_ref, $h1_fir_ref) = ({}, {});
       	$h1_heads_ref = $imap1->parse_headers([@h1_msgs_not_in_cache], @useheader) if (@h1_msgs_not_in_cache);
      -	$debug and print "Host1 parsing headers of folder [$h1_fold] took ", timenext(), " s\n";
      +	$debug and myprint( "Host1 parsing headers of folder [$h1_fold] took ", timenext(), " s\n" ) ;
       
      -	@$h1_fir_ref{@h1_msgs} = (undef);
      -        
      -	$debug and print "Host1 getting flags idate and sizes of folder [$h1_fold]\n" ;
      +	@{ $h1_fir_ref }{@h1_msgs} = ( undef ) ;
      +
      +	$debug and myprint( "Host1 getting flags idate and sizes of folder [$h1_fold]\n"  ) ;
               if ( $abletosearch ) {
      -		$h1_fir_ref = $imap1->fetch_hash( \@h1_msgs, "FLAGS", "INTERNALDATE", "RFC822.SIZE", $h1_fir_ref )
      +		$h1_fir_ref = $imap1->fetch_hash( \@h1_msgs, 'FLAGS', 'INTERNALDATE', 'RFC822.SIZE', $h1_fir_ref )
       	  	if ( @h1_msgs ) ;
               }else{
       		my $uidnext = $imap1->uidnext( $h1_fold ) || $uidnext_default ;
       		my $fetch_hash_uids = $fetch_hash_set || "1:$uidnext" ;
      -		$h1_fir_ref = $imap1->fetch_hash( $fetch_hash_uids, "FLAGS", "INTERNALDATE", "RFC822.SIZE", $h1_fir_ref )
      +		$h1_fir_ref = $imap1->fetch_hash( $fetch_hash_uids, 'FLAGS', 'INTERNALDATE', 'RFC822.SIZE', $h1_fir_ref )
       		if ( @h1_msgs ) ;
               }
      -	$debug and print "Host1 getting flags idate and sizes of folder [$h1_fold] took ", timenext(), " s\n";
      +	$debug and myprint( "Host1 getting flags idate and sizes of folder [$h1_fold] took ", timenext(), " s\n"  ) ;
       	unless ($h1_fir_ref) {
      -		my $error = join( '', "Host1 folder $h1_fold: Could not fetch_hash ",
      -			scalar(@h1_msgs), " msgs: ", $imap1->LastError || '', "\n" ) ;
      -		errors_incr( $error ) ;
      -		next FOLDER;
      +		my $error = join( q{}, "Host1 folder $h1_fold: Could not fetch_hash ",
      +			scalar @h1_msgs, ' msgs: ', $imap1->LastError || q{}, "\n" ) ;
      +		errors_incr( $sync, $error ) ;
      +		next FOLDER ;
       	}
       
       	my @h1_msgs_duplicate;
       	foreach my $m (@h1_msgs_not_in_cache) {
       		my $rc = parse_header_msg($imap1, $m, $h1_heads_ref, $h1_fir_ref, 'Host1', \%h1_hash);
      -		if (! defined($rc)) {
      -			my $h1_size = $h1_fir_ref->{$m}->{"RFC822.SIZE"} || 0;
      -			print "Host1 $h1_fold/$m size $h1_size ignored (no wanted headers so we ignore this message. To solve this: use --addheader)\n" ;
      +		if (! defined $rc) {
      +			my $h1_size = $h1_fir_ref->{$m}->{'RFC822.SIZE'} || 0;
      +			myprint( "Host1 $h1_fold/$m size $h1_size ignored (no wanted headers so we ignore this message. To solve this: use --addheader)\n"  ) ;
       			$total_bytes_skipped += $h1_size;
       			$nb_msg_skipped += 1;
       			$h1_nb_msg_noheader +=1;
                               $h1_nb_msg_processed +=1 ;
       		} elsif(0 == $rc) {
       			# duplicate
      -			push(@h1_msgs_duplicate, $m);
      +			push @h1_msgs_duplicate, $m;
       			# duplicate, same id same size?
      -			my $h1_size = $h1_fir_ref->{$m}->{"RFC822.SIZE"} || 0;
      +			my $h1_size = $h1_fir_ref->{$m}->{'RFC822.SIZE'} || 0;
       			$nb_msg_skipped += 1;
       			$h1_total_bytes_duplicate += $h1_size;
       			$h1_nb_msg_duplicate += 1;
                               $h1_nb_msg_processed +=1 ;
       		}
       	}
      -        my $h1_msgs_duplicate_nb = scalar( @h1_msgs_duplicate ) ;
      +        my $h1_msgs_duplicate_nb = scalar  @h1_msgs_duplicate  ;
               $h1{ $h1_fold }{ 'duplicates_nb' } = $h1_msgs_duplicate_nb ;
      -        
      -        $debug and print "Host1 selected: $h1_msgs_nb  duplicates: $h1_msgs_duplicate_nb\n" ;
      -	$debug and print "Host1 whole time parsing headers took ", timenext(), " s\n";
      -        
      -	$debug and print "Host2 parsing headers of folder [$h2_fold]\n";
      -        
      +
      +        $debug and myprint( "Host1 selected: $h1_msgs_nb  duplicates: $h1_msgs_duplicate_nb\n"  ) ;
      +	$debug and myprint( 'Host1 whole time parsing headers took ', timenext(), " s\n"  ) ;
      +
      +	$debug and myprint( "Host2 parsing headers of folder [$h2_fold]\n" ) ;
      +
       	my ($h2_heads_ref, $h2_fir_ref) = ( {}, {} );
       	$h2_heads_ref =   $imap2->parse_headers([@h2_msgs_not_in_cache], @useheader) if (@h2_msgs_not_in_cache);
      -	$debug and print "Host2 parsing headers of folder [$h2_fold] took ", timenext(), " s\n" ;
      +	$debug and myprint( "Host2 parsing headers of folder [$h2_fold] took ", timenext(), " s\n"  ) ;
       
      -	$debug and print "Host2 getting flags idate and sizes of folder [$h2_fold]\n" ;
      -	@$h2_fir_ref{@h2_msgs} = (  ); # fetch_hash can select by uid with last arg as ref
      +	$debug and myprint( "Host2 getting flags idate and sizes of folder [$h2_fold]\n"  ) ;
      +	@{ $h2_fir_ref }{@h2_msgs} = (  ); # fetch_hash can select by uid with last arg as ref
       
       
               if ( $abletosearch ) {
      -		$h2_fir_ref = $imap2->fetch_hash( \@h2_msgs, "FLAGS", "INTERNALDATE", "RFC822.SIZE", $h2_fir_ref)
      +		$h2_fir_ref = $imap2->fetch_hash( \@h2_msgs, 'FLAGS', 'INTERNALDATE', 'RFC822.SIZE', $h2_fir_ref)
       		if (@h2_msgs) ;
               }else{
       		my $uidnext = $imap2->uidnext( $h2_fold ) || $uidnext_default ;
       		my $fetch_hash_uids = $fetch_hash_set || "1:$uidnext" ;
      -		$h2_fir_ref = $imap2->fetch_hash( $fetch_hash_uids, "FLAGS", "INTERNALDATE", "RFC822.SIZE", $h2_fir_ref )
      +		$h2_fir_ref = $imap2->fetch_hash( $fetch_hash_uids, 'FLAGS', 'INTERNALDATE', 'RFC822.SIZE', $h2_fir_ref )
       		if ( @h2_msgs ) ;
               }
       
      -	$debug and print "Host2 getting flags idate and sizes of folder [$h2_fold] took ", timenext(), " s\n" ;
      -	
      +	$debug and myprint( "Host2 getting flags idate and sizes of folder [$h2_fold] took ", timenext(), " s\n"  ) ;
      +
       	my @h2_msgs_duplicate;
       	foreach my $m (@h2_msgs_not_in_cache) {
      -		my $rc = parse_header_msg($imap2, $m, $h2_heads_ref, $h2_fir_ref, 'Host2', \%h2_hash);
      -		my $h2_size = $h2_fir_ref->{$m}->{"RFC822.SIZE"} || 0;
      -		if (! defined($rc)) {
      -                        print "Host2 $h2_fold/$m size $h2_size ignored (no wanted headers so we ignore this message)\n" ;
      +		my $rc = parse_header_msg($imap2, $m, $h2_heads_ref, $h2_fir_ref, 'Host2', \%h2_hash) ;
      +		my $h2_size = $h2_fir_ref->{$m}->{'RFC822.SIZE'} || 0 ;
      +		if (! defined  $rc  ) {
      +                        myprint( "Host2 $h2_fold/$m size $h2_size ignored (no wanted headers so we ignore this message)\n"  ) ;
       			$h2_nb_msg_noheader += 1 ;
      -		} elsif(0 == $rc) {
      +		} elsif( 0 == $rc ) {
       			# duplicate
      -			$h2_nb_msg_duplicate += 1;
      -			$h2_total_bytes_duplicate += $h2_size;
      -			push(@h2_msgs_duplicate, $m);
      +			$h2_nb_msg_duplicate += 1 ;
      +			$h2_total_bytes_duplicate += $h2_size ;
      +			push  @h2_msgs_duplicate, $m  ;
       		}
       	}
      -        
      +
               # %h2_folders_of_md5
      -        foreach my $md5 (  keys( %h2_hash ) ) {
      +        foreach my $md5 (  keys  %h2_hash  ) {
               	$h2_folders_of_md5{ $md5 }->{ $h2_fold } ++ ;
               }
       
      -        
      -        my $h2_msgs_duplicate_nb = scalar( @h2_msgs_duplicate ) ;
      +
      +        my $h2_msgs_duplicate_nb = scalar  @h2_msgs_duplicate  ;
               $h2{ $h2_fold }{ 'duplicates_nb' } = $h2_msgs_duplicate_nb ;
      -        
      -        print "Host2 folder $h2_fold selected: $h2_msgs_nb messages,  duplicates: $h2_msgs_duplicate_nb\n" 
      +
      +        myprint( "Host2 folder $h2_fold selected: $h2_msgs_nb messages,  duplicates: $h2_msgs_duplicate_nb\n" )
               	if ( $debug or $delete2duplicates or $h2_msgs_duplicate_nb ) ;
      -	$debug and print "Host2 whole time parsing headers took ", timenext(), " s\n";
      +	$debug and myprint( 'Host2 whole time parsing headers took ', timenext(  ), " s\n"  ) ;
       
      -	$debug and print "++++ Verifying [$h1_fold] -> [$h2_fold]\n";
      +	$debug and myprint( "++++ Verifying [$h1_fold] -> [$h2_fold]\n" ) ;
       	# messages in host1 that are not in host2
      -	
      -	my @h1_hash_keys_sorted_by_uid 
      -	  = sort {$h1_hash{$a}{'m'} <=> $h1_hash{$b}{'m'}} keys(%h1_hash);
      -	
      -	#print map { $h1_hash{$_}{'m'} . " "} @h1_hash_keys_sorted_by_uid;
      -	
      -	my @h2_hash_keys_sorted_by_uid 
      -	  = sort {$h2_hash{$a}{'m'} <=> $h2_hash{$b}{'m'}} keys(%h2_hash);
       
      -        
      -	if( $delete2duplicates and not exists( $h2_folders_from_1_several{ $h2_fold } ) ) {
      +	my @h1_hash_keys_sorted_by_uid
      +	  = sort {$h1_hash{$a}{'m'} <=> $h1_hash{$b}{'m'}} keys %h1_hash;
      +
      +	#myprint( map { $h1_hash{$_}{'m'} . q{ }} @h1_hash_keys_sorted_by_uid ) ;
      +
      +	my @h2_hash_keys_sorted_by_uid
      +	  = sort {$h2_hash{$a}{'m'} <=> $h2_hash{$b}{'m'}} keys %h2_hash;
      +
      +
      +	if( $delete2duplicates and not exists  $h2_folders_from_1_several{ $h2_fold }  ) {
       		my @h2_expunge ;
       
       		foreach my $h2_msg ( @h2_msgs_duplicate ) {
      -			print "msg $h2_fold/$h2_msg marked \\Deleted [duplicate] on host2 $dry_message\n" ;
      -			push( @h2_expunge, $h2_msg ) if $uidexpunge2 ;
      +			myprint( "msg $h2_fold/$h2_msg marked \\Deleted [duplicate] on host2 $dry_message\n"  ) ;
      +			push  @h2_expunge, $h2_msg  if $uidexpunge2 ;
       			unless ( $dry ) {
       				$imap2->delete_message( $h2_msg ) ;
       				$h2_nb_msg_deleted += 1 ;
      @@ -1787,27 +1925,27 @@ FOLDER: foreach my $h1_fold ( @h1_folders_wanted ) {
       		}
       		my $cnt = scalar @h2_expunge ;
       		if( @h2_expunge and not $expunge2 ) {
      -			print "Host2: UidExpunging $cnt message(s) in folder $h2_fold $dry_message\n" ;
      +			myprint( "Host2: UidExpunging $cnt message(s) in folder $h2_fold $dry_message\n"  ) ;
       			$imap2->uidexpunge( \@h2_expunge ) if ! $dry ;
       		}
               	if ( $expunge2 ){
      -                	print "Host2: Expunging folder $h2_fold $dry_message\n" ;
      +                	myprint( "Host2: Expunging folder $h2_fold $dry_message\n"  ) ;
                       	$imap2->expunge(  ) if ! $dry ;
               	}
       	}
      -        
      -	if( $delete2 and not exists( $h2_folders_from_1_several{ $h2_fold } ) ) {
      +
      +	if( $delete2 and not exists  $h2_folders_from_1_several{ $h2_fold }  ) {
               	# No host1 folders f1a f1b ... going all to same f2 (via --regextrans2)
       		my @h2_expunge;
       		foreach my $m_id (@h2_hash_keys_sorted_by_uid) {
      -			#print "$m_id ";
      -			unless (exists($h1_hash{$m_id})) {
      +			#myprint( "$m_id " ) ;
      +			unless (exists $h1_hash{$m_id}) {
       				my $h2_msg  = $h2_hash{$m_id}{'m'};
      -				my $h2_flags  = $h2_hash{$m_id}{'F'} || "";
      +				my $h2_flags  = $h2_hash{$m_id}{'F'} || q{};
       				my $isdel  = $h2_flags =~ /\B\\Deleted\b/x ? 1 : 0;
      -				print "Host2: msg $h2_fold/$h2_msg marked \\Deleted on host2 [$m_id] $dry_message\n"
      +				myprint( "Host2: msg $h2_fold/$h2_msg marked \\Deleted on host2 [$m_id] $dry_message\n" )
       				  if ! $isdel;
      -				push(@h2_expunge, $h2_msg) if $uidexpunge2;
      +				push @h2_expunge, $h2_msg if $uidexpunge2;
       				unless ($dry or $isdel) {
       					$imap2->delete_message($h2_msg);
       					$h2_nb_msg_deleted += 1;
      @@ -1815,63 +1953,63 @@ FOLDER: foreach my $h1_fold ( @h1_folders_wanted ) {
       			}
       		}
       		foreach my $h2_msg ( @h2_msgs_delete2_not_in_cache ) {
      -			print "Host2: msg $h2_fold/$h2_msg marked \\Deleted [not in cache] on host2 $dry_message\n";
      -                        push(@h2_expunge, $h2_msg) if $uidexpunge2;
      +			myprint( "Host2: msg $h2_fold/$h2_msg marked \\Deleted [not in cache] on host2 $dry_message\n" ) ;
      +                        push @h2_expunge, $h2_msg if $uidexpunge2;
       			unless ($dry) {
       				$imap2->delete_message($h2_msg);
       				$h2_nb_msg_deleted += 1;
       			}
       		}
       		my $cnt = scalar @h2_expunge ;
      -		
      +
       		if( @h2_expunge and not $expunge2 ) {
      -			print "Host2: UidExpunging $cnt message(s) in folder $h2_fold $dry_message\n" ;
      +			myprint( "Host2: UidExpunging $cnt message(s) in folder $h2_fold $dry_message\n"  ) ;
       			$imap2->uidexpunge( \@h2_expunge ) if ! $dry ;
       		}
               	if ( $expunge2 ) {
      -                	print "Host2: Expunging folder $h2_fold $dry_message\n" ;
      +                	myprint( "Host2: Expunging folder $h2_fold $dry_message\n"  ) ;
                       	$imap2->expunge(  ) if ! $dry ;
               	}
       	}
       
      -	if( $delete2 and exists( $h2_folders_from_1_several{ $h2_fold } ) ) {
      -        	print "Host2 folder $h2_fold $h2_folders_from_1_several{ $h2_fold } folders left to sync there\n" ;
      +	if( $delete2 and exists  $h2_folders_from_1_several{ $h2_fold }  ) {
      +        	myprint( "Host2 folder $h2_fold $h2_folders_from_1_several{ $h2_fold } folders left to sync there\n"  ) ;
       		my @h2_expunge;
       		foreach my $m_id ( @h2_hash_keys_sorted_by_uid ) {
                       	my $h2_msg  = $h2_hash{ $m_id }{ 'm' } ;
      -			unless ( exists( $h1_hash{ $m_id } ) ) {
      -				my $h2_flags  = $h2_hash{ $m_id }{ 'F' } || "" ;
      +			unless ( exists  $h1_hash{ $m_id }  ) {
      +				my $h2_flags  = $h2_hash{ $m_id }{ 'F' } || q{} ;
       				my $isdel  = $h2_flags =~ /\B\\Deleted\b/x ? 1 : 0 ;
       				unless ( $isdel ) {
      -                                	$debug and print "Host2: msg $h2_fold/$h2_msg candidate for deletion [$m_id]\n" ;
      +                                	$debug and myprint( "Host2: msg $h2_fold/$h2_msg candidate for deletion [$m_id]\n"  ) ;
       					$uid_candidate_for_deletion{ $h2_fold }{ $h2_msg }++ ;
       				}
       			}else{
      -                        	$debug and print "Host2: msg $h2_fold/$h2_msg will cancel deletion [$m_id]\n" ;
      +                        	$debug and myprint( "Host2: msg $h2_fold/$h2_msg will cancel deletion [$m_id]\n"  ) ;
                               	$uid_candidate_no_deletion{ $h2_fold }{ $h2_msg }++ ;
                               }
       		}
       		foreach my $h2_msg ( @h2_msgs_delete2_not_in_cache ) {
      -			print "Host2: msg $h2_fold/$h2_msg candidate for deletion [not in cache]\n";
      +			myprint( "Host2: msg $h2_fold/$h2_msg candidate for deletion [not in cache]\n" ) ;
                               $uid_candidate_for_deletion{ $h2_fold }{ $h2_msg }++ ;
       		}
      -                
      +
       		foreach my $h2_msg ( @h2_msgs_in_cache ) {
      -			print "Host2: msg $h2_fold/$h2_msg will cancel deletion [in cache]\n";
      +			myprint( "Host2: msg $h2_fold/$h2_msg will cancel deletion [in cache]\n" ) ;
                               $uid_candidate_no_deletion{ $h2_fold }{ $h2_msg }++ ;
       		}
      -                
      -                
      +
      +
                       if ( 0 == $h2_folders_from_1_several{ $h2_fold } ) {
                       	# last host1 folder going to $h2_fold
      -                        print "Last host1 folder going to $h2_fold\n" ;
      +                        myprint( "Last host1 folder going to $h2_fold\n"  ) ;
                               foreach my $h2_msg ( keys %{ $uid_candidate_for_deletion{ $h2_fold } } ) {
      -                        	$debug and print "Host2: msg $h2_fold/$h2_msg candidate for deletion\n" ;
      -                                if ( exists( $uid_candidate_no_deletion{ $h2_fold }{ $h2_msg } ) ) {
      -                                	$debug and print "Host2: msg $h2_fold/$h2_msg canceled deletion\n" ;
      +                        	$debug and myprint( "Host2: msg $h2_fold/$h2_msg candidate for deletion\n"  ) ;
      +                                if ( exists  $uid_candidate_no_deletion{ $h2_fold }{ $h2_msg }  ) {
      +                                	$debug and myprint( "Host2: msg $h2_fold/$h2_msg canceled deletion\n"  ) ;
                                       }else{
      -                                	print "Host2: msg $h2_fold/$h2_msg marked \\Deleted $dry_message\n";
      -                                        push( @h2_expunge, $h2_msg ) if $uidexpunge2 ;
      +                                	myprint( "Host2: msg $h2_fold/$h2_msg marked \\Deleted $dry_message\n" ) ;
      +                                        push  @h2_expunge, $h2_msg  if $uidexpunge2 ;
                                               unless ( $dry ) {
                                               	$imap2->delete_message( $h2_msg ) ;
                                               	$h2_nb_msg_deleted += 1 ;
      @@ -1879,41 +2017,41 @@ FOLDER: foreach my $h1_fold ( @h1_folders_wanted ) {
                                       }
                               }
                       }
      -                
      +
       		my $cnt = scalar @h2_expunge ;
       		if( @h2_expunge and not $expunge2 ) {
      -			print "Host2: UidExpunging $cnt message(s) in folder $h2_fold $dry_message\n" ;
      +			myprint( "Host2: UidExpunging $cnt message(s) in folder $h2_fold $dry_message\n"  ) ;
       			$imap2->uidexpunge( \@h2_expunge ) if ! $dry ;
       		}
               	if ( $expunge2 ) {
      -                	print "Host2: Expunging host2 folder $h2_fold $dry_message\n" ;
      +                	myprint( "Host2: Expunging host2 folder $h2_fold $dry_message\n"  ) ;
                       	$imap2->expunge(  ) if ! $dry ;
               	}
       
      -                $h2_folders_from_1_several{ $h2_fold }-- ;                
      +                $h2_folders_from_1_several{ $h2_fold }-- ;
       	}
       
       
       	my $h2_uidnext = $imap2->uidnext( $h2_fold ) ;
      -        $debug and print "Host2 uidnext: $h2_uidnext\n" ;
      +        $debug and myprint( "Host2 uidnext: $h2_uidnext\n"  ) ;
       	$h2_uidguess = $h2_uidnext ;
       	MESS: foreach my $m_id (@h1_hash_keys_sorted_by_uid) {
               	last FOLDER if $imap1->IsUnconnected(  ) ;
                       last FOLDER if $imap2->IsUnconnected(  ) ;
       
      -		#print "h1_nb_msg_processed: $h1_nb_msg_processed\n" ;
      +		#myprint( "h1_nb_msg_processed: $h1_nb_msg_processed\n"  ) ;
       		my $h1_size  = $h1_hash{$m_id}{'s'};
       		my $h1_msg   = $h1_hash{$m_id}{'m'};
       		my $h1_idate = $h1_hash{$m_id}{'D'};
       
      -		if ( ( not exists( $h2_hash{ $m_id } ) ) 
      -                	and ( not exists( $h2_folders_of_md5{ $m_id } )
      +		if ( ( not exists  $h2_hash{ $m_id }  )
      +                	and ( not ( exists $h2_folders_of_md5{ $m_id } )
                                     or not $skipcrossduplicates ) ) {
       			# copy
      -			my $h2_msg = copy_message( $h1_msg, $h1_fold, $h2_fold, $h1_fir_ref, $permanentflags2, $cache_dir ) ;
      +			my $h2_msg = copy_message( $sync, $h1_msg, $h1_fold, $h2_fold, $h1_fir_ref, $permanentflags2, $cache_dir ) ;
                               $h2_folders_of_md5{ $m_id }->{ $h2_fold } ++ ;
      -                        if( $delete2 and exists( $h2_folders_from_1_several{ $h2_fold } ) and $h2_msg ) {
      -                        	print "Host2: msg $h2_fold/$h2_msg will cancel deletion [fresh copy] on host2\n" ;
      +                        if( $delete2 and ( exists $h2_folders_from_1_several{ $h2_fold } ) and $h2_msg ) {
      +                        	myprint( "Host2: msg $h2_fold/$h2_msg will cancel deletion [fresh copy] on host2\n"  ) ;
       	                        $uid_candidate_no_deletion{ $h2_fold }{ $h2_msg }++ ;
                               }
                               last FOLDER if total_bytes_max_reached(  ) ;
      @@ -1921,35 +2059,35 @@ FOLDER: foreach my $h1_fold ( @h1_folders_wanted ) {
       		}
       		else{
       		        # already on host2
      -                        if ( exists( $h2_hash{ $m_id } ) ) {
      +                        if ( exists  $h2_hash{ $m_id }  ) {
       				my $h2_msg   = $h2_hash{$m_id}{'m'} ;
      -				$debug and print "Host1 found msg $h1_fold/$h1_msg equals Host2 $h2_fold/$h2_msg\n" ;
      +				$debug and myprint( "Host1 found msg $h1_fold/$h1_msg equals Host2 $h2_fold/$h2_msg\n"  ) ;
                                       if ( $usecache ) {
      -                                	$debugcache and print "touch $cache_dir/${h1_msg}_$h2_msg\n" ;
      -                                	touch( "$cache_dir/${h1_msg}_$h2_msg" ) 
      +                                	$debugcache and myprint( "touch $cache_dir/${h1_msg}_$h2_msg\n"  ) ;
      +                                	touch( "$cache_dir/${h1_msg}_$h2_msg" )
                                               or croak( "Couldn't touch $cache_dir/${h1_msg}_$h2_msg" ) ;
                                       }
      -                        }elsif( exists( $h2_folders_of_md5{ $m_id } ) ) {
      -                        	my @folders_dup = keys( %{ $h2_folders_of_md5{ $m_id } } ) ;
      -                        	( $debug or $debugcrossduplicates ) and print "Host1 found msg $h1_fold/$h1_msg is also in Host2 folders @folders_dup\n" ;
      +                        }elsif( exists  $h2_folders_of_md5{ $m_id }  ) {
      +                        	my @folders_dup = keys  %{ $h2_folders_of_md5{ $m_id } }  ;
      +                        	( $debug or $debugcrossduplicates ) and myprint( "Host1 found msg $h1_fold/$h1_msg is also in Host2 folders @folders_dup\n"  ) ;
                               }
       			$total_bytes_skipped += $h1_size ;
       			$nb_msg_skipped += 1 ;
                               $h1_nb_msg_processed +=1 ;
                       }
      -		
      -                if ( exists( $h2_hash{ $m_id } ) ) {
      -			#$debug and print "MESSAGE $m_id\n";
      +
      +                if ( exists  $h2_hash{ $m_id }  ) {
      +			#$debug and myprint( "MESSAGE $m_id\n" ) ;
       			my $h2_msg  = $h2_hash{$m_id}{'m'};
       
                       	sync_flags_fir( $h1_fold, $h1_msg, $h2_fold, $h2_msg, $permanentflags2, $h1_fir_ref, $h2_fir_ref ) ;
       	    		# Good
       			my $h2_size = $h2_hash{$m_id}{'s'};
      -			$debug and print
      -			"Host1 size  msg $h1_fold/$h1_msg = $h1_size <> $h2_size = Host2 $h2_fold/$h2_msg\n";
      +			$debug and myprint(
      +			"Host1 size  msg $h1_fold/$h1_msg = $h1_size <> $h2_size = Host2 $h2_fold/$h2_msg\n" ) ;
       		}
                       last FOLDER if $imap2->IsUnconnected(  ) ;
      -                
      +
       		if ( $delete ) {
       			delete_message_on_host1( $h1_msg, $h1_fold ) ;
       		}
      @@ -1959,7 +2097,7 @@ FOLDER: foreach my $h1_fold ( @h1_folders_wanted ) {
               last FOLDER if $imap2->IsUnconnected(  ) ;
       	MESS_IN_CACHE: foreach my $h1_msg ( @h1_msgs_in_cache ) {
       		my $h2_msg = $cache_1_2_ref->{ $h1_msg } ;
      -		$debugcache and print "cache messages update flags $h1_msg->$h2_msg\n";
      +		$debugcache and myprint( "cache messages update flags $h1_msg->$h2_msg\n" ) ;
       		sync_flags_fir( $h1_fold, $h1_msg, $h2_fold, $h2_msg, $permanentflags2, $h1_fir_ref, $h2_fir_ref ) ;
       		my $h1_size = $h1_fir_ref->{ $h1_msg }->{ 'RFC822.SIZE' } || 0 ;
       		$total_bytes_skipped += $h1_size;
      @@ -1967,31 +2105,30 @@ FOLDER: foreach my $h1_fold ( @h1_folders_wanted ) {
                       $h1_nb_msg_processed +=1 ;
                       last FOLDER if $imap2->IsUnconnected(  ) ;
       	}
      -	
      -	#print "Messages by uid: ", map { "$_ " } keys %h1_msgs_copy_by_uid, "\n" ;
      +
      +	#myprint( "Messages by uid: ", map { "$_ " } keys %h1_msgs_copy_by_uid, "\n"  ) ;
       	MESS_BY_UID: foreach my $h1_msg ( sort { $a <=> $b } keys %h1_msgs_copy_by_uid ) {
      -		# 
      -		$debug and print "Copy by uid $h1_fold/$h1_msg\n" ;
      +		#
      +		$debug and myprint( "Copy by uid $h1_fold/$h1_msg\n"  ) ;
                       last FOLDER if $imap1->IsUnconnected(  ) ;
                       last FOLDER if $imap2->IsUnconnected(  ) ;
      -		my $h2_msg = copy_message( $h1_msg, $h1_fold, $h2_fold, $h1_fir_ref, $permanentflags2, $cache_dir ) ;
      -                if( $delete2 and exists( $h2_folders_from_1_several{ $h2_fold } ) and $h2_msg ) {
      -                	print "Host2: msg $h2_fold/$h2_msg will cancel deletion [fresh copy] on host2\n" ;
      +		my $h2_msg = copy_message( $sync, $h1_msg, $h1_fold, $h2_fold, $h1_fir_ref, $permanentflags2, $cache_dir ) ;
      +                if( $delete2 and exists  $h2_folders_from_1_several{ $h2_fold }  and $h2_msg ) {
      +                	myprint( "Host2: msg $h2_fold/$h2_msg will cancel deletion [fresh copy] on host2\n"  ) ;
       	                $uid_candidate_no_deletion{ $h2_fold }{ $h2_msg }++ ;
                       }
       		last FOLDER if total_bytes_max_reached(  ) ;
       	}
      -	
      +
       	if ( $expunge or $expunge1 ){
      -		print "Host1: Expunging folder $h1_fold $dry_message\n" ;
      +		myprint( "Host1: Expunging folder $h1_fold $dry_message\n"  ) ;
       		unless( $dry ) { $imap1->expunge(  ) } ;
       	}
       	if ( $expunge2 ){
      -		print "Host2: Expunging folder $h2_fold $dry_message\n" ;
      +		myprint( "Host2: Expunging folder $h2_fold $dry_message\n"  ) ;
       		unless( $dry ) { $imap2->expunge(  ) } ;
       	}
      -
      -	$debug and print "Time: ", timenext(  ), " s\n" ;
      +	$debug and myprint( 'Time: ', timenext(  ), " s\n"  ) ;
       }
       
       
      @@ -1999,20 +2136,18 @@ sub total_bytes_max_reached {
       
       	return( 0 ) if not $exitwhenover ;
       	if ( $total_bytes_transferred >= $exitwhenover ) {
      -        	print "Maximum bytes transferred reached, $total_bytes_transferred >= $exitwhenover, ending sync\n" ;
      +        	myprint( "Maximum bytes transferred reached, $total_bytes_transferred >= $exitwhenover, ending sync\n"  ) ;
               	return( 1 ) ;
      -        }  
      +        }
       
       }
       
      -print "++++ End looping on each folder\n";
      -( $debug or $sync->{debugfolders} ) and print "Time: ", timenext(), " s\n";
      -
      -print memory_consumption(  ) if ( $debugmemory ) ;
      +myprint( "++++ End looping on each folder\n"  ) ;
      +( $debug or $sync->{debugfolders} ) and myprint( 'Time: ', timenext(  ), " s\n"  ) ;
       
       
       if ( $foldersizesatend ) {
      -	print << 'END_SIZE' ;
      +	myprint( << 'END_SIZE'  ) ;
       
       Folders sizes after the synchronization.
       You can remove this foldersizes listing by using  "--nofoldersizesatend"
      @@ -2021,52 +2156,132 @@ END_SIZE
       	foldersizesatend(  ) ;
       }
       
      -$imap1->logout(  ) unless lost_connection($imap1, "for host1 [$host1]");
      -$imap2->logout(  ) unless lost_connection($imap2, "for host2 [$host2]");
      +$imap1->logout(  ) unless lost_connection( $imap1, "for host1 [$host1]" ) ;
      +$imap2->logout(  ) unless lost_connection( $imap2, "for host2 [$host2]" ) ;
       
      -print errorsdump(  ) if ( $errorsdump ) ;
      -
      -stats(  ) ;
      -print "Log file is $sync->{logfile} ( to change it, use --logfile filepath ; or use --nolog to turn off logging )\n" if ( $log ) ;
      -tests_live_result( $nb_errors ) if ( $testslive ) ;
      -exit_clean( 1 ) if ( $nb_errors ) ;
      -exit_clean( 0 ) ;
      +stats( $sync ) ;
      +myprint( errorsdump( $sync->{nb_errors}, errors_log( $sync ) ) ) if ( $sync->{errorsdump} ) ;
      +tests_live_result( $sync->{nb_errors} ) if ( $testslive ) ;
      +exit_clean( $sync, $EXIT_WITH_ERRORS ) if ( $sync->{nb_errors} ) ;
      +exit_clean( $sync, $EX_OK ) ;
       
       # END of main program
       
      +
       # subroutines
      +sub  myprint  { return print  @ARG ; } 
      +sub  myprintf { return printf @ARG ; } 
      +
      +sub mysprintf {
      +        my( $format, @list ) = @ARG ;
      +        return sprintf $format, @list ; 
      +}
      +
      +sub unsetunsafe {
      +        # Remove all content in unsafe evalued options
      +        @regextrans2 = (  ) ;
      +        @regexflag = (  ) ;
      +        @regexmess = (  ) ;
      +        @skipmess = (  ) ;
      +        @pipemess = (  ) ;
      +        $delete2foldersonly = undef ;
      +        $delete2foldersbutnot = undef ;
      +        return ;
      +}
      +
      +sub debugsleep {
      +        my $mysync = shift ;
      +        if ( defined $mysync->{debugsleep} ) {
      +                myprint( "Info: sleeping $mysync->{debugsleep}s\n" ) ;
      +                sleep $mysync->{debugsleep} ;
      +        }
      +        return ;
      +}
      +
      +sub foldersizes_on_h1h2 {
      +	myprint( << 'END_SIZE'  ) ;
      +
      +Folders sizes before the synchronization.
      +You can remove foldersizes listings by using "--nofoldersizes" and  "--nofoldersizesatend"
      +but then you will also loose the ETA (Estimation Time of Arrival) given after each message copy.
      +END_SIZE
      +
      +	( $h1_nb_msg_start, $h1_bytes_start ) = foldersizes( 'Host1', $imap1, $search1, @h1_folders_wanted        ) ;
      +	( $h2_nb_msg_start, $h2_bytes_start ) = foldersizes( 'Host2', $imap2, $search2, @h2_folders_from_1_wanted ) ;
      +
      +        if ( not all_defined( $h1_nb_msg_start, $h1_bytes_start, $h2_nb_msg_start, $h2_bytes_start ) ) {
      +                my $error = "Failure getting foldersizes, ETA and final diff will not be displayed\n" ;
      +                errors_incr( $sync, $error ) ;
      +                $foldersizes = 0 ;
      +                $foldersizesatend = 0 ;
      +                return ;
      +        }
      +        
      +        my $h2_bytes_limit = $sync->{host2}->{quota_limit_bytes} || 0 ;
      +        if ( $h2_bytes_limit and ( $h2_bytes_limit < $h1_bytes_start ) ) {
      +        	my $quota_percent = mysprintf( '%.0f', $h1_bytes_start/$h2_bytes_limit ) ;
      +                my $error = "Host2: Quota limit will be exceeded! Over $quota_percent % ( $h1_bytes_start bytes / $h2_bytes_limit bytes )\n" ;
      +                errors_incr( $sync, $error ) ;
      +        }
      +        return ;
      +}
      +
      +sub all_defined {
      +        if ( not @ARG ) {
      +                return 0 ;
      +        }
      +        foreach my $elem ( @ARG ) {
      +                if ( not defined $elem ) {
      +                        return 0 ;
      +                }
      +        }
      +        return 1 ;
      +}
      +
      +sub tests_all_defined {
      +        is( 0, all_defined(  ),             'all_defined: no param  => 0' ) ;
      +        is( 0, all_defined( () ),           'all_defined: void list => 0' ) ;
      +        is( 0, all_defined( undef ),        'all_defined: undef     => 0' ) ;
      +        is( 0, all_defined( undef, undef ), 'all_defined: undef     => 0' ) ;
      +        is( 0, all_defined( 1, undef ),     'all_defined: 1 undef   => 0' ) ;
      +        is( 0, all_defined( undef, 1 ),     'all_defined: undef 1   => 0' ) ;
      +        is( 1, all_defined( 1, 1 ),         'all_defined: 1 1   => 1' ) ;
      +        is( 1, all_defined( (1, 1) ),       'all_defined: (1 1) => 1' ) ;
      +        return ;
      +}
      +
       
       sub imap_id_stuff {
       	my $sync = shift ;
      -	
      -	if ( not $sync->{id} ) { return(  ) ; } ;
      -	
      +
      +	if ( not $sync->{id} ) { return ; } ;
      +
       	$sync->{h1_imap_id} = imap_id( $sync->{imap1}, 'Host1' ) ;
      -	#print 'Host1: ' . $sync->{h1_imap_id} ;
      +	#myprint( 'Host1: ' . $sync->{h1_imap_id}  ) ;
       	$sync->{h2_imap_id} = imap_id( $sync->{imap2}, 'Host2' ) ;
      -	#print 'Host2: ' . $sync->{h2_imap_id} ;
      -	
      -	return(  ) ;
      +	#myprint( 'Host2: ' . $sync->{h2_imap_id}  ) ;
      +
      +	return ;
       }
       
       sub imap_id {
       	my ( $imap, $Side ) = @_ ;
      -	
      -	$Side ||= '' ;
      -	my $imap_id_response = '' ;
      +
      +	$Side ||= q{} ;
      +	my $imap_id_response = q{} ;
       
       	if ( not $imap->has_capability( 'ID' ) ) {
       		 $imap_id_response = 'No ID capability' ;
      -                 print "$Side: No ID capability\n" ;
      +                 myprint( "$Side: No ID capability\n"  ) ;
       	}else{
      -		my $id_inp = imapsync_id( { side => lc( $Side ) } ) ;
      -		print "\n$Side: found ID capability. Sending/receiving ID, presented in raw IMAP for now.\n"
      -                . "In order to avoid sending/receiving ID, use option --noid\n" ;
      +		my $id_inp = imapsync_id( { side => lc $Side } ) ;
      +		myprint( "\n$Side: found ID capability. Sending/receiving ID, presented in raw IMAP for now.\n"
      +                . "In order to avoid sending/receiving ID, use option --noid\n" ) ;
       		my $debug_before = $imap->Debug(  ) ;
      -		$imap->Debug( 1 ) ;		
      +		$imap->Debug( 1 ) ;
       		my $id_out = $imap->tag_and_run( 'ID ' . $id_inp ) ;
       		#my $id_out = $imap->tag_and_run( 'ID NIL' ) ;
      -                print "\n" ;
      +                myprint( "\n"  ) ;
       		$imap->Debug( $debug_before ) ;
       		#$imap_id_response = Data::Dumper->Dump( [ $id_out ], [ 'IMAP_ID' ] ) ;
       	}
      @@ -2076,9 +2291,9 @@ sub imap_id {
       sub imapsync_id {
       	my $overhashref = shift ;
       	# See http://tools.ietf.org/html/rfc2971.html
      -	
      +
       	my $imapsync_id = { } ;
      -	
      +
       	my $imapsync_id_lamiral = {
       		name          => 'imapsync',
       		version       => imapsync_version(  ),
      @@ -2086,54 +2301,54 @@ sub imapsync_id {
       		vendor        => 'Gilles LAMIRAL',
       		'support-url' => 'http://imapsync.lamiral.info/',
       		# Example of date-time:  19-Sep-2015 08:56:07
      -		date          => date_from_rcs( '$Date: 2016/03/17 08:35:03 $ ' ),
      +		date          => date_from_rcs( q{$Date: 2016/08/19 10:30:36 $ } ),
       	} ;
      -	
      +
       	my $imapsync_id_github  = {
       		name          => 'imapsync',
       		version       => imapsync_version(  ),
       		os            => $OSNAME,
       		vendor        => 'github',
       		'support-url' => 'https://github.com/imapsync/imapsync',
      -		date          => date_from_rcs( '$Date: 2016/03/17 08:35:03 $ ' ),
      +		date          => date_from_rcs( q{$Date: 2016/08/19 10:30:36 $ } ),
       	} ;
      -	
      +
       	$imapsync_id = $imapsync_id_lamiral ;
       	#$imapsync_id = $imapsync_id_github ;
       	my %mix = ( %{ $imapsync_id }, %{ $overhashref } ) ;
       	my $imapsync_id_str = format_for_imap_arg( \%mix ) ;
      -	#print "$imapsync_id_str\n" ;
      +	#myprint( "$imapsync_id_str\n"  ) ;
       	return( $imapsync_id_str ) ;
       }
       
       sub tests_imapsync_id {
      -	ok( '("name" "imapsync" "version" "111" "os" "beurk" "vendor" "Gilles LAMIRAL" "support-url" "http://imapsync.lamiral.info/" "date" "22-12-1968" "side" "host1")' 
      -	eq imapsync_id( { 
      -		version => 111, 
      -		os => 'beurk', 
      -		date => '22-12-1968', 
      +	ok( '("name" "imapsync" "version" "111" "os" "beurk" "vendor" "Gilles LAMIRAL" "support-url" "http://imapsync.lamiral.info/" "date" "22-12-1968" "side" "host1")'
      +	eq imapsync_id( {
      +		version => 111,
      +		os => 'beurk',
      +		date => '22-12-1968',
       		side => 'host1' } ),
      -	'tests_imapsync_id override' ) ; 
      +	'tests_imapsync_id override' ) ;
       
      -	return(  ) ;
      +	return ;
       }
       
       sub format_for_imap_arg {
       	my $ref = shift ;
      -	
      -	my $string = '' ;
      +
      +	my $string = q{} ;
       	my %terms = %{ $ref } ;
       	my @terms = (  ) ;
       	if ( not ( %terms ) ) { return( 'NIL' ) } ;
       	# sort like in RFC then add extra key/values
       	foreach my $key ( qw( name version os os-version vendor support-url address date command arguments environment) ) {
       		if ( $terms{ $key } ) {
      -			push( @terms, $key, $terms{ $key } ) ;
      -			delete( $terms{ $key } ) ;
      +			push  @terms, $key, $terms{ $key }  ;
      +			delete $terms{ $key } ;
       		}
       	}
      -	push( @terms, %terms ) ;
      -	$string = '(' . join( ' ', map { '"' . $_ . '"' } @terms ) . ')' ;
      +	push  @terms, %terms  ;
      +	$string = '(' . ( join q{ }, map { '"' . $_ . '"' } @terms )  . ')' ;
       	return( $string ) ;
       }
       
      @@ -2143,25 +2358,25 @@ sub tests_format_for_imap_arg {
       	ok( 'NIL' eq format_for_imap_arg( { } ), 'format_for_imap_arg empty hash ref' ) ;
       	ok( '("name" "toto")' eq format_for_imap_arg( { name => 'toto' } ), 'format_for_imap_arg { name => toto }' ) ;
       	ok( '("name" "toto" "key" "val")' eq format_for_imap_arg( { name => 'toto', key => 'val' } ), 'format_for_imap_arg 2 x key val' ) ;
      -	return(  ) ;
      +	return ;
       }
       
       sub quota {
       	my ( $imap, $side, $sync ) = @_ ;
      -        
      -        my $Side = ucfirst( $side ) ;
      +
      +        my $Side = ucfirst $side ;
       	my $debug_before = $imap->Debug(  ) ;
       	$imap->Debug( 1 ) ;
      -	if ( not $imap->has_capability( 'QUOTA' ) ) { 
      +	if ( not $imap->has_capability( 'QUOTA' ) ) {
               	$imap->Debug( $debug_before ) ;
      -        	return(  ) ;
      +        	return ;
               } ;
      -	print "\n$Side: found quota, presented in raw IMAP\n" ;
      +	myprint( "\n$Side: found quota, presented in raw IMAP\n"  ) ;
       	my $getquotaroot = $imap->getquotaroot( 'INBOX' ) ;
               # Gmail INBOX quotaroot is "" but with it Mail::IMAPClient does a literal GETQUOTA {2} \n ""
               #$imap->quota( 'ROOT' ) ;
               #$imap->quota( '""' ) ;
      -	print "\n" ;
      +	myprint( "\n"  ) ;
       	$imap->Debug( $debug_before ) ;
               my $quota_limit_bytes   = quota_extract_storage_limit_in_bytes( $getquotaroot ) ;
               my $quota_current_bytes = quota_extract_storage_current_in_bytes( $getquotaroot ) ;
      @@ -2169,16 +2384,16 @@ sub quota {
               $sync->{$side}->{quota_current_bytes} = $quota_current_bytes ;
               my $quota_percent ;
               if ( $quota_limit_bytes > 0 ) {
      -        	$quota_percent = sprintf( "%.2f", 100 * $quota_current_bytes / $quota_limit_bytes ) ;
      +        	$quota_percent = mysprintf( '%.2f', $NUMBER_100 * $quota_current_bytes / $quota_limit_bytes ) ;
               }else{
               	$quota_percent = 0 ;
               }
      -        print "$Side: Quota current storage is $quota_current_bytes bytes. Limit is $quota_limit_bytes bytes. So $quota_percent % full\n" ;
      -        if ( 90 < $quota_percent ) {
      +        myprint( "$Side: Quota current storage is $quota_current_bytes bytes. Limit is $quota_limit_bytes bytes. So $quota_percent % full\n"  ) ;
      +        if ( $QUOTA_PERCENT_LIMIT < $quota_percent ) {
               	my $error = "$Side: $quota_percent % full: it is time to find a bigger place! ( $quota_current_bytes bytes / $quota_limit_bytes bytes )\n" ;
      -                errors_incr( $error ) ;
      +                errors_incr( $sync, $error ) ;
               }
      -	return(  ) ;
      +	return ;
       }
       
       sub tests_quota_extract_storage_limit_in_bytes {
      @@ -2188,18 +2403,18 @@ sub tests_quota_extract_storage_limit_in_bytes {
               '* QUOTA "Messages quota" (MESSAGE 2 100000)',
               '5 OK Getquotaroot completed.'
       	] ;
      -        ok( 104857600*1024 == quota_extract_storage_limit_in_bytes( $imap_output ), 'quota_extract_storage_limit_in_bytes ') ;
      -        return(  ) ;
      +        ok( $NUMBER_104857600 * $KIBI == quota_extract_storage_limit_in_bytes( $imap_output ), 'quota_extract_storage_limit_in_bytes ') ;
      +        return ;
       }
       
       sub quota_extract_storage_limit_in_bytes {
       	my $imap_output = shift ;
      -        
      -        my $limit_KB ;
      -        $limit_KB = ( map { /.*\(\s*STORAGE\s+\d+\s+(\d+)\s*\)/ ? $1 : () } @$imap_output )[0] ;
      -        $limit_KB ||= 0 ;
      -        $debug and print "storage_limit_KB = $limit_KB\n" ;
      -        return( 1024 * $limit_KB ) ;
      +
      +        my $limit_kb ;
      +        $limit_kb = ( map { /.*\(\s*STORAGE\s+\d+\s+(\d+)\s*\)/ ? $1 : () } @{ $imap_output } )[0] ;
      +        $limit_kb ||= 0 ;
      +        $debug and myprint( "storage_limit_kb = $limit_kb\n"  ) ;
      +        return( $KIBI * $limit_kb ) ;
       }
       
       
      @@ -2210,40 +2425,40 @@ sub tests_quota_extract_storage_current_in_bytes {
               '* QUOTA "Messages quota" (MESSAGE 2 100000)',
               '5 OK Getquotaroot completed.'
       	] ;
      -        ok( 1*1024 == quota_extract_storage_current_in_bytes( $imap_output ), 'quota_extract_storage_current_in_bytes: 1 => 1024 ') ;
      -        return(  ) ;
      +        ok( 1*$KIBI == quota_extract_storage_current_in_bytes( $imap_output ), 'quota_extract_storage_current_in_bytes: 1 => 1024 ') ;
      +        return ;
       }
       
       sub quota_extract_storage_current_in_bytes {
       	my $imap_output = shift ;
      -        
      -        my $current_KB ;
      -        $current_KB = ( map { /.*\(\s*STORAGE\s+(\d+)\s+\d+\s*\)/ ? $1 : () } @$imap_output )[0] ;
      -        $current_KB ||= 0 ;
      -        $debug and print "storage_current_KB = $current_KB\n" ;
      -        return( 1024 * $current_KB ) ;
      +
      +        my $current_kb ;
      +        $current_kb = ( map { /.*\(\s*STORAGE\s+(\d+)\s+\d+\s*\)/ ? $1 : () } @{ $imap_output } )[0] ;
      +        $current_kb ||= 0 ;
      +        $debug and myprint( "storage_current_kb = $current_kb\n"  ) ;
      +        return( $KIBI * $current_kb ) ;
       
       }
       
       
       sub automap {
       	my ( $sync ) = @_ ;
      -	
      +
       	if ( $sync->{automap} ) {
      -		print "Turned on automapping folders ( use --noautomap to turn off automapping )\n" ;
      +		myprint( "Turned on automapping folders ( use --noautomap to turn off automapping )\n"  ) ;
       	}else{
      -		print "Turned off automapping folders ( use --automap to turn on automapping )\n" ;
      -		return(  ) ;
      +		myprint( "Turned off automapping folders ( use --automap to turn on automapping )\n"  ) ;
      +		return ;
       	}
      -        
      +
               $sync->{h1_special} = special_from_folders_hash( $sync->{imap1}, 'Host1' ) ;
               $sync->{h2_special} = special_from_folders_hash( $sync->{imap2}, 'Host2' ) ;
      -	
      +
       	build_possible_special( $sync ) ;
               build_guess_special(  $sync ) ;
       	build_automap( $sync ) ;
      -        
      -	return(  ) ;
      +
      +	return ;
       }
       
       
      @@ -2251,75 +2466,75 @@ sub automap {
       
       sub build_guess_special {
       	my ( $sync ) = shift ;
      -	
      -        foreach my $h1_fold ( sort keys( %{ $sync->{h1_folders_all} } ) ) {
      +
      +        foreach my $h1_fold ( sort keys  %{ $sync->{h1_folders_all} }  ) {
               	my $special = guess_special( $h1_fold, $sync->{possible_special}, $sync->{h1_prefix} ) ;
               	if ( $special ) {
                       	$sync->{h1_special_guessed}{$h1_fold} = $special ;
                               my $already_guessed = $sync->{h1_special_guessed}{$special} ;
                               if ( $already_guessed ) {
      -                        	print "Host1: $h1_fold not $special because set to $already_guessed\n" ;
      +                        	myprint( "Host1: $h1_fold not $special because set to $already_guessed\n"  ) ;
                               }else{
       	                        $sync->{h1_special_guessed}{$special} = $h1_fold ;
                               }
                       }
               }
      -        foreach my $h2_fold ( sort keys( %{ $sync->{h2_folders_all} } ) ) {
      +        foreach my $h2_fold ( sort keys  %{ $sync->{h2_folders_all} }  ) {
               	my $special = guess_special( $h2_fold, $sync->{possible_special}, $sync->{h2_prefix} ) ;
               	if ( $special ) {
                       	$sync->{h2_special_guessed}{$h2_fold} = $special ;
                               my $already_guessed = $sync->{h2_special_guessed}{$special} ;
                               if ( $already_guessed ) {
      -                        	print "Host2: $h2_fold not $special because set to $already_guessed\n" ;
      +                        	myprint( "Host2: $h2_fold not $special because set to $already_guessed\n"  ) ;
                               }else{
       	                        $sync->{h2_special_guessed}{$special} = $h2_fold ;
                               }
                       }
               }
      -        return(  ) ;
      +        return ;
       }
       
       sub guess_special {
       	my( $folder, $possible_special_ref, $prefix ) = @_ ;
      -	
      +
               my $folder_no_prefix = $folder ;
               $folder_no_prefix =~ s/${prefix}// ;
      -        #$debug and print "folder_no_prefix: $folder_no_prefix\n" ;
      -        
      -        my $guess_special = $possible_special_ref->{ $folder } 
      -        	|| $possible_special_ref->{ $folder_no_prefix } 
      -        	|| '' ;
      -        
      +        #$debug and myprint( "folder_no_prefix: $folder_no_prefix\n"  ) ;
      +
      +        my $guess_special = $possible_special_ref->{ $folder }
      +        	|| $possible_special_ref->{ $folder_no_prefix }
      +        	|| q{} ;
      +
               return( $guess_special ) ;
       }
       
       sub tests_guess_special {
       	my $possible_special_ref = build_possible_special( my $sync ) ;
      -        ok( '\Sent' eq guess_special( 'Sent', $possible_special_ref, '' ) ,'guess_special: Sent => \Sent' ) ;
      -        ok( '' eq guess_special( 'Blabla', $possible_special_ref, '' ) ,'guess_special: Blabla => ""' ) ;
      +        ok( '\Sent' eq guess_special( 'Sent', $possible_special_ref, q{} ) ,'guess_special: Sent => \Sent' ) ;
      +        ok( q{} eq guess_special( 'Blabla', $possible_special_ref, q{} ) ,'guess_special: Blabla => q{}' ) ;
               ok( '\Sent' eq guess_special( 'INBOX.Sent', $possible_special_ref, 'INBOX.' ) ,'guess_special: INBOX.Sent => \Sent' ) ;
      -	return(  ) ;
      +	return ;
       }
       
       sub build_automap {
       	my ( $sync ) = @_ ;
      -	
      +
       	foreach my $h1_fold ( @{ $sync->{h1_folders_wanted} } ) {
       		my $h2_fold ;
       		my $h1_special = $sync->{h1_special}{$h1_fold} ;
                       my $h1_special_guessed = $sync->{h1_special_guessed}{$h1_fold} ;
       
       		# Case 1: special on both sides.
      -		if ( $h1_special 
      -                     and exists( $sync->{h2_special}{$h1_special} ) ) {
      +		if ( $h1_special
      +                     and exists  $sync->{h2_special}{$h1_special}  ) {
       			$h2_fold = $sync->{h2_special}{$h1_special} ;
       			$sync->{f1f2auto}{ $h1_fold } = $h2_fold ;
       			next ;
       		}
       		# Case 2: special on host1, not on host2
      -		if ( $h1_special 
      -                     and ( not exists( $sync->{h2_special}{$h1_special} ) )
      -                     and ( exists( $sync->{h2_special_guessed}{$h1_special} ) ) 
      +		if ( $h1_special
      +                     and ( not exists  $sync->{h2_special}{$h1_special}  )
      +                     and ( exists  $sync->{h2_special_guessed}{$h1_special}  )
                          ) {
       			# special_guessed on host2
                               $h2_fold = $sync->{h2_special_guessed}{$h1_special} ;
      @@ -2329,7 +2544,7 @@ sub build_automap {
       		# Case 3: no special on host1, special on host2
                       if ( ( not $h1_special )
                            and ( $h1_special_guessed )
      -                     and ( exists( $sync->{h2_special}{$h1_special_guessed} ) )
      +                     and ( exists  $sync->{h2_special}{$h1_special_guessed}  )
                       ) {
                       	$h2_fold = $sync->{h2_special}{$h1_special_guessed} ;
                               $sync->{f1f2auto}{ $h1_fold } = $h2_fold ;
      @@ -2338,8 +2553,8 @@ sub build_automap {
                       # Case 4: no special on both sides.
                       if ( ( not $h1_special )
                            and ( $h1_special_guessed )
      -                     and ( not exists( $sync->{h2_special}{$h1_special_guessed} ) )
      -                     and ( exists( $sync->{h2_special_guessed}{$h1_special_guessed} ) )
      +                     and ( not exists  $sync->{h2_special}{$h1_special_guessed}  )
      +                     and ( exists  $sync->{h2_special_guessed}{$h1_special_guessed}  )
                       ) {
                       	$h2_fold = $sync->{h2_special_guessed}{$h1_special_guessed} ;
                               $sync->{f1f2auto}{ $h1_fold } = $h2_fold ;
      @@ -2349,30 +2564,33 @@ sub build_automap {
       	return( $sync->{f1f2auto} ) ;
       }
       
      +# I willll probably add what there is at:
      +# http://stackoverflow.com/questions/2185391/localized-gmail-imap-folders/2185548#2185548
       sub build_possible_special {
       	my $sync = shift ;
       	my $possible_special = { } ;
       	# All|Archive|Drafts|Flagged|Junk|Sent|Trash
      -	
      -	$possible_special->{'\All'}     = [ 'All', 'All Messages' ] ; 
      -	$possible_special->{'\Archive'} = [ 'Archive', 'Archives' ] ; 
      -	$possible_special->{'\Drafts'}  = [ 'Drafts',  ] ;
      -	$possible_special->{'\Flagged'} = [ 'Flagged', 'Starred' ] ;
      -	$possible_special->{'\Junk'}    = [ 'Junk', 'Spam' ] ;
      -	$possible_special->{'\Sent'}    = [ 'Sent', 'Sent Messages', 'Sent Items', 
      +
      +	$possible_special->{'\All'}     = [ 'All', 'All Messages', '&BBIEQQQ1-' ] ;
      +	$possible_special->{'\Archive'} = [ 'Archive', 'Archives', '&BBAEQARFBDgEMg-' ] ;
      +	$possible_special->{'\Drafts'}  = [ 'Drafts', '&BCcENQRABD0EPgQyBDgEOgQ4-' ] ;
      +	$possible_special->{'\Flagged'} = [ 'Flagged', 'Starred', '&BB8EPgQ8BDUERwQ1BD0EPQRLBDU-' ] ;
      +	$possible_special->{'\Junk'}    = [ 'Junk', 'Spam', '&BCEEPwQwBDw-' ] ;
      +	$possible_special->{'\Sent'}    = [ 'Sent', 'Sent Messages', 'Sent Items',
                                                   'Gesendete Elemente', 'Gesendete Objekte',
                                                   '&AMk-l&AOk-ments envoy&AOk-s', 'Envoy&AOk-',
                                                   'Elementos enviados',
      -                                            '&kAFP4W4IMH8wojCkMMYw4A-'  ] ;
      -	$possible_special->{'\Trash'}   = [ 'Trash', ] ;
      +                                            '&kAFP4W4IMH8wojCkMMYw4A-',
      +                                            '&BB4EQgQ,BEAEMAQyBDsENQQ9BD0ESwQ1-'] ;
      +	$possible_special->{'\Trash'}   = [ 'Trash', '&BCMENAQwBDsENQQ9BD0ESwQ1-', '&BBoEPgRABDcEOAQ9BDA-' ] ;
       
       	foreach my $special ( qw( \All \Archive \Drafts \Flagged \Junk \Sent \Trash ) ){
      -		foreach my $possible_folder ( @{ $possible_special->{$special} } ) { 
      +		foreach my $possible_folder ( @{ $possible_special->{$special} } ) {
       			$possible_special->{ $possible_folder } = $special ;
       		} ;
       	}
               $sync->{possible_special} = $possible_special ;
      -	$debug and print Data::Dumper->Dump( [ $possible_special ], [ 'possible_special' ] ) ;
      +	$debug and myprint( Data::Dumper->Dump( [ $possible_special ], [ 'possible_special' ] )  ) ;
               return( $possible_special ) ;
       }
       
      @@ -2381,49 +2599,81 @@ sub special_from_folders_hash {
       	my %special = (  ) ;
               if ( not( Mail::IMAPClient->can( 'folders_hash' ) ) ) {
               	my $error =  "$side: To have automagic rfc6154 folder mapping, upgrade Mail::IMAPClient >= 3.34\n" ;
      -                errors_incr( $error ) ;
      +                errors_incr( $sync, $error ) ;
                       return( \%special ) ; # empty hash ref
               }
       	my $folders_hash = $imap->folders_hash(  ) ;
      -	foreach my $fhash (@$folders_hash) {
      +	foreach my $fhash (@{ $folders_hash } ) {
       			my @special =  grep { /\\(?:All|Archive|Drafts|Flagged|Junk|Sent|Trash)/ } @{ $fhash->{attrs} }  ;
       			if ( @special ) {
       				my $special = $special[0] ; # keep first one. Could be not very good.
      -				if ( exists( $special{ $special } ) ) {
      -					printf( "%s: special %-20s = %s already asigned to %s\n", 
      -					        $side, $fhash->{name}, join( ' ', @special ), $special{ $special } ) ;
      +				if ( exists  $special{ $special }  ) {
      +					myprintf( "%s: special %-20s = %s already asigned to %s\n",
      +					        $side, $fhash->{name}, join( q{ }, @special ), $special{ $special } ) ;
       				}else{
      -					printf( "%s: special %-20s = %s\n", 
      -					        $side, $fhash->{name}, join( ' ', @special ) ) ;
      +					myprintf( "%s: special %-20s = %s\n",
      +					        $side, $fhash->{name}, join( q{ }, @special ) ) ;
       					$special{ $special } = $fhash->{name} ;
       					$special{ $fhash->{name} } = $special ; # double entry value => key
       				}
       			}
       		}
      -        print "\n" if ( %special ) ;
      +        myprint( "\n" ) if ( %special ) ;
       	return( \%special ) ;
       }
       
       sub errors_incr {
      -	my @error = @_ ;
      -	$nb_errors++ ;
      +	my ( $mysync, @error ) = @ARG ;
      +	$sync->{nb_errors}++ ;
      +        
               if ( @error ) {
      -		push( @errors_log, join( '', @error ) ) if ( @error ) ;
      -                print @error;
      +		errors_log( $mysync, @error ) ;
      +                myprint( @error ) ;
               }
      -	if ( $nb_errors >= $errorsmax ) {
      -		print "Maximum number of errors $errorsmax reached ( set it to 150 with --errorsmax 150 ). Exiting.\n" ;
      -		print errorsdump(  ) if ( $errorsdump ) ;
      -		exit_clean( 1 ) ;
      +        
      +        $mysync->{errorsmax} ||= $ERRORS_MAX ;
      +	if ( $sync->{nb_errors} >= $mysync->{errorsmax} ) {
      +		myprint( "Maximum number of errors $mysync->{errorsmax} reached ( you can change $mysync->{errorsmax} to 100 with --errorsmax 100 ). Exiting.\n"  ) ;
      +                if ( $mysync->{errorsdump} ) {
      +                        myprint( errorsdump( $sync->{nb_errors}, errors_log( $mysync ) ) ) ;
      +                        # again since errorsdump(  ) can be very verbose and masq previous warning
      +		        myprint( "Maximum number of errors $mysync->{errorsmax} reached ( you can change $mysync->{errorsmax} to 100 with --errorsmax 100 ). Exiting.\n"  ) ;
      +		}
      +                exit_clean( $mysync, $EXIT_WITH_ERRORS_MAX ) ;
       	}
      -	return(  ) ;
      +	return ;
       }
       
      +sub errors_log {
      +        my ( $mysync, @error ) = @ARG ;
      +
      +        if ( ! $mysync->{errors_log} ) {
      +                $mysync->{errors_log} = [] ;
      +        }
      +
      +        if ( @error ) {
      +		push  @{ $mysync->{errors_log} }, join( q{}, @error  ) ;
      +        }
      +        if ( @{ $mysync->{errors_log} } ) {
      +                return @{ $mysync->{errors_log} } ;
      +        }
      +        else {
      +                return ;
      +        }
      +}
      +
      +sub tests_errors_log {
      +
      +
      +}
      +
      +
       sub errorsdump {
      +        my( $nb_errors, @errors_log ) = @ARG ;
       	my $error_num = 0 ;
      -	my $errors_list = '' ;
      +	my $errors_list = q{} ;
       	if ( @errors_log ) {
      -		$errors_list = "Listing $nb_errors errors encountered during the sync ( avoid this listing with --noerrorsdump ).\n" ;
      +		$errors_list = "++++ Listing $nb_errors errors encountered during the sync ( avoid this listing with --noerrorsdump ).\n" ;
       		foreach my $error ( @errors_log ) {
       			$error_num++ ;
       			$errors_list .= "Err $error_num/$nb_errors: $error" ;
      @@ -2436,31 +2686,35 @@ sub errorsdump {
       sub tests_live_result {
       	my $nb_errors = shift ;
       	if ( $nb_errors  ) {
      -		print "Live tests failed with $nb_errors errors\n" ;
      +		myprint( "Live tests failed with $nb_errors errors\n"  ) ;
       	} else {
      -		print "Live tests ended successfully\n" ;
      +		myprint( "Live tests ended successfully\n"  ) ;
       	}
      -	return(  ) ;
      +	return ;
       }
       
       sub foldersizesatend {
       	timenext(  ) ;
      -	return(  ) if ( $imap1->IsUnconnected(  ) ) ;
      -	return(  ) if ( $imap2->IsUnconnected(  ) ) ;
      +	return if ( $imap1->IsUnconnected(  ) ) ;
      +	return if ( $imap2->IsUnconnected(  ) ) ;
       	# Get all folders on host2 again since new were created
       	@h2_folders_all = sort $imap2->folders();
      -	for ( @h2_folders_all ) { 
      +	for ( @h2_folders_all ) {
               	$h2_folders_all{ $_ } = 1 ;
      -        	$h2_folders_all_UPPER{ uc( $_ ) } = 1 ;
      +        	$h2_folders_all_UPPER{ uc  $_  } = 1 ;
               } ;
      -	( $h1_nb_msg_end, $h1_bytes_end ) = foldersizes( "Host1", $imap1, $search1, @h1_folders_wanted ) ;
      -	( $h2_nb_msg_end, $h2_bytes_end ) = foldersizes( "Host2", $imap2, $search2, @h2_folders_from_1_wanted ) ;
      -	return(  ) ;
      +	( $h1_nb_msg_end, $h1_bytes_end ) = foldersizes( 'Host1', $imap1, $search1, @h1_folders_wanted ) ;
      +	( $h2_nb_msg_end, $h2_bytes_end ) = foldersizes( 'Host2', $imap2, $search2, @h2_folders_from_1_wanted ) ;
      +        if ( not all_defined( $h1_nb_msg_end, $h1_bytes_end, $h2_nb_msg_end, $h2_bytes_end ) ) {
      +                my $error = "Failure getting foldersizes, final differences will not be calculated\n" ;
      +                errors_incr( $sync, $error ) ;
      +        }
      +	return ;
       }
       
       sub size_filtered_flag {
       	my $h1_size = shift ;
      -	
      +
       	if (defined $maxsize and $h1_size >= $maxsize) {
       		return( 1 ) ;
       	}
      @@ -2473,228 +2727,229 @@ sub size_filtered_flag {
       sub sync_flags_fir {
       	my ( $h1_fold, $h1_msg, $h2_fold, $h2_msg, $permanentflags2, $h1_fir_ref, $h2_fir_ref ) = @_ ;
       
      -	if ( not defined( $h1_msg ) ) { return(  ) } ;
      -	if ( not defined( $h2_msg ) ) { return(  ) } ;
      -        
      -	my $h1_size = $h1_fir_ref->{$h1_msg}->{"RFC822.SIZE"} ;
      -	return(  ) if size_filtered_flag( $h1_size ) ;
      +	if ( not defined  $h1_msg  ) { return } ;
      +	if ( not defined  $h2_msg  ) { return } ;
      +
      +	my $h1_size = $h1_fir_ref->{$h1_msg}->{'RFC822.SIZE'} ;
      +	return if size_filtered_flag( $h1_size ) ;
       
       	# used cached flag values for efficiency
      -	my $h1_flags = $h1_fir_ref->{ $h1_msg }->{ "FLAGS" } || '' ;
      -	my $h2_flags = $h2_fir_ref->{ $h2_msg }->{ "FLAGS" } || '' ;
      +	my $h1_flags = $h1_fir_ref->{ $h1_msg }->{ 'FLAGS' } || q{} ;
      +	my $h2_flags = $h2_fir_ref->{ $h2_msg }->{ 'FLAGS' } || q{} ;
       
       	sync_flags( $h1_fold, $h1_msg, $h1_flags, $h2_fold, $h2_msg, $h2_flags, $permanentflags2 ) ;
       
      -        return(  ) ;
      +        return ;
       }
       
       sub sync_flags_after_copy {
       	my( $h1_fold, $h1_msg, $h1_flags, $h2_fold, $h2_msg, $permanentflags2 ) = @_ ;
      -        
      +
               my @h2_flags = $imap2->flags( $h2_msg ) ;
               my $h2_flags = "@h2_flags" ;
      -        ( $debug or $debugflags ) and print "Host2 flags before resync by STORE on msg $h2_msg: $h2_flags\n" ;
      +        ( $debug or $debugflags ) and myprint( "Host2 flags before resync by STORE on msg $h2_msg: $h2_flags\n"  ) ;
       	sync_flags( $h1_fold, $h1_msg, $h1_flags, $h2_fold, $h2_msg, $h2_flags, $permanentflags2 ) ;
      -        return(  ) ;
      +        return ;
       }
       
       sub sync_flags {
       	my( $h1_fold, $h1_msg, $h1_flags, $h2_fold, $h2_msg, $h2_flags, $permanentflags2 ) = @_ ;
       
      -	( $debug or $debugflags ) and 
      -        print "Host1: flags init msg $h1_fold/$h1_msg flags( $h1_flags ) Host2 $h2_fold/$h2_msg flags( $h2_flags )\n" ;
      +	( $debug or $debugflags ) and
      +        myprint( "Host1: flags init msg $h1_fold/$h1_msg flags( $h1_flags ) Host2 $h2_fold/$h2_msg flags( $h2_flags )\n"  ) ;
       
       	$h1_flags = flags_for_host2( $h1_flags, $permanentflags2 ) ;
       
      -	$h2_flags = flagsCase( $h2_flags ) ;
      +	$h2_flags = flagscase( $h2_flags ) ;
      +
      +	( $debug or $debugflags ) and
      +        myprint( "Host1 flags filt msg $h1_fold/$h1_msg flags( $h1_flags ) Host2 $h2_fold/$h2_msg flags( $h2_flags )\n"  ) ;
       
      -	( $debug or $debugflags ) and 
      -        print "Host1 flags filt msg $h1_fold/$h1_msg flags( $h1_flags ) Host2 $h2_fold/$h2_msg flags( $h2_flags )\n" ;
       
      -	
       	# compare flags - set flags if there a difference
      -	my @h1_flags = sort split(' ', $h1_flags );
      -	my @h2_flags = sort split(' ', $h2_flags );
      +	my @h1_flags = sort split(q{ }, $h1_flags );
      +	my @h2_flags = sort split(q{ }, $h2_flags );
       	my $diff = compare_lists( \@h1_flags, \@h2_flags );
       
      -	$diff and ( $debug or $debugflags ) 
      -		and     print "Host2 flags msg $h2_fold/$h2_msg replacing h2 flags( $h2_flags ) with h1 flags( $h1_flags )\n";
      +	$diff and ( $debug or $debugflags )
      +		and     myprint( "Host2 flags msg $h2_fold/$h2_msg replacing h2 flags( $h2_flags ) with h1 flags( $h1_flags )\n" ) ;
       	# This sets flags so flags can be removed with this
       	# When you remove a \Seen flag on host1 you want to it
      -	# to be removed on host2. Just add flags is not what 
      +	# to be removed on host2. Just add flags is not what
       	# we need most of the time.
      -	
      +
       	if ( not $dry and $diff and not $imap2->store( $h2_msg, "FLAGS.SILENT (@h1_flags)" ) ) {
      -		my $error_msg = join( '', "Host2 flags msg $h2_fold/$h2_msg could not add flags [@h1_flags]: ",
      -		  $imap2->LastError || '', "\n" ) ;
      -		errors_incr( $error_msg ) ;
      +		my $error_msg = join q{}, "Host2 flags msg $h2_fold/$h2_msg could not add flags [@h1_flags]: ",
      +		  $imap2->LastError || q{}, "\n" ;
      +		errors_incr( $sync, $error_msg ) ;
       	}
       
      -        return(  ) ;
      +        return ;
       }
       
       
       
       sub _filter {
      -	my $str = shift or return "";
      -        my $sz  = 64;
      -        my $len = length($str);
      +	my $str = shift or return q{} ;
      +        my $sz  = $SIZE_MAX_STR ;
      +        my $len = length $str ;
               if ( not $debug and $len > $sz*2 ) {
      -                my $beg = substr($str, 0, $sz);
      -                my $end = substr($str, -$sz, $sz);
      -                $str = $beg . "..." . $end;
      +                my $beg = substr $str, 0, $sz ;
      +                my $end = substr $str, -$sz, $sz ;
      +                $str = $beg . '...' . $end ;
               }
      -        $str =~ s/\012?\015$//x;
      -        return "(len=$len) " . $str;
      +        $str =~ s/\012?\015$//x ;
      +        return "(len=$len) " . $str ;
       }
       
       
       
       sub lost_connection {
      -	my($imap, $error_message) = @_;
      +	my( $imap, $error_message ) = @_;
               if ( $imap->IsUnconnected(  ) ) {
      -                $nb_errors++;
      -                my $lcomm = $imap->LastIMAPCommand || "";
      -                my $einfo = $imap->LastError || @{$imap->History}[-1] || "";
      +                $sync->{nb_errors}++ ;
      +                my $lcomm = $imap->LastIMAPCommand || q{} ;
      +                my $einfo = $imap->LastError || @{$imap->History}[$LAST] || q{} ;
       
                       # if string is long try reduce to a more reasonable size
      -                $lcomm = _filter($lcomm);
      -                $einfo = _filter($einfo);
      -                print("Failure: last command: $lcomm\n") if ($debug && $lcomm);
      -                print("Failure: lost connection $error_message: ", $einfo, "\n");
      -                return(1);
      +                $lcomm = _filter( $lcomm ) ;
      +                $einfo = _filter( $einfo ) ;
      +                myprint( "Failure: last command: $lcomm\n") if ($debug && $lcomm) ;
      +                myprint( "Failure: lost connection $error_message: ", $einfo, "\n") ;
      +                return( 1 ) ;
               }
               else{
      -        	return(0);
      +        	return( 0 ) ;
               }
       }
       
       sub max {
       	my @list = @_ ;
      -	return( undef ) if ( 0 == scalar( @list ) ) ;
      +	return( undef ) if ( 0 == scalar  @list  ) ;
       	my @sorted = sort { $a <=> $b } @list ;
      -	return( pop( @sorted ) ) ;
      +	return( pop @sorted ) ;
       }
       
       sub tests_max {
      -	ok( 0 == max(0),   "max 0");
      -	ok( 1 == max(1),   "max 1");
      -	ok( -1 == max(-1), "max -1");
      -	ok( not ( defined( max(  ) ) ), "max no arg" ) ;
      -	ok( 100 == max( 1, 100 ), "max 1 100" ) ;
      -	ok( 100 == max( 100, 1 ), "max 100 1") ;
      -	ok( 100 == max( 100, 42, 1 ), "max 100 42 1") ;
      -	ok( 100 == max( 100, "42", 1 ), "max 100 42 1") ;
      -	ok( 100 == max( "100", "42", 1 ), "max 100 42 1") ;
      -	#ok( 100 == max( 100, "haha", 1 ), "max 100 42 1") ;
      -        return(  ) ;
      -}
      -
      -sub keyval {
      -        my %hash = @_ ;
      -        return( join( " ", map( { "$_ => " . $hash{ $_ } } keys %hash ) ) . "\n" ) ;
      +	ok( 0  == max( 0 ),  'max 0' ) ;
      +	ok( 1  == max( 1 ),  'max 1' ) ;
      +	ok( $MINUS_ONE == max( $MINUS_ONE ), 'max -1') ;
      +	ok( not ( defined max(  ) ), 'max no arg' ) ;
      +	ok( $NUMBER_100 == max( 1, $NUMBER_100 ), 'max 1 100' ) ;
      +	ok( $NUMBER_100 == max( $NUMBER_100, 1 ), 'max 100 1' ) ;
      +	ok( $NUMBER_100 == max( $NUMBER_100, $NUMBER_42, 1 ), 'max 100 42 1' ) ;
      +	ok( $NUMBER_100 == max( $NUMBER_100, '42', 1 ), 'max 100 42 1' ) ;
      +	ok( $NUMBER_100 == max( '100', '42', 1 ), 'max 100 42 1' ) ;
      +	#ok( 100 == max( 100, 'haha', 1 ), 'max 100 42 1') ;
      +        return ;
       }
      -        
       
       
       sub check_lib_version {
      -	$debug and print "IMAPClient $Mail::IMAPClient::VERSION\n" ;
      +	$debug and myprint( "IMAPClient $Mail::IMAPClient::VERSION\n"  ) ;
       	if ( '2.2.9' eq $Mail::IMAPClient::VERSION ) {
      -		print "imapsync no longer supports Mail::IMAPClient 2.2.9, upgrade it" ;
      -		return( 0 ) ;
      +		myprint( "imapsync no longer supports Mail::IMAPClient 2.2.9, upgrade it\n"  ) ;
      +		return 0 ;
       	}
       	else{
       		# 3.x.x is no longer buggy with imapsync.
      -		return( 1 ) ;      
      +                # 3.30 or currently superior is imposed in the Perl "use Mail::IMAPClient line".
      +		return 1 ;
       	}
      -        return(  ) ;
      +        return ;
       }
       
       sub module_version_str {
       	my( $module_name, $module_version ) = @_ ;
      -	my $str = sprintf( "%-20s %s\n", $module_name, $module_version ) ;
      +	my $str = mysprintf( "%-20s %s\n", $module_name, $module_version ) ;
               return( $str ) ;
       }
       
      -sub modules_VERSION {
      +sub modulesversion {
       
       	my @list_version;
       
       	my $v ;
      -	eval { require Mail::IMAPClient; $v = $Mail::IMAPClient::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Mail::IMAPClient', $v ) ) ;
      +	eval { require Mail::IMAPClient; $v = $Mail::IMAPClient::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Mail::IMAPClient', $v )  ;
      +
      +	eval { require IO::Socket; $v = $IO::Socket::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'IO::Socket', $v )  ;
      +
      +	eval { require IO::Socket::INET; $v = $IO::Socket::INET::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'IO::Socket::INET', $v )  ;
       
      -	eval { require IO::Socket; $v = $IO::Socket::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'IO::Socket', $v ) ) ;
      +	eval { require IO::Socket::INET6; $v = $IO::Socket::INET6::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'IO::Socket::INET6', $v )  ;
       
      -	eval { require IO::Socket::IP; $v = $IO::Socket::IP::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'IO::Socket::IP', $v ) ) ;
      +	eval { require IO::Socket::SSL ; $v = $IO::Socket::SSL::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'IO::Socket::SSL ', $v )  ;
       
      -	eval { require IO::Socket::INET; $v = $IO::Socket::INET::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'IO::Socket::INET', $v ) ) ;
      +	eval { require Net::SSLeay ; $v = $Net::SSLeay::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Net::SSLeay ', $v )  ;
       
      -	eval { require IO::Socket::SSL ; $v = $IO::Socket::SSL::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'IO::Socket::SSL ', $v ) ) ;
      +	eval { require Compress::Zlib; $v = $Compress::Zlib::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Compress::Zlib', $v )  ;
       
      -	eval { require Net::SSLeay ; $v = $Net::SSLeay::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Net::SSLeay ', $v ) ) ;
      +	eval { require Digest::MD5; $v = $Digest::MD5::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Digest::MD5', $v )  ;
       
      -	eval { require Compress::Zlib; $v = $Compress::Zlib::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Compress::Zlib', $v ) ) ;
      +	eval { require Digest::HMAC_MD5; $v = $Digest::HMAC_MD5::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Digest::HMAC_MD5', $v )  ;
       
      -	eval { require Digest::MD5; $v = $Digest::MD5::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Digest::MD5', $v ) ) ;
      +	eval { require Digest::HMAC_SHA1; $v = $Digest::HMAC_SHA1::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Digest::HMAC_SHA1', $v )  ;
       
      -	eval { require Digest::HMAC_MD5; $v = $Digest::HMAC_MD5::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Digest::HMAC_MD5', $v ) ) ;
      +	eval { require Term::ReadKey; $v = $Term::ReadKey::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Term::ReadKey', $v )  ;
       
      -	eval { require Digest::HMAC_SHA1; $v = $Digest::HMAC_SHA1::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Digest::HMAC_SHA1', $v ) ) ;
      +	eval { require File::Spec; $v = $File::Spec::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'File::Spec', $v )  ;
       
      -	eval { require Term::ReadKey; $v = $Term::ReadKey::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Term::ReadKey', $v ) ) ;
      +	eval { require Time::HiRes; $v = $Time::HiRes::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Time::HiRes', $v )  ;
       
      -	eval { require File::Spec; $v = $File::Spec::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'File::Spec', $v ) ) ;
      +	eval { require Unicode::String; $v = $Unicode::String::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Unicode::String', $v )  ;
       
      -	eval { require Time::HiRes; $v = $Time::HiRes::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Time::HiRes', $v ) ) ;
      +	eval { require IO::Tee; $v = $IO::Tee::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'IO::Tee', $v )  ;
       
      -	eval { require Unicode::String; $v = $Unicode::String::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Unicode::String', $v ) ) ;
      +	eval { require File::Copy::Recursive; $v = $File::Copy::Recursive::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'File::Copy::Recursive', $v )  ;
       
      -	eval { require IO::Tee; $v = $IO::Tee::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'IO::Tee', $v ) ) ;
      +	eval { require Authen::NTLM; $v = $Authen::NTLM::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Authen::NTLM', $v )  ;
       
      -	eval { require File::Copy::Recursive; $v = $File::Copy::Recursive::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'File::Copy::Recursive', $v ) ) ;
      +	eval { require URI::Escape; $v = $URI::Escape::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'URI::Escape', $v )  ;
       
      -	eval { require Authen::NTLM; $v = $Authen::NTLM::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Authen::NTLM', $v ) ) ;
      +	eval { require Data::Uniqid; $v = $Data::Uniqid::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Data::Uniqid', $v )  ;
       
      -	eval { require URI::Escape; $v = $URI::Escape::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'URI::Escape', $v ) ) ;
      +	eval { require JSON; $v = $JSON::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'JSON', $v )  ;
       
      -	eval { require Data::Uniqid; $v = $Data::Uniqid::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Data::Uniqid', $v ) ) ;
      +	eval { require JSON::WebToken; $v = $JSON::WebToken::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'JSON::WebToken', $v )  ;
       
      -	eval { require JSON; $v = $JSON::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'JSON', $v ) ) ;
      +	eval { require Crypt::OpenSSL::RSA; $v = $Crypt::OpenSSL::RSA::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Crypt::OpenSSL::RSA', $v )  ;
       
      -	eval { require JSON::WebToken; $v = $JSON::WebToken::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'JSON::WebToken', $v ) ) ;
      +	eval { require LWP; $v = $LWP::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'LWP', $v )  ;
       
      -	eval { require Crypt::OpenSSL::RSA; $v = $Crypt::OpenSSL::RSA::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Crypt::OpenSSL::RSA', $v ) ) ;
      +	eval { require HTML::Entities; $v = $HTML::Entities::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'HTML::Entities', $v )  ;
       
      -	eval { require LWP; $v = $LWP::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'LWP', $v ) ) ;
      +	#eval { require Filesys::DfPortable; $v = $Filesys::DfPortable::VERSION } or $v = q{?} ;
      +	#push  @list_version, module_version_str( 'Filesys::DfPortable', $v )  ;
       
      -	eval { require HTML::Entities; $v = $HTML::Entities::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'HTML::Entities', $v ) ) ;
      +	eval { require Getopt::Long; $v = $Getopt::Long::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Getopt::Long', $v )  ;
       
      -	eval { require Filesys::DfPortable; $v = $Filesys::DfPortable::VERSION } or $v = "?" ;
      -	push ( @list_version, module_version_str( 'Filesys::DfPortable', $v ) ) ;
      +	eval { require Test::MockObject; $v = $Test::MockObject::VERSION } or $v = q{?} ;
      +	push  @list_version, module_version_str( 'Test::MockObject', $v )  ;
       
       	return( @list_version ) ;
       }
      @@ -2702,66 +2957,104 @@ sub modules_VERSION {
       
       # Construct a command line copy with passwords replaced by MASKED.
       sub command_line_nopassword {
      -	my @argv = @_;
      -	my @argv_nopassword;
      -        
      -        return("@argv") if $showpasswords ;
      -	while (@argv) {
      -		my $arg = shift(@argv); # option name or value
      -		if ($arg =~ m/-password[12]/x) {
      -			shift(@argv); # password value 
      -			push(@argv_nopassword, $arg, "MASKED"); # option name and fake value
      +	my @argv = @_ ;
      +	my @argv_nopassword ;
      +
      +        return( "@argv" ) if $showpasswords ;
      +	while ( @argv ) {
      +		my $arg = shift @argv ; # option name or value
      +		if ( $arg =~ m/-password[12]/x ) {
      +			shift @argv ; # password value
      +			push  @argv_nopassword, $arg, 'MASKED'  ; # option name and fake value
       		}else{
      -			push(@argv_nopassword, $arg); # same option or value
      +			push  @argv_nopassword, $arg ; # same option or value
       		}
       	}
      -	return("@argv_nopassword");
      +	return("@argv_nopassword") ;
       }
       
       sub tests_command_line_nopassword {
       
      -	ok('' eq command_line_nopassword(), 'command_line_nopassword void');
      +	ok(q{} eq command_line_nopassword(), 'command_line_nopassword void');
       	ok('--blabla' eq command_line_nopassword('--blabla'), 'command_line_nopassword --blabla');
      -	#print command_line_nopassword((qw{ --password1 secret1 })), "\n";
      +	#myprint( command_line_nopassword((qw{ --password1 secret1 })), "\n" ) ;
       	ok('--password1 MASKED' eq command_line_nopassword(qw{ --password1 secret1}), 'command_line_nopassword --password1');
      -	ok('--blabla --password1 MASKED --blibli' 
      +	ok('--blabla --password1 MASKED --blibli'
       	eq command_line_nopassword(qw{ --blabla --password1 secret1 --blibli }), 'command_line_nopassword --password1 --blibli');
       	$showpasswords = 1 ;
      -	ok('' eq command_line_nopassword(), 'command_line_nopassword void');
      +	ok(q{} eq command_line_nopassword(), 'command_line_nopassword void');
       	ok('--blabla' eq command_line_nopassword('--blabla'), 'command_line_nopassword --blabla');
      -	#print command_line_nopassword((qw{ --password1 secret1 })), "\n";
      +	#myprint( command_line_nopassword((qw{ --password1 secret1 })), "\n" ) ;
       	ok('--password1 secret1' eq command_line_nopassword(qw{ --password1 secret1}), 'command_line_nopassword --password1');
      -	ok('--blabla --password1 secret1 --blibli' 
      +	ok('--blabla --password1 secret1 --blibli'
       	eq command_line_nopassword(qw{ --blabla --password1 secret1 --blibli }), 'command_line_nopassword --password1 --blibli');
      -        return(  ) ;
      +        return ;
       }
       
       sub ask_for_password {
       	my ( $user, $host ) = @_ ;
      -	print "What's the password for $user\@$host? (not visible while you type, then enter RETURN) " ;
      +	myprint( "What's the password for $user" . '@' . "$host? (not visible while you type, then enter RETURN) "  ) ;
       	Term::ReadKey::ReadMode( 2 ) ;
       	my $password = <> ;
       	chomp $password ;
      -	printf "\nGot it\n" ;
      +	myprint( "\nGot it\n" ) ;
       	Term::ReadKey::ReadMode( 0 ) ;
       	return $password ;
       }
       
       sub catch_exit {
      -	my $signame = shift ;
      -	print "\nGot a SIG$signame!\n" ;
      -	stats(  ) ;
      -	exit_clean( 6 ) ;
      -        return(  ) ; # fake, for perlcritic
      -}
      -
      -sub catch_continue {
      -	my $signame = shift ;
      -	print "\nGot a SIG$signame!\n" ;
      -        return(  ) ;
      -}
      +        my $mysync = shift ;
      +        my $signame = shift ;
      +        if ( $signame ) {
      +                myprint( "\nGot a signal $signame\n" ) ;
      +        }
      +	stats( $mysync ) ;
      +        myprint( "Ended by a signal\n" ) ;
      +	exit_clean( $mysync, $EXIT_BY_SIGNAL ) ;
      +        return ;
      +}
      +
      +sub catch_reconnect {
      +	my $mysync = shift ;
      +        my $signame = shift ;
      +        myprint( "\nGot a signal $signame\n",
      +                "Hit 2 ctr-c within 2 seconds to exit the program\n",
      +                "Hit only 1 ctr-c to reconnect to both imap servers\n",
      +        ) ;
      +        if ( here_twice( $mysync ) ) {
      +                myprint( "Got two signals $signame within $INTERVAL_TO_EXIT seconds. Exiting...\n" ) ;
      +                catch_exit( $mysync ) ;
      +        }
      +        else{
      +                myprint( "For now only one signal $signame within $INTERVAL_TO_EXIT seconds.\n" ) ;
      +        }
       
      +        if ( ! defined $mysync->{imap1} ) { return ; }
      +        if ( ! defined $mysync->{imap2} ) { return ; }
      +        
       
      +        myprint( "Info: reconnecting to host1 imap server\n" ) ;
      +        $mysync->{imap1}->State( Mail::IMAPClient::Unconnected ) ;
      +        $mysync->{imap1}->reconnect(  ) ;
      +        myprint( "Info: reconnecting to host2 imap server\n" ) ;
      +        $mysync->{imap2}->State( Mail::IMAPClient::Unconnected ) ;
      +        $mysync->{imap2}->reconnect(  ) ;
      +        myprint( "Info: reconnected to both imap servers\n" ) ;
      +        return ;
      +}
      +
      +sub here_twice {
      +        my $mysync = shift ;
      +        my $now = time ;
      +        my $previous = $mysync->{lastcatch} || 0 ;
      +        $mysync->{lastcatch} = $now ;
      +        
      +        if ( $INTERVAL_TO_EXIT >= $now - $previous ) {
      +                return $TRUE ;
      +        }else{
      +                return $FALSE ;
      +        }
      +}
       
       
       
      @@ -2769,14 +3062,14 @@ sub catch_continue {
       sub justconnect {
       
       	$imap1 = connect_imap( $host1, $port1, $debugimap1, $ssl1, $tls1, 'Host1', $sync->{h1}->{timeout}, $sync->{h1} ) ;
      -	print "Host1 banner: ", $imap1->Banner(  ) ;
      -	print "Host1 capability: ", join(" ", $imap1->capability(  ) ), "\n" ;
      +	myprint( 'Host1 banner: ', $imap1->Banner(  )  ) ;
      +	myprint( 'Host1 capability: ', join(q{ }, $imap1->capability(  ) ), "\n"  ) ;
       	$imap2 = connect_imap( $host2, $port2, $debugimap2, $ssl2, $tls2, 'Host2', $sync->{h2}->{timeout}, $sync->{h2} ) ;
      -	print "Host2 banner: ", $imap2->Banner(  ) ;
      -	print "Host2 capability: ", join(" ", $imap2->capability(  ) ), "\n" ;
      +	myprint( 'Host2 banner: ', $imap2->Banner(  )  ) ;
      +	myprint( 'Host2 capability: ', join(q{ }, $imap2->capability(  ) ), "\n"  ) ;
       	$imap1->logout(  ) ;
       	$imap2->logout(  ) ;
      -        return(  ) ;
      +        return ;
       }
       
       sub connect_imap {
      @@ -2793,12 +3086,12 @@ sub connect_imap {
       
               my $banner = $imap->Results()->[0] ;
               $imap->Banner( $banner ) ;
      -        
      +
               if ( $imap->Tls(  ) ) {
               	set_tls( $imap, $h ) ;
               	$imap->starttls(  )
                       or die_clean("$Side: Can not go to tls encryption on [$host]:", $imap->LastError, "\n" ) ;
      -                print "$Side: Socket successfuly converted to SSL\n" ;
      +                myprint( "$Side: Socket successfuly converted to SSL\n"  ) ;
               }
               return( $imap ) ;
       }
      @@ -2807,28 +3100,28 @@ sub connect_imap {
       sub login_imap {
       
       	my @allargs = @_ ;
      -	my( 
      -		$host, $port, $user, $domain, $password, 
      -		$mydebugimap, $mytimeout, $fastio, 
      +	my(
      +		$host, $port, $user, $domain, $password,
      +		$mydebugimap, $mytimeout, $fastio,
       		$ssl, $tls, $authmech, $authuser, $reconnectretry,
       		$proxyauth, $uid, $split, $Side, $h ) = @allargs ;
       
      -	my $side = lc( $Side ) ;
      -	print "$Side: connecting and login on $side [$host] port [$port] with user [$user]\n" ;
      +	my $side = lc $Side ;
      +	myprint( "$Side: connecting and login on $side [$host] port [$port] with user [$user]\n"  ) ;
       
       	my $imap = init_imap( @allargs ) ;
       
       	$imap->connect()
       	  or die_clean("$Side failure: can not open imap connection on $side [$host] with user [$user]: $@\n") ;
      -	
      +
               my $banner = $imap->Results()->[0] ;
               $imap->Banner( $banner ) ;
      -	print "$Side banner: $banner" ;
      +	myprint( "$Side banner: $banner"  ) ;
       
               if ( $authmech eq 'PREAUTH' ) {
               	if ( $imap->IsAuthenticated( ) ) {
               		$imap->Socket ;
      -			printf("%s: Assuming PREAUTH for %s\n", $Side, $imap->Server ) ;
      +			myprintf("%s: Assuming PREAUTH for %s\n", $Side, $imap->Server ) ;
               	}else{
                       	die_clean( "$Side failure: error login on $side [$host] with user [$user] auth [PREAUTH]" ) ;
                       }
      @@ -2838,12 +3131,12 @@ sub login_imap {
       		set_tls( $imap, $h ) ;
               	$imap->starttls(  )
                       or die_clean("$Side failure: Can not go to tls encryption on $side [$host]:", $imap->LastError, "\n" ) ;
      -                print "$Side: Socket successfuly converted to SSL\n" ;
      +                myprint( "$Side: Socket successfuly converted to SSL\n"  ) ;
               }
      -	
      +
               authenticate_imap( $imap, @allargs ) ;
      -	
      -	print "$Side: success login on [$host] with user [$user] auth [$authmech]\n" ;
      +
      +	myprint( "$Side: success login on [$host] with user [$user] auth [$authmech]\n"  ) ;
       	return( $imap ) ;
       }
       
      @@ -2851,41 +3144,41 @@ sub login_imap {
       sub authenticate_imap {
       
       	my($imap,
      -           $host, $port, $user, $domain, $password, 
      -	   $mydebugimap, $mytimeout, $fastio, 
      +           $host, $port, $user, $domain, $password,
      +	   $mydebugimap, $mytimeout, $fastio,
       	   $ssl, $tls, $authmech, $authuser, $reconnectretry,
       	   $proxyauth, $uid, $split, $Side, $h ) = @_ ;
       
       	check_capability( $imap, $authmech, $Side ) ;
       
               if ( $proxyauth ) {
      -                $imap->Authmechanism("") ;
      +                $imap->Authmechanism(q{}) ;
                       $imap->User($authuser) ;
               } else {
                       $imap->Authmechanism( $authmech ) unless ( $authmech eq 'LOGIN'  or $authmech eq 'PREAUTH' ) ;
                       $imap->User($user) ;
               }
      -        
      +
       	$imap->Authcallback(\&xoauth)  if ( 'XOAUTH'  eq $authmech ) ;
       	$imap->Authcallback(\&xoauth2) if ( 'XOAUTH2' eq $authmech ) ;
       	$imap->Authcallback(\&plainauth) if ( ( 'PLAIN' eq $authmech ) or ( 'EXTERNAL' eq $authmech )  ) ;
      -	
      -        $imap->Domain($domain) if (defined($domain)) ;
      +
      +        $imap->Domain($domain) if (defined $domain) ;
               $imap->Authuser($authuser) ;
               $imap->Password($password) ;
      -	
      +
       	unless ( $authmech eq 'PREAUTH' or $imap->login( ) ) {
       		my $info  = "$Side failure: Error login on [$host] with user [$user] auth" ;
      -		my $einfo = $imap->LastError || @{$imap->History}[-1] ;
      -		chomp( $einfo ) ;
      +		my $einfo = $imap->LastError || @{$imap->History}[$LAST] ;
      +		chomp $einfo ;
       		my $error = "$info [$authmech]: $einfo\n" ;
                       if ( $authmech eq 'LOGIN' or $imap->IsUnconnected(  ) or $authuser ) {
                       	die_clean( $error ) ;
                       }else{
      -			print $error ;
      +			myprint( $error  ) ;
                       }
      -		print "$Side info: trying LOGIN Auth mechanism on [$host] with user [$user]\n" ;
      -		$imap->Authmechanism("") ;
      +		myprint( "$Side info: trying LOGIN Auth mechanism on [$host] with user [$user]\n"  ) ;
      +		$imap->Authmechanism(q{}) ;
       		$imap->login() or
       		  die_clean("$info [LOGIN]: ", $imap->LastError, "\n") ;
       	}
      @@ -2893,34 +3186,34 @@ sub authenticate_imap {
               if ( $proxyauth ) {
                       if ( ! $imap->proxyauth( $user ) ) {
                               my $info  = "$Side failure: Error doing proxyauth as user [$user] on [$host] using proxy-login as [$authuser]" ;
      -                        my $einfo = $imap->LastError || @{$imap->History}[-1] ;
      -                        chomp( $einfo ) ;
      +                        my $einfo = $imap->LastError || @{$imap->History}[$LAST] ;
      +                        chomp $einfo ;
                               die_clean( "$info: $einfo\n" ) ;
                       }
               }
       
      -	return(  ) ;
      +	return ;
       }
       
       sub check_capability {
       
       	my( $imap, $authmech, $Side ) = @_ ;
      -        
      +
       	if ($imap->has_capability("AUTH=$authmech")
       	    or $imap->has_capability($authmech)
       	   ) {
      -		printf("%s: %s says it has CAPABILITY for AUTHENTICATE %s\n",
      +		myprintf("%s: %s says it has CAPABILITY for AUTHENTICATE %s\n",
       		       $Side, $imap->Server, $authmech);
      -	} 
      +	}
       	else {
      -		printf("%s: %s says it has NO CAPABILITY for AUTHENTICATE %s\n",
      +		myprintf("%s: %s says it has NO CAPABILITY for AUTHENTICATE %s\n",
       		       $Side, $imap->Server, $authmech);
       		if ($authmech eq 'PLAIN') {
      -			print "$Side: frequently PLAIN is only supported with SSL, ",
      -			  "try --ssl or --tls options\n";
      +			myprint( "$Side: frequently PLAIN is only supported with SSL, ",
      +			  "try --ssl or --tls options\n" ) ;
       		}
       	}
      -	return(  ) ;
      +	return ;
       }
       
       sub set_ssl {
      @@ -2932,23 +3225,23 @@ sub set_ssl {
               my $sslargs_hash = $h->{sslargs} ;
       
       	my $sslargs_default = {
      -		SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(  ),
      +		SSL_verify_mode => $DEFAULT_SSL_VERIFY,
               	SSL_verifycn_scheme => 'imap',
               } ;
       
               # initiate with default values
               my %sslargs_mix = %{ $sslargs_default } ;
               # now override with passed values
      -        @sslargs_mix{ keys( %{ $sslargs_hash } ) } = values( %{ $sslargs_hash } ) ;
      +        @sslargs_mix{ keys %{ $sslargs_hash } } = values %{ $sslargs_hash } ;
               # remove keys with undef values
      -        foreach my $key ( keys %sslargs_mix ) { 
      -                delete( $sslargs_mix{ $key } ) if ( not defined( $sslargs_mix{ $key } ) ) ;
      +        foreach my $key ( keys %sslargs_mix ) {
      +                delete $sslargs_mix{ $key } if ( not defined  $sslargs_mix{ $key }  ) ;
               }
               # back to an ARRAY
               my @sslargs_mix = %sslargs_mix ;
      -        #print Data::Dumper->Dump( [ $sslargs_hash, $sslargs_default, \%sslargs_mix, \@sslargs_mix ] ) ;
      +        #myprint( Data::Dumper->Dump( [ $sslargs_hash, $sslargs_default, \%sslargs_mix, \@sslargs_mix ] )  ) ;
               $imap->Ssl( \@sslargs_mix ) ;
      -	return(  ) ;
      +	return ;
       }
       
       sub set_tls {
      @@ -2957,22 +3250,22 @@ sub set_tls {
               my $sslargs_hash = $h->{sslargs} ;
       
       	my $sslargs_default = {
      -		SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(  ),
      +		SSL_verify_mode => $DEFAULT_SSL_VERIFY,
               } ;
       
               # initiate with default values
               my %sslargs_mix = %{ $sslargs_default } ;
               # now override with passed values
      -        @sslargs_mix{ keys( %{ $sslargs_hash } ) } = values( %{ $sslargs_hash } ) ;
      +        @sslargs_mix{ keys %{ $sslargs_hash } } = values %{ $sslargs_hash } ;
               # remove keys with undef values
      -        foreach my $key ( keys %sslargs_mix ) { 
      -                delete( $sslargs_mix{ $key } ) if ( not defined( $sslargs_mix{ $key } ) ) ;
      +        foreach my $key ( keys %sslargs_mix ) {
      +                delete $sslargs_mix{ $key } if ( not defined  $sslargs_mix{ $key } ) ;
               }
               # back to an ARRAY
               my @sslargs_mix = %sslargs_mix ;
       
               $imap->Starttls( \@sslargs_mix ) ;
      -	return(  ) ;
      +	return ;
       }
       
       
      @@ -2980,32 +3273,32 @@ sub set_tls {
       
       sub init_imap {
       	my(
      -	   $host, $port, $user, $domain, $password, 
      -	   $mydebugimap, $mytimeout, $fastio, 
      +	   $host, $port, $user, $domain, $password,
      +	   $mydebugimap, $mytimeout, $fastio,
       	   $ssl, $tls, $authmech, $authuser, $reconnectretry,
       	   $proxyauth, $uid, $split, $Side, $h ) = @_ ;
       
       	my ( $imap ) ;
      -	
      +
       	$imap = Mail::IMAPClient->new() ;
      -	
      +
       	if ( $ssl ) { set_ssl( $imap, $h ) }
       	if ( $tls ) { $imap->Tls( 1 ) } # can not do set_tls() here because connect() will directly do a STARTTLS
       	$imap->Clear(1);
       	$imap->Server($host);
       	$imap->Port($port);
       	$imap->Fast_io($fastio);
      -	$imap->Buffer($buffersize || 4096);
      +	$imap->Buffer($buffersize || $DEFAULT_BUFFER_SIZE);
       	$imap->Uid($uid);
      -	#$imap->Uid(0);
      +
       	$imap->Peek(1);
       	$imap->Debug($mydebugimap);
      -	defined( $mytimeout ) and $imap->Timeout( $mytimeout ) ;
      +	defined  $mytimeout  and $imap->Timeout( $mytimeout ) ;
       
      -	$imap->Reconnectretry($reconnectretry) if ($reconnectretry);
      +	$imap->Reconnectretry( $reconnectretry ) if ( $reconnectretry ) ;
       	$imap->Ignoresizeerrors( $allowsizemismatch ) ;
      -	$split and $imap->Maxcommandlength( 10 * $split ) ;
      -	
      +	$split and $imap->Maxcommandlength( $SPLIT_FACTOR * $split ) ;
      +
       
       	return( $imap ) ;
       
      @@ -3015,18 +3308,18 @@ sub plainauth {
               my $code = shift;
               my $imap = shift;
       
      -        my $string = sprintf("%s\x00%s\x00%s", $imap->User,
      +        my $string = mysprintf("%s\x00%s\x00%s", $imap->User,
                                   $imap->Authuser, $imap->Password);
      -        return encode_base64("$string", "");
      +        return encode_base64("$string", q{});
       }
       
       # Copy from https://github.com/imapsync/imapsync/pull/25/files
       # Changes "use" pragmas to "require".
      -# The openssl system call shall be replaced by pure Perl and 
      +# The openssl system call shall be replaced by pure Perl and
       # https://metacpan.org/pod/Crypt::OpenSSL::PKCS12
       
       # Now the Joaquin Lopez code:
      -# 
      +#
       # Used this as an example: https://gist.github.com/gsainio/6322375
       #
       # And this as a reference: https://developers.google.com/accounts/docs/OAuth2ServiceAccount
      @@ -3040,6 +3333,13 @@ sub plainauth {
       #
       # This is a good guide on setting up the google api/apps side of the equation:
       # http://www.limilabs.com/blog/oauth2-gmail-imap-service-account
      +#
      +# 2016/05/27: Updated to support oauth/key data in the .json files Google now defaults to
      +# when creating gmail service accounts. They're easier to work with since they neither
      +# requiring decrypting nor specifying the oauth2 client id separately.
      +#
      +# If the password arg ends in .json, it will assume this new json method, otherwise it
      +# will fallback to the "oauth client id;.p12" format it was previously using.
       sub xoauth2 {
       	require JSON::WebToken ;
       	require LWP::UserAgent ;
      @@ -3049,30 +3349,47 @@ sub xoauth2 {
       	require Crypt::OpenSSL::RSA ;
               require Encode::Byte ;
               require IO::Socket::SSL ;
      -        
      +
               my $code = shift;
               my $imap = shift;
       
      -        # Get iss (service account address), keyfile name, and keypassword if necessary
      -        my ( $iss, $keyfile, $keypass ) = $imap->Password =~ /([\-\d\w\@\.]+);([a-zA-Z0-9\_\-\.\/]+);?(.*)?/ ;
      +        my ($iss,$key);
       
      -        # Assume key password is google default if not provided
      -        $keypass = 'notasecret' if not $keypass;
      +        if( $imap->Password =~ /^(.*\.json)$/ ) {
      +            my $json = JSON->new( ) ;
      +            my $filename = $1;
      +            $debug and myprint( "XOAUTH2 json file: $filename\n" ) ;
      +            open( my $FILE, '<', $filename ) or die_clean( "error [$filename]: $! " ) ;
      +            my $jsonfile = $json->decode( join q{}, <$FILE> ) ;
      +            close $FILE ;
       
      -        $debug and print("Service account: $iss\nKey file: $keyfile\nKey password: $keypass\n");
      +            $iss = $jsonfile->{client_id};
      +            $key = $jsonfile->{private_key};
      +            $debug and myprint( "Service account: $iss\n");
      +            $debug and myprint( "Private key:\n$key\n");
      +        }
      +        else {
      +            # Get iss (service account address), keyfile name, and keypassword if necessary
      +            ( $iss, my $keyfile, my $keypass ) = $imap->Password =~ /([\-\d\w\@\.]+);([a-zA-Z0-9 \_\-\.\/]+);?(.*)?/ ;
      +
      +            # Assume key password is google default if not provided
      +            $keypass = 'notasecret' if not $keypass;
       
      -        # Get private key from p12 file (would be better in perl...)
      -        my $key = `openssl pkcs12 -in $keyfile -nodes -nocerts -passin pass:$keypass -nomacver`;
      +            $debug and myprint( "Service account: $iss\nKey file: $keyfile\nKey password: $keypass\n");
       
      -        $debug and print("Private key:\n$key\n");
      +            # Get private key from p12 file (would be better in perl...)
      +            $key = `openssl pkcs12 -in "$keyfile" -nodes -nocerts -passin pass:$keypass -nomacver`;
      +
      +            $debug and myprint( "Private key:\n$key\n");
      +        }
       
               # Create jwt of oauth2 request
      -        my $time = time();
      +        my $time = time ;
               my $jwt = JSON::WebToken->encode( {
               'iss' => $iss, # service account
               'scope' => 'https://mail.google.com/',
               'aud' => 'https://www.googleapis.com/oauth2/v3/token',
      -        'exp' => $time + 3600,
      +        'exp' => $time + $DEFAULT_EXPIRATION_TIME_OAUTH2_PK12,
               'iat' => $time,
               'prn' => $imap->User # user to auth as
               },
      @@ -3081,98 +3398,100 @@ sub xoauth2 {
               # Post oauth2 request
               my $ua = LWP::UserAgent->new(  ) ;
               $ua->env_proxy(  ) ;
      -        
      +
               my $response = $ua->post('https://www.googleapis.com/oauth2/v3/token',
               { grant_type => HTML::Entities::encode_entities('urn:ietf:params:oauth:grant-type:jwt-bearer'),
               assertion => $jwt } ) ;
       
               unless( $response->is_success(  ) ) {
      -                die( $response->code, "\n", $response->content, "\n" ) ;
      +                die_clean( $response->code, "\n", $response->content, "\n" ) ;
               }else{
      -                $debug and print $response->content ;
      +                $debug and myprint( $response->content  ) ;
               }
       
               # access_token in response is what we need
               my $data = JSON::decode_json( $response->content ) ;
       
               # format as oauth2 auth data
      -        my $xoauth2_string = encode_base64("user=" . $imap->User . "\1auth=Bearer " . $data->{access_token} . "\1\1", "");
      +        my $xoauth2_string = encode_base64( 'user=' . $imap->User . "\1auth=Bearer " . $data->{access_token} . "\1\1", q{} ) ;
       
      -        $debug and print("XOAUTH2 String: $xoauth2_string\n");
      +        $debug and myprint( "XOAUTH2 String: $xoauth2_string\n");
               return($xoauth2_string);
       }
       
       
      +
      +
       # xoauth() thanks to Eduardo Bortoluzzi Junior
       sub xoauth {
      -               require URI::Escape  ;
      -               require Data::Uniqid ;
      +        require URI::Escape  ;
      +        require Data::Uniqid ;
       
               my $code = shift;
               my $imap = shift;
      -               
      +
               # The base information needed to construct the OAUTH authentication
      -        my $method = "GET";
      -        my $URL = sprintf("https://mail.google.com/mail/b/%s/imap/", $imap->User);
      -        my $URLparm = sprintf("xoauth_requestor_id=%s", URI::Escape::uri_escape($imap->User));
      -        
      +        my $method = 'GET' ;
      +        my $url = mysprintf( 'https://mail.google.com/mail/b/%s/imap/', $imap->User ) ;
      +        my $urlparm = mysprintf( 'xoauth_requestor_id=%s', URI::Escape::uri_escape( $imap->User ) ) ;
      +
               # For Google Apps, the consumer key is the primary domain
               # TODO: create a command line argument to define the consumer key
      -        my @user_parts = split(/@/x, $imap->User);
      -        $debug and print "XOAUTH: consumer key: $user_parts[1]\n";
      -        
      +        my @user_parts = split /@/x, $imap->User ;
      +        $debug and myprint( "XOAUTH: consumer key: $user_parts[1]\n" ) ;
      +
               # All the parameters needed to be signed on the XOAUTH
               my %hash = ();
               $hash { 'xoauth_requestor_id' } = URI::Escape::uri_escape($imap->User);
               $hash { 'oauth_consumer_key' } = $user_parts[1];
               $hash { 'oauth_nonce' } = md5_hex(Data::Uniqid::uniqid(rand(), 1==1));
               $hash { 'oauth_signature_method' } = 'HMAC-SHA1';
      -        $hash { 'oauth_timestamp' } = time();
      +        $hash { 'oauth_timestamp' } = time ;
               $hash { 'oauth_version' } = '1.0';
       
               # Base will hold the string to be signed
      -        my $base = "$method&" . URI::Escape::uri_escape($URL) . "&";
      -        
      +        my $base = "$method&" . URI::Escape::uri_escape( $url ) . q{&} ;
      +
               # The parameters must be in dictionary order before signing
      -        my $baseparms = "";
      -        foreach my $key (sort keys %hash) {
      -                if(length($baseparms)>0) {
      -                        $baseparms .= "&";
      +        my $baseparms = q{} ;
      +        foreach my $key ( sort keys %hash ) {
      +                if ( length( $baseparms ) > 0 ) {
      +                        $baseparms .= q{&} ;
                       }
      -                
      -                $baseparms .= "$key=$hash{$key}";
      +
      +                $baseparms .= "$key=$hash{$key}" ;
               }
      -        
      +
               $base .= URI::Escape::uri_escape($baseparms);
      -        $debug and print "XOAUTH: base request to sign: $base\n";
      +        $debug and myprint( "XOAUTH: base request to sign: $base\n" ) ;
               # Sign it with the consumer secret, informed on the command line (password)
      -        my $digest = hmac_sha1($base, URI::Escape::uri_escape($imap->Password) . "&");
      -        
      +        my $digest = hmac_sha1( $base, URI::Escape::uri_escape( $imap->Password ) . q{&} ) ;
      +
               # The parameters signed become a parameter and...
      -        $hash { 'oauth_signature' } = URI::Escape::uri_escape(substr(encode_base64($digest),0,-1));
      -        
      +        $hash { 'oauth_signature' } = URI::Escape::uri_escape( substr encode_base64( $digest ), 0, $MINUS_ONE ) ;
      +
               # ... we don't need the requestor_id anymore.
      -        delete $hash{'xoauth_requestor_id'};
      -        
      +        delete $hash{'xoauth_requestor_id'} ;
      +
               # Create the final authentication string
      -        my $string = $method . " " . $URL . "?" . $URLparm ." ";
      +        my $string = $method . q{ } . $url . q{?} . $urlparm .q{ } ;
       
               # All the parameters must be sorted
      -        $baseparms = "";
      +        $baseparms = q{};
               foreach my $key (sort keys %hash) {
                       if(length($baseparms)>0) {
      -                        $baseparms .= ",";
      +                        $baseparms .= q{,} ;
                       }
      -                
      +
                       $baseparms .= "$key=\"$hash{$key}\"";
               }
      -        
      +
               $string .= $baseparms;
      -        
      -        $debug and print "XOAUTH: authentication string: $string\n";
      -       
      -       # It must be base64 encoded     
      -        return encode_base64("$string", "");
      +
      +        $debug and myprint( "XOAUTH: authentication string: $string\n" ) ;
      +
      +       # It must be base64 encoded
      +        return encode_base64("$string", q{});
       }
       
       sub server_banner {
      @@ -3185,85 +3504,124 @@ sub server_banner {
       sub banner_imapsync {
       
       	my @argv = @_ ;
      -	my $banner_imapsync = join("", 
      -		  '$RCSfile: imapsync,v $ ',
      -		  '$Revision: 1.684 $ ',
      -		  '$Date: 2016/03/17 08:35:03 $ ',
      -		  "\n",localhost_info(), "\n",
      -		  "Command line used:\n",
      -		  "$0 ", command_line_nopassword( @argv ), "\n",
      -	) ;
      +
      +	my $banner_imapsync = join q{},
      +		q{$RCSfile: imapsync,v $ },
      +		q{$Revision: 1.727 $ },
      +		q{$Date: 2016/08/19 10:30:36 $ },
      +		"\n", localhost_info(), "\n",
      +		"Command line used:\n",
      +		"$0 ", command_line_nopassword( @argv ), "\n" ;
      +
               return( $banner_imapsync ) ;
       }
       
       sub is_valid_directory {
       	my $dir = shift;
      +
      +	# all good => return ok.
       	return( 1 ) if ( -d $dir and -r _ and -w _ ) ;
      +
      +	# exist but bad
      +	if ( -e $dir and not -d _ ) {
      +		myprint( "Error: $dir exists but is not a directory\n"  ) ;
      +		return( 0 ) ;
      +	}
      +	if ( -e $dir and not -w _ ) {
      +		my $sb = stat $dir ;
      +		myprintf( "Error: directory %s is not writable for user %s, permissions are %04o and owner is %s ( uid %s )\n",
      +		         $dir, getpwuid_any_os( $EFFECTIVE_USER_ID ), ($sb->mode & oct($PERMISSION_FILTER) ), getpwuid_any_os( $sb->uid ), $sb->uid(  ) ) ;
      +		return( 0 ) ;
      +	}
       	# Trying to create it
      +	myprint( "Creating directory $dir\n"  ) ;
       	eval { mkpath( $dir ) } ;
      +	myprint( "$@" ) if ( $@ )  ;
       	return( 1 ) if ( -d $dir and -r _ and -w _ ) ;
       	return( 0 ) ;
       }
       
      +sub tests_is_valid_directory {
      +        Readonly my $NB_UNIX_tests_is_valid_directory => 4 ;
      +	SKIP: {
      +		skip( 'Tests only for Unix', $NB_UNIX_tests_is_valid_directory ) if ( 'MSWin32' eq $OSNAME ) ;
      +		ok( 1 == is_valid_directory( '.'), 'is_valid_directory: . good' ) ;
      +		ok( 1 == is_valid_directory( './tmp/tests/valid/sub'), 'is_valid_directory: ./tmp/tests/valid/sub good' ) ;
      +		diag( 'Error / not writable is on purpose' ) ;
      +		ok( 0 == is_valid_directory( '/'), 'is_valid_directory: / bad' ) ;
      +		diag( 'Error permission denied on /noway is on purpose' ) ;
      +		ok( 0 == is_valid_directory( '/noway'), 'is_valid_directory: /noway bad' ) ;
      +	}
      +	return ;
      +}
       
      -sub write_pidfile { 
      +sub write_pidfile {
       	my $pid_filename = shift ;
      -	
      -	print "PID file is $pid_filename ( to change it use --pidfile filepath ; to avoid it use --pidfile \"\" )\n" ;
      -	if ( -e $pid_filename and $pidfilelocking ) {
      -		print "$pid_filename already exists, another imapsync may be curently running. Aborting imapsync.\n" ;
      -                exit( 8 ) ;
      -	} 
      +        my $lock = shift ;
      +        
      +	myprint( "PID file is $pid_filename ( to change it use --pidfile filepath ; to avoid it use --pidfile \"\" )\n" ) ;
      +	if ( -e $pid_filename and $lock ) {
      +		myprint( "$pid_filename already exists, another imapsync may be curently running. Aborting imapsync.\n"  ) ;
      +                exit $EXIT_PID_FILE_ALREADY_EXIST ;
      +	}
       	if ( -e $pid_filename ) {
      -		print "$pid_filename already exists, overwriting it ( use --pidfilelocking to avoid concurrent runs )\n" ;
      +		myprint( "$pid_filename already exists, overwriting it ( use --pidfilelocking to avoid concurrent runs )\n"  ) ;
       	}
      -        
      -	open my $FILE_HANDLE, '>', $pid_filename 
      +
      +	open my $FILE_HANDLE, '>', $pid_filename
               	or do {
      -			print "Could not open $pid_filename for writing. Check permissions or disk space." ;
      -		return(  ) ;
      +			myprint( "Could not open $pid_filename for writing. Check permissions or disk space."  ) ;
      +		return ;
       	} ;
      -	
      +        myprint( "Wrinting my PID $PROCESS_ID in $pid_filename\n"  ) ;
       	print $FILE_HANDLE $PROCESS_ID ;
       	close $FILE_HANDLE ;
      -        
      +
       	return( $PROCESS_ID ) ;
      -} 
      +}
       
       sub remove_tmp_files {
      -	unlink( $pidfile ) ;
      -	return(  ) ;
      +        my $mysync = shift ;
      +	unlink $mysync->{pidfile} ;
      +	return ;
       }
       
      +
       sub exit_clean {
      +        my $mysync = shift ;
       	my $status = shift ;
      -	$status = defined( $status ) ? $status : 1 ;
      -        remove_tmp_files(  ) ;
      -	exit( $status ) ;
      +	$status = defined  $status  ? $status : $EXIT_UNKNOWN ;
      +        remove_tmp_files( $mysync ) ;
      +        myprint( "Exiting with return value $status\n" ) ;
      +        if ( $mysync->{log} ) {
      +                myprint( "Log file is $mysync->{logfile} ( to change it, use --logfile filepath ; or use --nolog to turn off logging )\n" ) ;
      +                close $mysync->{logfile_handle} ;
      +        }
      +	exit $status ;
       }
       
       sub die_clean {
       	my @messages = @_ ;
      -        remove_tmp_files(  ) ;
      -	die( @messages ) ;
      -} 
      +        remove_tmp_files( $sync ) ;
      +	die @messages ;
      +}
       
       sub missing_option {
       	my ( $option ) = @_ ;
       	die_clean( "$option option is mandatory, for help run $0 --help\n" ) ;
      -	return(  ) ;
      +	return ;
       }
       
       
       sub fix_Inbox_INBOX_mapping {
       	my( $h1_all, $h2_all ) = @_ ;
       
      -	my $regex = '' ;
      +	my $regex = q{} ;
       	SWITCH: {
      -		if ( exists( $h1_all->{INBOX} ) and exists( $h2_all->{INBOX} ) ) { $regex = '' ; last SWITCH ; } ;
      -		if ( exists( $h1_all->{Inbox} ) and exists( $h2_all->{Inbox} ) ) { $regex = '' ; last SWITCH ; } ;
      -		if ( exists( $h1_all->{INBOX} ) and exists( $h2_all->{Inbox} ) ) { $regex = 's/^INBOX$/Inbox/x' ; last SWITCH ; } ;
      -		if ( exists( $h1_all->{Inbox} ) and exists( $h2_all->{INBOX} ) ) { $regex = 's/^Inbox$/INBOX/x' ; last SWITCH ; } ;
      +		if ( exists  $h1_all->{INBOX}  and exists  $h2_all->{INBOX}  ) { $regex = q{} ; last SWITCH ; } ;
      +		if ( exists  $h1_all->{Inbox}  and exists  $h2_all->{Inbox}  ) { $regex = q{} ; last SWITCH ; } ;
      +		if ( exists  $h1_all->{INBOX}  and exists  $h2_all->{Inbox}  ) { $regex = q{s/^INBOX$/Inbox/x} ; last SWITCH ; } ;
      +		if ( exists  $h1_all->{Inbox}  and exists  $h2_all->{INBOX}  ) { $regex = q{s/^Inbox$/INBOX/x} ; last SWITCH ; } ;
       	} ;
               return( $regex ) ;
       }
      @@ -3271,38 +3629,38 @@ sub fix_Inbox_INBOX_mapping {
       sub tests_fix_Inbox_INBOX_mapping {
       
       	my( $h1_all, $h2_all ) ;
      -        
      -	$h1_all = { 'INBOX' => '' } ;
      -	$h2_all = { 'INBOX' => '' } ;
      -	ok( '' eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: INBOX INBOX' ) ;
      -        
      -	$h1_all = { 'Inbox' => '' } ;
      -	$h2_all = { 'Inbox' => '' } ;
      -	ok( '' eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: Inbox Inbox' ) ;
      -        
      -	$h1_all = { 'INBOX' => '' } ;
      -	$h2_all = { 'Inbox' => '' } ;
      -	ok( 's/^INBOX$/Inbox/x' eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: INBOX Inbox' ) ;
      -        
      -	$h1_all = { 'Inbox' => '' } ;
      -	$h2_all = { 'INBOX' => '' } ;
      -	ok( 's/^Inbox$/INBOX/x' eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: Inbox INBOX' ) ;
      -        
      -	$h1_all = { 'INBOX' => '' } ;
      -	$h2_all = { 'rrrrr' => '' } ;
      -	ok( '' eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: INBOX rrrrrr' ) ;
      -        
      -	$h1_all = { 'rrrrr' => '' } ;
      -	$h2_all = { 'Inbox' => '' } ;
      -	ok( '' eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: rrrrr Inbox' ) ;
       
      -	return(  ) ;
      +	$h1_all = { 'INBOX' => q{} } ;
      +	$h2_all = { 'INBOX' => q{} } ;
      +	ok( q{} eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: INBOX INBOX' ) ;
      +
      +	$h1_all = { 'Inbox' => q{} } ;
      +	$h2_all = { 'Inbox' => q{} } ;
      +	ok( q{} eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: Inbox Inbox' ) ;
      +
      +	$h1_all = { 'INBOX' => q{} } ;
      +	$h2_all = { 'Inbox' => q{} } ;
      +	ok( q{s/^INBOX$/Inbox/x} eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: INBOX Inbox' ) ;
      +
      +	$h1_all = { 'Inbox' => q{} } ;
      +	$h2_all = { 'INBOX' => q{} } ;
      +	ok( q{s/^Inbox$/INBOX/x} eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: Inbox INBOX' ) ;
      +
      +	$h1_all = { 'INBOX' => q{} } ;
      +	$h2_all = { 'rrrrr' => q{} } ;
      +	ok( q{} eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: INBOX rrrrrr' ) ;
      +
      +	$h1_all = { 'rrrrr' => q{} } ;
      +	$h2_all = { 'Inbox' => q{} } ;
      +	ok( q{} eq fix_Inbox_INBOX_mapping( $h1_all, $h2_all ), 'fix_Inbox_INBOX_mapping: rrrrr Inbox' ) ;
      +
      +	return ;
       }
       
       
       sub jux_utf8_list {
       	my @s_inp = @_ ;
      -	my $s_out = '' ;
      +	my $s_out = q{} ;
       	foreach my $s ( @s_inp ) {
       		$s_out .= jux_utf8( $s ) . "\n" ;
       	}
      @@ -3310,8 +3668,8 @@ sub jux_utf8_list {
       }
       
       sub tests_jux_utf8_list {
      -	ok( '' eq jux_utf8_list(  ), 'jux_utf8_list: void' ) ;
      -	ok( "[]\n" eq jux_utf8_list( '' ), 'jux_utf8_list: empty string' ) ;
      +	ok( q{} eq jux_utf8_list(  ), 'jux_utf8_list: void' ) ;
      +	ok( "[]\n" eq jux_utf8_list( q{} ), 'jux_utf8_list: empty string' ) ;
       	ok( "[INBOX]\n" eq jux_utf8_list( 'INBOX' ), 'jux_utf8_list: INBOX' ) ;
       	ok( "[&ANY-] = [Ö]\n" eq jux_utf8_list( '&ANY-' ), 'jux_utf8_list: &ANY-' ) ;
       	return( 0 ) ;
      @@ -3321,32 +3679,32 @@ sub jux_utf8 {
       	# juxtapose utf8 at the right if different
               my ( $s_utf7 ) =  shift ;
               my ( $s_utf8 ) =  imap_utf7_decode( $s_utf7 ) ;
      -        
      +
               if ( $s_utf7 eq $s_utf8 ) {
      -        	#print "[$s_utf7]\n" ;
      +        	#myprint( "[$s_utf7]\n"  ) ;
               	return( "[$s_utf7]" ) ;
               }else{
      -        	#print "[$s_utf7] = [$s_utf8]\n" ;
      +        	#myprint( "[$s_utf7] = [$s_utf8]\n"  ) ;
               	return( "[$s_utf7] = [$s_utf8]" ) ;
               }
       }
       
       # editing utf8 can be tricky without an utf8 editor
      -sub tests_jux_utf8 { 
      +sub tests_jux_utf8 {
       	ok( '[INBOX]' eq jux_utf8( 'INBOX'), 'jux_utf8: INBOX => [INBOX]' ) ;
       	ok( '[&ZTZO9nux-] = [收件箱]' eq jux_utf8( '&ZTZO9nux-'), 'jux_utf8: => [&ZTZO9nux-] = [收件箱]' ) ;
       	ok( '[&ANY-] = [Ö]' eq jux_utf8( '&ANY-'), 'jux_utf8: &ANY- => [&ANY-] = [Ö]' ) ;
      -        ok( '[]' eq jux_utf8( '' ), 'jux_utf8: void => []' ) ;
      +        ok( '[]' eq jux_utf8( q{} ), 'jux_utf8: void => []' ) ;
               ok( '[+BD8EQAQ1BDQEOwQ+BDM-] = [предлог]' eq jux_utf8( '+BD8EQAQ1BDQEOwQ+BDM-' ), 'jux_utf8: => [+BD8EQAQ1BDQEOwQ+BDM-] = [предлог]' ) ;
               ok( '[&BB8EQAQ+BDUEOgRC-] = [Проект]'      eq jux_utf8( '&BB8EQAQ+BDUEOgRC-' ),    'jux_utf8: => [&BB8EQAQ+BDUEOgRC-] = [Проект]' ) ;
      -	
      +
       	return( 0 ) ;
       }
       
       # Copied from http://cpansearch.perl.org/src/FABPOT/Unicode-IMAPUtf7-2.01/lib/Unicode/IMAPUtf7.pm
      -# and then fixed with 
      +# and then fixed with
       # https://rt.cpan.org/Public/Bug/Display.html?id=11172
      -sub imap_utf7_decode { 
      +sub imap_utf7_decode {
               my ( $s ) = shift ;
       
               # Algorithm
      @@ -3363,7 +3721,7 @@ sub imap_utf7_encode {
       	my ( $s ) = @_ ;
       
       	$s = Unicode::String::utf8( $s )->utf7 ;
      -	
      +
       	$s =~ s/\+([^\/&\-]*)\/([^\/\-&]*)\-/\+$1,$2\-/g ;
       	$s =~ s/&/&\-/g ;
       	$s =~ s/\+([^+\-]+)?\-/&$1\-/g ;
      @@ -3376,10 +3734,24 @@ sub imap_utf7_encode {
       sub select_folder {
       	my ( $imap, $folder, $hostside ) = @_ ;
       	if ( ! $imap->select( $folder ) ) {
      -		my $error = join( '',  
      +		my $error = join q{},
       			"$hostside folder $folder: Could not select: ",
      -			$imap->LastError,  "\n" ) ;
      -		errors_incr( $error ) ;
      +			$imap->LastError,  "\n" ;
      +		errors_incr( $sync, $error ) ;
      +		return( 0 ) ;
      +	}else{
      +		# ok select succeeded
      +		return( 1 ) ;
      +	}
      +}
      +
      +sub examine_folder {
      +	my ( $imap, $folder, $hostside ) = @_ ;
      +	if ( ! $imap->examine( $folder ) ) {
      +		my $error = join q{},
      +			"$hostside folder $folder: Could not examine: ",
      +			$imap->LastError,  "\n" ;
      +		errors_incr( $sync, $error ) ;
       		return( 0 ) ;
       	}else{
       		# ok select succeeded
      @@ -3387,63 +3759,66 @@ sub select_folder {
       	}
       }
       
      -sub count_from_select {
      -	my @lines = @_ ;
      -        my $count ;
      -        foreach my $line ( @lines ) {
      -        	#print "line = [$line]\n" ;
      -                if ( $line =~ m/^\*\s+(\d+)\s+EXISTS/ ) {
      -                	$count = $1 ;
      -                        return( $count ) ;
      -                }
      -        }
      -        return( undef ) ;
      -}
      -        
       
       
      -sub examine_folder {
      -	my ( $imap, $folder, $hostside ) = @_ ;
      -	if ( ! $imap->examine( $folder ) ) {
      -		my $error = join( '', 
      -		"$hostside folder $folder: Could not examine: ",
      -		$imap->LastError,  "\n" ) ;
      -		errors_incr( $error ) ;
      -		return( 0 ) ;
      -	}else{
      -		# ok examine succeeded
      -		return( 1 ) ;
      -	}
      -}
      +
      +sub count_from_select {
      +	my @lines = @_ ;
      +        my $count ;
      +        foreach my $line ( @lines ) {
      +        	#myprint( "line = [$line]\n"  ) ;
      +                if ( $line =~ m/^\*\s+(\d+)\s+EXISTS/ ) {
      +                	$count = $1 ;
      +                        return( $count ) ;
      +                }
      +        }
      +        return( undef ) ;
      +}
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
       
       
       sub create_folder_old {
       	my( $imap, $h2_fold, $h1_fold ) = @_ ;
      -	
      -	print "Creating (old way) folder [$h2_fold] on host2\n";
      -        if ( ( 'INBOX' eq uc( $h2_fold) )
      +
      +	myprint( "Creating (old way) folder [$h2_fold] on host2\n" ) ;
      +        if ( ( 'INBOX' eq uc  $h2_fold )
                and ( $imap->exists( $h2_fold ) ) ) {
      -                print "Folder [$h2_fold] already exists\n" ;
      +                myprint( "Folder [$h2_fold] already exists\n"  ) ;
                       return( 1 ) ;
               }
       	if ( ! $dry ){
       		if ( ! $imap->create( $h2_fold ) ) {
      -			my $error = join( '', 
      +			my $error = join q{},
       				"Could not create folder [$h2_fold] from [$h1_fold]: ",
      -				$imap->LastError(  ), "\n" ) ;
      -			errors_incr( $error ) ;
      +				$imap->LastError(  ), "\n" ;
      +			errors_incr( $sync, $error ) ;
                               # success if folder exists ("already exists" error)
                               return( 1 ) if $imap->exists( $h2_fold ) ;
                               # failure since create failed
       			return( 0 ) ;
       		}else{
       			#create succeeded
      -                        print "Created ( the old way ) folder [$h2_fold] on host2\n" ;
      +                        myprint( "Created ( the old way ) folder [$h2_fold] on host2\n"  ) ;
       			return( 1 ) ;
       		}
       	}else{
       		# dry mode, no folder so many imap will fail, assuming failure
      -                print "Created ( the old way ) folder [$h2_fold] on host2 $dry_message\n" ;
      +                myprint( "Created ( the old way ) folder [$h2_fold] on host2 $dry_message\n"  ) ;
       		return( 0 ) ;
       	}
       }
      @@ -3453,56 +3828,61 @@ sub create_folder {
               my( $imap2 , $h2_fold , $h1_fold ) = @_ ;
               my( @parts , $parent ) ;
       
      +        if ( $imap2->IsUnconnected(  ) ) {
      +                myprint( "Host2: Unconnected state\n"  ) ;
      +                return( 0 ) ;
      +        }
      +
       	if ( $create_folder_old ) {
               	return( create_folder_old( $imap2 , $h2_fold , $h1_fold ) ) ;
       	}
      -        print "Creating folder [$h2_fold] on host2\n" ;
      -        if ( ( 'INBOX' eq uc( $h2_fold ) )
      +        myprint( "Creating folder [$h2_fold] on host2\n"  ) ;
      +        if ( ( 'INBOX' eq uc  $h2_fold  )
                and ( $imap2->exists( $h2_fold ) ) ) {
      -                print "Folder [$h2_fold] already exists\n" ;
      +                myprint( "Folder [$h2_fold] already exists\n"  ) ;
                       return( 1 ) ;
               }
       
               if ( $mixfolders and $imap2->exists( $h2_fold ) ) {
      -                print "Folder [$h2_fold] already exists  (--nomixfolders is not set)\n" ;
      +                myprint( "Folder [$h2_fold] already exists  (--nomixfolders is not set)\n"  ) ;
                       return( 1 ) ;
               }
       
      -        
      +
               if ( ( not $mixfolders ) and ( $imap2->exists( $h2_fold ) ) ) {
      -                print "Folder [$h2_fold] already exists and --nomixfolders is set\n" ;
      +                myprint( "Folder [$h2_fold] already exists and --nomixfolders is set\n"  ) ;
                       return( 0 ) ;
               }
       
      -        @parts = split( /\Q$h2_sep\E/ , $h2_fold ) ;
      -        pop( @parts ) ;
      -        $parent = join( $h2_sep , @parts ) ;
      +        @parts = split /\Q$h2_sep\E/, $h2_fold ;
      +        pop @parts ;
      +        $parent = join $h2_sep, @parts ;
               $parent =~ s/^\s+|\s+$//g ;
      -        if ( ( $parent ne "" ) and ( ! $imap2->exists( $parent ) ) ) {
      +        if ( ( $parent ne q{} ) and ( ! $imap2->exists( $parent ) ) ) {
                       create_folder( $imap2 , $parent , $h1_fold ) ;
               }
       
               if ( ! $dry ) {
                       if ( ! $imap2->create( $h2_fold ) ) {
      -			my $error = join( '', 
      +			my $error = join q{},
       				"Could not create folder [$h2_fold] from [$h1_fold]: " ,
      -				$imap2->LastError(  ), "\n" ) ;
      -			errors_incr( $error ) ;
      +				$imap2->LastError(  ), "\n" ;
      +			errors_incr( $sync, $error ) ;
                               # success if folder exists ("already exists" error)
                               return( 1 ) if $imap2->exists( $h2_fold ) ;
                               # failure since create failed
                               return( 0 ) ;
                       }else{
                               #create succeeded
      -                        print "Created  folder [$h2_fold] on host2\n" ;
      +                        myprint( "Created folder [$h2_fold] on host2\n"  ) ;
                               return( 1 ) ;
                       }
               }else{
                       # dry mode, no folder so many imap will fail, assuming failure
      -                print "Created  folder [$h2_fold] on host2 $dry_message\n" ;
      +                myprint( "Created  folder [$h2_fold] on host2 $dry_message\n"  ) ;
                       if ( ! $justfolders ) {
      -			print "Since --dry mode is on and folder [$h2_fold] on host2 does not exist yet, syncing messages will not be simulated.\n"
      -			. "To simulate message syncing, use --justfolders without --dry to first create the missing folders then rerun the --dry sync.\n" ;
      +			myprint( "Since --dry mode is on and folder [$h2_fold] on host2 does not exist yet, syncing messages will not be simulated.\n"
      +			. "To simulate message syncing, use --justfolders without --dry to first create the missing folders then rerun the --dry sync.\n" ) ;
                       }
       		return( 0 ) ;
               }
      @@ -3523,7 +3903,7 @@ sub tests_folder_routines {
       	ok(  is_requested_folder('folder_toto'), 'is_requested_folder 5'                         );
       	ok(  remove_from_requested_folders('folder_toto'), 'remove_from_requested_folders: '       );
       	ok( !is_requested_folder('folder_toto'), 'is_requested_folder 6'                         );
      -	ok( !remove_from_requested_folders('folder_bar'), "remove_from_requested_folders: empty" ) ;
      +	ok( !remove_from_requested_folders('folder_bar'), 'remove_from_requested_folders: empty' ) ;
       
               ok( 0 == compare_lists( [ sort_requested_folders(  ) ], [] ), 'sort_requested_folders: all empty' ) ;
       	ok(  add_to_requested_folders('M_55'), 'add_to_requested_folders M_55'       );
      @@ -3535,11 +3915,11 @@ sub tests_folder_routines {
       
       	ok(  add_to_requested_folders('M_55', 'M_44',), 'add_to_requested_folders M_55 M_44'       );
               ok( 0 == compare_lists( [ sort_requested_folders(  ) ], [ 'Z_11', 'M_44', 'M_55', 'A_99' ] ), 'sort_requested_folders: first+middle+last 2' ) ;
      -	@folderfirst = ( 'Z_22', 'Z_11' ) ;
      -	@folderlast  = ( 'A_99', 'A_88' ) ;
      +	@folderfirst = qw( Z_22  Z_11 ) ;
      +	@folderlast  = qw( A_99  A_88 ) ;
               ok( 0 == compare_lists( [ sort_requested_folders(  ) ], [  'Z_22', 'Z_11', 'M_44', 'M_55', 'A_99', 'A_88' ] ), 'sort_requested_folders: first+middle+last 3' ) ;
      -        
      -	return(  ) ;
      +
      +	return ;
       }
       
       
      @@ -3554,7 +3934,7 @@ sub sort_requested_folders {
               	remove_from_requested_folders( $folder ) ;
               }
       
      -	my @middle = sort( keys( %requested_folder ) ) ;
      +	my @middle = sort keys %requested_folder ;
       
               @requested_folders_sorted = ( @folderfirst, @middle, @folderlast ) ;
       
      @@ -3563,124 +3943,124 @@ sub sort_requested_folders {
       
       sub is_requested_folder {
       	my ( $folder ) = @_;
      -	
      -	return( defined( $requested_folder{ $folder } ) ) ;
      +
      +	return( defined  $requested_folder{ $folder }  ) ;
       }
       
       
       sub add_to_requested_folders {
       	my @wanted_folders = @_ ;
      -	
      +
       	foreach my $folder ( @wanted_folders ) {
       	 	++$requested_folder{ $folder } ;
       	}
      -	return( keys( %requested_folder ) ) ;
      +	return( keys  %requested_folder  ) ;
       }
       
       sub remove_from_requested_folders {
       	my @wanted_folders = @_ ;
      -	
      +
       	foreach my $folder ( @wanted_folders ) {
       	 	delete $requested_folder{ $folder } ;
       	}
      -	return( keys( %requested_folder ) ) ;
      +	return( keys %requested_folder ) ;
       }
       
       sub compare_lists {
       	my ($list_1_ref, $list_2_ref) = @_;
      -	
      -	return(-1) if ((not defined($list_1_ref)) and defined($list_2_ref));
      -	return(0)  if ((not defined($list_1_ref)) and not defined($list_2_ref)); # end if no list
      -	return(1)  if (not defined($list_2_ref)); # end if only one list
      -	
      -	if (not ref($list_1_ref)) {$list_1_ref = [$list_1_ref]};
      -	if (not ref($list_2_ref)) {$list_2_ref = [$list_2_ref]};
      +
      +	return($MINUS_ONE) if ((not defined $list_1_ref) and defined $list_2_ref);
      +	return(0)  if ((not defined $list_1_ref) and not defined $list_2_ref); # end if no list
      +	return(1)  if (not defined $list_2_ref); # end if only one list
      +
      +	if (not ref $list_1_ref ) {$list_1_ref = [$list_1_ref]};
      +	if (not ref $list_2_ref ) {$list_2_ref = [$list_2_ref]};
      +
      +
      +	my $last_used_indice = $MINUS_ONE;
       
       
      -	my $last_used_indice = -1;
      -	#print "\$#$list_1_ref:", $#$list_1_ref, "\n";
      -	#print "\$#$list_2_ref:", $#$list_2_ref, "\n";
       	ELEMENT:
      -	foreach my $indice ( 0 .. $#$list_1_ref ) {
      -		$last_used_indice = $indice;
      -		
      +	foreach my $indice ( 0 .. $#{ $list_1_ref } ) {
      +		$last_used_indice = $indice ;
      +
       		# End of list_2
      -		return 1 if ($indice > $#$list_2_ref);
      -		
      -		my $element_list_1 = $list_1_ref->[$indice];
      -		my $element_list_2 = $list_2_ref->[$indice];
      +		return 1 if ($indice > $#{ $list_2_ref } ) ;
      +
      +		my $element_list_1 = $list_1_ref->[$indice] ;
      +		my $element_list_2 = $list_2_ref->[$indice] ;
       		my $balance = $element_list_1 cmp $element_list_2 ;
       		next ELEMENT if ($balance == 0) ;
      -		return $balance;
      +		return $balance ;
       	}
       	# each element equal until last indice of list_1
      -	return -1 if ($last_used_indice < $#$list_2_ref) ;
      -	
      +	return $MINUS_ONE if ($last_used_indice < $#{ $list_2_ref } ) ;
      +
       	# same size, each element equal
       	return 0 ;
       }
       
       sub tests_compare_lists {
       
      -	
      +
       	my $empty_list_ref = [];
      -	
      +
       	ok( 0 == compare_lists()               , 'compare_lists, no args');
       	ok( 0 == compare_lists(undef)          , 'compare_lists, undef = nothing');
       	ok( 0 == compare_lists(undef, undef)   , 'compare_lists, undef = undef');
      -	ok(-1 == compare_lists(undef , [])     , 'compare_lists, undef < []');
      -	ok(-1 == compare_lists(undef , [1])    , 'compare_lists, undef < [1]');
      -	ok(-1 == compare_lists(undef , [0])    , 'compare_lists, undef < [0]');
      +	ok($MINUS_ONE == compare_lists(undef , [])     , 'compare_lists, undef < []');
      +	ok($MINUS_ONE == compare_lists(undef , [1])    , 'compare_lists, undef < [1]');
      +	ok($MINUS_ONE == compare_lists(undef , [0])    , 'compare_lists, undef < [0]');
             	ok(+1 == compare_lists([])             , 'compare_lists, [] > nothing');
               ok(+1 == compare_lists([], undef)      , 'compare_lists, [] > undef');
       	ok( 0 == compare_lists([] , [])        , 'compare_lists, [] = []');
       
      -	ok(-1 == compare_lists([] , [1])        , 'compare_lists, [] < [1]');
      +	ok($MINUS_ONE == compare_lists([] , [1])        , 'compare_lists, [] < [1]');
       	ok(+1 == compare_lists([1] , [])        , 'compare_lists, [1] > []');
       
      -	
      -	ok( 0 == compare_lists([1],  1 )          , "compare_lists, [1] =  1 ") ;
      -	ok( 0 == compare_lists( 1 , [1])          , "compare_lists,  1  = [1]") ;
      -	ok( 0 == compare_lists( 1 ,  1 )          , "compare_lists,  1  =  1 ") ;
      -	ok(-1 == compare_lists( 0 ,  1 )          , "compare_lists,  0  <  1 ") ;
      -	ok(-1 == compare_lists(-1 ,  0 )          , "compare_lists, -1  <  0 ") ;
      -	ok(-1 == compare_lists( 1 ,  2 )          , "compare_lists,  1  <  2 ") ;
      -	ok(+1 == compare_lists( 2 ,  1 )          , "compare_lists,  2  >  1 ") ;
      -
      -
      -	ok( 0 == compare_lists([1,2], [1,2])   , "compare_lists, [1,2] = [1,2]") ;
      -	ok(-1 == compare_lists([1], [1,2])     , "compare_lists, [1] < [1,2]") ;
      -	ok(+1 == compare_lists([2], [1,2])     , "compare_lists, [2] > [1,2]") ;
      -	ok(-1 == compare_lists([1], [1,1])     , "compare_lists, [1] < [1,1]") ;
      -	ok(+1 == compare_lists([1, 1], [1])    , "compare_lists, [1, 1] > [1]") ;
      -	ok( 0 == compare_lists([1 .. 20_000] , [1 .. 20_000])
      -                                               , "compare_lists, [1..20_000] = [1..20_000]") ;
      -	ok(-1 == compare_lists([1], [3])       , 'compare_lists, [1] < [3]') ;
      +
      +	ok( 0 == compare_lists([1],  1 )          , 'compare_lists, [1] =  1 ') ;
      +	ok( 0 == compare_lists( 1 , [1])          , 'compare_lists,  1  = [1]') ;
      +	ok( 0 == compare_lists( 1 ,  1 )          , 'compare_lists,  1  =  1 ') ;
      +	ok($MINUS_ONE == compare_lists( 0 ,  1 )          , 'compare_lists,  0  <  1 ') ;
      +	ok($MINUS_ONE == compare_lists($MINUS_ONE ,  0 )          , 'compare_lists, -1  <  0 ') ;
      +	ok($MINUS_ONE == compare_lists( 1 ,  2 )          , 'compare_lists,  1  <  2 ') ;
      +	ok(+1 == compare_lists( 2 ,  1 )          , 'compare_lists,  2  >  1 ') ;
      +
      +
      +	ok( 0 == compare_lists([1,2], [1,2])   , 'compare_lists,  [1,2] = [1,2]' ) ;
      +	ok($MINUS_ONE == compare_lists([1], [1,2])     , 'compare_lists,    [1] < [1,2]' ) ;
      +	ok(+1 == compare_lists([2], [1,2])     , 'compare_lists,    [2] > [1,2]' ) ;
      +	ok($MINUS_ONE == compare_lists([1], [1,1])     , 'compare_lists,    [1] < [1,1]' ) ;
      +	ok(+1 == compare_lists([1, 1], [1])    , 'compare_lists, [1, 1] >   [1]' ) ;
      +	ok( 0 == compare_lists([1 .. $NUMBER_20_000] , [1 .. $NUMBER_20_000])
      +                                               , 'compare_lists, [1..20_000] = [1..20_000]' ) ;
      +	ok($MINUS_ONE == compare_lists([1], [2])       , 'compare_lists, [1] < [2]') ;
       	ok( 0 == compare_lists([2], [2])       , 'compare_lists, [0] = [2]') ;
      -	ok(+1 == compare_lists([3], [1])       , 'compare_lists, [3] > [1]') ;
      -	
      -	ok(-1 == compare_lists(["a"], ["b"])   , 'compare_lists, ["a"] < ["b"]') ;
      -	ok( 0 == compare_lists(["a"], ["a"])   , 'compare_lists, ["a"] = ["a"]') ;
      -	ok( 0 == compare_lists(["ab"], ["ab"]) , 'compare_lists, ["ab"] = ["ab"]') ;
      -	ok(+1 == compare_lists(["b"], ["a"])   , 'compare_lists, ["b"] > ["a"]') ;
      -	ok(-1 == compare_lists(["a"], ["aa"])  , 'compare_lists, ["a"] < ["aa"]') ;
      -	ok(-1 == compare_lists(["a"], ["a", "a"]), 'compare_lists, ["a"] < ["a", "a"]') ;
      -	ok( 0 == compare_lists([split(" ", "a b")], ["a", "b"]), 'compare_lists, split') ;
      -	ok( 0 == compare_lists([sort split(" ", "b a")], ["a", "b"]), 'compare_lists, sort split') ;
      -        return(  ) ;
      +	ok(+1 == compare_lists([2], [1])       , 'compare_lists, [2] > [1]') ;
      +
      +	ok($MINUS_ONE == compare_lists(['a'],  ['b'])   , 'compare_lists, ["a"] < ["b"]') ;
      +	ok( 0 == compare_lists(['a'],  ['a'])   , 'compare_lists, ["a"] = ["a"]') ;
      +	ok( 0 == compare_lists(['ab'], ['ab']) , 'compare_lists, ["ab"] = ["ab"]') ;
      +	ok(+1 == compare_lists(['b'],  ['a'])   , 'compare_lists, ["b"] > ["a"]') ;
      +	ok($MINUS_ONE == compare_lists(['a'],  ['aa'])  , 'compare_lists, ["a"] < ["aa"]') ;
      +	ok($MINUS_ONE == compare_lists(['a'],  ['a', 'a']), 'compare_lists, ["a"] < ["a", "a"]') ;
      +	ok( 0 == compare_lists([split q{ }, 'a b' ], ['a', 'b']), 'compare_lists, split') ;
      +	ok( 0 == compare_lists([sort split q{ }, 'b a' ], ['a', 'b']), 'compare_lists, sort split') ;
      +        return ;
       }
       
       
       sub guess_prefix {
       	my @foldernames = @_ ;
      -	
      +
       	return( undef ) unless ( @foldernames ) ;
       
      -	my $prefix_guessed = '' ;
      +	my $prefix_guessed = q{} ;
       	foreach my $folder ( @foldernames ) {
       		next if ( $folder =~ m{^INBOX$}i ) ; # no guessing from INBOX
       		if ( $folder !~ m{^INBOX}i ) {
      -			$prefix_guessed = '' ; # prefix empty guessed
      +			$prefix_guessed = q{} ; # prefix empty guessed
       			last ;
       		}
       		if ( $folder =~ m{^(INBOX(?:\.|\/))}i ) {
      @@ -3692,36 +4072,36 @@ sub guess_prefix {
       
       sub tests_guess_prefix {
       
      -	ok( not( defined( guess_prefix(  ) ) ), 'guess_prefix: no args' ) ;
      -	ok( '' eq guess_prefix( 'INBOX' ), 'guess_prefix: INBOX alone' ) ;
      -	ok( '' eq guess_prefix( 'Inbox' ), 'guess_prefix: Inbox alone' ) ;
      -	ok( '' eq guess_prefix( 'INBOX' ), 'guess_prefix: INBOX alone' ) ;
      +	ok( not( defined guess_prefix(  ) ), 'guess_prefix: no args' ) ;
      +	ok( q{} eq guess_prefix( 'INBOX' ), 'guess_prefix: INBOX alone' ) ;
      +	ok( q{} eq guess_prefix( 'Inbox' ), 'guess_prefix: Inbox alone' ) ;
      +	ok( q{} eq guess_prefix( 'INBOX' ), 'guess_prefix: INBOX alone' ) ;
       	ok( 'INBOX/' eq guess_prefix( 'INBOX', 'INBOX/Junk' ), 'guess_prefix: INBOX INBOX/Junk' ) ;
       	ok( 'INBOX.' eq guess_prefix( 'INBOX', 'INBOX.Junk' ), 'guess_prefix: INBOX INBOX.Junk' ) ;
       	ok( 'Inbox/' eq guess_prefix( 'Inbox', 'Inbox/Junk' ), 'guess_prefix: Inbox Inbox/Junk' ) ;
       	ok( 'Inbox.' eq guess_prefix( 'Inbox', 'Inbox.Junk' ), 'guess_prefix: Inbox Inbox.Junk' ) ;
       	ok( 'INBOX/' eq guess_prefix( 'INBOX', 'INBOX/Junk', 'INBOX/rrr' ), 'guess_prefix: INBOX INBOX/Junk INBOX/rrr' ) ;
      -	ok( '' eq guess_prefix( 'INBOX', 'INBOX/Junk', 'INBOX/rrr', 'zzz' ), 'guess_prefix: INBOX INBOX/Junk INBOX/rrr zzz' ) ;
      -	ok( '' eq guess_prefix( 'INBOX', 'Junk' ), 'guess_prefix: INBOX Junk' ) ;
      -	ok( '' eq guess_prefix( 'INBOX', 'Junk' ), 'guess_prefix: INBOX Junk' ) ;
      +	ok( q{} eq guess_prefix( 'INBOX', 'INBOX/Junk', 'INBOX/rrr', 'zzz' ), 'guess_prefix: INBOX INBOX/Junk INBOX/rrr zzz' ) ;
      +	ok( q{} eq guess_prefix( 'INBOX', 'Junk' ), 'guess_prefix: INBOX Junk' ) ;
      +	ok( q{} eq guess_prefix( 'INBOX', 'Junk' ), 'guess_prefix: INBOX Junk' ) ;
       
      -	return(  ) ;
      +	return ;
       }
       
      -sub get_prefix { 
      +sub get_prefix {
       	my( $imap, $prefix_in, $prefix_opt, $Side, $folders_ref ) = @_ ;
       	my( $prefix_out, $prefix_guessed ) ;
      -	
      -	( $debug or $sync->{debugfolders} ) and print "$Side: Getting prefix\n" ;
      -	$prefix_guessed = guess_prefix( @$folders_ref ) ;
      -	print "$Side: guessing prefix from folder listing: [$prefix_guessed]\n" ;
      -	( $debug or $sync->{debugfolders} ) and print "$Side: Calling namespace capability\n" ;
      -	if ( $imap->has_capability( "namespace" ) ) {
      +
      +	( $debug or $sync->{debugfolders} ) and myprint( "$Side: Getting prefix\n"  ) ;
      +	$prefix_guessed = guess_prefix( @{ $folders_ref } ) ;
      +	myprint( "$Side: guessing prefix from folder listing: [$prefix_guessed]\n"  ) ;
      +	( $debug or $sync->{debugfolders} ) and myprint( "$Side: Calling namespace capability\n"  ) ;
      +	if ( $imap->has_capability( 'namespace' ) ) {
       		my $r_namespace = $imap->namespace(  ) ;
       		$prefix_out = $r_namespace->[0][0][0] ;
      -                print "$Side: prefix given by NAMESPACE: [$prefix_out]\n" ;
      -		if ( defined( $prefix_in ) ) {
      -                	print "$Side: but using [$prefix_in] given by $prefix_opt\n" ;
      +                myprint( "$Side: prefix given by NAMESPACE: [$prefix_out]\n"  ) ;
      +		if ( defined  $prefix_in  ) {
      +                	myprint( "$Side: but using [$prefix_in] given by $prefix_opt\n"  ) ;
                       	$prefix_out = $prefix_in ;
                       	return( $prefix_out ) ;
                       }else{
      @@ -3730,25 +4110,25 @@ sub get_prefix {
                       }
       	}
       	else{
      -        	if ( defined( $prefix_in ) ) {
      -                	print "$Side: using [$prefix_in] given by $prefix_opt\n" ;
      +        	if ( defined  $prefix_in  ) {
      +                	myprint( "$Side: using [$prefix_in] given by $prefix_opt\n"  ) ;
                       	$prefix_out = $prefix_in ;
                       	return( $prefix_out ) ;
                       }else{
      -			print 
      -			  "$Side: No NAMESPACE capability so so using guessed separator [$prefix_guessed]\n",
      -			  help_to_guess_prefix( $imap, $prefix_opt ) ;
      +			myprint(
      +			  "$Side: No NAMESPACE capability so using guessed prefix [$prefix_guessed]\n",
      +			  help_to_guess_prefix( $imap, $prefix_opt ) ) ;
       			return( $prefix_guessed ) ;
                       }
       	}
      -        return(  ) ;
      +        return ;
       }
       
       
       sub guess_separator {
       	my @foldernames = @_ ;
      -	
      -	return( undef ) unless ( @foldernames ) ;
      +
      +	#return( undef ) unless ( @foldernames ) ;
       
       	my $sep_guessed ;
       	my %counter ;
      @@ -3757,87 +4137,86 @@ sub guess_separator {
       		$counter{'.'}++  while ( $folder =~ m{\.}g ) ; # count .
       		$counter{'\\\\'}++ while ( $folder =~ m{(\\){2}}g ) ; # count \\
       	}
      -	my @race_sorted = sort { $counter{ $b } <=> $counter{ $a } } keys( %counter ) ;
      -	#print "@race_sorted\n" ;
      -	$sep_guessed = shift @race_sorted || '/' ; # / when nothing found.
      +	my @race_sorted = sort { $counter{ $b } <=> $counter{ $a } } keys  %counter  ;
      +	#myprint( "@race_sorted\n"  ) ;
      +	$sep_guessed = shift @race_sorted || $LAST_RESSORT_SEPARATOR ; # / when nothing found.
       	return( $sep_guessed ) ;
      -
       }
       
       sub tests_guess_separator {
      -	ok( not( defined( guess_separator(  ) ) ), 'guess_separator: no args' ) ;
      +	ok( '/' eq  guess_separator(  ), 'guess_separator: no args' ) ;
       	ok( '/' eq guess_separator( 'abcd' ), 'guess_separator: abcd' ) ;
       	ok( '/' eq guess_separator( 'a/b/c.d' ), 'guess_separator: a/b/c.d' ) ;
       	ok( '.' eq guess_separator( 'a.b/c.d' ), 'guess_separator: a.b/c.d' ) ;
      -	ok( '\\\\' eq guess_separator( 'a\\\\b\\\\c.c\\\\d/e/f' ), 'guess_separator: a\\\\b\\\\c.c\\\\d/e/f' ) ;	
      -	return(  ) ;
      +	ok( '\\\\' eq guess_separator( 'a\\\\b\\\\c.c\\\\d/e/f' ), 'guess_separator: a\\\\b\\\\c.c\\\\d/e/f' ) ;
      +	return ;
       }
       
      -sub get_separator { 
      +sub get_separator {
       	my( $imap, $sep_in, $sep_opt, $Side, $folders_ref ) = @_ ;
       	my( $sep_out, $sep_guessed ) ;
      -	
      -	( $debug or $sync->{debugfolders} ) and print "$Side: Getting separator\n" ;
      -	$sep_guessed = guess_separator( @$folders_ref ) ;
      -	print "$Side: guessing separator from folder listing: [$sep_guessed]\n" ;
      -	
      -	( $debug or $sync->{debugfolders} ) and print "$Side: calling namespace capability\n" ;
      -	if ( $imap->has_capability( "namespace" ) ) {
      +
      +	( $debug or $sync->{debugfolders} ) and myprint( "$Side: Getting separator\n"  ) ;
      +	$sep_guessed = guess_separator( @{ $folders_ref } ) ;
      +	myprint( "$Side: guessing separator from folder listing: [$sep_guessed]\n"  ) ;
      +
      +	( $debug or $sync->{debugfolders} ) and myprint( "$Side: calling namespace capability\n"  ) ;
      +	if ( $imap->has_capability( 'namespace' ) ) {
       		$sep_out = $imap->separator(  ) ;
      -		if ( defined( $sep_out ) ) {
      -                	print "$Side: separator given by NAMESPACE: [$sep_out]\n" ;
      -                        if ( defined( $sep_in ) ) {
      -                		print "$Side: but using [$sep_in] given by $sep_opt\n" ;
      +		if ( defined  $sep_out  ) {
      +                	myprint( "$Side: separator given by NAMESPACE: [$sep_out]\n"  ) ;
      +                        if ( defined  $sep_in  ) {
      +                		myprint( "$Side: but using [$sep_in] given by $sep_opt\n"  ) ;
                               	$sep_out = $sep_in ;
                               	return( $sep_out ) ;
                               }else{
                               	return( $sep_out ) ;
                               }
       		}else{
      -                	if ( defined( $sep_in ) ) {
      -                        	print "$Side: NAMESPACE request failed but using [$sep_in] given by $sep_opt\n" ;
      +                	if ( defined  $sep_in  ) {
      +                        	myprint( "$Side: NAMESPACE request failed but using [$sep_in] given by $sep_opt\n"  ) ;
                               	$sep_out = $sep_in ;
                               	return( $sep_out ) ;
                               }else{
      -				print 
      -		  		"$Side: NAMESPACE request failed so using guessed separator [$sep_guessed]\n", 
      -                  		help_to_guess_sep( $imap, $sep_opt ) ;
      +				myprint(
      +		  		"$Side: NAMESPACE request failed so using guessed separator [$sep_guessed]\n",
      +                  		help_to_guess_sep( $imap, $sep_opt ) ) ;
       				return( $sep_guessed ) ;
                               }
                       }
       	}
       	else{
      -        	if ( defined( $sep_in ) ) {
      -                	print "$Side: No NAMESPACE capability but using [$sep_in] given by $sep_opt\n" ;
      +        	if ( defined  $sep_in  ) {
      +                	myprint( "$Side: No NAMESPACE capability but using [$sep_in] given by $sep_opt\n"  ) ;
                       	$sep_out = $sep_in ;
                       	return( $sep_out ) ;
                       }else{
      -			print
      -		  	"$Side: No NAMESPACE capability, so using guessed separator [$sep_guessed]\n", 
      -		      	help_to_guess_sep( $imap, $sep_opt ) ;
      +			myprint(
      +		  	"$Side: No NAMESPACE capability, so using guessed separator [$sep_guessed]\n",
      +		      	help_to_guess_sep( $imap, $sep_opt ) ) ;
       			return( $sep_guessed ) ;
                       }
       	}
      -        return(  ) ;
      +        return ;
       }
       
       sub help_to_guess_sep {
       	my( $imap, $sep_opt ) = @_ ;
      -	
      +
       	my $help_to_guess_sep = "You can set the separator character with the $sep_opt option,\n"
       	. "the complete listing of folders may help you to find it\n"
       	. folders_list_to_help( $imap ) ;
      -	
      +
       	return( $help_to_guess_sep ) ;
       }
       
       sub help_to_guess_prefix {
       	my( $imap, $prefix_opt ) = @_ ;
      -		      
      +
       	my $help_to_guess_prefix = "You can set the prefix namespace with the $prefix_opt option,\n"
       	. "the folowing listing of folders may help you to find it:\n"
       	. folders_list_to_help( $imap ) ;
      -	
      +
       	return( $help_to_guess_prefix ) ;
       }
       
      @@ -3846,19 +4225,19 @@ sub folders_list_to_help {
       	my($imap) = @_ ;
       
       	my @folders = $imap->folders ;
      -	my $listing = join('', map { "[$_]\n" } @folders) ;
      +	my $listing = join q{}, map { "[$_]\n" } @folders ;
       	return( $listing ) ;
       }
       
       
       sub tests_separator_invert {
       	$fixslash2 = 0 ;
      -	ok( not( defined( separator_invert(  ) ) ), 'separator_invert: no args' ) ;
      -	ok( not( defined( separator_invert( '' ) ) ), 'separator_invert: not enough args' ) ;
      -	ok( not( defined( separator_invert( '', '' ) ) ), 'separator_invert: not enough args' ) ;
      -	
      -	ok( '' eq separator_invert( '', '', '' ), 'separator_invert: 3 empty strings' ) ;
      -	ok( 'lalala' eq separator_invert( 'lalala', '', '' ), 'separator_invert: empty separator' ) ;
      +	ok( not( defined separator_invert(  )  ), 'separator_invert: no args' ) ;
      +	ok( not( defined separator_invert( q{} ) ), 'separator_invert: not enough args' ) ;
      +	ok( not( defined separator_invert( q{}, q{} ) ), 'separator_invert: not enough args' ) ;
      +
      +	ok( q{} eq separator_invert( q{}, q{}, q{} ), 'separator_invert: 3 empty strings' ) ;
      +	ok( 'lalala' eq separator_invert( 'lalala', q{}, q{} ), 'separator_invert: empty separator' ) ;
       	ok( 'lalala' eq separator_invert( 'lalala', '/', '/' ), 'separator_invert: same separator /' ) ;
       	ok( 'lal/ala' eq separator_invert( 'lal/ala', '/', '/' ), 'separator_invert: same separator / 2' ) ;
       	ok( 'lal.ala' eq separator_invert( 'lal/ala', '/', '.' ), 'separator_invert: separators /.' ) ;
      @@ -3869,41 +4248,41 @@ sub tests_separator_invert {
               $fixslash2 = 1 ;
       	ok( 'l_al.ala' eq separator_invert( 'l.al/ala', '/', '.' ), 'separator_invert: separators /.' ) ;
       
      -	return(  ) ;
      +	return ;
       }
       
       sub separator_invert {
       	my( $h1_fold, $h1_separator, $h2_separator ) = @_ ;
       
      -	return( undef ) if ( not defined( $h1_fold ) or not defined( $h1_separator ) or not defined( $h2_separator ) ) ;
      +	return( undef ) if ( not defined  $h1_fold  or not defined  $h1_separator  or not defined  $h2_separator  ) ;
       	# The separator we hope we'll never encounter: 00000000 == 0x00
      -	my $o_sep="\000" ;
      +	my $o_sep = "\000" ;
       
       	my $h2_fold = $h1_fold ;
      -	$h2_fold =~ s@\Q$h2_separator@$o_sep@xg ;
      -	$h2_fold =~ s@\Q$h1_separator@$h2_separator@xg ;
      -	$h2_fold =~ s@\Q$o_sep@$h1_separator@xg ;
      +	$h2_fold =~ s,\Q$h2_separator,$o_sep,xg ;
      +	$h2_fold =~ s,\Q$h1_separator,$h2_separator,xg ;
      +	$h2_fold =~ s,\Q$o_sep,$h1_separator,xg ;
               $h2_fold =~ s,/,_,xg if( $fixslash2 and '/' ne $h2_separator and '/' eq $h1_separator ) ;
       	return( $h2_fold ) ;
      -} 
      +}
       
       
       sub tests_imap2_folder_name {
       
      -$h1_prefix = $h2_prefix = '';
      +$h1_prefix = $h2_prefix = q{};
       $h1_sep = '/';
       $h2_sep = '.';
       
      -$debug and print <<"EOS"
      +$debug and myprint( <<"EOS"
       prefix1: [$h1_prefix]
       prefix2: [$h2_prefix]
       sep1:[$h1_sep]
       sep2:[$h2_sep]
       EOS
      -;
      +) ;
       
       $fixslash2 = 0 ;
      -ok('' eq imap2_folder_name(''), 'imap2_folder_name: empty string');
      +ok(q{} eq imap2_folder_name(q{}), 'imap2_folder_name: empty string');
       ok('blabla' eq imap2_folder_name('blabla'), 'imap2_folder_name: blabla');
       ok('spam.spam' eq imap2_folder_name('spam/spam'), 'imap2_folder_name: spam/spam');
       ok('spam/spam' eq imap2_folder_name('spam.spam'), 'imap2_folder_name: spam.spam');
      @@ -3916,22 +4295,22 @@ $sync->{f1f2}{ 'auto/auto' } = 'moto x 2' ;
       ok( 'moto x 2' eq imap2_folder_name( 'auto/auto' ), 'imap2_folder_name: auto/auto' ) ;
       
       @regextrans2 = ('s,/,X,g');
      -ok('' eq imap2_folder_name(''), 'imap2_folder_name: empty string [s,/,X,g]');
      +ok(q{} eq imap2_folder_name(q{}), 'imap2_folder_name: empty string [s,/,X,g]');
       ok('blabla' eq imap2_folder_name('blabla'), 'imap2_folder_name: blabla [s,/,X,g]');
       ok('spam.spam' eq imap2_folder_name('spam/spam'), 'imap2_folder_name: spam/spam [s,/,X,g]');
       ok('spamXspam' eq imap2_folder_name('spam.spam'), 'imap2_folder_name: spam.spam [s,/,X,g]');
       ok('spam.spamXspam' eq imap2_folder_name('spam/spam.spam'), 'imap2_folder_name: spam/spam.spam [s,/,X,g]');
       
      -@regextrans2 = ('s, ,_,g');
      +@regextrans2 = ( 's, ,_,g' ) ;
       ok('blabla' eq imap2_folder_name('blabla'), 'imap2_folder_name: blabla [s, ,_,g]');
       ok('bla_bla' eq imap2_folder_name('bla bla'), 'imap2_folder_name: blabla [s, ,_,g]');
       
      -@regextrans2 = ('s,(.*),\U$1,');
      -ok('BLABLA' eq imap2_folder_name('blabla'), 'imap2_folder_name: blabla [s,\U(.*)\E,$1,]');
      +@regextrans2 = ( q{s,(.*),\U$1,} ) ;
      +ok( 'BLABLA' eq imap2_folder_name( 'blabla' ), q{imap2_folder_name: blabla [s,\U(.*)\E,$1,]} ) ;
       
       $fixslash2 = 1 ;
       @regextrans2 = (  ) ;
      -ok('' eq imap2_folder_name(''), 'imap2_folder_name: empty string');
      +ok(q{} eq imap2_folder_name(q{}), 'imap2_folder_name: empty string');
       ok('blabla' eq imap2_folder_name('blabla'), 'imap2_folder_name: blabla');
       ok('spam.spam' eq imap2_folder_name('spam/spam'), 'imap2_folder_name: spam/spam -> spam.spam');
       ok('spam_spam' eq imap2_folder_name('spam.spam'), 'imap2_folder_name: spam.spam -> spam_spam');
      @@ -3940,7 +4319,7 @@ ok('s pam.spam_spa  m' eq imap2_folder_name('s pam/spam.spa  m'), 'imap2_folder_
       
       $h1_sep = '.';
       $h2_sep = '/';
      -ok('' eq imap2_folder_name(''), 'imap2_folder_name: empty string');
      +ok(q{} eq imap2_folder_name(q{}), 'imap2_folder_name: empty string');
       ok('blabla' eq imap2_folder_name('blabla'), 'imap2_folder_name: blabla');
       ok('spam.spam' eq imap2_folder_name('spam/spam'), 'imap2_folder_name: spam/spam -> spam.spam');
       ok('spam/spam' eq imap2_folder_name('spam.spam'), 'imap2_folder_name: spam.spam -> spam/spam');
      @@ -3949,7 +4328,7 @@ ok('spam.spam/spam' eq imap2_folder_name('spam/spam.spam'), 'imap2_folder_name: 
       
       
       $fixslash2 = 0 ;
      -$h1_prefix = ' ';
      +$h1_prefix = q{ };
       
       ok('spam.spam/spam' eq imap2_folder_name('spam/spam.spam'), 'imap2_folder_name: spam/spam.spam -> spam.spam/spam');
       ok('spam.spam/spam' eq imap2_folder_name(' spam/spam.spam'), 'imap2_folder_name:  spam/spam.spam -> spam.spam/spam');
      @@ -3957,15 +4336,15 @@ ok('spam.spam/spam' eq imap2_folder_name(' spam/spam.spam'), 'imap2_folder_name:
       $h1_sep = '.' ;
       $h2_sep = '/' ;
       $h1_prefix = 'INBOX.' ;
      -$h2_prefix = '' ;
      -@regextrans2 = ('s,(.*),\U$1,') ;
      +$h2_prefix = q{} ;
      +@regextrans2 = ( q{s,(.*),\U$1,} ) ;
       ok( 'BLABLA' eq imap2_folder_name( 'blabla' ), 'imap2_folder_name: blabla' ) ;
       ok( 'TEST/TEST/TEST/TEST' eq imap2_folder_name( 'INBOX.TEST.test.Test.tesT' ), 'imap2_folder_name: INBOX.TEST.test.Test.tesT' ) ;
      -@regextrans2 = ( 's,(.*),\L$1,' ) ;
      +@regextrans2 = ( q{s,(.*),\L$1,} ) ;
       ok( 'test/test/test/test' eq imap2_folder_name( 'INBOX.TEST.test.Test.tesT' ), 'imap2_folder_name: INBOX.TEST.test.Test.tesT' ) ;
       
       
      -return(  ) ;
      +return ;
       
       }
       
      @@ -3974,12 +4353,12 @@ sub imap2_folder_name {
       	my ( $h2_fold ) ;
       	if ( $sync->{f1f2}{ $h1_fold } ) {
       		$h2_fold = $sync->{f1f2}{ $h1_fold } ;
      -		( $debug or $sync->{debugfolders} ) and print "f1f2 [$h1_fold] -> [$h2_fold]\n" ;
      +		( $debug or $sync->{debugfolders} ) and myprint( "f1f2 [$h1_fold] -> [$h2_fold]\n"  ) ;
       		return( $h2_fold ) ;
       	}
       	if ( $sync->{f1f2auto}{ $h1_fold } ) {
       		$h2_fold = $sync->{f1f2auto}{ $h1_fold } ;
      -		( $debug or $sync->{debugfolders} ) and print "automap [$h1_fold] -> [$h2_fold]\n" ;
      +		( $debug or $sync->{debugfolders} ) and myprint( "automap [$h1_fold] -> [$h2_fold]\n"  ) ;
       		return( $h2_fold ) ;
       	}
       
      @@ -3994,13 +4373,13 @@ sub prefix_seperator_invertion {
       
       	# first we remove the prefix
       	$h1_fold =~ s/^\Q$h1_prefix\E//x ;
      -	( $debug or $sync->{debugfolders} ) and print "removed host1 prefix: [$h1_fold]\n" ;
      +	( $debug or $sync->{debugfolders} ) and myprint( "removed host1 prefix: [$h1_fold]\n"  ) ;
       	$h2_fold = separator_invert( $h1_fold, $h1_sep, $h2_sep ) ;
      -	( $debug or $sync->{debugfolders} ) and print "inverted  separators: [$h2_fold]\n" ;
      +	( $debug or $sync->{debugfolders} ) and myprint( "inverted  separators: [$h2_fold]\n"  ) ;
       	# Adding the prefix supplied by namespace or the --prefix2 option
      -	$h2_fold = $h2_prefix . $h2_fold 
      -	  unless( ( $h2_prefix eq "INBOX" . $h2_sep ) and ( $h2_fold =~ m/^INBOX$/xi ) ) ;
      -	( $debug or $sync->{debugfolders} ) and print "added   host2 prefix: [$h2_fold]\n" ;
      +	$h2_fold = $h2_prefix . $h2_fold
      +	  unless( ( $h2_prefix eq 'INBOX' . $h2_sep ) and ( $h2_fold =~ m/^INBOX$/xi ) ) ;
      +	( $debug or $sync->{debugfolders} ) and myprint( "added   host2 prefix: [$h2_fold]\n"  ) ;
       	return( $h2_fold ) ;
       }
       
      @@ -4009,9 +4388,9 @@ sub regextrans2 {
       	# Transforming the folder name by the --regextrans2 option(s)
       	foreach my $regextrans2 ( @regextrans2 ) {
       	        my $h2_fold_before = $h2_fold ;
      -		my $ret = eval( "\$h2_fold =~ $regextrans2 ; 1 ") ;
      -		( $debug or $sync->{debugfolders} ) and print "[$h2_fold_before] -> [$h2_fold] using regextrans2 [$regextrans2]\n" ;
      -                if ( not ( defined( $ret ) ) or $@ ) {
      +		my $ret = eval "\$h2_fold =~ $regextrans2 ; 1 " ;
      +		( $debug or $sync->{debugfolders} ) and myprint( "[$h2_fold_before] -> [$h2_fold] using regextrans2 [$regextrans2]\n"  ) ;
      +                if ( not ( defined  $ret  ) or $@ ) {
       			die_clean( "error: eval regextrans2 '$regextrans2': $@\n" ) ;
                       }
       	}
      @@ -4021,9 +4400,9 @@ sub regextrans2 {
       
       sub tests_decompose_regex {
       	ok( 1, 'decompose_regex 1' ) ;
      -	ok( 0 == compare_lists( [ '', '' ], [ decompose_regex( '' ) ] ), 'decompose_regex empty string' ) ;
      +	ok( 0 == compare_lists( [ q{}, q{} ], [ decompose_regex( q{} ) ] ), 'decompose_regex empty string' ) ;
       	ok( 0 == compare_lists( [ '.*', 'lala' ], [ decompose_regex( 's/.*/lala/' ) ] ), 'decompose_regex s/.*/lala/' ) ;
      -	return(  ) ;
      +	return ;
       }
       
       sub decompose_regex {
      @@ -4031,7 +4410,7 @@ sub decompose_regex {
       	my( $left_part, $right_part ) ;
       
       	( $left_part, $right_part ) = $regex =~ m{^s/((?:[^/]|\\/)+)/((?:[^/]|\\/)+)/}x;
      -        return( '', '' ) if not $left_part ;
      +        return( q{}, q{} ) if not $left_part ;
       	return( $left_part, $right_part ) ;
       }
       
      @@ -4042,70 +4421,78 @@ sub foldersizes {
       	my $total_size = 0 ;
       	my $total_nb = 0 ;
       	my $biggest_in_all = 0 ;
      -	
      -	my $nb_folders = scalar( @folders ) ;
      +
      +	my $nb_folders = scalar  @folders  ;
       	my $ct_folders = 0 ; # folder counter.
      -	print "++++ Calculating sizes of $nb_folders folders on $side\n" ;
      +	myprint( "++++ Calculating sizes of $nb_folders folders on $side\n"  ) ;
       	foreach my $folder ( @folders )     {
       		my $stot = 0 ;
       		my $nb_msgs = 0 ;
       		$ct_folders++ ;
      -		printf( "$side folder %7s %-35s", "$ct_folders/$nb_folders", jux_utf8( $folder ) ) ;
      -                if ( 'Host2' eq $side and not exists( $h2_folders_all_UPPER{ uc( $folder ) } ) ) {
      -		        print(" does not exist yet\n") ;
      +		myprintf( "$side folder %7s %-35s", "$ct_folders/$nb_folders", jux_utf8( $folder ) ) ;
      +                if ( 'Host2' eq $side and not exists  $h2_folders_all_UPPER{ uc  $folder  }  ) {
      +		        myprint( " does not exist yet\n") ;
       			next ;
       		}
      -                if ( 'Host1' eq $side and not exists( $h1_folders_all{ $folder } ) ) {
      -		        print( " does not exist\n" ) ;
      +                if ( 'Host1' eq $side and not exists  $h1_folders_all{ $folder }  ) {
      +		        myprint( " does not exist\n" ) ;
       			next ;
       		}
      -                
      -		last if $imap->IsUnconnected(  ) ;                
      +
      +		last if $imap->IsUnconnected(  ) ;
       		# FTGate is RFC buggy with EXAMINE it does not act as SELECT
       		#unless ( $imap->examine( $folder ) ) {
       		unless ( $imap->select( $folder ) ) {
      -			my $error = join( '', 
      +			my $error = join q{},
       				"$side Folder $folder: Could not select: ",
      -				$imap->LastError,  "\n" ) ;
      -			errors_incr( $error ) ;
      +				$imap->LastError,  "\n"  ;
      +			errors_incr( $sync, $error ) ;
       			next ;
       		}
       		last if $imap->IsUnconnected(  ) ;
       
       		my $hash_ref = { } ;
       		my @msgs = select_msgs( $imap, undef, $search_cmd, $folder ) ;
      -		$nb_msgs = scalar( @msgs ) ;
      +		$nb_msgs = scalar  @msgs  ;
       		my $biggest_in_folder = 0 ;
      -		@$hash_ref{ @msgs } = ( undef ) if @msgs ;
      +		@{ $hash_ref }{ @msgs } = ( undef ) if @msgs ;
       
       		last if $imap->IsUnconnected(  ) ;
       		if ( $nb_msgs > 0 and @msgs ) {
                       	if ( $abletosearch ) {
      -				$imap->fetch_hash( \@msgs, "RFC822.SIZE", $hash_ref) or die_clean("$@" ) ;
      +				if ( ! $imap->fetch_hash( \@msgs, 'RFC822.SIZE', $hash_ref) ) {
      +                                        my $error = "$side failure with fetch_hash: $@" ;
      +                                        errors_incr( $sync, $error ) ;
      +                                        return ;
      +                                }
                               }else{
       				my $uidnext = $imap->uidnext( $folder ) || $uidnext_default ;
       				my $fetch_hash_uids = $fetch_hash_set || "1:$uidnext" ;
      -				$imap->fetch_hash( $fetch_hash_uids, "RFC822.SIZE", $hash_ref ) or die_clean( "$@" ) ;
      +				if ( ! $imap->fetch_hash( $fetch_hash_uids, 'RFC822.SIZE', $hash_ref ) ) {
      +                                        my $error = "$side failure with fetch_hash: $@" ;
      +                                        errors_incr( $sync, $error ) ;
      +                                        return ;
      +                                }
                               }
      -			for ( keys %$hash_ref ) {
      -                        	my $size =  $hash_ref->{ $_ }->{ "RFC822.SIZE" } ;
      +			for ( keys %{ $hash_ref } ) {
      +                        	my $size =  $hash_ref->{ $_ }->{ 'RFC822.SIZE' } ;
                               	$stot    += $size ;
                                       $biggest_in_folder =  max( $biggest_in_folder, $size ) ;
                               }
       		}
      -		
      -		printf( " Size: %9s", $stot ) ;
      -		printf( " Messages: %5s", $nb_msgs ) ;
      -		printf( " Biggest: %9s\n", $biggest_in_folder ) ;
      +
      +		myprintf( ' Size: %9s', $stot ) ;
      +		myprintf( ' Messages: %5s', $nb_msgs ) ;
      +		myprintf( " Biggest: %9s\n", $biggest_in_folder ) ;
       		$total_size += $stot ;
       		$total_nb += $nb_msgs ;
                       $biggest_in_all =  max( $biggest_in_all, $biggest_in_folder ) ;
       	}
      -	printf ( "%s Nb folders:      %11s folders\n",    $side, $nb_folders ) ;
      -	printf ( "%s Nb messages:     %11s messages\n",   $side, $total_nb ) ;
      -	printf ( "%s Total size:      %11s bytes (%s)\n", $side, $total_size, bytes_display_string( $total_size ) ) ;
      -	printf ( "%s Biggest message: %11s bytes (%s)\n", $side, $biggest_in_all, bytes_display_string( $biggest_in_all ) ) ;
      -	printf ( "%s Time spent:      %11.1f seconds\n",  $side, timenext(  ) ) ;
      +	myprintf( "%s Nb folders:      %11s folders\n",    $side, $nb_folders ) ;
      +	myprintf( "%s Nb messages:     %11s messages\n",   $side, $total_nb ) ;
      +	myprintf( "%s Total size:      %11s bytes (%s)\n", $side, $total_size, bytes_display_string( $total_size ) ) ;
      +	myprintf( "%s Biggest message: %11s bytes (%s)\n", $side, $biggest_in_all, bytes_display_string( $biggest_in_all ) ) ;
      +	myprintf( "%s Time spent:      %11.1f seconds\n",  $side, timenext(  ) ) ;
               return( $total_nb, $total_size ) ;
       }
       
      @@ -4130,119 +4517,119 @@ sub timesince {
       
       
       sub tests_flags_regex {
      -	
      -	
      -	ok('' eq flags_regex(''), "flags_regex, null string ''");
      -	ok('\Seen NonJunk $Spam' eq flags_regex('\Seen NonJunk $Spam'), 'flags_regex, nothing to do');
      +
      +	ok( q{} eq flags_regex(q{} ), 'flags_regex, null string q{}' ) ;
      +	ok( q'\Seen NonJunk $Spam' eq flags_regex( q'\Seen NonJunk $Spam' ), 'flags_regex, nothing to do');
       
       	@regexflag = ('I am BAD' ) ;
      -        ok( not ( defined( flags_regex( '' ) ) ), 'flags_regex, bad regex' ) ;
      -        
      -	@regexflag = ('s/NonJunk//g');
      -	ok('\Seen  $Spam' eq flags_regex('\Seen NonJunk $Spam'), "flags_regex, remove NonJunk: 's/NonJunk//g'");
      -	@regexflag = ('s/\$Spam//g');
      -	ok('\Seen NonJunk ' eq flags_regex('\Seen NonJunk $Spam'), 'flags_regex, remove $Spam: '."'s/\$Spam//g'");
      -	
      -	@regexflag = ('s/\\\\Seen//g');
      -	
      -	ok(' NonJunk $Spam' eq flags_regex('\Seen NonJunk $Spam'), 'flags_regex, remove \Seen: '. "'s/\\\\\\\\Seen//g'");
      -	
      -	@regexflag = ('s/(\s|^)[^\\\\]\w+//g');
      -	ok('\Seen \Middle \End' eq flags_regex('\Seen NonJunk \Middle $Spam \End'), 'flags_regex, only \word [' . flags_regex('\Seen NonJunk \Middle $Spam \End'.']'));
      -	ok(' \Seen \Middle \End1' eq flags_regex('Begin \Seen NonJunk \Middle $Spam \End1 End'), 'flags_regex, only \word [' . flags_regex('Begin \Seen NonJunk \Middle $Spam \End1 End'.']'));
      -
      -	@regexflag = ('s/.*?(Keep1|Keep2|Keep3)/$1 /g');
      -	ok('Keep1 Keep2  ReB' eq flags_regex('ReA Keep1 REM Keep2 ReB'), "Keep only regex");
      -	#ok('Keep1 Keep2' eq flags_regex('Keep1 Keep2 Remove1'), "Keep only regex");
      -	ok('Keep1 Keep2 ' eq flags_regex('REM REM Keep1 Keep2'), "Keep only regex");
      -	ok('Keep1 Keep2 ' eq flags_regex('Keep1 REM REM Keep2'), "Keep only regex");
      -	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 REM REM  Keep2'), "Keep only regex");
      -	ok('Keep1 Keep2 ' eq flags_regex('Keep1 Keep2'), "Keep only regex");
      -	ok('Keep1 ' eq flags_regex('REM Keep1'), "Keep only regex");
      -
      -	@regexflag = ('s/(Keep1|Keep2|Keep3) (?!(Keep1|Keep2|Keep3)).*/$1 /g');
      -	ok('Keep1 Keep2 ' eq flags_regex('Keep1 Keep2 ReB'), "Keep only regex");
      -	ok('Keep1 Keep2 ' eq flags_regex('Keep1 Keep2 REM REM  REM'), "Keep only regex");
      -	ok('Keep2 ' eq flags_regex('Keep2 REM REM  REM'), "Keep only regex");
      -	#ok('' eq flags_regex('REM REM'), "Keep only regex");
      +        ok( not ( defined flags_regex( q{} ) ), 'flags_regex, bad regex' ) ;
      +
      +	@regexflag = ( 's/NonJunk//g' ) ;
      +	ok( q'\Seen  $Spam' eq flags_regex( q'\Seen NonJunk $Spam' ), q{flags_regex, remove NonJunk: 's/NonJunk//g'} ) ;
      +	@regexflag = ( q's/\$Spam//g' ) ;
      +	ok( '\Seen NonJunk ' eq flags_regex( q'\Seen NonJunk $Spam' ), q{flags_regex, remove $Spam: 's/\$Spam//g'} ) ;
      +
      +	@regexflag = ( 's/\\\\Seen//g' ) ;
      +
      +	ok( q' NonJunk $Spam' eq flags_regex( q'\Seen NonJunk $Spam' ), q{flags_regex, remove \Seen: 's/\\\\\\\\Seen//g'} ) ;
      +
      +	@regexflag = ( 's/(\s|^)[^\\\\]\w+//g' ) ;
      +	ok( '\Seen \Middle \End'   eq flags_regex( q'\Seen NonJunk \Middle $Spam \End' ), q{flags_regex: only \word among \Seen NonJunk \Middle $Spam \End} ) ;
      +	ok( ' \Seen \Middle \End1' eq flags_regex( q'Begin \Seen NonJunk \Middle $Spam \End1 End' ), 
      +                     q'flags_regex: only \word among Begin \Seen NonJunk \Middle $Spam \End1 End' ) ;
      +
      +	@regexflag = ( q's/.*?(Keep1|Keep2|Keep3)/$1 /g' ) ;
      +	ok('Keep1 Keep2  ReB' eq flags_regex('ReA Keep1 REM Keep2 ReB'), 'Keep only regex' ) ;
       	
      -	@regexflag = ('s/.*?(Keep1|Keep2|Keep3)/$1 /g', 
      -	's/(Keep1|Keep2|Keep3) (?!(Keep1|Keep2|Keep3)).*/$1 /g');
      -	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 REM Keep2 REM'), "Keep only regex");
      -	ok('Keep1 Keep2 ' eq flags_regex('Keep1 REM Keep2 REM'), "Keep only regex");
      -	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 Keep2 REM'), "Keep only regex");
      -	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 REM Keep2'), "Keep only regex");
      -	ok('Keep1 Keep2 Keep3 ' eq flags_regex('REM Keep1 REM Keep2 REM REM Keep3 REM'), "Keep only regex");
      -	ok('Keep1 ' eq flags_regex('REM  REM Keep1 REM REM REM '), "Keep only regex");
      -	ok('Keep1 Keep3 ' eq flags_regex('RE1 Keep1 RE2 Keep3 RE3 RE4 RE5 '), "Keep only regex");
      +	ok('Keep1 Keep2 ' eq flags_regex( 'REM REM Keep1 Keep2'), 'Keep only regex' ) ;
      +	ok('Keep1 Keep2 ' eq flags_regex( 'Keep1 REM REM Keep2'), 'Keep only regex' ) ;
      +	ok('Keep1 Keep2 ' eq flags_regex( 'REM Keep1 REM REM  Keep2'), 'Keep only regex' ) ;
      +	ok('Keep1 Keep2 ' eq flags_regex( 'Keep1 Keep2'), 'Keep only regex' ) ;
      +	ok('Keep1 ' eq flags_regex( 'REM Keep1'), 'Keep only regex' ) ;
      +
      +	@regexflag = ( q's/(Keep1|Keep2|Keep3) (?!(Keep1|Keep2|Keep3)).*/$1 /g' ) ;
      +	ok('Keep1 Keep2 ' eq flags_regex( 'Keep1 Keep2 ReB'), 'Keep only regex' ) ;
      +	ok('Keep1 Keep2 ' eq flags_regex( 'Keep1 Keep2 REM REM  REM'), 'Keep only regex' ) ;
      +	ok('Keep2 ' eq flags_regex('Keep2 REM REM  REM'), 'Keep only regex' ) ;
       	
      +
      +	@regexflag = ( q's/.*?(Keep1|Keep2|Keep3)/$1 /g',
      +	   's/(Keep1|Keep2|Keep3) (?!(Keep1|Keep2|Keep3)).*/$1 /g');
      +	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 REM Keep2 REM'), 'Keep only regex');
      +	ok('Keep1 Keep2 ' eq flags_regex('Keep1 REM Keep2 REM'), 'Keep only regex');
      +	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 Keep2 REM'), 'Keep only regex');
      +	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 REM Keep2'), 'Keep only regex');
      +	ok('Keep1 Keep2 Keep3 ' eq flags_regex('REM Keep1 REM Keep2 REM REM Keep3 REM'), 'Keep only regex');
      +	ok('Keep1 ' eq flags_regex('REM  REM Keep1 REM REM REM '), 'Keep only regex');
      +	ok('Keep1 Keep3 ' eq flags_regex('RE1 Keep1 RE2 Keep3 RE3 RE4 RE5 '), 'Keep only regex');
      +
       	@regexflag = ('s/(.*)/$1 jrdH8u/');
      -	ok('REM  REM  REM REM REM jrdH8u' eq flags_regex('REM  REM  REM REM REM'), "Keep only regex 's/(.*)/\$1 jrdH8u/'") ;
      +	ok('REM  REM  REM REM REM jrdH8u' eq flags_regex('REM  REM  REM REM REM'), q{Keep only regex 's/(.*)/\$1 jrdH8u/'} ) ;
       	@regexflag = ('s/jrdH8u *//');
      -	ok('REM  REM  REM REM REM ' eq flags_regex('REM  REM  REM REM REM jrdH8u'), "Keep only regex s/jrdH8u *//") ;
      -	
      +	ok('REM  REM  REM REM REM ' eq flags_regex('REM  REM  REM REM REM jrdH8u'), q{Keep only regex s/jrdH8u *//} ) ;
      +
       	@regexflag = (
       	's/(.*)/$1 jrdH8u/',
      -	's/.*?(Keep1|Keep2|Keep3|jrdH8u)/$1 /g', 
      +	's/.*?(Keep1|Keep2|Keep3|jrdH8u)/$1 /g',
       	's/(Keep1|Keep2|Keep3|jrdH8u) (?!(Keep1|Keep2|Keep3|jrdH8u)).*/$1 /g',
       	's/jrdH8u *//'
       	);
      -	
      -	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 REM Keep2 REM'), "Keep only regex 'REM Keep1 REM Keep2 REM'");
      -	ok('Keep1 Keep2 ' eq flags_regex('Keep1 REM Keep2 REM'), "Keep only regex");
      -	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 Keep2 REM'), "Keep only regex");
      -	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 REM Keep2'), "Keep only regex");
      -	ok('Keep1 Keep2 Keep3 ' eq flags_regex('REM Keep1 REM Keep2 REM REM Keep3 REM'), "Keep only regex");
      -	ok('Keep1 ' eq flags_regex('REM  REM Keep1 REM REM REM '), "Keep only regex");
      -	ok('Keep1 Keep3 ' eq flags_regex('RE1 Keep1 RE2 Keep3 RE3 RE4 RE5 '), "Keep only regex");
      -	ok('' eq flags_regex('REM  REM REM REM REM'), "Keep only regex");
      -	
      +
      +	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 REM Keep2 REM'), q{Keep only regex 'REM Keep1 REM Keep2 REM'} ) ;
      +	ok('Keep1 Keep2 ' eq flags_regex('Keep1 REM Keep2 REM'), 'Keep only regex');
      +	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 Keep2 REM'), 'Keep only regex');
      +	ok('Keep1 Keep2 ' eq flags_regex('REM Keep1 REM Keep2'), 'Keep only regex');
      +	ok('Keep1 Keep2 Keep3 ' eq flags_regex('REM Keep1 REM Keep2 REM REM Keep3 REM'), 'Keep only regex');
      +	ok('Keep1 ' eq flags_regex('REM  REM Keep1 REM REM REM '), 'Keep only regex');
      +	ok('Keep1 Keep3 ' eq flags_regex('RE1 Keep1 RE2 Keep3 RE3 RE4 RE5 '), 'Keep only regex');
      +	ok(q{} eq flags_regex('REM  REM REM REM REM'), 'Keep only regex');
      +
       	@regexflag = (
       	's/(.*)/$1 jrdH8u/',
      -	's/.*?(\\\\Seen|\\\\Answered|\\\\Flagged|\\\\Deleted|\\\\Draft|jrdH8u)/$1 /g', 
      +	's/.*?(\\\\Seen|\\\\Answered|\\\\Flagged|\\\\Deleted|\\\\Draft|jrdH8u)/$1 /g',
       	's/(\\\\Seen|\\\\Answered|\\\\Flagged|\\\\Deleted|\\\\Draft|jrdH8u) (?!(\\\\Seen|\\\\Answered|\\\\Flagged|\\\\Deleted|\\\\Draft|jrdH8u)).*/$1 /g',
       	's/jrdH8u *//'
       	);
      -	
      -	ok('\\Deleted \\Answered ' 
      -	eq flags_regex('Blabla $Junk \\Deleted machin \\Answered truc'), "Keep only regex: Exchange case");
      -	ok('' eq flags_regex(''), "Keep only regex: Exchange case, null string");
      -	ok('' 
      -	eq flags_regex('Blabla $Junk  machin  truc'), "Keep only regex: Exchange case, no accepted flags ");
      -	ok('\\Deleted \\Answered \\Draft \\Flagged ' 
      -	eq flags_regex('\\Deleted    \\Answered  \\Draft \\Flagged '), "Keep only regex: Exchange case");
      -	
      -	
      +
      +	ok('\\Deleted \\Answered '
      +	    eq flags_regex('Blabla $Junk \\Deleted machin \\Answered truc'), 'Keep only regex: Exchange case' ) ;
      +	ok( q{} eq flags_regex( q{} ), 'Keep only regex: Exchange case, null string' ) ;
      +	ok( q{}
      +	   eq flags_regex('Blabla $Junk  machin  truc'), 'Keep only regex: Exchange case, no accepted flags' ) ;
      +	ok( '\\Deleted \\Answered \\Draft \\Flagged '
      +	    eq flags_regex('\\Deleted    \\Answered  \\Draft \\Flagged '), 'Keep only regex: Exchange case' ) ;
      +
      +
       	@regexflag = (
       	's/.*?(?:(\\\\(?:Answered|Flagged|Deleted|Seen|Draft)\s?)|$)/defined($1)?$1:q()/eg'
       	);
      -	
      -	ok('\\Deleted \\Answered ' 
      -	eq flags_regex('Blabla \$Junk \\Deleted machin \\Answered truc'), 
      -	"Keep only regex: Exchange case (Phil)");
      -	
      -	ok('' eq flags_regex(''), "Keep only regex: Exchange case, null string (Phil)");
      -	
      -	ok('' 
      -	eq flags_regex('Blabla $Junk  machin  truc'), 
      -	"Keep only regex: Exchange case, no accepted flags (Phil)");
      -	
      -	ok('\\Deleted \\Answered \\Draft \\Flagged ' 
      -	eq flags_regex('\\Deleted    \\Answered  \\Draft \\Flagged '), 
      -	"Keep only regex: Exchange case (Phil)");
      -	
      -	return(  ) ;
      +
      +	ok( '\\Deleted \\Answered '
      +	eq flags_regex('Blabla \$Junk \\Deleted machin \\Answered truc'),
      +	'Keep only regex: Exchange case (Phil)' ) ;
      +
      +	ok( q{} eq flags_regex( q{} ), 'Keep only regex: Exchange case, null string (Phil)' ) ;
      +
      +	ok( q{}
      +	eq flags_regex('Blabla $Junk  machin  truc'),
      +	'Keep only regex: Exchange case, no accepted flags (Phil)' ) ;
      +
      +	ok('\\Deleted \\Answered \\Draft \\Flagged '
      +	eq flags_regex('\\Deleted    \\Answered  \\Draft \\Flagged '),
      +	'Keep only regex: Exchange case (Phil)' ) ;
      +
      +	return ;
       }
       
       sub flags_regex {
       	my ( $h1_flags ) = @_ ;
       	foreach my $regexflag ( @regexflag ) {
       		my $h1_flags_orig = $h1_flags ;
      -		$debugflags and print "eval \$h1_flags =~ $regexflag\n" ;
      -		my $ret = eval( "\$h1_flags =~ $regexflag ; 1 " ) ;
      -		$debugflags and print "regexflag $regexflag [$h1_flags_orig] -> [$h1_flags]\n" ;
      +		$debugflags and myprint( "eval \$h1_flags =~ $regexflag\n"  ) ;
      +		my $ret = eval "\$h1_flags =~ $regexflag ; 1 " ;
      +		$debugflags and myprint( "regexflag $regexflag [$h1_flags_orig] -> [$h1_flags]\n"  ) ;
                       if( not ( defined $ret ) or $@ ) {
      -			print "Error: eval regexflag '$regexflag': $@\n" ;
      +			myprint( "Error: eval regexflag '$regexflag': $@\n"  ) ;
                               return( undef ) ;
                       }
       	}
      @@ -4253,41 +4640,41 @@ sub acls_sync {
       	my($h1_fold, $h2_fold) = @_ ;
       	if ( $syncacls ) {
       		my $h1_hash = $imap1->getacl($h1_fold)
      -		  or print "Could not getacl for $h1_fold: $@\n";
      +		  or myprint( "Could not getacl for $h1_fold: $@\n" ) ;
       		my $h2_hash = $imap2->getacl($h2_fold)
      -		  or print "Could not getacl for $h2_fold: $@\n";
      -		my %users = map({ ($_, 1) } (keys(%$h1_hash), keys(%$h2_hash)));
      -		foreach my $user (sort(keys(%users))) {
      -			my $acl = $h1_hash->{$user} || "none";
      -			print "acl $user: [$acl]\n";
      +		  or myprint( "Could not getacl for $h2_fold: $@\n" ) ;
      +		my %users = map { ($_, 1) } ( keys  %{ $h1_hash} , keys %{ $h2_hash }  ) ;
      +		foreach my $user (sort keys %users ) {
      +			my $acl = $h1_hash->{$user} || 'none' ;
      +			myprint( "acl $user: [$acl]\n" ) ;
       			next if ($h1_hash->{$user} && $h2_hash->{$user} &&
       				 $h1_hash->{$user} eq $h2_hash->{$user});
       			unless ($dry) {
      -				print "setting acl $h2_fold $user $acl\n";
      +				myprint( "setting acl $h2_fold $user $acl\n" ) ;
       				$imap2->setacl($h2_fold, $user, $acl)
      -				  or print "Could not set acl: $@\n";
      +				  or myprint( "Could not set acl: $@\n" ) ;
       			}
       		}
       	}
      -        return(  ) ;
      +        return ;
       }
       
       
       sub tests_permanentflags {
      -	
      +
       	my $string;
      -	ok('' eq permanentflags(' * OK [PERMANENTFLAGS (\* \Draft \Answered)] Limited'), 
      +	ok(q{} eq permanentflags(' * OK [PERMANENTFLAGS (\* \Draft \Answered)] Limited'),
       	   'permanentflags \*');
      -	ok('\Draft \Answered' eq permanentflags(' * OK [PERMANENTFLAGS (\Draft \Answered)] Limited'), 
      +	ok('\Draft \Answered' eq permanentflags(' * OK [PERMANENTFLAGS (\Draft \Answered)] Limited'),
       	   'permanentflags \Draft \Answered');
      -	ok('\Draft \Answered' 
      -	   eq permanentflags('Blabla', 
      +	ok('\Draft \Answered'
      +	   eq permanentflags('Blabla',
       	                     ' * OK [PERMANENTFLAGS (\Draft \Answered)] Limited',
       			     'Blabla'),
       	   'permanentflags \Draft \Answered'
       	);
      -	ok('' eq permanentflags('Blabla'), 'permanentflags nothing');
      -        return(  ) ;
      +	ok(q{} eq permanentflags('Blabla'), 'permanentflags nothing');
      +        return ;
       }
       
       sub permanentflags {
      @@ -4295,64 +4682,64 @@ sub permanentflags {
       
       	foreach my $line (@lines) {
       		if ( $line =~ m{\[PERMANENTFLAGS\s\(([^)]+?)\)\]}x ) {
      -			( $debugflags or $debug ) and print "permanentflags: $line" ;
      +			( $debugflags or $debug ) and myprint( "permanentflags: $line"  ) ;
       			my $permanentflags = $1 ;
       			if ( $permanentflags =~ m{\\\*}x ) {
      -				$permanentflags = '' ;
      +				$permanentflags = q{} ;
       			}
       			return($permanentflags) ;
       		} ;
       	}
      -        return( '' ) ;
      +        return( q{} ) ;
       }
       
       sub tests_flags_filter {
       
       	ok( '\Seen' eq flags_filter('\Seen', '\Draft \Seen \Answered'), 'flags_filter ' );
      -	ok( '' eq flags_filter('\Seen', '\Draft  \Answered'), 'flags_filter ' );
      +	ok( q{} eq flags_filter('\Seen', '\Draft  \Answered'), 'flags_filter ' );
       	ok( '\Seen' eq flags_filter('\Seen', '\Seen'), 'flags_filter ' );
       	ok( '\Seen' eq flags_filter('\Seen', ' \Seen '), 'flags_filter ' );
      -	ok( '\Seen \Draft' 
      +	ok( '\Seen \Draft'
       	   eq flags_filter('\Seen \Draft', '\Draft \Seen \Answered'), 'flags_filter ' );
      -	ok( '\Seen \Draft' 
      +	ok( '\Seen \Draft'
       	   eq flags_filter('\Seen \Draft', ' \Draft \Seen \Answered '), 'flags_filter ' );
      -        return(  ) ;
      +        return ;
       }
       
       sub flags_filter {
       	my( $flags, $allowed_flags ) = @_ ;
      -	
      -	my @flags = split( /\s+/x, $flags ) ;
      -	my %allowed_flags = map { $_ => 1 } split(' ', $allowed_flags ) ;
      +
      +	my @flags = split  /\s+/x, $flags ;
      +	my %allowed_flags = map { $_ => 1 } split q{ }, $allowed_flags ;
       	my @flags_out     = map { exists $allowed_flags{$_} ? $_ : () } @flags ;
       
      -	my $flags_out = join( ' ', @flags_out ) ;
      -	#print "%%%$flags_out%%%\n" ;
      +	my $flags_out = join q{ }, @flags_out ;
      +
       	return( $flags_out ) ;
       }
       
      -sub flagsCase {
      +sub flagscase {
       	my $flags = shift ;
      -	
      -	my @flags = split( /\s+/x, $flags );
      -	my %rfc_flags = map { $_ => 1 } split(' ', '\Answered \Flagged \Deleted \Seen \Draft' );
      -	my @flags_out = map { exists $rfc_flags{ ucsecond( lc( $_ ) ) } ? ucsecond( lc( $_ ) ) : $_ } @flags ;
       
      -	my $flags_out = join( ' ', @flags_out ) ;
      -	#print "%%%$flags_out%%%\n" ;
      +	my @flags = split /\s+/x, $flags ;
      +	my %rfc_flags = map { $_ => 1 } split q{ }, '\Answered \Flagged \Deleted \Seen \Draft' ;
      +	my @flags_out = map { exists $rfc_flags{ ucsecond( lc $_ ) } ? ucsecond( lc $_ ) : $_ } @flags ;
      +
      +	my $flags_out = join q{ }, @flags_out ;
      +
       	return( $flags_out ) ;
       }
       
      -sub tests_flagsCase {
      -	ok( '\Seen' eq flagsCase( '\Seen' ), 'flagsCase: \Seen -> \Seen' ) ;
      -	ok( '\Seen' eq flagsCase( '\SEEN' ), 'flagsCase: \SEEN -> \Seen' ) ;
      +sub tests_flagscase {
      +	ok( '\Seen' eq flagscase( '\Seen' ), 'flagscase: \Seen -> \Seen' ) ;
      +	ok( '\Seen' eq flagscase( '\SEEN' ), 'flagscase: \SEEN -> \Seen' ) ;
       
      -	ok( '\Seen \Draft' eq flagsCase( '\SEEN \DRAFT' ), 'flagsCase: \SEEN \DRAFT -> \Seen \Draft' ) ;
      -	ok( '\Draft \Seen' eq flagsCase( '\DRAFT \SEEN' ), 'flagsCase: \DRAFT \SEEN -> \Draft \Seen' ) ;
      -	
      -	ok( '\Draft LALA \Seen' eq flagsCase( '\DRAFT  LALA \SEEN' ), 'flagsCase: \DRAFT  LALA \SEEN -> \Draft LALA \Seen' ) ;
      -	ok( '\Draft lala \Seen' eq flagsCase( '\DRAFT  lala \SEEN' ), 'flagsCase: \DRAFT  lala \SEEN -> \Draft lala \Seen' ) ;
      -        return(  ) ;
      +	ok( '\Seen \Draft' eq flagscase( '\SEEN \DRAFT' ), 'flagscase: \SEEN \DRAFT -> \Seen \Draft' ) ;
      +	ok( '\Draft \Seen' eq flagscase( '\DRAFT \SEEN' ), 'flagscase: \DRAFT \SEEN -> \Draft \Seen' ) ;
      +
      +	ok( '\Draft LALA \Seen' eq flagscase( '\DRAFT  LALA \SEEN' ), 'flagscase: \DRAFT  LALA \SEEN -> \Draft LALA \Seen' ) ;
      +	ok( '\Draft lala \Seen' eq flagscase( '\DRAFT  lala \SEEN' ), 'flagscase: \DRAFT  lala \SEEN -> \Draft lala \Seen' ) ;
      +        return ;
       }
       
       
      @@ -4360,11 +4747,11 @@ sub tests_flagsCase {
       sub ucsecond {
       	my $string = shift ;
       	my $output ;
      +
      +	return( $string )  if ( 1 >= length $string ) ;
       	
      -	return( $string )  if ( 1 >= length( $string ) ) ;
      -	$output = substr( $string, 0, 1) . uc( substr( $string, 1, 1 ) ) if ( 2 == length( $string ) ) ;
      -	$output = substr( $string, 0, 1) . uc( substr( $string, 1, 1 ) ) . substr( $string, 2 );
      -	#print "UUU $string -> $output\n" ;
      +	$output = ( substr( $string, 0, 1) ) . ( uc substr $string, 1, 1 ) . ( substr $string, 2 ) ;
      +	#myprint( "UUU $string -> $output\n"  ) ;
       	return( $output ) ;
       }
       
      @@ -4378,7 +4765,7 @@ sub tests_ucsecond {
       	ok( 'AB'    eq ucsecond( 'Ab' ),    'ucsecond: Ab -> AB' ) ;
       	ok( '\B'    eq ucsecond( '\b' ),    'ucsecond: \b -> \B' ) ;
       	ok( '\Bcde' eq ucsecond( '\bcde' ), 'ucsecond: \bcde -> \Bcde' ) ;
      -        return(  ) ;
      +        return ;
       }
       
       
      @@ -4386,7 +4773,7 @@ sub select_msgs {
       	my ( $imap, $msgs_all_hash_ref, $search_cmd, $folder ) = @_ ;
       	my ( @msgs ) ;
       
      -	if ( $abletosearch ) { 
      +	if ( $abletosearch ) {
       		@msgs = select_msgs_by_search( $imap, $msgs_all_hash_ref, $search_cmd, $folder ) ;
       	}else{
       		@msgs = select_msgs_by_fetch( $imap, $msgs_all_hash_ref, $search_cmd, $folder ) ;
      @@ -4398,31 +4785,31 @@ sub select_msgs {
       sub select_msgs_by_search {
       	my ( $imap, $msgs_all_hash_ref, $search_cmd, $folder ) = @_ ;
       	my ( @msgs, @msgs_all ) ;
      -	
      +
               # Need to have the whole list in msgs_all_hash_ref
               # without calling messages() several times.
      -        # Need all messages list to avoid deleting useful cache part 
      +        # Need all messages list to avoid deleting useful cache part
               # in case of --search or --minage or --maxage
       
      -	if ( ( defined( $msgs_all_hash_ref ) and $usecache )
      -        or ( not defined( $maxage ) and not defined( $minage ) and not defined( $search_cmd ) )
      +	if ( ( defined  $msgs_all_hash_ref  and $usecache )
      +        or ( not defined  $maxage  and not defined  $minage  and not defined  $search_cmd  )
               ) {
       
      -       		$debugdev and print "Calling messages()\n" ;
      -		@msgs_all = $imap->messages() ;
      +       		$debugdev and myprint( "Calling messages()\n"  ) ;
      +		@msgs_all = $imap->messages(  ) ;
       
      -                return if ( $#msgs_all == 0 && !defined( $msgs_all[0] ) ) ;
      -                
      -                if ( defined( $msgs_all_hash_ref ) ) {
      +                return if ( $#msgs_all == 0 && !defined  $msgs_all[0]  ) ;
      +
      +                if ( defined  $msgs_all_hash_ref  ) {
                               @{ $msgs_all_hash_ref }{ @msgs_all } =  () ;
                       }
                       # return all messages
      -                if ( not defined( $maxage ) and not defined( $minage ) and not defined( $search_cmd ) ) {
      +                if ( not defined  $maxage  and not defined  $minage  and not defined  $search_cmd  ) {
                               return( @msgs_all ) ;
                       }
       	}
      -        
      -        if ( defined( $search_cmd ) ) {
      +
      +        if ( defined  $search_cmd  ) {
               	@msgs = $imap->search( $search_cmd ) ;
                       return( @msgs ) ;
               }
      @@ -4436,49 +4823,49 @@ sub select_msgs_by_search {
       sub select_msgs_by_fetch {
       	my ( $imap, $msgs_all_hash_ref, $search_cmd, $folder ) = @_ ;
       	my ( @msgs, @msgs_all, %fetch ) ;
      -	
      +
               # Need to have the whole list in msgs_all_hash_ref
               # without calling messages() several times.
      -        # Need all messages list to avoid deleting useful cache part 
      +        # Need all messages list to avoid deleting useful cache part
               # in case of --search or --minage or --maxage
       
       
      -	$debugdev and print "Calling fetch_hash()\n" ;
      +	$debugdev and myprint( "Calling fetch_hash()\n"  ) ;
       	my $uidnext = $imap->uidnext( $folder ) || $uidnext_default ;
       	my $fetch_hash_uids = $fetch_hash_set || "1:$uidnext" ;
      -	%fetch = %{$imap->fetch_hash( $fetch_hash_uids, "INTERNALDATE") } ;
      -	
      -        @msgs_all = sort { $a <=> $b } keys( %fetch ) ;
      -        $debugdev and print "Done fetch_hash()\n" ;
      +	%fetch = %{$imap->fetch_hash( $fetch_hash_uids, 'INTERNALDATE' ) } ;
       
      -        return(  ) if ( $#msgs_all == 0 && !defined( $msgs_all[0] ) ) ;
      -               
      -        if ( defined( $msgs_all_hash_ref ) ) {
      +        @msgs_all = sort { $a <=> $b } keys  %fetch  ;
      +        $debugdev and myprint( "Done fetch_hash()\n"  ) ;
      +
      +        return if ( $#msgs_all == 0 && !defined  $msgs_all[0]  ) ;
      +
      +        if ( defined  $msgs_all_hash_ref  ) {
                        @{ $msgs_all_hash_ref }{ @msgs_all } =  () ;
               }
               # return all messages
      -        if ( not defined( $maxage ) and not defined( $minage ) and not defined( $search_cmd ) ) {
      +        if ( not defined  $maxage  and not defined  $minage  and not defined  $search_cmd  ) {
                       return( @msgs_all ) ;
               }
      -	
      -        if ( defined( $search_cmd ) ) {
      -		print "Warning: strange to see --search with --noabletosearch, an error can happen\n" ;
      +
      +        if ( defined  $search_cmd  ) {
      +		myprint( "Warning: strange to see --search with --noabletosearch, an error can happen\n"  ) ;
               	@msgs = $imap->search( $search_cmd ) ;
                       return( @msgs ) ;
               }
       
       	# we are here only if $maxage or $minage is defined
       	my( @max, @min, $maxage_epoch, $minage_epoch ) ;
      -	if ( defined( $maxage ) ) { $maxage_epoch = $timestart_int - 86400 * $maxage ; }
      -	if ( defined( $minage ) ) { $minage_epoch = $timestart_int - 86400 * $minage ; }
      +	if ( defined  $maxage  ) { $maxage_epoch = $timestart_int - $NB_SECONDS_IN_A_DAY * $maxage ; }
      +	if ( defined  $minage  ) { $minage_epoch = $timestart_int - $NB_SECONDS_IN_A_DAY * $minage ; }
       	foreach my $msg ( @msgs_all ) {
       		my $idate = $fetch{ $msg }->{'INTERNALDATE'} ;
      -		#print "$idate\n" ;
      -		if ( defined( $maxage ) and ( epoch( $idate ) >= $maxage_epoch ) ) {
      -			push( @max, $msg ) ;
      +		#myprint( "$idate\n"  ) ;
      +		if ( defined  $maxage  and ( epoch( $idate ) >= $maxage_epoch ) ) {
      +			push  @max, $msg  ;
       		}
      -		if ( defined( $minage ) and ( epoch( $idate ) <= $minage_epoch ) ) {
      -			push( @min, $msg ) ;
      +		if ( defined  $minage  and ( epoch( $idate ) <= $minage_epoch ) ) {
      +			push  @min, $msg  ;
       		}
       	}
               @msgs = msgs_from_maxmin( \@max, \@min ) ;
      @@ -4487,14 +4874,14 @@ sub select_msgs_by_fetch {
       
       sub select_msgs_by_age {
       	my( $imap ) = @_ ;
      -        
      +
       	my( @max, @min, @msgs, @inter, @union ) ;
      -        
      -	if ( defined( $maxage ) ) {
      -		@max = $imap->sentsince( $timestart_int - 86400 * $maxage ) ;
      +
      +	if ( defined  $maxage  ) {
      +		@max = $imap->sentsince( $timestart_int - $NB_SECONDS_IN_A_DAY * $maxage ) ;
       	}
      -	if ( defined( $minage ) ) {
      -		@min = $imap->sentbefore( $timestart_int - 86400 * $minage ) ;
      +	if ( defined  $minage  ) {
      +		@min = $imap->sentbefore( $timestart_int - $NB_SECONDS_IN_A_DAY * $minage ) ;
       	}
       
       	@msgs = msgs_from_maxmin( \@max, \@min ) ;
      @@ -4505,40 +4892,40 @@ sub msgs_from_maxmin {
       	my( $max_ref, $min_ref ) = @_ ;
       	my( @max, @min, @msgs, @inter, @union ) ;
       
      -	@max = @$max_ref ;
      -	@min = @$min_ref ;
      +	@max = @{ $max_ref } ;
      +	@min = @{ $min_ref } ;
       
       	SWITCH: {
      -		unless( defined( $minage ) ) { @msgs = @max ; last SWITCH } ;
      -		unless( defined( $maxage ) ) { @msgs = @min ; last SWITCH } ;
      -		my ( %union, %inter ) ; 
      +		unless( defined  $minage  ) { @msgs = @max ; last SWITCH } ;
      +		unless( defined  $maxage  ) { @msgs = @min ; last SWITCH } ;
      +		my ( %union, %inter ) ;
       		foreach my $m ( @min, @max ) { $union{ $m }++ && $inter{ $m }++ }
      -		@inter = sort { $a <=> $b } keys( %inter ) ;
      -		@union = sort { $a <=> $b } keys( %union ) ;
      +		@inter = sort { $a <=> $b } keys  %inter  ;
      +		@union = sort { $a <=> $b } keys  %union  ;
       		# normal case
       		if ( $minage <= $maxage )  { @msgs = @inter ; last SWITCH } ;
       		# just exclude messages between
       		if ( $minage > $maxage )  { @msgs = @union ; last SWITCH } ;
      -		
      +
       	}
       	return( @msgs ) ;
       }
       
       sub tests_msgs_from_maxmin {
       	my @msgs ;
      -	$maxage = 200 ;
      +	$maxage = $NUMBER_200 ;
       	@msgs = msgs_from_maxmin( [ '1', '2' ], [ '2', '3' ] ) ;
       	ok( 0 == compare_lists( [ '1', '2' ], \@msgs ), 'msgs_from_maxmin: maxage++' ) ;
      -	$minage = 100 ;
      +	$minage = $NUMBER_100 ;
       	@msgs = msgs_from_maxmin( [ '1', '2' ], [ '2', '3' ] ) ;
       	ok( 0 == compare_lists( [ '2' ], \@msgs ), 'msgs_from_maxmin:  -maxage++minage-' ) ;
      -	$minage = 300 ;
      +	$minage = $NUMBER_300 ;
       	@msgs = msgs_from_maxmin( [ '1', '2' ], [ '2', '3' ] ) ;
       	ok( 0 == compare_lists( [ '1', '2', '3' ], \@msgs ), 'msgs_from_maxmin:  ++maxage-minage++' ) ;
       	$maxage = undef ;
       	@msgs = msgs_from_maxmin( [ '1', '2' ], [ '2', '3' ] ) ;
       	ok( 0 == compare_lists( [ '2', '3' ], \@msgs ), 'msgs_from_maxmin:  ++minage-' ) ;
      -	return(  ) ;
      +	return ;
       }
       
       
      @@ -4547,7 +4934,7 @@ sub lastuid {
       	my $folder = shift ;
       	my $lastuid_guess  = shift ;
       	my $lastuid ;
      -	
      +
       	# rfc3501: The only reliable way to identify recent messages is to
       	#          look at message flags to see which have the \Recent flag
       	#          set, or to do a SEARCH RECENT.
      @@ -4557,12 +4944,12 @@ sub lastuid {
       	# SEARCH RECENT for each transfer can be expensive with a big folder
       	# Call commented for now
       	#@recent_messages = $imap->recent(  ) ;
      -	#print "Recent: @recent_messages\n";
      -	
      +	#myprint( "Recent: @recent_messages\n" ) ;
      +
       	my $max_recent ;
       	$max_recent = max( @recent_messages ) ;
      -	 
      -	if ( defined( $max_recent ) and ($lastuid_guess <= $max_recent ) ) {
      +
      +	if ( defined  $max_recent  and ($lastuid_guess <= $max_recent ) ) {
       		$lastuid = $max_recent ;
       	}else{
       		$lastuid = $lastuid_guess
      @@ -4572,16 +4959,16 @@ sub lastuid {
       
       sub size_filtered {
       	my( $h1_size, $h1_msg, $h1_fold, $h2_fold  ) = @_ ;
      -	
      +
               $h1_size = 0 if ( ! $h1_size ) ; # null if empty or undef
       	if (defined $maxsize and $h1_size > $maxsize) {
      -		print "msg $h1_fold/$h1_msg skipped ($h1_size exceeds maxsize limit $maxsize bytes)\n";
      +		myprint( "msg $h1_fold/$h1_msg skipped ($h1_size exceeds maxsize limit $maxsize bytes)\n" ) ;
       		$total_bytes_skipped += $h1_size;
       		$nb_msg_skipped += 1;
       		return( 1 ) ;
       	}
       	if (defined $minsize and $h1_size <= $minsize) {
      -		print "msg $h1_fold/$h1_msg skipped ($h1_size smaller than minsize $minsize bytes)\n";
      +		myprint( "msg $h1_fold/$h1_msg skipped ($h1_size smaller than minsize $minsize bytes)\n" ) ;
       		$total_bytes_skipped += $h1_size;
       		$nb_msg_skipped += 1;
       		return( 1 ) ;
      @@ -4592,86 +4979,94 @@ sub size_filtered {
       sub message_exists {
       	my( $imap, $msg ) = @_ ;
       	return( 1 ) if not $imap->Uid(  ) ;
      -        
      +
       	my $search_uid ;
               ( $search_uid ) = $imap->search( "UID $msg" ) ;
      -        #print "$search ? $msg\n" ;
      +        #myprint( "$search ? $msg\n"  ) ;
               return( 1 ) if ( $search_uid eq $msg ) ;
               return( 0 ) ;
       }
       
       sub copy_message {
       	# copy
      -	
      -	my ( $h1_msg, $h1_fold, $h2_fold, $h1_fir_ref, $permanentflags2, $cache_dir ) = @_ ;
      -	( $debug or $dry) and print "msg $h1_fold/$h1_msg copying to $h2_fold $dry_message\n";
       
      -	my $h1_size  = $h1_fir_ref->{$h1_msg}->{"RFC822.SIZE"} || 0 ;
      -	my $h1_flags = $h1_fir_ref->{$h1_msg}->{"FLAGS"} || '' ;
      -	my $h1_idate = $h1_fir_ref->{$h1_msg}->{"INTERNALDATE"} || '' ;
      -	
      -	
      +	my ( $sync, $h1_msg, $h1_fold, $h2_fold, $h1_fir_ref, $permanentflags2, $cache_dir ) = @_ ;
      +	( $debug or $dry) and myprint( "msg $h1_fold/$h1_msg copying to $h2_fold $dry_message\n" ) ;
      +
      +	my $h1_size  = $h1_fir_ref->{$h1_msg}->{'RFC822.SIZE'}  || 0 ;
      +	my $h1_flags = $h1_fir_ref->{$h1_msg}->{'FLAGS'}        || q{} ;
      +	my $h1_idate = $h1_fir_ref->{$h1_msg}->{'INTERNALDATE'} || q{} ;
      +
      +
               if ( size_filtered( $h1_size, $h1_msg, $h1_fold, $h2_fold  ) ) {
               	$h1_nb_msg_processed +=1 ;
      -                return(  ) ;
      +                return ;
               }
      -	
      -	do { print "SLEEP 5\n" and sleep 5 ; } if ( $debugsleep ) ;
      -	print "- msg $h1_fold/$h1_msg S[$h1_size] F[$h1_flags] I[$h1_idate] has RFC822.SIZE null!\n" if ( ! $h1_size ) ;
       
      -	
      +	debugsleep( $sync ) ;
      +	myprint( "- msg $h1_fold/$h1_msg S[$h1_size] F[$h1_flags] I[$h1_idate] has RFC822.SIZE null!\n" ) if ( ! $h1_size )   ;
      +
      +
               if ( $checkmessageexists and not message_exists( $imap1, $h1_msg ) ) {
       		$total_bytes_skipped += $h1_size;
       		$nb_msg_skipped += 1;
               	$h1_nb_msg_processed +=1 ;
      -                return(  ) ;
      +                return ;
      +        }
      +        if ( $sync->{debugmemory} ) {
      +                myprintf("C1: Memory consumption: %.1f MiB\n", memory_consumption(  ) / $KIBI / $KIBI) ;
               }
       
       	my ( $string, $string_len ) ;
      -        ( $string, $string_len ) = message_for_host2( $h1_msg, $h1_fold, $h1_size, $h1_flags, $h1_idate, $h1_fir_ref ) ;
      -        
      -        if ( not defined( $string ) and not defined( $string_len ) ) {
      -		print "- msg $h1_fold/$h1_msg skipped.\n" ;
      +        ( $string_len ) = message_for_host2( $sync, $h1_msg, $h1_fold, $h1_size, $h1_flags, $h1_idate, $h1_fir_ref, \$string ) ;
      +
      +        if ( $sync->{debugmemory} ) {
      +                myprintf("C2: Memory consumption: %.1f MiB\n", memory_consumption(  ) / $KIBI / $KIBI) ;
      +        }
      +
      +        # not defined or empty $string
      +        if ( ( not $string ) and ( not $string_len ) ) {
      +		myprint( "- msg $h1_fold/$h1_msg skipped.\n"  ) ;
       		$total_bytes_skipped += $h1_size;
       		$nb_msg_skipped += 1;
                       $h1_nb_msg_processed +=1 ;
      -                return(  ) ;
      +                return ;
               }
      -        
      -        # Lines too long (or not enough) => do no copy or fix 
      -        if ( defined ( $maxlinelength ) or defined ( $minmaxlinelength ) ) {
      +
      +        # Lines too long (or not enough) => do no copy or fix
      +        if ( ( defined $maxlinelength ) or ( defined $minmaxlinelength ) ) {
       		$string = linelengthstuff( $string, $h1_fold, $h1_msg, $string_len, $h1_size, $h1_flags, $h1_idate ) ;
      -		if ( not defined( $string ) ) {
      +		if ( not defined  $string  ) {
       			$h1_nb_msg_processed +=1 ;
       			$total_bytes_skipped += $h1_size ;
       			$nb_msg_skipped += 1 ;
      -			return(  ) ;
      +			return ;
       		}
       	}
       
       	my $h1_date = date_for_host2( $h1_msg, $h1_idate ) ;
       
      -	( $debug or $debugflags ) and 
      -        print "Host1 flags init msg $h1_fold/$h1_msg date [$h1_date] flags [$h1_flags] size [$h1_size]\n" ;
      +	( $debug or $debugflags ) and
      +        myprint( "Host1 flags init msg $h1_fold/$h1_msg date [$h1_date] flags [$h1_flags] size [$h1_size]\n"  ) ;
       
       	$h1_flags = flags_for_host2( $h1_flags, $permanentflags2 ) ;
       
      -	( $debug or $debugflags ) and 
      -        print "Host1 flags filt msg $h1_fold/$h1_msg date [$h1_date] flags [$h1_flags] size [$h1_size]\n" ;
      +	( $debug or $debugflags ) and
      +        myprint( "Host1 flags filt msg $h1_fold/$h1_msg date [$h1_date] flags [$h1_flags] size [$h1_size]\n"  ) ;
       
      -	$h1_date = undef if ($h1_date eq "");
      -	
      -	my $new_id = append_message_on_host2( $string, $h1_fold, $h1_msg, $string_len, $h2_fold, $h1_size, $h1_flags, $h1_date, $cache_dir ) ;
      +	$h1_date = undef if ($h1_date eq q{});
      +
      +	my $new_id = append_message_on_host2( \$string, $h1_fold, $h1_msg, $string_len, $h2_fold, $h1_size, $h1_flags, $h1_date, $cache_dir ) ;
       
       	if ( $new_id and $syncflagsaftercopy ) {
               	sync_flags_after_copy( $h1_fold, $h1_msg, $h1_flags, $h2_fold, $new_id, $permanentflags2 ) ;
               }
       
      -	if ( $debugmemory ) { 
      -        	printf ("Memory consumption: %.1f MiB\n", memory_consumption(  ) / 1024 / 1024) ;
      +	if ( $sync->{debugmemory} ) {
      +        	myprintf("C3: Memory consumption: %.1f MiB\n", memory_consumption(  ) / $KIBI / $KIBI) ;
               }
      -        
      -        return( $new_id ) ;
      +
      +        return $new_id ;
       }
       
       
      @@ -4679,131 +5074,254 @@ sub copy_message {
       sub linelengthstuff {
       	my( $string, $h1_fold, $h1_msg, $string_len, $h1_size, $h1_flags, $h1_idate  ) = @_ ;
       	my $maxlinelength_string = max_line_length( $string ) ;
      -        $debugmaxlinelength and print "msg $h1_fold/$h1_msg maxlinelength: $maxlinelength_string\n" ;
      +        $debugmaxlinelength and myprint( "msg $h1_fold/$h1_msg maxlinelength: $maxlinelength_string\n"  ) ;
       
      -        if ( defined ( $minmaxlinelength )  and ( $maxlinelength_string <= $minmaxlinelength ) ) {
      +        if ( ( defined $minmaxlinelength )  and ( $maxlinelength_string <= $minmaxlinelength ) ) {
       		my $subject = subject( $string ) ;
      -         	$debugdev and print "- msg $h1_fold/$h1_msg skipped S[$h1_size] F[$h1_flags] I[$h1_idate] " 
      -                      	. "(Subject:[$subject]) (max line length under minmaxlinelength $minmaxlinelength bytes)\n" ;
      -         	return(  ) ;
      +         	$debugdev and myprint( "- msg $h1_fold/$h1_msg skipped S[$h1_size] F[$h1_flags] I[$h1_idate] "
      +                      	. "(Subject:[$subject]) (max line length under minmaxlinelength $minmaxlinelength bytes)\n" ) ;
      +         	return ;
               }
       
      -        if ( defined ( $maxlinelength )  and ( $maxlinelength_string > $maxlinelength ) ) {
      +        if ( ( defined $maxlinelength )  and ( $maxlinelength_string > $maxlinelength ) ) {
                	my $subject = subject( $string ) ;
       		if ( $maxlinelengthcmd ) {
       			$string = pipemess( $string, $maxlinelengthcmd ) ;
       			# string undef means something was bad.
      -			if ( not ( defined( $string ) ) ) {
      -				print
      -					"- msg $h1_fold/$h1_msg {$string_len} S[$h1_size] F[$h1_flags] I[$h1_idate] " 
      -					. "(Subject:[$subject]) could not be successfully transformed by --maxlinelengthcmd option\n" ;
      -				return(  ) ;
      +			if ( not ( defined  $string  ) ) {
      +				myprint( "- msg $h1_fold/$h1_msg {$string_len} S[$h1_size] F[$h1_flags] I[$h1_idate] "
      +				      . "(Subject:[$subject]) could not be successfully transformed by --maxlinelengthcmd option\n" ) ;
      +				return ;
       			}else{
      -				return( $string ) ;
      +				return $string ;
       			}
       		}
      -         	print "- msg $h1_fold/$h1_msg skipped S[$h1_size] F[$h1_flags] I[$h1_idate] " 
      -                      	. "(Subject:[$subject]) (line length exceeds maxlinelength $maxlinelength bytes)\n" ;
      -		return(  ) ;
      +         	myprint( "- msg $h1_fold/$h1_msg skipped S[$h1_size] F[$h1_flags] I[$h1_idate] "
      +                      . "(Subject:[$subject]) (line length exceeds maxlinelength $maxlinelength bytes)\n" ) ;
      +		return ;
       	}
      -	return( $string ) ;
      +	return $string ;
       }
       
       
       sub message_for_host2 {
      -	my ( $h1_msg, $h1_fold, $h1_size, $h1_flags, $h1_idate, $h1_fir_ref ) = @_ ;
      -        
      -	my $string = $imap1->message_string( $h1_msg ) ;
      -	
      -	my $string_len = defined( $string ) ? length( $string ) : '' ; # length or empty string
      -	#print "- msg $h1_fold/$h1_msg {$string_len}\n" ;
      -	unless ( defined( $string ) and $string_len ) { 
      +
      +# global variable list: 
      +# @skipmess
      +# @regexmess
      +# @pipemess
      +# $addheader
      +# $debugcontent
      +# $debug
      +# 
      +# API current
      +#
      +# at failure: 
      +#   * return nothing ( will then be undef or () )
      +#   * $string_ref content is undef or empty
      +# at success:
      +#   * return string length ($string_ref content length)
      +#   * $string_ref content filled with message
      +
      +# API future
      +# 
      +# 
      +	my ( $sync, $h1_msg, $h1_fold, $h1_size, $h1_flags, $h1_idate, $h1_fir_ref, $string_ref ) = @_ ;
      +
      +        # abort when missing a parameter
      +        if ( (!$sync) or  (!$h1_msg) or (!$h1_fold) or (!$h1_size) or (!defined $h1_flags) or (!$h1_idate) or (!$h1_fir_ref) or (!$string_ref) ) {
      +                return ;
      +        }
      +
      +        if ( $sync->{debugmemory} ) {
      +                myprintf("M1: Memory consumption: %.1f MiB\n", memory_consumption(  ) / $KIBI / $KIBI) ;
      +        }
      +
      +        my $imap1 = $sync->{imap1} ;
      +	my $string_ok = $imap1->message_to_file( $string_ref, $h1_msg ) ;
      +
      +        if ( $sync->{debugmemory} ) {
      +                myprintf("M2: Memory consumption: %.1f MiB\n", memory_consumption(  ) / $KIBI / $KIBI) ;
      +        }
      +
      +	my $string_len = length_ref( $string_ref  ) ;
      +
      +
      +	unless ( defined  $string_ok  and $string_len ) {
       		# undef or 0 length
      -		my $error = join( '', 
      +		my $error = join q{},
       			"- msg $h1_fold/$h1_msg {$string_len} S[$h1_size] F[$h1_flags] I[$h1_idate] could not be fetched: ",
      -			$imap1->LastError || '', "\n" ) ;
      -		errors_incr( $error ) ;
      +			$imap1->LastError || q{}, "\n"  ;
      +		errors_incr( $sync, $error ) ;
       		$total_bytes_error += $h1_size if ( $h1_size ) ;
                       $h1_nb_msg_processed +=1 ;
      -		return(  ) ;
      +		return ;
       	}
       
       	if ( @skipmess ) {
      -		my $match = skipmess( $string ) ;
      +		my $match = skipmess( ${ $string_ref } ) ;
                       # string undef means the eval regex was bad.
      -                if ( not ( defined( $match ) ) ) {
      -                	print
      -			"- msg $h1_fold/$h1_msg {$string_len} S[$h1_size] F[$h1_flags] I[$h1_idate]" 
      -                        . " could not be skipped by --skipmess option, bad regex\n" ;
      -                	return(  ) ;
      +                if ( not ( defined  $match  ) ) {
      +                	myprint(
      +			"- msg $h1_fold/$h1_msg {$string_len} S[$h1_size] F[$h1_flags] I[$h1_idate]"
      +                        . " could not be skipped by --skipmess option, bad regex\n" ) ;
      +                	return ;
                       }
                       if ( $match ) {
      -					my $subject = subject( $string ) ;
      -                	print
      -			"- msg $h1_fold/$h1_msg {$string_len} S[$h1_size] F[$h1_flags] I[$h1_idate]" 
      -                        . " (Subject:[$subject]) skipped by --skipmess\n" ;
      -                	return(  ) ;
      +                        my $subject = subject( ${ $string_ref } ) ;
      +                        myprint( "- msg $h1_fold/$h1_msg {$string_len} S[$h1_size] F[$h1_flags] I[$h1_idate]"
      +                            . " (Subject:[$subject]) skipped by --skipmess\n" ) ;
      +                	return ;
                       }
       	}
       
      -	
       	if ( @regexmess ) {
      -		$string = regexmess( $string ) ;
      +		${ $string_ref } = regexmess( ${ $string_ref } ) ;
                       # string undef means the eval regex was bad.
      -                if ( not ( defined( $string ) ) ) {
      -                	print
      -			"- msg $h1_fold/$h1_msg {$string_len} S[$h1_size] F[$h1_flags] I[$h1_idate]" 
      -                        . " could not be transformed by --regexmess\n" ;
      -                	return(  ) ;
      +                if ( not ( defined  ${ $string_ref }  ) ) {
      +                	myprint(
      +			"- msg $h1_fold/$h1_msg {$string_len} S[$h1_size] F[$h1_flags] I[$h1_idate]"
      +                        . " could not be transformed by --regexmess\n" ) ;
      +                	return ;
                       }
       	}
      -        
      +
       	if ( @pipemess ) {
      -		$string = pipemess( $string, @pipemess ) ;
      +		${ $string_ref } = pipemess( ${ $string_ref }, @pipemess ) ;
                       # string undef means something was bad.
      -                if ( not ( defined( $string ) ) ) {
      -                	print
      -			"- msg $h1_fold/$h1_msg {$string_len} S[$h1_size] F[$h1_flags] I[$h1_idate]" 
      -                        . " could not be successfully transformed by --pipemess option\n" ;
      -                	return(  ) ;
      +                if ( not ( defined  ${ $string_ref }  ) ) {
      +                	myprint(
      +			"- msg $h1_fold/$h1_msg {$string_len} S[$h1_size] F[$h1_flags] I[$h1_idate]"
      +                        . " could not be successfully transformed by --pipemess option\n" ) ;
      +                	return ;
                       }
       	}
      +
      +        if ( $addheader and defined $h1_fir_ref->{$h1_msg}->{'NO_HEADER'} ) {
      +                my $header = add_header( $h1_msg ) ;
      +                $debug and myprint( "msg $h1_fold/$h1_msg adding custom header [$header]\n"  ) ;
      +                ${ $string_ref } = $header . "\r\n" . ${ $string_ref } ;
      +        }
      +
      +        $string_len = length_ref( $string_ref  ) ;
      +
      +	$debugcontent and myprint(
      +		q{=} x $STD_CHAR_PER_LINE, "\n",
      +		"F message content begin next line ($string_len characters long)\n",
      +		${ $string_ref },
      +		"F message content ended on previous line\n", q{=} x $STD_CHAR_PER_LINE, "\n" ) ;
      +
      +        if ( $sync->{debugmemory} ) {
      +                myprintf("M3: Memory consumption: %.1f MiB\n", memory_consumption(  ) / $KIBI / $KIBI) ;
      +        }
      +
      +	return $string_len ;
      +}
      +
      +sub tests_message_for_host2 {
               
      +        my ( $sync, $h1_msg, $h1_fold, $h1_size, $h1_flags, $h1_idate, $h1_fir_ref, $string_ref ) ;
               
      +        is( undef, message_for_host2(  ), q{message_for_host2: no args} ) ;
      +        is( undef, message_for_host2( $sync, $h1_msg, $h1_fold, $h1_size, $h1_flags, $h1_idate, $h1_fir_ref, $string_ref ), q{message_for_host2: undef args} ) ;
       
      -        if ( $addheader and defined $h1_fir_ref->{$h1_msg}->{"NO_HEADER"} ) {
      -                my $header = add_header( $h1_msg ) ;
      -                $debug and print "msg $h1_fold/$h1_msg adding custom header [$header]\n" ;
      -                $string = $header . "\r\n" . $string ;
      +        require Test::MockObject ;
      +        my $imapT = Test::MockObject->new(  ) ;
      +        $sync->{imap1} = $imapT ;
      +        my $string ;
      +        
      +        $h1_msg = 1 ;
      +        $h1_fold = 'FoldFoo';
      +        $h1_size =  9 ; 
      +        $h1_flags = '' ; 
      +        $h1_idate = '10-Jul-2015 09:00:00 +0200' ;
      +        $h1_fir_ref = {} ;
      +        $string_ref = \$string ;
      +        $imapT->mock( 'message_to_file',   
      +                sub {
      +                        my ( $imap, $string_ref, $msg ) = @_ ;
      +                        ${$string_ref} = 'blablabla' ;
      +                        return length ${$string_ref} ;
      +                }
      +        ) ;
      +        is( 9, message_for_host2( $sync, $h1_msg, $h1_fold, $h1_size, $h1_flags, $h1_idate, $h1_fir_ref, $string_ref ), 
      +        q{message_for_host2: msg 1 == "blablabla", length} ) ;
      +        is( 'blablabla', $string, q{message_for_host2: msg 1 == "blablabla", value} ) ;
      + 
      +        # so far so good
      +        # now the --pipemess stuff
      +
      +	SKIP: {
      +                Readonly my $NB_WIN_tests_message_for_host2 => 0 ;
      +		skip( 'Not on MSWin32', $NB_WIN_tests_message_for_host2 ) if ('MSWin32' ne $OSNAME) ;
      +		# Windows
      +		# "type" command does not accept redirection of STDIN with <
      +		# "sort" does
      +
      +	} ;
      +
      +	SKIP: {
      +                Readonly my $NB_UNX_tests_message_for_host2 => 6 ;
      +		skip( 'Not on Unix', $NB_UNX_tests_message_for_host2 ) if ('MSWin32' eq $OSNAME) ;
      +		# Unix
      +                
      +                # no change by cat
      +                @pipemess = ( 'cat' ) ;
      +                is( 9, message_for_host2( $sync, $h1_msg, $h1_fold, $h1_size, $h1_flags, $h1_idate, $h1_fir_ref, $string_ref ), 
      +                q{message_for_host2: --pipemess 'cat', length} ) ;
      +                is( 'blablabla', $string, q{message_for_host2: --pipemess 'cat', value} ) ;
      +
      +                
      +                # failure by false
      +                @pipemess = ( 'false' ) ;
      +                is( undef, message_for_host2( $sync, $h1_msg, $h1_fold, $h1_size, $h1_flags, $h1_idate, $h1_fir_ref, $string_ref ), 
      +                q{message_for_host2: --pipemess 'false', length} ) ;
      +                is( undef, $string, q{message_for_host2: --pipemess 'false', value} ) ;
      +
      +                # failure by true since no output
      +                @pipemess = ( 'true' ) ;
      +                is( undef, message_for_host2( $sync, $h1_msg, $h1_fold, $h1_size, $h1_flags, $h1_idate, $h1_fir_ref, $string_ref ), 
      +                q{message_for_host2: --pipemess 'true', length} ) ;
      +                is( undef, $string, q{message_for_host2: --pipemess 'true', value} ) ;
               }
      +        return ;
      +}
       
      +sub length_ref {
      +        my $string_ref = shift ;
      +        my $string_len = defined  ${ $string_ref }  ? length( ${ $string_ref } ) : q{} ; # length or empty string
      +        return $string_len ;
      +}
       
      -	$debugcontent and print 
      -		"=" x80, "\n", 
      -		"F message content begin next line\n",
      -		$string,
      -		"F message content ended on previous line\n", "=" x 80, "\n";
      +sub tests_length_ref {
      +        my $notdefined ;
      +        is( q{}, length_ref( \$notdefined ), q{length_ref: value not defined} ) ;
      +        my $notref ;
      +        is( q{}, length_ref( $notref ), q{length_ref: param not a ref} ) ;
       
      -	return( $string, $string_len ) ;
      +        my $lala = 'lala' ;
      +        is( 4, length_ref( \$lala ), q{length_ref: lala length == 4} ) ;
      +        is( 4, length_ref( \'lili' ), q{length_ref: lili length == 4} ) ;
      +        return ;
       }
       
       sub date_for_host2 {
       	my( $h1_msg, $h1_idate ) = @_ ;
       
      -	my $h1_date = "" ;
      +	my $h1_date = q{} ;
       
       	if ( $syncinternaldates ) {
       		$h1_date = $h1_idate ;
      -		$debug and print "internal date from host1: [$h1_date]\n" ;
      +		$debug and myprint( "internal date from host1: [$h1_date]\n"  ) ;
       		$h1_date = good_date( $h1_date ) ;
      -		$debug and print "internal date from host1: [$h1_date] (fixed)\n" ;
      +		$debug and myprint( "internal date from host1: [$h1_date] (fixed)\n"  ) ;
       	}
      -	
      +
       	if ( $idatefromheader ) {
      -		$h1_date = $imap1->get_header($h1_msg,"Date") ;
      -		$debug and print "header date from host1: [$h1_date]\n" ;
      +		$h1_date = $imap1->get_header( $h1_msg, 'Date' ) ;
      +		$debug and myprint( "header date from host1: [$h1_date]\n"  ) ;
       		$h1_date = good_date( $h1_date ) ;
      -		$debug and print "header date from host1: [$h1_date] (fixed)\n" ;
      +		$debug and myprint( "header date from host1: [$h1_date] (fixed)\n"  ) ;
       	}
       
       	return( $h1_date ) ;
      @@ -4817,27 +5335,27 @@ sub flags_for_host2 {
               if ( @regexflag and defined( $h1_flags_re = flags_regex( $h1_flags ) ) ) {
                       $h1_flags = $h1_flags_re ;
               }
      -	$h1_flags = flagsCase( $h1_flags ) if $flagsCase ;
      +	$h1_flags = flagscase( $h1_flags ) if $flagscase ;
               $h1_flags = flags_filter( $h1_flags, $permanentflags2) if ( $permanentflags2 and $filterflags ) ;
      -	
      +
       	return( $h1_flags ) ;
       }
       
       sub subject {
       	my $string = shift ;
      -	my $subject = '' ;
      -        
      +	my $subject = q{} ;
      +
               my $header = extract_header( $string ) ;
       
      -        if( $header =~ m/^Subject:\s*([^\n\r]*)\r?$/msx ) {  
      -        	#print "MMM[$1]\n" ;
      +        if( $header =~ m/^Subject:\s*([^\n\r]*)\r?$/msx ) {
      +        	#myprint( "MMM[$1]\n"  ) ;
               	$subject = $1 ;
               }
       	return( $subject ) ;
       }
       
       sub tests_subject {
      -	ok( '' eq subject( '' ), 'subject: null') ;
      +	ok( q{} eq subject( q{} ), 'subject: null') ;
       	ok( 'toto le hero' eq subject( 'Subject: toto le hero' ), 'subject: toto le hero') ;
       	ok( 'toto le hero' eq subject( 'Subject:toto le hero' ), 'subject: toto le hero blank') ;
       	ok( 'toto le hero' eq subject( "Subject:toto le hero\r\n" ), 'subject: toto le hero\r\n') ;
      @@ -4877,9 +5395,9 @@ Date: zzzzzz
       
       Subject: toto le hero
       EOF
      -	ok( '' eq subject( $MESS ), 'subject: null but body could') ;
      +	ok( q{} eq subject( $MESS ), 'subject: null but body could') ;
       
      -	return(  ) ;
      +	return ;
       }
       
       
      @@ -4888,7 +5406,6 @@ EOF
       # $max_msg_size_in_bytes
       # $imap2
       # $imap1
      -# $nb_errors
       # $total_bytes_error
       # $h1_nb_msg_processed
       # $h2_uidguess
      @@ -4900,24 +5417,30 @@ EOF
       #
       #
       sub append_message_on_host2 {
      -	my( $string, $h1_fold, $h1_msg, $string_len, $h2_fold, $h1_size, $h1_flags, $h1_date, $cache_dir ) = @_ ;
      -	
      +	my( $string_ref, $h1_fold, $h1_msg, $string_len, $h2_fold, $h1_size, $h1_flags, $h1_date, $cache_dir ) = @_ ;
      +	if ( $sync->{debugmemory} ) {
      +        	myprintf("A1: Memory consumption: %.1f MiB\n", memory_consumption(  ) / $KIBI / $KIBI) ;
      +        }
      +
       	my $new_id ;
       	if ( ! $dry ) {
       		$max_msg_size_in_bytes = max( $h1_size, $max_msg_size_in_bytes ) ;
      -		$new_id = $imap2->append_string( $h2_fold, $string, $h1_flags, $h1_date ) ;
      +		$new_id = $imap2->append_string( $h2_fold, ${ $string_ref }, $h1_flags, $h1_date ) ;
      +	        if ( $sync->{debugmemory} ) {
      +        	        myprintf("A2: Memory consumption: %.1f MiB\n", memory_consumption(  ) / $KIBI / $KIBI) ;
      +                }
       		if ( ! $new_id){
      -                	my $subject = subject( $string ) ;
      -                        my $error_imap = $imap2->LastError || '' ;
      +                	my $subject = subject( ${ $string_ref } ) ;
      +                        my $error_imap = $imap2->LastError || q{} ;
       			my $error = "- msg $h1_fold/$h1_msg {$string_len} couldn't append  (Subject:[$subject]) to folder $h2_fold: $error_imap\n" ;
      -			errors_incr( $error ) ;
      +			errors_incr( $sync, $error ) ;
       			$total_bytes_error += $h1_size;
                               $h1_nb_msg_processed +=1 ;
      -			return(  ) ;
      +			return ;
       		}
       		else{
       			# good
      -			# $new_id is an id if the IMAP server has the 
      +			# $new_id is an id if the IMAP server has the
       			# UIDPLUS capability else just a ref
       			if ( $new_id !~ m{^\d+$}x ) {
       				$new_id = lastuid( $imap2, $h2_fold, $h2_uidguess ) ;
      @@ -4929,23 +5452,23 @@ sub append_message_on_host2 {
       
                               my $time_spent = timesince( $begin_transfer_time ) ;
                               my $rate = bytes_display_string( $total_bytes_transferred / $time_spent ) ;
      -                        my $eta = eta( $time_spent, 
      -                                       $h1_nb_msg_processed, $h1_nb_msg_at_start, $nb_msg_transferred ) ;
      +                        my $eta = eta( $time_spent,
      +                                       $h1_nb_msg_processed, $h1_nb_msg_start, $nb_msg_transferred ) ;
                               my $amount_transferred = bytes_display_string( $total_bytes_transferred ) ;
      -			printf( "msg %s/%-19s copied to %s/%-10s %.2f msgs/s  %s/s %s copied  %s\n", 
      +			myprintf( "msg %s/%-19s copied to %s/%-10s %.2f msgs/s  %s/s %s copied  %s\n",
                               $h1_fold, "$h1_msg {$string_len}", $h2_fold, $new_id, $nb_msg_transferred/$time_spent, $rate,
      -                        $amount_transferred, 
      +                        $amount_transferred,
                               $eta );
                               sleep_if_needed( $time_spent, $total_bytes_transferred, $nb_msg_transferred ) ;
                               if ( $usecache and $cacheaftercopy and $new_id =~ m{^\d+$}x ) {
      -				$debugcache and print "touch $cache_dir/${h1_msg}_$new_id\n" ;
      -				touch( "$cache_dir/${h1_msg}_$new_id" ) 
      +				$debugcache and myprint( "touch $cache_dir/${h1_msg}_$new_id\n"  ) ;
      +				touch( "$cache_dir/${h1_msg}_$new_id" )
                               	or croak( "Couldn't touch $cache_dir/${h1_msg}_$new_id" ) ;
                               }
       			if ( $delete ) {
       				delete_message_on_host1( $h1_msg, $h1_fold ) ;
       			}
      -			#print "PRESS ENTER" and my $a = <> ;
      +			#myprint( "PRESS ENTER" ) and my $a = <> ;
                               return( $new_id ) ;
       		}
       	}
      @@ -4956,7 +5479,7 @@ sub append_message_on_host2 {
                       $h1_nb_msg_processed +=1 ;
       	}
       
      -	return(  ) ;
      +	return ;
       }
       
       sub sleep_if_needed {
      @@ -4965,16 +5488,16 @@ sub sleep_if_needed {
               my $sleep_max_bytes = sleep_max_bytes( $total_bytes_transferred, $time_spent, $maxbytespersecond  ) ;
               my $sleep_max = max( $sleep_max_messages, $sleep_max_bytes ) ;
               if ( $sleep_max > 0 ) {
      -        	printf( "sleeping %.2f s\n", $sleep_max ) ;
      -                sleep( $sleep_max ) ;
      +        	myprintf( "sleeping %.2f s\n", $sleep_max ) ;
      +                sleep $sleep_max ;
               }
      -	return(  ) ;
      +	return ;
       }
       
       sub sleep_max_messages {
       	# how long we have to sleep to go under max_messages_per_second
               my( $nb_msg_transferred, $time_spent, $maxmessagespersecond ) = @_ ;
      -        if ( ( not defined( $maxmessagespersecond ) ) or $maxmessagespersecond <= 0 ) { return( 0 ) } ;
      +        if ( ( not defined  $maxmessagespersecond  ) or $maxmessagespersecond <= 0 ) { return( 0 ) } ;
               my $sleep = ( $nb_msg_transferred / $maxmessagespersecond ) - $time_spent ;
               # the sleep must be positive
               return( max( 0, $sleep ) ) ;
      @@ -4984,18 +5507,18 @@ sub sleep_max_messages {
       sub tests_sleep_max_messages {
       	ok( 0 == sleep_max_messages( 4, 2, undef ),  'sleep_max_messages: maxmessagespersecond = undef') ;
       	ok( 0 == sleep_max_messages( 4, 2, 0 ),  'sleep_max_messages: maxmessagespersecond = 0') ;
      -	ok( 0 == sleep_max_messages( 4, 2, -1 ), 'sleep_max_messages: maxmessagespersecond = -1') ;
      +	ok( 0 == sleep_max_messages( 4, 2, $MINUS_ONE ), 'sleep_max_messages: maxmessagespersecond = -1') ;
       	ok( 0 == sleep_max_messages( 4, 2, 2 ),  'sleep_max_messages: maxmessagespersecond = 2 max reached') ;
       	ok( 2 == sleep_max_messages( 8, 2, 2 ),  'sleep_max_messages: maxmessagespersecond = 2 max over') ;
       	ok( 0 == sleep_max_messages( 2, 2, 2 ),  'sleep_max_messages: maxmessagespersecond = 2 max not reached') ;
      -	return(  ) ;
      +	return ;
       }
       
       
       sub sleep_max_bytes {
       	# how long we have to sleep to go under max_bytes_per_second
               my( $total_bytes_transferred, $time_spent, $maxbytespersecond ) = @_ ;
      -        if ( ( not defined( $maxbytespersecond ) ) or $maxbytespersecond <= 0 ) { return( 0 ) } ;
      +        if ( ( not defined  $maxbytespersecond  ) or $maxbytespersecond <= 0 ) { return( 0 ) } ;
               my $sleep = ( $total_bytes_transferred / $maxbytespersecond ) - $time_spent ;
               # the sleep must be positive
               return( max( 0, $sleep ) ) ;
      @@ -5005,39 +5528,39 @@ sub sleep_max_bytes {
       sub tests_sleep_max_bytes {
       	ok( 0 == sleep_max_bytes( 4000, 2, undef ),  'sleep_max_bytes: maxbytespersecond = undef') ;
       	ok( 0 == sleep_max_bytes( 4000, 2, 0 ),  'sleep_max_bytes: maxbytespersecond = 0') ;
      -	ok( 0 == sleep_max_bytes( 4000, 2, -1 ), 'sleep_max_bytes: maxbytespersecond = -1') ;
      +	ok( 0 == sleep_max_bytes( 4000, 2, $MINUS_ONE ), 'sleep_max_bytes: maxbytespersecond = -1') ;
       	ok( 0 == sleep_max_bytes( 4000, 2, 2000 ),  'sleep_max_bytes: maxbytespersecond = 2 max reached') ;
       	ok( 2 == sleep_max_bytes( 8000, 2, 2000 ),  'sleep_max_bytes: maxbytespersecond = 2 max over') ;
       	ok( 0 == sleep_max_bytes( 2000, 2, 2000 ),  'sleep_max_bytes: maxbytespersecond = 2 max not reached') ;
      -	return(  ) ;
      +	return ;
       }
       
       
      - 
       
      -# 6 GlobVar: $dry_message $dry $imap1 $h1_nb_msg_deleted $expunge $expunge1 
      +
      +# 6 GlobVar: $dry_message $dry $imap1 $h1_nb_msg_deleted $expunge $expunge1
       sub delete_message_on_host1  {
       	my( $h1_msg, $h1_fold ) = @_ ;
      -	my $expunge_message = '' ;
      -	$expunge_message = "and expunged" if ( $expungeaftereach and ( $expunge or $expunge1 ) ) ;
      -	print "Host1 msg $h1_fold/$h1_msg marked deleted $expunge_message $dry_message\n" ;
      +	my $expunge_message = q{} ;
      +	$expunge_message = 'and expunged' if ( $expungeaftereach and ( $expunge or $expunge1 ) ) ;
      +	myprint( "Host1 msg $h1_fold/$h1_msg marked deleted $expunge_message $dry_message\n"  ) ;
               if ( ! $dry ) {
               	$imap1->delete_message( $h1_msg ) ;
               	$h1_nb_msg_deleted += 1 ;
               	$imap1->expunge(  ) if ( $expungeaftereach and ( $expunge or $expunge1 ) ) ;
               }
      -        return(  ) ;
      +        return ;
       }
       
       
       sub eta {
       	my( $my_time_spent, $h1_nb_processed, $h1_nb_msg_start, $nb_transferred ) = @_ ;
      -	return( '' ) if not $foldersizes ;
      -        
      +	return( q{} ) if not $foldersizes ;
      +
               my $time_remaining = time_remaining( $my_time_spent, $h1_nb_processed, $h1_nb_msg_start, $nb_transferred ) ;
               my $nb_msg_remaining = $h1_nb_msg_start - $h1_nb_processed ;
               my $eta_date = localtime( time + $time_remaining ) ;
      -        return( sprintf( "ETA: %s  %1.0f s  %s/%s msgs left", $eta_date, $time_remaining, $nb_msg_remaining, $h1_nb_msg_start ) ) ;
      +        return( mysprintf( 'ETA: %s  %1.0f s  %s/%s msgs left', $eta_date, $time_remaining, $nb_msg_remaining, $h1_nb_msg_start ) ) ;
       }
       
       sub time_remaining {
      @@ -5051,41 +5574,41 @@ sub time_remaining {
       
       sub tests_time_remaining {
       
      -	ok( 1 == time_remaining( 1, 1, 2, 1 ), "time_remaining: 1, 1, 2, 1 -> 1") ;
      -	ok( 1 == time_remaining( 9, 9, 10, 9 ), "time_remaining: 9, 9, 10, 9 -> 1") ;
      -	ok( 9 == time_remaining( 1, 1, 10, 1 ), "time_remaining: 1, 1, 10, 1 -> 1") ;
      -	return(  ) ;
      +	ok( 1 == time_remaining( 1, 1,  2, 1 ), 'time_remaining: 1, 1, 2, 1 -> 1'  ) ;
      +	ok( 1 == time_remaining( 9, 9, 10, 9 ), 'time_remaining: 9, 9, 10, 9 -> 1' ) ;
      +	ok( 9 == time_remaining( 1, 1, 10, 1 ), 'time_remaining: 1, 1, 10, 1 -> 1' ) ;
      +	return ;
       }
       
       
       sub cache_map {
       	my ( $cache_files_ref, $h1_msgs_ref, $h2_msgs_ref ) = @_;
       	my ( %map1_2, %map2_1, %done2 ) ;
      -	
      +
       	my $h1_msgs_hash_ref = {  } ;
       	my $h2_msgs_hash_ref = {  } ;
      -	
      -	@$h1_msgs_hash_ref{ @$h1_msgs_ref } = (  ) ;
      -	@$h2_msgs_hash_ref{ @$h2_msgs_ref } = (  ) ;
      -	
      -	foreach my $file ( sort @$cache_files_ref ) {
      -		$debugcache and print "C12: $file\n" ;
      +
      +	@{ $h1_msgs_hash_ref }{ @{ $h1_msgs_ref } } = (  ) ;
      +	@{ $h2_msgs_hash_ref }{ @{ $h2_msgs_ref } } = (  ) ;
      +
      +	foreach my $file ( sort @{ $cache_files_ref } ) {
      +		$debugcache and myprint( "C12: $file\n"  ) ;
       		( $uid1, $uid2 ) = match_a_cache_file( $file ) ;
      -		
      -		if (  exists( $h1_msgs_hash_ref->{ defined( $uid1 ) ? $uid1 : q{} } ) 
      -		  and exists( $h2_msgs_hash_ref->{ defined( $uid2 ) ? $uid2 : q{} } ) ) {
      -		  	# keep only the greatest uid2 
      +
      +		if (  exists( $h1_msgs_hash_ref->{ defined  $uid1  ? $uid1 : q{} } )
      +		  and exists( $h2_msgs_hash_ref->{ defined  $uid2  ? $uid2 : q{} } ) ) {
      +		  	# keep only the greatest uid2
       			# 130_2301 and
       			# 130_231  => keep only 130 -> 2301
      -			
      +
       			# keep only the greatest uid1
       			# 1601_260 and
       			#  161_260 => keep only 1601 -> 260
      -		  	my $max_uid2 = max( $uid2, $map1_2{ $uid1 } || -1 ) ;
      -			if ( exists( $done2{ $max_uid2 } ) ) {
      +		  	my $max_uid2 = max( $uid2, $map1_2{ $uid1 } || $MINUS_ONE ) ;
      +			if ( exists $done2{ $max_uid2 } ) {
       				if ( $done2{ $max_uid2 } < $uid1 )  {
       					$map1_2{ $uid1 } = $max_uid2 ;
      -					delete( $map1_2{ $done2{ $max_uid2 } } ) ;
      +					delete $map1_2{ $done2{ $max_uid2 } } ;
       					$done2{ $max_uid2 } = $uid1 ;
       				}
       			}else{
      @@ -5093,9 +5616,9 @@ sub cache_map {
       				$done2{ $max_uid2 } = $uid1 ;
       			}
       		};
      -		
      +
       	}
      -	%map2_1 = reverse( %map1_2 ) ;
      +	%map2_1 = reverse %map1_2 ;
       	return( \%map1_2, \%map2_1) ;
       }
       
      @@ -5119,28 +5642,28 @@ sub tests_cache_map {
       	161_260
       	1601_260
       	) ;
      -	
      +
       	my $msgs_1 = [120, 142, 143, 144, 161, 1601,           177,      182, 130 ];
       	my $msgs_2 = [     242, 243,       260,      299, 377, 279, 255, 280, 231, 2301 ];
      -	
      +
       	my( $c12, $c21 ) ;
       	ok( ( $c12, $c21 ) = cache_map( \@cache_files, $msgs_1, $msgs_2 ), 'cache_map: 02' );
      -	my $a1 = [ sort { $a <=> $b } keys %$c12 ] ;
      -	my $a2 = [ sort { $a <=> $b } keys %$c21 ] ;
      +	my $a1 = [ sort { $a <=> $b } keys %{ $c12 } ] ;
      +	my $a2 = [ sort { $a <=> $b } keys %{ $c21 } ] ;
       	ok( 0 == compare_lists( [ 130, 142, 143,      177, 182, 1601      ], $a1 ), 'cache_map: 03' );
       	ok( 0 == compare_lists( [      242, 243, 260, 279, 280,      2301 ], $a2 ), 'cache_map: 04' );
       	ok( ! $c12->{161},        'cache_map: ! 161 ->  260' );
       	ok( 260  == $c12->{1601}, 'cache_map:  1601 ->  260' );
       	ok( 2301 == $c12->{130},  'cache_map:   130 -> 2301' );
      -	#print $c12->{1601}, "\n";
      -	return(  ) ;
      +	#myprint( $c12->{1601}, "\n" ) ;
      +	return ;
       
       }
       
       sub cache_dir_fix {
       	my $cache_dir = shift ;
               $cache_dir =~ s/([;<>\*\|`&\$!#\(\)\[\]\{\}:'"\\])/\\$1/xg ;
      -        #print "cache_dir_fix: $cache_dir\n" ;
      +        #myprint( "cache_dir_fix: $cache_dir\n"  ) ;
       	return( $cache_dir ) ;
       }
       
      @@ -5154,67 +5677,64 @@ sub tests_cache_dir_fix {
       	ok( '\\\\ ' eq  cache_dir_fix('\\ '), 'cache_dir_fix: \\  -> \\\\\ ' );
       	ok( '\\\\ ' eq  cache_dir_fix('\ '), 'cache_dir_fix: \  -> \\\\\ ' );
       	ok( '\[bracket\]' eq  cache_dir_fix('[bracket]'), 'cache_dir_fix: [bracket] -> \[bracket\]' );
      -	return(  ) ;
      +	return ;
       }
       
       sub cache_dir_fix_win {
       	my $cache_dir = shift ;
               $cache_dir =~ s/(\[|\])/[$1]/xg ;
      -        #print "cache_dir_fix_win: $cache_dir\n" ;
      +        #myprint( "cache_dir_fix_win: $cache_dir\n"  ) ;
       	return( $cache_dir ) ;
       }
       
       sub tests_cache_dir_fix_win {
       	ok( 'lalala' eq  cache_dir_fix_win('lalala'),  'cache_dir_fix_win: lalala -> lalala' );
       	ok( '[[]bracket[]]' eq  cache_dir_fix_win('[bracket]'), 'cache_dir_fix_win: [bracket] -> [[]bracket[]]' );
      -	return(  ) ;
      +	return ;
       }
       
       
       
       
      -sub get_cache { 
      +sub get_cache {
       	my ( $cache_dir, $h1_msgs_ref, $h2_msgs_ref, $h1_msgs_all_hash_ref, $h2_msgs_all_hash_ref ) = @_;
       
      -	$debugcache and print "Entering get_cache\n";
      +	$debugcache and myprint( "Entering get_cache\n" ) ;
       
       	-d $cache_dir or return( undef ); # exit if cache directory doesn't exist
      -	$debugcache and print "cache_dir    : $cache_dir\n";
      -	
      -        
      +	$debugcache and myprint( "cache_dir    : $cache_dir\n" ) ;
      +
      +
               if ( 'MSWin32' ne $OSNAME ) {
               	$cache_dir = cache_dir_fix( $cache_dir ) ;
               }else{
               	$cache_dir = cache_dir_fix_win( $cache_dir ) ;
               }
       
      -	$debugcache and print "cache_dir_fix: $cache_dir\n" ;
      -        
      +	$debugcache and myprint( "cache_dir_fix: $cache_dir\n"  ) ;
      +
       	my @cache_files = bsd_glob( "$cache_dir/*" ) ;
      -	#$debugcache and print "cache_files: [@cache_files]\n" ;
      -        
      -	$debugcache and print( "cache_files: ", scalar( @cache_files ), " files found\n" ) ;
      -	
      -	my( $cache_1_2_ref, $cache_2_1_ref ) 
      +	#$debugcache and myprint( "cache_files: [@cache_files]\n"  ) ;
      +
      +	$debugcache and myprint( 'cache_files: ', scalar  @cache_files , " files found\n" ) ;
      +
      +	my( $cache_1_2_ref, $cache_2_1_ref )
       	  = cache_map( \@cache_files, $h1_msgs_ref, $h2_msgs_ref ) ;
      -	
      +
       	clean_cache( \@cache_files, $cache_1_2_ref, $h1_msgs_all_hash_ref, $h2_msgs_all_hash_ref ) ;
      -	
      -	#print "\n", map { "c12 $_ -> $cache_1_2_ref->{ $_ }\n" } keys %$cache_1_2_ref ;
      -	#print "\n", map { "c21 $_ -> $cache_2_1_ref->{ $_ }\n" } keys %$cache_2_1_ref ;
       
      -	$debugcache and print "Exiting get_cache\n";
      -	return ( $cache_1_2_ref, $cache_2_1_ref ) ;
      +	$debugcache and myprint( "Exiting get_cache\n" ) ;
      +	return( $cache_1_2_ref, $cache_2_1_ref ) ;
       }
       
       
       sub tests_get_cache {
      -	
      +
       	ok( not( get_cache('/cache_no_exist') ), 'get_cache: /cache_no_exist' );
       	ok( ( not -d 'W/tmp/cache/F1/F2' or rmtree( 'W/tmp/cache/F1/F2' )), 'get_cache: rmtree W/tmp/cache/F1/F2' ) ;
       	ok( mkpath( 'W/tmp/cache/F1/F2' ), 'get_cache: mkpath W/tmp/cache/F1/F2' ) ;
      -	
      -	my @test_files_cache = ( qw( 
      +
      +	my @test_files_cache = ( qw(
       	W/tmp/cache/F1/F2/100_200
       	W/tmp/cache/F1/F2/101_201
       	W/tmp/cache/F1/F2/120_220
      @@ -5226,27 +5746,27 @@ sub tests_get_cache {
       	W/tmp/cache/F1/F2/155_255
       	) ) ;
       	ok( touch( @test_files_cache ), 'get_cache: touch W/tmp/cache/F1/F2/...' ) ;
      -	
      -	
      +
      +
       	# on cache: 100_200 101_201 142_242 143_243 177_277 177_377 177_777 155_255
       	# on live:
       	my $msgs_1 = [120, 142, 143, 144,          177      ];
       	my $msgs_2 = [     242, 243,     299, 377, 777, 255 ];
      -        
      +
               my $msgs_all_1 = { 120 => 0, 142 => 0, 143 => 0, 144 => 0, 177 => 0 } ;
               my $msgs_all_2 = { 242 => 0, 243 => 0, 299 => 0, 377 => 0, 777 => 0, 255 => 0 } ;
      -	
      +
       	my( $c12, $c21 ) ;
       	ok( ( $c12, $c21 ) = get_cache( 'W/tmp/cache/F1/F2', $msgs_1, $msgs_2, $msgs_all_1, $msgs_all_2 ), 'get_cache: 02' );
      -	my $a1 = [ sort { $a <=> $b } keys %$c12 ] ;
      -	my $a2 = [ sort { $a <=> $b } keys %$c21 ] ;
      +	my $a1 = [ sort { $a <=> $b } keys %{ $c12 } ] ;
      +	my $a2 = [ sort { $a <=> $b } keys %{ $c21 } ] ;
       	ok( 0 == compare_lists( [ 142, 143, 177 ], $a1 ), 'get_cache: 03' );
       	ok( 0 == compare_lists( [ 242, 243, 777 ], $a2 ), 'get_cache: 04' );
       	ok( -f 'W/tmp/cache/F1/F2/142_242', 'get_cache: file kept 142_242');
       	ok( -f 'W/tmp/cache/F1/F2/142_242', 'get_cache: file kept 143_243');
       	ok( ! -f 'W/tmp/cache/F1/F2/100_200', 'get_cache: file removed 100_200');
       	ok( ! -f 'W/tmp/cache/F1/F2/101_201', 'get_cache: file removed 101_201');
      -	
      +
       	# test clean_cache executed
       	$maxage = 2 ;
       	ok( touch(@test_files_cache), 'get_cache: touch W/tmp/cache/F1/F2/...' ) ;
      @@ -5255,15 +5775,15 @@ sub tests_get_cache {
       	ok( -f 'W/tmp/cache/F1/F2/142_242', 'get_cache: file kept 143_243');
       	ok( ! -f 'W/tmp/cache/F1/F2/100_200', 'get_cache: file NOT removed 100_200');
       	ok( ! -f 'W/tmp/cache/F1/F2/101_201', 'get_cache: file NOT removed 101_201');
      -	
      -	
      +
      +
       	# strange files
       	#$debugcache = 1 ;
       	$maxage = undef ;
       	ok( ( not -d 'W/tmp/cache/rr\uee' or rmtree( 'W/tmp/cache/rr\uee' )), 'get_cache: rmtree W/tmp/cache/rr\uee' ) ;
       	ok( mkpath( 'W/tmp/cache/rr\uee' ), 'get_cache: mkpath W/tmp/cache/rr\uee' ) ;
      -	
      -	@test_files_cache = ( qw( 
      +
      +	@test_files_cache = ( qw(
       	W/tmp/cache/rr\uee/100_200
       	W/tmp/cache/rr\uee/101_201
       	W/tmp/cache/rr\uee/120_220
      @@ -5275,31 +5795,31 @@ sub tests_get_cache {
       	W/tmp/cache/rr\uee/155_255
       	) ) ;
       	ok( touch(@test_files_cache), 'get_cache: touch strange W/tmp/cache/...' ) ;
      -	
      +
       	# on cache: 100_200 101_201 142_242 143_243 177_277 177_377 177_777 155_255
       	# on live:
       	$msgs_1 = [120, 142, 143, 144,          177      ] ;
       	$msgs_2 = [     242, 243,     299, 377, 777, 255 ] ;
      -	
      -        $msgs_all_1 = { 120 => '', 142 => '', 143 => '', 144 => '', 177 => '' } ;
      -        $msgs_all_2 = { 242 => '', 243 => '', 299 => '', 377 => '', 777 => '', 255 => '' } ;
      -        
      +
      +        $msgs_all_1 = { 120 => q{}, 142 => q{}, 143 => q{}, 144 => q{}, 177 => q{} } ;
      +        $msgs_all_2 = { 242 => q{}, 243 => q{}, 299 => q{}, 377 => q{}, 777 => q{}, 255 => q{} } ;
      +
       	ok( ( $c12, $c21 ) = get_cache('W/tmp/cache/rr\uee', $msgs_1, $msgs_2, $msgs_all_1, $msgs_all_2), 'get_cache: strange path 02' );
      -	$a1 = [ sort { $a <=> $b } keys %$c12 ] ;
      -	$a2 = [ sort { $a <=> $b } keys %$c21 ] ;
      +	$a1 = [ sort { $a <=> $b } keys %{ $c12 } ] ;
      +	$a2 = [ sort { $a <=> $b } keys %{ $c21 } ] ;
       	ok( 0 == compare_lists( [ 142, 143, 177 ], $a1 ), 'get_cache: strange path 03' );
       	ok( 0 == compare_lists( [ 242, 243, 777 ], $a2 ), 'get_cache: strange path 04' );
       	ok( -f 'W/tmp/cache/rr\uee/142_242', 'get_cache: strange path file kept 142_242');
       	ok( -f 'W/tmp/cache/rr\uee/142_242', 'get_cache: strange path file kept 143_243');
       	ok( ! -f 'W/tmp/cache/rr\uee/100_200', 'get_cache: strange path file removed 100_200');
       	ok( ! -f 'W/tmp/cache/rr\uee/101_201', 'get_cache: strange path file removed 101_201');
      -	return(  ) ;
      +	return ;
       }
       
       sub match_a_cache_file {
       	my $file = shift ;
       	my ( $cache_uid1, $cache_uid2 ) ;
      -	
      +
       	return( ( undef, undef ) ) if ( ! $file ) ;
       	if ( $file =~ m{(?:^|/)(\d+)_(\d+)$}x ) {
       		$cache_uid1 = $1 ;
      @@ -5311,17 +5831,17 @@ sub match_a_cache_file {
       sub tests_match_a_cache_file {
       	my ( $tuid1, $tuid2 ) ;
       	ok( ( $tuid1, $tuid2 ) = match_a_cache_file(  ), 'match_a_cache_file: no arg' ) ;
      -	ok( ! defined( $tuid1 ), 'match_a_cache_file: no arg 1' ) ;
      -	ok( ! defined( $tuid2 ), 'match_a_cache_file: no arg 2' ) ;
      -	
      -	ok( ( $tuid1, $tuid2 ) = match_a_cache_file( '' ), 'match_a_cache_file: empty arg' ) ;
      -	ok( ! defined( $tuid1 ), 'match_a_cache_file: empty arg 1' ) ;
      -	ok( ! defined( $tuid2 ), 'match_a_cache_file: empty arg 2' ) ;
      -	
      +	ok( ! defined  $tuid1 , 'match_a_cache_file: no arg 1' ) ;
      +	ok( ! defined  $tuid2 , 'match_a_cache_file: no arg 2' ) ;
      +
      +	ok( ( $tuid1, $tuid2 ) = match_a_cache_file( q{} ), 'match_a_cache_file: empty arg' ) ;
      +	ok( ! defined  $tuid1 , 'match_a_cache_file: empty arg 1' ) ;
      +	ok( ! defined  $tuid2 , 'match_a_cache_file: empty arg 2' ) ;
      +
       	ok( ( $tuid1, $tuid2 ) = match_a_cache_file( '000_000' ), 'match_a_cache_file: 000_000' ) ;
       	ok( '000' eq $tuid1, 'match_a_cache_file: 000_000 1' ) ;
       	ok( '000' eq $tuid2, 'match_a_cache_file: 000_000 2' ) ;
      -	
      +
       	ok( ( $tuid1, $tuid2 ) = match_a_cache_file( '123_456' ), 'match_a_cache_file: 123_456' ) ;
       	ok( '123' eq $tuid1, 'match_a_cache_file: 123_456 1' ) ;
       	ok( '456' eq $tuid2, 'match_a_cache_file: 123_456 2' ) ;
      @@ -5338,32 +5858,32 @@ sub tests_match_a_cache_file {
       	ok( ! $tuid1, 'match_a_cache_file: la123_456 1' ) ;
       	ok( ! $tuid2, 'match_a_cache_file: la123_456 2' ) ;
       
      -	return(  ) ;
      +	return ;
       }
       
       sub clean_cache {
       	my ( $cache_files_ref, $cache_1_2_ref, $h1_msgs_all_hash_ref, $h2_msgs_all_hash_ref )  = @_ ;
      -	
      -	$debugcache and print "Entering clean_cache\n";
      -	
      -	$debugcache and print map { "$_ -> " . $cache_1_2_ref->{ $_ } . "\n" } keys %$cache_1_2_ref ;
      -	foreach my $file ( @$cache_files_ref ) {
      -		$debugcache and print "$file\n" ;
      +
      +	$debugcache and myprint( "Entering clean_cache\n" ) ;
      +
      +	$debugcache and myprint( map { "$_ -> " . $cache_1_2_ref->{ $_ } . "\n" } keys %{ $cache_1_2_ref }  ) ;
      +	foreach my $file ( @{ $cache_files_ref } ) {
      +		$debugcache and myprint( "$file\n"  ) ;
       		my ( $cache_uid1, $cache_uid2 ) = match_a_cache_file( $file ) ;
      -		$debugcache and print( "u1: $cache_uid1 u2: $cache_uid2 c12: ", $cache_1_2_ref->{ $cache_uid1 } || '', "\n") ;
      +		$debugcache and myprint( "u1: $cache_uid1 u2: $cache_uid2 c12: ", $cache_1_2_ref->{ $cache_uid1 } || q{}, "\n") ;
       #		  or ( ! exists( $cache_1_2_ref->{ $cache_uid1 } ) )
       #		  or ( ! ( $cache_uid2 == $cache_1_2_ref->{ $cache_uid1 } ) )
      -		if ( ( not defined( $cache_uid1 ) )
      -		  or ( not defined( $cache_uid2 ) )
      -                  or ( not exists( $h1_msgs_all_hash_ref->{ $cache_uid1 } ) )
      -                  or ( not exists( $h2_msgs_all_hash_ref->{ $cache_uid2 } ) )
      +		if ( ( not defined  $cache_uid1  )
      +		  or ( not defined  $cache_uid2  )
      +                  or ( not exists  $h1_msgs_all_hash_ref->{ $cache_uid1 }  )
      +                  or ( not exists  $h2_msgs_all_hash_ref->{ $cache_uid2 }  )
                       ) {
      -			$debugcache and print "remove $file\n" ;
      -			unlink( $file ) or print "$!" ;
      +			$debugcache and myprint( "remove $file\n"  ) ;
      +			unlink $file or myprint( "$!"  ) ;
       		}
       	}
      -	
      -	$debugcache and print "Exiting clean_cache\n";
      +
      +	$debugcache and myprint( "Exiting clean_cache\n" ) ;
       	return( 1 ) ;
       }
       
      @@ -5371,8 +5891,8 @@ sub tests_clean_cache {
       
       	ok( ( not -d  'W/tmp/cache/G1/G2' or rmtree( 'W/tmp/cache/G1/G2' )), 'clean_cache: rmtree W/tmp/cache/G1/G2' ) ;
       	ok( mkpath( 'W/tmp/cache/G1/G2' ), 'clean_cache: mkpath W/tmp/cache/G1/G2' ) ;
      -	
      -	my @test_files_cache = ( qw( 
      +
      +	my @test_files_cache = ( qw(
       	W/tmp/cache/G1/G2/100_200
       	W/tmp/cache/G1/G2/101_201
       	W/tmp/cache/G1/G2/120_220
      @@ -5384,46 +5904,46 @@ sub tests_clean_cache {
       	W/tmp/cache/G1/G2/155_255
       	) ) ;
       	ok( touch(@test_files_cache), 'clean_cache: touch W/tmp/cache/G1/G2/...' ) ;
      -	
      +
       	ok( -f 'W/tmp/cache/G1/G2/100_200', 'clean_cache: 100_200 before' );
       	ok( -f 'W/tmp/cache/G1/G2/142_242', 'clean_cache: 142_242 before' );
       	ok( -f 'W/tmp/cache/G1/G2/177_277', 'clean_cache: 177_277 before' );
       	ok( -f 'W/tmp/cache/G1/G2/177_377', 'clean_cache: 177_377 before' );
       	ok( -f 'W/tmp/cache/G1/G2/177_777', 'clean_cache: 177_777 before' );
       	ok( -f 'W/tmp/cache/G1/G2/155_255', 'clean_cache: 155_255 before' );
      -	
      +
       	my $cache = {
       		142 => 242,
       		177 => 777,
       	} ;
      -        
      +
               my $all_1 = {
      -                142 => '',
      -                177 => '',
      +                142 => q{},
      +                177 => q{},
               } ;
      -        
      +
               my $all_2 = {
      -                200 => '',
      -                242 => '',
      -                777 => '',
      +                200 => q{},
      +                242 => q{},
      +                777 => q{},
               } ;
       	ok( clean_cache( \@test_files_cache, $cache, $all_1, $all_2 ), 'clean_cache: ' ) ;
      -	
      +
       	ok( ! -f 'W/tmp/cache/G1/G2/100_200', 'clean_cache: 100_200 after' );
       	ok(   -f 'W/tmp/cache/G1/G2/142_242', 'clean_cache: 142_242 after' );
       	ok( ! -f 'W/tmp/cache/G1/G2/177_277', 'clean_cache: 177_277 after' );
       	ok( ! -f 'W/tmp/cache/G1/G2/177_377', 'clean_cache: 177_377 after' );
       	ok(   -f 'W/tmp/cache/G1/G2/177_777', 'clean_cache: 177_777 after' );
       	ok( ! -f 'W/tmp/cache/G1/G2/155_255', 'clean_cache: 155_255 after' );
      -	return(  ) ;
      +	return ;
       }
       
       sub tests_clean_cache_2 {
       
       	ok( ( not -d  'W/tmp/cache/G1/G2' or rmtree( 'W/tmp/cache/G1/G2' )), 'clean_cache_2: rmtree W/tmp/cache/G1/G2' ) ;
       	ok( mkpath( 'W/tmp/cache/G1/G2' ), 'clean_cache_2: mkpath W/tmp/cache/G1/G2' ) ;
      -	
      -	my @test_files_cache = ( qw( 
      +
      +	my @test_files_cache = ( qw(
       	W/tmp/cache/G1/G2/100_200
       	W/tmp/cache/G1/G2/101_201
       	W/tmp/cache/G1/G2/120_220
      @@ -5435,42 +5955,42 @@ sub tests_clean_cache_2 {
       	W/tmp/cache/G1/G2/155_255
       	) ) ;
       	ok( touch(@test_files_cache), 'clean_cache_2: touch W/tmp/cache/G1/G2/...' ) ;
      -	
      +
       	ok( -f 'W/tmp/cache/G1/G2/100_200', 'clean_cache_2: 100_200 before' );
       	ok( -f 'W/tmp/cache/G1/G2/142_242', 'clean_cache_2: 142_242 before' );
       	ok( -f 'W/tmp/cache/G1/G2/177_277', 'clean_cache_2: 177_277 before' );
       	ok( -f 'W/tmp/cache/G1/G2/177_377', 'clean_cache_2: 177_377 before' );
       	ok( -f 'W/tmp/cache/G1/G2/177_777', 'clean_cache_2: 177_777 before' );
       	ok( -f 'W/tmp/cache/G1/G2/155_255', 'clean_cache_2: 155_255 before' );
      -	
      +
       	my $cache = {
       		142 => 242,
       		177 => 777,
       	} ;
      -        
      +
               my $all_1 = {
      -                100 => '',
      -                142 => '',
      -                177 => '',
      +                $NUMBER_100 => q{},
      +                142 => q{},
      +                177 => q{},
               } ;
      -        
      +
               my $all_2 = {
      -                200 => '',
      -                242 => '',
      -                777 => '',
      +                200 => q{},
      +                242 => q{},
      +                777 => q{},
               } ;
      -        
      -        
      -        
      +
      +
      +
       	ok( clean_cache( \@test_files_cache, $cache, $all_1, $all_2 ), 'clean_cache_2: ' ) ;
      -	
      +
       	ok(   -f 'W/tmp/cache/G1/G2/100_200', 'clean_cache_2: 100_200 after' );
       	ok(   -f 'W/tmp/cache/G1/G2/142_242', 'clean_cache_2: 142_242 after' );
       	ok( ! -f 'W/tmp/cache/G1/G2/177_277', 'clean_cache_2: 177_277 after' );
       	ok( ! -f 'W/tmp/cache/G1/G2/177_377', 'clean_cache_2: 177_377 after' );
       	ok(   -f 'W/tmp/cache/G1/G2/177_777', 'clean_cache_2: 177_777 after' );
       	ok( ! -f 'W/tmp/cache/G1/G2/155_255', 'clean_cache_2: 155_255 after' );
      -	return(  ) ;
      +	return ;
       }
       
       
      @@ -5481,21 +6001,21 @@ sub tests_mkpath {
       
       	SKIP: {
       		skip( 'Tests only for Unix', 2   ) if ( 'MSWin32' eq $OSNAME ) ;
      -		my $long_path_unix = "123456789/" x 30 ;
      -		ok( (-d "W/tmp/tests/long/$long_path_unix" or  mkpath( "W/tmp/tests/long/$long_path_unix" )), 'tests_mkpath: mkpath > 300 char' ) ;
      -		ok( (-d "W/tmp/tests/long/$long_path_unix" and rmtree( "W/tmp/tests/long/" )),           'tests_mkpath: rmtree > 300 char' ) ;
      +		my $long_path_unix = '123456789/' x 30 ;
      +		ok( (-d "W/tmp/tests/long/$long_path_unix" or  mkpath( "W/tmp/tests/long/$long_path_unix" ) ), 'tests_mkpath: mkpath > 300 char' ) ;
      +		ok( (-d "W/tmp/tests/long/$long_path_unix" and rmtree( 'W/tmp/tests/long/' ) ), 'tests_mkpath: rmtree > 300 char' ) ;
               } ;
      -	
      +
       	SKIP: {
       		skip( 'Tests only for MSWin32', 6  ) if ( 'MSWin32' ne $OSNAME ) ;
      -		my $long_path_2_prefix =  "$tmpdir\\imapsync_tests" || '\\\?\\E:\\TEMP\\imapsync_tests'  ; 
      -		print "long_path_2_prefix: $long_path_2_prefix\n" ;
      -		
      -		my $long_path_2 = $long_path_2_prefix . "\\" . "123456789\\" x 10 . 'END'; 
      -		my $long_path_300 = $long_path_2_prefix . "\\" . "123456789\\" x 30 . 'END'; 
      -
      -		print "$long_path_2\n" ;
      -		
      +		my $long_path_2_prefix =  "$tmpdir\\imapsync_tests" || '\\\?\\E:\\TEMP\\imapsync_tests'  ;
      +		myprint( "long_path_2_prefix: $long_path_2_prefix\n"  ) ;
      +
      +		my $long_path_2   = $long_path_2_prefix . '\\' . '123456789\\' x 10 . 'END' ;
      +		my $long_path_300 = $long_path_2_prefix . '\\' . '123456789\\' x 30 . 'END' ;
      +
      +		myprint( "$long_path_2\n"  ) ;
      +
       		#ok( ( -d $long_path_2_prefix and rmtree( $long_path_2_prefix ) ), 'tests_mkpath: rmtree > 200 char' ) ;
       		#ok( ( -d $long_path_2_prefix or mkpath( "\\\\\?\\E:\\\\TEMP\\imapsync_tests" ) ), 'tests_mkpath: -d  small path 1' ) ;
       
      @@ -5505,14 +6025,14 @@ sub tests_mkpath {
       		ok( ( -d $long_path_2 ), 'tests_mkpath: -d mkpath > 200 char done' ) ;
       		ok( ( -d $long_path_2_prefix and rmtree( $long_path_2_prefix ) ), 'tests_mkpath: rmtree > 200 char' ) ;
       		ok( (! -d $long_path_2_prefix ), 'tests_mkpath: ! -d rmtree done' ) ;
      -	
      -		print "$long_path_300\n" ;
      +
      +		myprint( "$long_path_300\n"  ) ;
       		# This one just kill the whole process without a whisper:
       		#ok( ( -d $long_path_300        or mkpath( $long_path_300 ) ),        'tests_mkpath: mkpath fails > 300 char' ) ;
       		#ok( ( -d $long_path_300 and rmtree( $long_path_300 ) ), 'tests_mkpath: rmtree \ > 300 char' ) ;
       	} ;
      -	
      -	return(  ) ;
      +
      +	return 1 ;
       }
       
       sub tests_touch {
      @@ -5523,20 +6043,20 @@ sub tests_touch {
       	ok( 0 == touch( '/no/no/no/aaa'), 'tests_touch: not /aaa') ;
       	ok( 1 == touch( 'W/tmp/tests/lili', 'W/tmp/tests/lolo'), 'tests_touch: 2 files') ;
       	ok( 0 == touch( 'W/tmp/tests/\y', '/no/no/aaa'), 'tests_touch: 2 files, 1 fails' ) ;
      -	return(  ) ;
      +	return ;
       }
       
       
       sub touch {
       	my @files = @_ ;
       	my $failures = 0 ;
      -	
      +
       	foreach my $file ( @files ) {
       		my  $fh = IO::File->new ;
       		if ( $fh->open(">> $file" ) ) {
       			$fh->close ;
       		}else{
      -                	print "Could not open file $file in write/append mode\n" ;
      +                	myprint( "Could not open file $file in write/append mode\n"  ) ;
                       	$failures++ ;
                       }
       	}
      @@ -5546,11 +6066,11 @@ sub touch {
       
       sub tests_tmpdir_has_colon_bug {
       
      -	ok( 0 == tmpdir_has_colon_bug( '' ),        'tmpdir_has_colon_bug: ' ) ;
      +	ok( 0 == tmpdir_has_colon_bug( q{} ),        'tmpdir_has_colon_bug: ' ) ;
       	ok( 0 == tmpdir_has_colon_bug( '/tmp' ),    'tmpdir_has_colon_bug: /tmp' ) ;
       	ok( 1 == tmpdir_has_colon_bug( 'C:' ),      'tmpdir_has_colon_bug: C:' ) ;
       	ok( 1 == tmpdir_has_colon_bug( 'C:\temp' ), 'tmpdir_has_colon_bug: C:\temp' ) ;
      -        
      +
               return( 0 ) ;
       }
       
      @@ -5559,7 +6079,7 @@ sub tmpdir_has_colon_bug {
       
       	my $path_filtered = filter_forbidden_characters( $path ) ;
       	if ( $path_filtered ne $path ) {
      -        	( -d $path_filtered ) and print "Path $path was previously mistakely changed to $path_filtered\n" ;
      +        	( -d $path_filtered ) and myprint( "Path $path was previously mistakely changed to $path_filtered\n"  ) ;
               	return( 1 ) ;
               }
               return( 0 ) ;
      @@ -5569,7 +6089,7 @@ sub tmpdir_fix_colon_bug {
       
               my $err = 0 ;
               if ( not (-d $tmpdir and -r _ and -w _) ) {
      -                print "tmpdir $tmpdir is not valid\n" ;
      +                myprint( "tmpdir $tmpdir is not valid\n"  ) ;
                       return( 0 ) ;
               }
               my $cachedir_new = "$tmpdir/imapsync_cache" ;
      @@ -5579,33 +6099,33 @@ sub tmpdir_fix_colon_bug {
               # check if old cache directory already exists
               my $cachedir_old = filter_forbidden_characters( $cachedir_new ) ;
               if ( not ( -d $cachedir_old ) ) {
      -                print "Old cache directory $cachedir_new no exists, nothing to do\n" ;
      +                myprint( "Old cache directory $cachedir_new no exists, nothing to do\n"  ) ;
                       return( 1 ) ;
               }
               # check if new cache directory already exists
               if ( -d $cachedir_new ) {
      -                print "New fixed cache directory $cachedir_new already exists, not moving the old one $cachedir_old. Fix this manually.\n" ;
      +                myprint( "New fixed cache directory $cachedir_new already exists, not moving the old one $cachedir_old. Fix this manually.\n"  ) ;
                       return( 0 ) ;
               }else{
                       # move the old one to the new place
      -                print "Moving $cachedir_old to $cachedir_new Do not interrupt this task.\n" ;
      -                File::Copy::Recursive::rmove( $cachedir_old, $cachedir_new ) 
      -                or do { 
      -                        print "Could not move $cachedir_old to $cachedir_new\n" ;
      +                myprint( "Moving $cachedir_old to $cachedir_new Do not interrupt this task.\n"  ) ;
      +                File::Copy::Recursive::rmove( $cachedir_old, $cachedir_new )
      +                or do {
      +                        myprint( "Could not move $cachedir_old to $cachedir_new\n"  ) ;
                               $err++ ;
                       } ;
                       # check it succeeded
                       if ( -d $cachedir_new and -r _ and -w _ ) {
      -                        print "New fixed cache directory $cachedir_new ok\n" ;
      +                        myprint( "New fixed cache directory $cachedir_new ok\n"  ) ;
                       }else{
      -                        print "New fixed cache directory $cachedir_new does not exist\n" ;
      +                        myprint( "New fixed cache directory $cachedir_new does not exist\n"  ) ;
                               $err++ ;
                       }
                       if ( -d $cachedir_old ) {
      -                        print "Old cache directory $cachedir_old still exists\n" ;
      +                        myprint( "Old cache directory $cachedir_old still exists\n"  ) ;
                               $err++ ;
                       }else{
      -                        print "Old cache directory $cachedir_old successfuly moved\n" ;
      +                        myprint( "Old cache directory $cachedir_old successfuly moved\n"  ) ;
                       }
               }
               return( not $err ) ;
      @@ -5614,43 +6134,43 @@ sub tmpdir_fix_colon_bug {
       
       sub tests_cache_folder {
       
      -	ok( '/path/fold1/fold2' eq cache_folder( '', '/path', 'fold1', 'fold2'), 'cache_folder: /path, fold1, fold2 -> /path/fold1/fold2' ) ;
      -	ok( '/pa_th/fold1/fold2' eq cache_folder( '', '/pa*th', 'fold1', 'fold2'), 'cache_folder: /pa*th, fold1, fold2 -> /path/fold1/fold2' ) ;
      -	ok( '/_p_a__th/fol_d1/fold2' eq cache_folder( '', '/>pp /path/fol_d1/fold2' ) ;
      +	ok( '/path/fold1/fold2' eq cache_folder( q{}, '/path', 'fold1', 'fold2'), 'cache_folder: /path, fold1, fold2 -> /path/fold1/fold2' ) ;
      +	ok( '/pa_th/fold1/fold2' eq cache_folder( q{}, '/pa*th', 'fold1', 'fold2'), 'cache_folder: /pa*th, fold1, fold2 -> /path/fold1/fold2' ) ;
      +	ok( '/_p_a__th/fol_d1/fold2' eq cache_folder( q{}, '/>pp /path/fol_d1/fold2' ) ;
       
       	ok( 'D:/path/fold1/fold2' eq cache_folder( 'D:', '/path', 'fold1', 'fold2'), 'cache_folder: /path, fold1, fold2 -> /path/fold1/fold2' ) ;
       	ok( 'D:/pa_th/fold1/fold2' eq cache_folder( 'D:', '/pa*th', 'fold1', 'fold2'), 'cache_folder: /pa*th, fold1, fold2 -> /path/fold1/fold2' ) ;
       	ok( 'D:/_p_a__th/fol_d1/fold2' eq cache_folder( 'D:', '/>pp /path/fol_d1/fold2' ) ;
      -	ok( '//' eq cache_folder( '', '', '', ''), 'cache_folder:  -> //' ) ;
      -	ok( '//_______' eq cache_folder( '', '', '', '*|?:"<>'), 'cache_folder: *|?:"<> -> //_______' ) ;
      -	return(  ) ;
      +	ok( '//' eq cache_folder( q{}, q{}, q{}, q{}), 'cache_folder:  -> //' ) ;
      +	ok( '//_______' eq cache_folder( q{}, q{}, q{}, '*|?:"<>'), 'cache_folder: *|?:"<> -> //_______' ) ;
      +	return ;
       }
       
       sub cache_folder {
       	my( $cache_base, $cache_dir, $h1_fold, $h2_fold ) = @_ ;
      -	
      +
       	my $sep_1 = $h1_sep || '/';
       	my $sep_2 = $h2_sep || '/';
      -	
      -	#print "$cache_dir h1_fold $h1_fold sep1 $sep_1 h2_fold $h2_fold sep2 $sep_2\n";
      +
      +	#myprint( "$cache_dir h1_fold $h1_fold sep1 $sep_1 h2_fold $h2_fold sep2 $sep_2\n" ) ;
       	$h1_fold = convert_sep_to_slash( $h1_fold, $sep_1 ) ;
       	$h2_fold = convert_sep_to_slash( $h2_fold, $sep_2 ) ;
      -                
      +
               my $cache_folder = "$cache_base" . filter_forbidden_characters( "$cache_dir/$h1_fold/$h2_fold" ) ;
      -	#print "cache_folder [$cache_folder]\n" ;
      +	#myprint( "cache_folder [$cache_folder]\n"  ) ;
               return( $cache_folder ) ;
       }
       
       sub filter_forbidden_characters  {
       	my $string = shift ;
      -        
      +
               if ( 'MSWin32' eq $OSNAME ) {
               	# Move trailing whitespace to _ " a b /c d " -> " a b_/c d_"
               	$string =~ s{\ (/|$)}{_$1}xg ;
               }
               $string =~ s{[\Q*|?:"<>\E]}{_}xg ;
      -        #print "[$string]\n" ;
      -	return ( $string ) ;
      +        #myprint( "[$string]\n"  ) ;
      +	return( $string ) ;
       }
       
       sub tests_filter_forbidden_characters  {
      @@ -5665,86 +6185,86 @@ sub tests_filter_forbidden_characters  {
       		skip( 'Not on MSWin32', 1 ) if ( 'MSWin32' eq $OSNAME ) ;
       		ok( ( 'a b ' eq filter_forbidden_characters( 'a b ' ) ), 'filter_forbidden_characters: "a b " -> "a b "' ) ;
       	} ;
      -	
      +
       	SKIP: {
       		skip( 'Only on MSWin32', 2 ) if ( 'MSWin32' ne $OSNAME ) ;
       		ok( ( ' a b_' eq filter_forbidden_characters( ' a b ' ) ), 'filter_forbidden_characters: "a b " -> "a b_"' ) ;
       		ok( ( ' a b_/ c d_' eq filter_forbidden_characters( ' a b / c d ' ) ), 'filter_forbidden_characters: " a b / c d " -> "a b_/ c d_"' ) ;
               } ;
      -	
      -	return(  ) ;
      +
      +	return ;
       }
       
       sub convert_sep_to_slash {
       	my ( $folder, $sep ) = @_ ;
      -	
      +
       	$folder =~ s{\Q$sep\E}{/}xg ;
       	return( $folder ) ;
       }
       
       sub tests_convert_sep_to_slash {
       
      -	ok('' eq convert_sep_to_slash('', '/'), 'convert_sep_to_slash: no folder');
      +	ok(q{} eq convert_sep_to_slash(q{}, '/'), 'convert_sep_to_slash: no folder');
       	ok('INBOX' eq convert_sep_to_slash('INBOX', '/'), 'convert_sep_to_slash: INBOX');
       	ok('INBOX/foo' eq convert_sep_to_slash('INBOX/foo', '/'), 'convert_sep_to_slash: INBOX/foo');
       	ok('INBOX/foo' eq convert_sep_to_slash('INBOX_foo', '_'), 'convert_sep_to_slash: INBOX_foo');
       	ok('INBOX/foo/zob' eq convert_sep_to_slash('INBOX_foo_zob', '_'), 'convert_sep_to_slash: INBOX_foo_zob');
       	ok('INBOX/foo' eq convert_sep_to_slash('INBOX.foo', '.'), 'convert_sep_to_slash: INBOX.foo');
       	ok('INBOX/foo/hi' eq convert_sep_to_slash('INBOX.foo.hi', '.'), 'convert_sep_to_slash: INBOX.foo.hi');
      -	return(  ) ;
      +	return ;
       }
       
       
       sub tests_regexmess {
      -	
      -	ok("blabla" eq regexmess("blabla"), "regexmess, no regexmess, nothing to do");
      +
      +	ok( 'blabla' eq regexmess( 'blabla' ), 'regexmess, no regexmess, nothing to do' ) ;
       
       	@regexmess = ( 'lalala' ) ;
      -	ok( not( defined( regexmess("popopo") ) ), "regexmess, bad regex lalala") ;
      -	
      +	ok( not( defined regexmess( 'popopo' ) ), 'regexmess, bad regex lalala' ) ;
      +
       	@regexmess = ( 's/p/Z/g' ) ;
      -	ok("ZoZoZo" eq regexmess("popopo"), "regexmess, s/p/Z/g");
      -	
      +	ok( 'ZoZoZo' eq regexmess( 'popopo' ), 'regexmess, s/p/Z/g' ) ;
      +
       	@regexmess = ( 's{c}{C}gxms' ) ;
      -	ok("H1: abC\nH2: Cde\n\nBody abC" 
      -		   eq regexmess("H1: abc\nH2: cde\n\nBody abc"), 
      -	   "regexmess, c->C");
      -	   
      +	ok("H1: abC\nH2: Cde\n\nBody abC"
      +		   eq regexmess( "H1: abc\nH2: cde\n\nBody abc"),
      +	   'regexmess, c->C');
      +
       	@regexmess = ( 's{\AFrom\ }{From:}gxms' ) ;
      -	ok(          '' 
      -	eq regexmess(''),
      +	ok(          q{}
      +	eq regexmess(q{}),
       	'From mbox 1 add colon blank');
      -	
      -	ok(          'From:' 
      +
      +	ok(          'From:'
       	eq regexmess('From '),
       	'From mbox 2 add colo');
      -	
      -	ok(          "\n" . 'From ' 
      +
      +	ok(          "\n" . 'From '
       	eq regexmess("\n" . 'From '),
       	'From mbox 3 add colo') ;
      -	
      -	ok(          "From: zzz\n" . 'From ' 
      +
      +	ok(          "From: zzz\n" . 'From '
       	eq regexmess("From  zzz\n" . 'From '),
       	'From mbox 4 add colo') ;
      -	
      +
       	@regexmess = ( 's{\AFrom\ [^\n]*(\n)?}{}gxms' ) ;
      -	ok(          '' 
      -	eq regexmess(''),
      +	ok(          q{}
      +	eq regexmess(q{}),
       	'From mbox 1 remove, blank');
      -	
      -	ok(          '' 
      +
      +	ok(          q{}
       	eq regexmess('From '),
       	'From mbox 2 remove');
      -	
      -	ok(          "\n" . 'From ' 
      +
      +	ok(          "\n" . 'From '
       	eq regexmess("\n" . 'From '),
       	'From mbox 3 remove');
      -	
      -	#print "[", regexmess("From  zzz\n" . 'From '), "]";
      -	ok(          ""            . 'From ' 
      +
      +	#myprint( "[", regexmess("From  zzz\n" . 'From '), "]" ) ;
      +	ok(          q{}            . 'From '
       	eq regexmess("From  zzz\n" . 'From '),
       	'From mbox 4 remove');
      -	
      +
       
       	ok(
       <<'EOM'
      @@ -5847,7 +6367,7 @@ EOM
       ),
       	'regexmess: 4 Delete header Disposition-Notification-To:');
       
      -	
      +
       	ok(
       <<'EOM'
       Date: Sat, 10 Jul 2010 05:34:45 -0700
      @@ -6037,7 +6557,7 @@ EOM
       
       
       @regexmess = ( 's{\A(.*?(?! ^$))^Disposition-Notification-To:(.*?)$}{$1X-Disposition-Notification-To:$2}igxms' ) ; # BAD!
      -@regexmess = ( 's{\A((?:[^\n]+\n)+|)(^Disposition-Notification-To:[^\n]*\n)(\r?\n|.*\n\r?\n)}{$1X-$2$3}ims' ) ; 
      +@regexmess = ( 's{\A((?:[^\n]+\n)+|)(^Disposition-Notification-To:[^\n]*\n)(\r?\n|.*\n\r?\n)}{$1X-$2$3}ims' ) ;
       
       
       ok(
      @@ -6123,7 +6643,7 @@ EOM
       ),
       	'regexmess: 15 Delete header Disposition-Notification-To:');
       
      -	
      +
       ok(
       <<'EOM'
       Date: Sat, 10 Jul 2010 05:34:45 -0700
      @@ -6170,49 +6690,49 @@ EOM
       ),
       	'regexmess: 17 Delete header Disposition-Notification-To:');
       
      -	
      -	
      +
      +
       # regex to play with Date: from the FAQ
       #@regexmess = 's{\A(.*?(?! ^$))^Date:(.*?)$}{$1Date:$2\nX-Date:$2}gxms'
       
      -return(  ) ;
      +return ;
       
       }
       
       sub regexmess {
       	my ( $string ) = @_ ;
       	foreach my $regexmess ( @regexmess ) {
      -		$debug and print "eval \$string =~ $regexmess\n" ;
      -		my $ret = eval( "\$string =~ $regexmess ; 1" ) ;
      -                #print "eval [$ret]\n" ;
      +		$debug and myprint( "eval \$string =~ $regexmess\n"  ) ;
      +		my $ret = eval "\$string =~ $regexmess ; 1" ;
      +                #myprint( "eval [$ret]\n"  ) ;
                       if ( ( not $ret ) or $@ ) {
      -			print "Error: eval regexmess '$regexmess': $@" ;
      +			myprint( "Error: eval regexmess '$regexmess': $@"  ) ;
                               return( undef ) ;
                       }
       	}
      -        $debug and print "$string\n";
      +        $debug and myprint( "$string\n" ) ;
       	return( $string ) ;
       }
       
       
       sub tests_skipmess {
       
      -	ok( not( defined( skipmess("blabla") ) ), "skipmess, no skipmess, no skip") ;
      +	ok( not( defined skipmess( 'blabla' ) ), 'skipmess, no skipmess, no skip' ) ;
       
       	@skipmess = ('[') ;
      -	ok( not( defined( skipmess("popopo") ) ), "skipmess, bad regex [") ;
      -	
      +	ok( not( defined skipmess( 'popopo' ) ), 'skipmess, bad regex [' ) ;
      +
       	@skipmess = ('lalala') ;
      -	ok( not( defined( skipmess("popopo") ) ), "skipmess, bad regex lalala") ;
      -	
      +	ok( not( defined skipmess( 'popopo' ) ), 'skipmess, bad regex lalala' ) ;
      +
       	@skipmess = ('/popopo/') ;
      -	ok( 1 == skipmess("popopo"), "skipmess, popopo match regex /popopo/") ;
      -	
      +	ok( 1 == skipmess( 'popopo' ), 'skipmess, popopo match regex /popopo/' ) ;
      +
       	@skipmess = ('/popopo/') ;
      -	ok( 0 == skipmess("rrrrrr"), "skipmess, rrrrrr does not match regex /popopo/") ;
      -	
      +	ok( 0 == skipmess( 'rrrrrr' ), 'skipmess, rrrrrr does not match regex /popopo/' ) ;
      +
       	@skipmess = ('m{^$}') ;
      -	ok( 1 == skipmess( '' ),    'skipmess: empty string yes' ) ;
      +	ok( 1 == skipmess( q{} ),    'skipmess: empty string yes' ) ;
       	ok( 0 == skipmess( 'Hi!' ), 'skipmess: empty string no' ) ;
       
       	@skipmess = ('m{i}') ;
      @@ -6228,28 +6748,28 @@ sub tests_skipmess {
       	ok( 0 == skipmess( 'lala' ), 'skipmess: A or B no' ) ;
       	ok( 0 == skipmess( "\xff" ), 'skipmess: A or B no' ) ;
       	ok( 1 == skipmess( 'AB' ),   'skipmess: A or B yes' ) ;
      -	ok( 1 == skipmess( "BA" ),   'skipmess: A or B yes' ) ;
      -	ok( 1 == skipmess( "AA" ),   'skipmess: A or B yes' ) ;
      -	ok( 1 == skipmess( "Ok Bye" ),  'skipmess: A or B yes' ) ;
      +	ok( 1 == skipmess( 'BA' ),   'skipmess: A or B yes' ) ;
      +	ok( 1 == skipmess( 'AA' ),   'skipmess: A or B yes' ) ;
      +	ok( 1 == skipmess( 'Ok Bye' ), 'skipmess: A or B yes' ) ;
       
       
      -	@skipmess = ( 'm{\A((?:[^\n]+\n)+|)^Content-Type: Message/Partial;[^\n]*\n(?:\n|.*\n\n)}ism' ) ; # SUPER BEST!
      -	
      +	@skipmess = ( 'm#\A((?:[^\n]+\n)+|)^Content-Type: Message/Partial;[^\n]*\n(?:\n|.*\n\n)#ism' ) ; # SUPER BEST!
       
      -	
      -	ok( 1 == skipmess( 
      +
      +
      +	ok( 1 == skipmess(
       <<'EOM'
       Date: Sat, 10 Jul 2010 05:34:45 -0700
      -Content-Type: Message/Partial; blabla 
      +Content-Type: Message/Partial; blabla
       From:
       
       Hello!
       Bye.
       EOM
      -), 
      +),
           'skipmess: 1 match Content-Type: Message/Partial' ) ;
       
      -	ok( 0 == skipmess( 
      +	ok( 0 == skipmess(
       <<'EOM'
       Date: Sat, 10 Jul 2010 05:34:45 -0700
       From:
      @@ -6257,65 +6777,65 @@ From:
       Hello!
       Bye.
       EOM
      -), 
      +),
           'skipmess: 2 not match Content-Type: Message/Partial' ) ;
       
       
      -	ok( 1 == skipmess( 
      +	ok( 1 == skipmess(
       <<'EOM'
       Date: Sat, 10 Jul 2010 05:34:45 -0700
       From:
      -Content-Type: Message/Partial; blabla 
      +Content-Type: Message/Partial; blabla
       
       Hello!
       Bye.
       EOM
      -), 
      +),
           'skipmess: 3 match Content-Type: Message/Partial' ) ;
       
      -	ok( 0 == skipmess( 
      +	ok( 0 == skipmess(
       <<'EOM'
       Date: Sat, 10 Jul 2010 05:34:45 -0700
       From:
       
       Hello!
      -Content-Type: Message/Partial; blabla 
      +Content-Type: Message/Partial; blabla
       Bye.
       EOM
      -), 
      +),
           'skipmess: 4 not match Content-Type: Message/Partial' ) ;
      -		
      -	
      -	ok( 0 == skipmess( 
      +
      +
      +	ok( 0 == skipmess(
       <<'EOM'
       Date: Sat, 10 Jul 2010 05:34:45 -0700
       From:
       
       Hello!
      -Content-Type: Message/Partial; blabla 
      +Content-Type: Message/Partial; blabla
       
       Bye.
       EOM
      -), 
      +),
           'skipmess: 5 not match Content-Type: Message/Partial' ) ;
      -		
      -	
      -	ok( 1 == skipmess( 
      +
      +
      +	ok( 1 == skipmess(
       <<'EOM'
       Date: Sat, 10 Jul 2010 05:34:45 -0700
      -Content-Type: Message/Partial; blabla 
      +Content-Type: Message/Partial; blabla
       From:
       
       Hello!
       
      -Content-Type: Message/Partial; blabla 
      +Content-Type: Message/Partial; blabla
       
       Bye.
       EOM
      -), 
      +),
           'skipmess: 6 match Content-Type: Message/Partial' ) ;
      -		
      -	ok( 1 == skipmess( 
      +
      +	ok( 1 == skipmess(
       <<'EOM'
       Date: Sat, 10 Jul 2010 05:34:45 -0700
       Content-Type: Message/Partial;
      @@ -6324,10 +6844,10 @@ From:
       Hello!
       Bye.
       EOM
      -), 
      +),
           'skipmess: 7 match Content-Type: Message/Partial' ) ;
       
      -	ok( 1 == skipmess( 
      +	ok( 1 == skipmess(
       <<'EOM'
       Date: Wed, 2 Jul 2014 02:26:40 +0000
       MIME-Version: 1.0
      @@ -6342,11 +6862,11 @@ Content-Type: message/partial;
       Hello!
       Bye.
       EOM
      -), 
      +),
           'skipmess: 8 match Content-Type: Message/Partial' ) ;
       
      -	
      -ok( 1 == skipmess( 
      +
      +ok( 1 == skipmess(
       <<'EOM'
       Return-Path: 
       Received: by lamiral.info (Postfix, from userid 1000)
      @@ -6364,10 +6884,10 @@ From: gilles@lamiral.info (Gilles LAMIRAL)
       
       test: aethaecohngiexao
       EOM
      -), 
      +),
           'skipmess: 9 match Content-Type: Message/Partial' ) ;
       
      -ok( 1 == skipmess( 
      +ok( 1 == skipmess(
       <<'EOM'
       Date: Mon,  2 Mar 2015 15:38:34 +0100 (CET)
       From: gilles@lamiral.info (Gilles LAMIRAL)
      @@ -6379,10 +6899,10 @@ Content-Type: message/partial;
       test: aethaecohngiexao
       EOM
       . "lalala\n" x 3000000
      -), 
      +),
           'skipmess: 10 match Content-Type: Message/Partial' ) ;
       
      -ok( 0 == skipmess( 
      +ok( 0 == skipmess(
       <<'EOM'
       Date: Mon,  2 Mar 2015 15:38:34 +0100 (CET)
       From: gilles@lamiral.info (Gilles LAMIRAL)
      @@ -6390,11 +6910,11 @@ From: gilles@lamiral.info (Gilles LAMIRAL)
       test: aethaecohngiexao
       EOM
       . "lalala\n" x 3000000
      -), 
      +),
           'skipmess: 11 match Content-Type: Message/Partial' ) ;
       
       
      -ok( 0 == skipmess( 
      +ok( 0 == skipmess(
       <<"EOM"
       From: fff\r
       To: fff\r
      @@ -6405,29 +6925,25 @@ Content-Type: text/plain; charset=iso-8859-1\r
       Content-Transfer-Encoding: 7bit\r
       \r
       EOM
      -. " !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg\r\n" x 50000
      -), 
      +. qq{!#"$%&'()*+,-./0123456789:;<=>?\@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg\r\n } x 32730
      +),
           'skipmess: 12 not match Content-Type: Message/Partial' ) ;
      -
      -	
      -	return(  ) ;
      +        # Complex regular subexpression recursion limit (32766) exceeded with more lines
      +        # exit;
      +	return ;
       }
       
       sub skipmess {
       	my ( $string ) = @_ ;
       	my $match ;
      -	#print "$string\n" ;
      +	#myprint( "$string\n"  ) ;
       	foreach my $skipmess ( @skipmess ) {
      -		my $regex = eval { qr/$skipmess/ } ;
      -		if ( $@ ) { print "invalid regex --skipmess $skipmess \n$@"  ;
      -                	return( undef ) ;
      -		}
      -		$debug and print "eval \$match = \$string =~ $skipmess\n" ;
      -		my $ret = eval( "\$match = \$string =~ $skipmess ; 1" ) ;
      -		#print "eval [$ret]\n" ;
      -		$debug and print "match [$match]\n" ;
      +		$debug and myprint( "eval \$match = \$string =~ $skipmess\n"  ) ;
      +		my $ret = eval "\$match = \$string =~ $skipmess ; 1"  ;
      +		#myprint( "eval [$ret]\n"  ) ;
      +		$debug and myprint( "match [$match]\n"  ) ;
       		if ( ( not $ret ) or $@ ) {
      -			print "Error: eval skipmess '$skipmess': $@" ;
      +			myprint( "Error: eval skipmess '$skipmess': $@"  ) ;
       			return( undef ) ;
       		}
       		return( $match ) if ( $match ) ;
      @@ -6440,6 +6956,10 @@ sub skipmess {
       
       sub tests_bytes_display_string {
       
      +        is(    'NA', bytes_display_string(       ), 'bytes_display_string: no args => NA' ) ;
      +        is(    'NA', bytes_display_string( undef ), 'bytes_display_string: undef   => NA' ) ;
      +        is(    'NA', bytes_display_string( 'blabla' ), 'bytes_display_string: blabla   => NA' ) ;
      +        
       	ok(    '0.000 KiB' eq bytes_display_string(       0 ), 'bytes_display_string:       0' ) ;
       	ok(    '0.001 KiB' eq bytes_display_string(       1 ), 'bytes_display_string:       1' ) ;
       	ok(    '0.010 KiB' eq bytes_display_string(      10 ), 'bytes_display_string:      10' ) ;
      @@ -6459,106 +6979,195 @@ sub tests_bytes_display_string {
       	ok( '1024.000 PiB' eq bytes_display_string( 1152921504606846976 ), 'bytes_display_string: 1152921504606846976' ) ;
       
       	ok( '1048576.000 PiB' eq bytes_display_string( 1180591620717411303424 ), 'bytes_display_string: 1180591620717411303424' ) ;
      -        
      -        #print  bytes_display_string( 1180591620717411303424 ), "\n" ;
      -	return(  ) ;
      +
      +        #myprint(  bytes_display_string( 1180591620717411303424 ), "\n"  ) ;
      +	return ;
       }
       
      -sub bytes_display_string { 
      +sub bytes_display_string {
       	my ( $bytes ) = @_ ;
       
      -	my $readable_value = '' ;
      -       
      +	my $readable_value = q{} ;
      +
      +        if ( ! defined( $bytes ) ) {
      +                return( 'NA' ) ;
      +        }
      +
      +        if ( not match_number( $bytes ) ) {
      +                return( 'NA' ) ;
      +        }
      +
      +        
      +
       	SWITCH: {
      -        	if ( abs( $bytes ) < ( 1000 * 1024 ) ) {
      -        		$readable_value = sprintf( "%.3f KiB", $bytes / 1024) ; 
      +        	if ( abs( $bytes ) < ( 1000 * $KIBI ) ) {
      +        		$readable_value = mysprintf( '%.3f KiB', $bytes / $KIBI) ;
                       	last SWITCH ;
               	}
      -        	if ( abs( $bytes ) < ( 1000 * 1024 * 1024 ) ) {
      -        		$readable_value = sprintf( "%.3f MiB", $bytes / (1024 * 1024) ) ;
      +        	if ( abs( $bytes ) < ( 1000 * $KIBI * $KIBI ) ) {
      +        		$readable_value = mysprintf( '%.3f MiB', $bytes / ($KIBI * $KIBI) ) ;
               	        last SWITCH ;
               	}
      -        	if ( abs( $bytes ) < ( 1000 * 1024 * 1024 * 1024) ) {
      -			$readable_value = sprintf("%.3f GiB", $bytes / (1024 * 1024 * 1024) ) ;
      +        	if ( abs( $bytes ) < ( 1000 * $KIBI * $KIBI * $KIBI) ) {
      +			$readable_value = mysprintf( '%.3f GiB', $bytes / ($KIBI * $KIBI * $KIBI) ) ;
               	        last SWITCH ;
               	}
      -        	if ( abs( $bytes ) < ( 1000 * 1024 * 1024 * 1024 * 1024) ) {
      -			$readable_value = sprintf( "%.3f TiB", $bytes / (1024 * 1024 * 1024 * 1024) ) ;
      +        	if ( abs( $bytes ) < ( 1000 * $KIBI * $KIBI * $KIBI * $KIBI) ) {
      +			$readable_value = mysprintf( '%.3f TiB', $bytes / ($KIBI * $KIBI * $KIBI * $KIBI) ) ;
               	        last SWITCH ;
               	} else {
      -			$readable_value = sprintf( "%.3f PiB", $bytes / (1024 * 1024 * 1024 * 1024 * 1024) ) ;
      +			$readable_value = mysprintf( '%.3f PiB', $bytes / ($KIBI * $KIBI * $KIBI * $KIBI * $KIBI) ) ;
               	}
      -		# if you have exabytes (EiB) of email to transfer, you have too much email
      +		# if you have exabytes (EiB) of email to transfer, you have too much email!
       	}
      -        #print "$bytes = $readable_value\n" ;
      +        #myprint( "$bytes = $readable_value\n"  ) ;
               return( $readable_value ) ;
       }
       
       sub stats {
      -	$timeend = time(  );
      -	my $timediff = $timeend - $sync->{timestart} ;
      +        my $sync_loc = shift ;
       
      -	my $timeend_str   = localtime( $timeend ) ;
      +        if ( ! $sync_loc->{stats} ) {
      +                return ;
      +        }
               
      +	$timeend = time ;
      +	my $timediff = $timeend - $sync_loc->{timestart} ;
      +
      +	my $timeend_str   = localtime $timeend ;
      +
       	my $memory_consumption = 0 ;
               $memory_consumption = memory_consumption(  ) || 0 ;
      -	my $memory_ratio = ($max_msg_size_in_bytes) ?  
      -		sprintf('%.1f', $memory_consumption / $max_msg_size_in_bytes) : "NA" ;
      +	my $memory_ratio = ($max_msg_size_in_bytes) ?
      +		mysprintf('%.1f', $memory_consumption / $max_msg_size_in_bytes) : 'NA' ;
       
       	my $host1_reconnect_count = $imap1->Reconnect_counter() || 0 ;
       	my $host2_reconnect_count = $imap2->Reconnect_counter() || 0 ;
       
      -	print   "++++ Statistics\n" ;
      -	print   "Transfer started on               : $timestart_str\n";
      -	print   "Transfer ended on                 : $timeend_str\n";
      -	printf( "Transfer time                     : %.1f sec\n", $timediff ) ;
      -	print   "Folders synced                    : $h1_folders_wanted_ct/$h1_folders_wanted_nb synced\n";
      -	print   "Messages transferred              : $nb_msg_transferred ";
      -	print   "(could be $nb_msg_skipped_dry_mode without dry mode)" if ($dry);
      -	print   "\n";
      -	print   "Messages skipped                  : $nb_msg_skipped\n";
      -	print   "Messages found duplicate on host1 : $h1_nb_msg_duplicate\n";
      -	print   "Messages found duplicate on host2 : $h2_nb_msg_duplicate\n";
      -	print   "Messages void (noheader) on host1 : $h1_nb_msg_noheader\n";
      -	print   "Messages void (noheader) on host2 : $h2_nb_msg_noheader\n";
      -	print   "Messages deleted on host1         : $h1_nb_msg_deleted\n";
      -	print   "Messages deleted on host2         : $h2_nb_msg_deleted\n";
      -        printf( "Total bytes transferred           : %d (%s)\n",
      +	myprint(  "++++ Statistics\n"  ) ;
      +	myprint(  "Transfer started on               : $timestart_str\n"  ) ;
      +	myprint(  "Transfer ended on                 : $timeend_str\n"  ) ;
      +	myprintf( "Transfer time                     : %.1f sec\n", $timediff ) ;
      +	myprint(  "Folders synced                    : $h1_folders_wanted_ct/$h1_folders_wanted_nb synced\n"  ) ;
      +	myprint(  "Messages transferred              : $nb_msg_transferred "  ) ;
      +	myprint(  "(could be $nb_msg_skipped_dry_mode without dry mode)" ) if ( $dry ) ;
      +	myprint(  "\n" ) ;
      +	myprint(  "Messages skipped                  : $nb_msg_skipped\n"  ) ;
      +	myprint(  "Messages found duplicate on host1 : $h1_nb_msg_duplicate\n"  ) ;
      +	myprint(  "Messages found duplicate on host2 : $h2_nb_msg_duplicate\n"  ) ;
      +	myprint(  "Messages void (noheader) on host1 : $h1_nb_msg_noheader\n"  ) ;
      +	myprint(  "Messages void (noheader) on host2 : $h2_nb_msg_noheader\n"  ) ;
      +	myprint(  "Messages deleted on host1         : $h1_nb_msg_deleted\n"  ) ;
      +	myprint(  "Messages deleted on host2         : $h2_nb_msg_deleted\n"  ) ;
      +        myprintf( "Total bytes transferred           : %s (%s)\n",
                       $total_bytes_transferred,
      -                bytes_display_string($total_bytes_transferred));
      -        printf( "Total bytes duplicate host1       : %d (%s)\n",
      +                bytes_display_string( $total_bytes_transferred ) ) ;
      +        myprintf( "Total bytes duplicate host1       : %s (%s)\n",
                       $h1_total_bytes_duplicate,
      -                bytes_display_string($h1_total_bytes_duplicate));
      -        printf( "Total bytes duplicate host2       : %d (%s)\n",
      +                bytes_display_string( $h1_total_bytes_duplicate) ) ;
      +        myprintf( "Total bytes duplicate host2       : %s (%s)\n",
                       $h2_total_bytes_duplicate,
      -                bytes_display_string($h2_total_bytes_duplicate));
      -        printf( "Total bytes skipped               : %d (%s)\n",
      +                bytes_display_string( $h2_total_bytes_duplicate) ) ;
      +        myprintf( "Total bytes skipped               : %s (%s)\n",
                       $total_bytes_skipped,
      -                bytes_display_string($total_bytes_skipped));
      -        printf( "Total bytes error                 : %d (%s)\n",
      +                bytes_display_string( $total_bytes_skipped ) ) ;
      +        myprintf( "Total bytes error                 : %s (%s)\n",
                       $total_bytes_error,
      -                bytes_display_string($total_bytes_error));
      +                bytes_display_string( $total_bytes_error ) ) ;
       	$timediff ||= 1 ; # No division per 0
      -	printf("Message rate                      : %.1f messages/s\n", $nb_msg_transferred / $timediff ) ;
      -	printf("Average bandwidth rate            : %.1f KiB/s\n", $total_bytes_transferred / 1024 / $timediff ) ;
      -	print  "Reconnections to host1            : $host1_reconnect_count\n" ;
      -	print  "Reconnections to host2            : $host2_reconnect_count\n" ;
      -	printf("Memory consumption                : %.1f MiB\n", $memory_consumption / 1024 / 1024 ) ;
      -	print  "Biggest message                   : $max_msg_size_in_bytes bytes\n" ;
      -#	print  "Memory/biggest message ratio      : $memory_ratio\n" ;
      +	myprintf("Message rate                      : %.1f messages/s\n", $nb_msg_transferred / $timediff ) ;
      +	myprintf("Average bandwidth rate            : %.1f KiB/s\n", $total_bytes_transferred / $KIBI / $timediff ) ;
      +	#myprint(  "Reconnections to host1            : $host1_reconnect_count\n"  ) ;
      +	#myprint(  "Reconnections to host2            : $host2_reconnect_count\n"  ) ;
      +	myprintf("Memory consumption                : %.1f MiB\n", $memory_consumption / $KIBI / $KIBI ) ;
      +        myprintf("Biggest message                   : %s bytes (%s)\n",
      +                $max_msg_size_in_bytes,
      +                bytes_display_string( $max_msg_size_in_bytes) ) ;
      +	myprint(  "Memory/biggest message ratio      : $memory_ratio\n"  ) ;
               if ( $foldersizesatend and $foldersizes ) {
      -	printf("Start difference host2 - host1    : %s messages, %s bytes (%s)\n", $h2_nb_msg_start - $h1_nb_msg_at_start,
      -                                                        $h2_bytes_start  - $h1_bytes_start,
      -                                                        bytes_display_string( $h2_bytes_start  - $h1_bytes_start ) ) ;
      -	printf("Final difference host2 - host1    : %s messages, %s bytes (%s)\n", $h2_nb_msg_end   - $h1_nb_msg_end,
      -                                                        $h2_bytes_end    - $h1_bytes_end,
      -                                                        bytes_display_string( $h2_bytes_end    - $h1_bytes_end ) ) ;
      +        
      +
      +        my $nb_msg_start_diff = diff_or_NA( $h2_nb_msg_start, $h1_nb_msg_start ) ;
      +        my $bytes_start_diff  = diff_or_NA( $h2_bytes_start,  $h1_bytes_start  ) ;
      +        
      +	myprintf("Start difference host2 - host1    : %s messages, %s bytes (%s)\n", $nb_msg_start_diff,
      +                                                        $bytes_start_diff,
      +                                                        bytes_display_string( $bytes_start_diff ) ) ;
      +
      +        my $nb_msg_end_diff = diff_or_NA( $h2_nb_msg_end, $h1_nb_msg_end ) ;
      +        my $bytes_end_diff  = diff_or_NA( $h2_bytes_end,  $h1_bytes_end  ) ;
      +        
      +	myprintf("Final difference host2 - host1    : %s messages, %s bytes (%s)\n", $nb_msg_end_diff,
      +                                                        $bytes_end_diff,
      +                                                        bytes_display_string( $bytes_end_diff ) ) ;
      +        }
      +	myprint(  "Detected $sync->{nb_errors} errors\n\n"  ) ;
      +
      +	myprint(  $warn_release, "\n"  ) ;
      +	myprint(  thank_author(  )  ) ;
      +	return ;
      +}
      +
      +sub diff_or_NA {
      +        my( $n1, $n2 ) = @ARG ;
      +        
      +        if ( not defined $n1 or not defined $n2 ) {
      +                return 'NA' ;
      +        }
      +        
      +        if ( not match_number( $n1 ) 
      +          or not match_number( $n2 ) ) {
      +                 return 'NA' ;
               }
      -	print  "Detected $nb_errors errors\n\n" ;
      +        
      +        return( $n1 - $n2 ) ;
      +}
      +
      +sub match_number {
      +        my $n = shift @ARG ;
      +        
      +        if ( not defined $n ) {
      +                return 0 ;
      +        }
      +        if ( $n =~  /[0-9]+\.?[0-9]?/ ) {
      +                return 1 ;
      +        }
      +        else {
      +                return 0 ;
      +        }
      +}
       
      -	print  $warn_release, "\n" ;
      -	print  thank_author(  ) ;
      -	return(  ) ;
      +
      +sub tests_match_number {
      +
      +        is( 0, match_number(   ),        'match_number: no parameters => 0' ) ;
      +        is( 0, match_number( undef ),    'match_number:         undef => 0' ) ;
      +        is( 0, match_number( 'blabla' ), 'match_number:        blabla => 0' ) ;
      +        is( 1, match_number( 0 ),        'match_number:             0 => 1' ) ;
      +        is( 1, match_number( 1 ),        'match_number:             1 => 1' ) ;
      +        is( 1, match_number( 1.0 ),      'match_number:           1.0 => 1' ) ;
      +        is( 1, match_number( 0.0 ),      'match_number:           0.0 => 1' ) ;
      +        return ;
      +}
      +
      +
      +
      +sub tests_diff_or_NA {
      +
      +        is( 'NA', diff_or_NA(  ),             'diff_or_NA: no parameters => NA' ) ;
      +        is( 'NA', diff_or_NA( undef ),        'diff_or_NA: undef         => NA' ) ;
      +        is( 'NA', diff_or_NA( undef, undef ), 'diff_or_NA: undef  undef  => NA' ) ;
      +        is( 'NA', diff_or_NA( undef, 1 ),     'diff_or_NA: undef  1      => NA' ) ;
      +        is( 'NA', diff_or_NA( 1, undef ),     'diff_or_NA: 1      undef  => NA' ) ;
      +        is( 'NA', diff_or_NA( 'blabla', 1 ),  'diff_or_NA: blabla 1      => NA' ) ;
      +        is( 'NA', diff_or_NA( 1, 'blabla' ),  'diff_or_NA: 1      blabla => NA' ) ;
      +        is( 0, diff_or_NA( 1, 1 ),            'diff_or_NA: 1      1      =>  0' ) ;
      +        is( 1, diff_or_NA( 1, 0 ),            'diff_or_NA: 1      0      =>  1' ) ;
      +        is( -1, diff_or_NA( 0, 1 ),           'diff_or_NA: 0      1      => -1' ) ;
      +        is( 0, diff_or_NA( 1.0, 1 ),          'diff_or_NA: 1.0    1      =>  0' ) ;
      +        is( 1, diff_or_NA( 1.0, 0 ),          'diff_or_NA: 1.0    0      =>  1' ) ;
      +        is( -1, diff_or_NA( 0, 1.0 ),         'diff_or_NA: 0      1.0    => -1' ) ;
      +        return ;
       }
       
       sub thank_author {
      @@ -6571,62 +7180,68 @@ sub load_modules {
       	if ( $ssl1 or $ssl2 or $tls1 or $tls2) {
               	# not yet a "use" statement
               	require IO::Socket::SSL ;
      +		if ( $sync->{inet4} ) {
      +		        IO::Socket::SSL->import( 'inet4' ) ;
      +		}
      +		if ( $sync->{inet6} ) {
      +		        IO::Socket::SSL->import( 'inet6' ) ;
      +		}
               }
       
      -       if ( ( ( not( $password1 or $passfile1 ) ) 
      -	   or (not ( $password2 or $passfile2 ) ) 
      +       if ( ( ( not( $password1 or $passfile1 ) )
      +	   or (not ( $password2 or $passfile2 ) )
                   )
       	and ( not $help ) ) {
      -        	# now a "use" statement 
      +        	# now a "use" statement
               	#require Term::ReadKey ;
               }
       
      -	return(  ) ;
      +	return ;
       }
       
       
       
       sub parse_header_msg {
      -	my ($imap, $m_uid, $s_heads, $s_fir, $side, $s_hash) = @_;
      -	
      -	my $head = $s_heads->{$m_uid};
      -	my $headnum =  scalar(keys(%$head));
      -	$debug and print "$side uid $m_uid head nb pass one: ", $headnum, "\n";
      -	
      +	my ( $imap, $m_uid, $s_heads, $s_fir, $side, $s_hash ) = @_ ;
      +
      +	my $head = $s_heads->{$m_uid} ;
      +	my $headnum =  scalar keys  %{ $head }   ;
      +	$debug and myprint( "$side uid $m_uid head nb pass one: ", $headnum, "\n"  ) ;
      +
       	if ( ( ! $headnum ) and ( $wholeheaderifneeded ) ){
      -		print "$side uid $m_uid no header by parse_headers so taking whole header with BODY.PEEK[HEADER]\n" ;
      -		$imap->fetch($m_uid, "BODY.PEEK[HEADER]");
      -		my $whole_header = $imap->_transaction_literals;
      -		
      -                #print $whole_header;
      +		myprint( "$side uid $m_uid no header by parse_headers so taking whole header with BODY.PEEK[HEADER]\n"  ) ;
      +		$imap->fetch($m_uid, 'BODY.PEEK[HEADER]' ) ;
      +		my $whole_header = $imap->_transaction_literals ;
      +
      +                #myprint( $whole_header ) ;
                       $head = decompose_header( $whole_header ) ;
      -                
      -                $headnum =  scalar( keys( %$head ) ) ;
      -	        $debug and print "$side uid $m_uid head nb pass two: ", $headnum, "\n";
      +
      +                $headnum =  scalar  keys  %{ $head }   ;
      +	        $debug and myprint( "$side uid $m_uid head nb pass two: ", $headnum, "\n" ) ;
       	}
       
      -        #print Data::Dumper->Dump( [ $head, \%useheader ] ) ;
      +        #myprint( Data::Dumper->Dump( [ $head, \%useheader ] )  ) ;
       
       	my $headstr ;
      -        
      +
               $headstr = header_construct( $head, $side, $m_uid ) ;
      -		
      -	if ( ( ! $headstr) and ( $addheader ) and ( $side eq "Host1" )){
      +
      +	if ( ( ! $headstr) and ( $addheader ) and ( $side eq 'Host1' ) ) {
               	my $header = add_header( $m_uid ) ;
      -		print "Host1 uid $m_uid no header found so adding our own [$header]\n";
      -		$headstr .= uc( $header ) ;
      -		$s_fir->{$m_uid}->{"NO_HEADER"} = 1;
      +		myprint( "Host1 uid $m_uid no header found so adding our own [$header]\n" ) ;
      +		$headstr .= uc  $header  ;
      +		$s_fir->{$m_uid}->{NO_HEADER} = 1;
       	}
       
      -	return(  ) if ( ! $headstr ) ;
      -	
      -	my $size  = $s_fir->{$m_uid}->{"RFC822.SIZE"};
      -	my $flags = $s_fir->{$m_uid}->{"FLAGS"};
      -	my $idate = $s_fir->{$m_uid}->{"INTERNALDATE"};
      -	$size = length( $headstr ) unless ( $size ) ;
      +	return if ( ! $headstr ) ;
      +
      +	my $size  = $s_fir->{$m_uid}->{'RFC822.SIZE'} ;
      +	my $flags = $s_fir->{$m_uid}->{'FLAGS'} ;
      +	my $idate = $s_fir->{$m_uid}->{'INTERNALDATE'} ;
      +	$size = length $headstr  unless ( $size ) ;
       	my $m_md5 = md5_base64( $headstr ) ;
      -	$debug and print "$side uid $m_uid sig $m_md5 size $size idate $idate\n";
      -	my $key;
      +	$debug and myprint( "$side uid $m_uid sig $m_md5 size $size idate $idate\n"  ) ;
      +	my $key ;
               if ($skipsize) {
                       $key = "$m_md5";
               }
      @@ -6647,21 +7262,21 @@ sub parse_header_msg {
       sub header_construct {
       
       	my( $head, $side, $m_uid ) = @_ ;
      -        
      +
               my $headstr ;
      -	foreach my $h ( sort keys( %$head ) ) {
      -                next if ( not exists( $useheader{ uc( $h ) } )
      -                      and not exists( $useheader{ 'ALL' } )
      +	foreach my $h ( sort keys  %{ $head }  ) {
      +                next if ( not ( exists $useheader{ uc  $h  } )
      +                      and ( not exists  $useheader{ 'ALL' } )
                       ) ;
       		foreach my $val ( sort @{$head->{$h}} ) {
      -                	
      +
                               my $H = header_line_normalize( $h, $val ) ;
      -                                                
      +
       			# show stuff in debug mode
      -			$debug and print "$side uid $m_uid header [$H]", "\n" ;
      -			
      +			$debug and myprint( "$side uid $m_uid header [$H]", "\n"  ) ;
      +
       			if ($skipheader and $H =~ m/$skipheader/xi) {
      -				$debug and print "$side uid $m_uid skipping header [$H]\n" ;
      +				$debug and myprint( "$side uid $m_uid skipping header [$H]\n"  ) ;
       				next ;
       			}
       			$headstr .= "$H" ;
      @@ -6673,7 +7288,7 @@ sub header_construct {
       
       sub header_line_normalize {
       	my( $header_key,  $header_val ) = @_ ;
      -	
      +
               # no 8-bit data in headers !
               $header_val =~ s/[\x80-\xff]/X/xog;
       
      @@ -6690,19 +7305,19 @@ sub header_line_normalize {
               $header_val =~ s/\s+/ /xgo;
       
               # remove Message-Id value domain part ( Mailenable changes it )
      -        if ( ( $messageidnodomain ) and ( 'MESSAGE-ID' eq uc( $header_key ) ) ) { $header_val =~ s/^([^@]+).*$/$1/xo ; }
      +        if ( ( $messageidnodomain ) and ( 'MESSAGE-ID' eq uc  $header_key  ) ) { $header_val =~ s/^([^@]+).*$/$1/xo ; }
       
      -        # and uppercase header line 
      +        # and uppercase header line
               # (dbmail and dovecot)
       
      -        my $header_line = uc("$header_key: $header_val") ;
      +        my $header_line = uc "$header_key: $header_val" ;
       
       	return( $header_line ) ;
       }
       
       sub tests_header_line_normalize {
       
      -	ok( ': ' eq header_line_normalize( '', '' ), 'header_line_normalize: empty args' ) ;
      +	ok( ': ' eq header_line_normalize( q{}, q{} ), 'header_line_normalize: empty args' ) ;
       	ok( 'HHH: VVV' eq header_line_normalize( 'hhh', 'vvv' ), 'header_line_normalize: hhh vvv ' ) ;
       	ok( 'HHH: VVV' eq header_line_normalize( 'hhh', '  vvv' ), 'header_line_normalize: remove first blancs' ) ;
       	ok( 'HHH: AA BB CCC D' eq header_line_normalize( 'hhh', 'aa  bb   ccc d' ), 'header_line_normalize: remove succesive blanks' ) ;
      @@ -6710,31 +7325,46 @@ sub tests_header_line_normalize {
       	ok( 'HHH: VVV XX YY' eq header_line_normalize( 'hhh', "vvv\t\txx\tyy" ), 'header_line_normalize: tabs' ) ;
       	ok( 'HHH: XABX' eq header_line_normalize( 'hhh', "\x80AB\xff" ), 'header_line_normalize: 8bit' ) ;
       
      -	return(  ) ;
      +	return ;
       }
       
       
       sub firstline {
               # extract the first line of a file (without \n)
       
      -        my($file) = @_ ;
      -        my $line  = "" ;
      -        
      -        open( my $FILE, '<', $file ) or die_clean( "error [$file]: $! " ) ;
      -        chomp( $line = <$FILE> ) ;
      +        my( $file ) = @_ ;
      +        my $line  = q{} ;
      +        my $FILE ;
      +        open $FILE, '<', $file or do {
      +                myprint( "Error opening file $file : $!\n" ) ;
      +                return ;
      +        } ;
      +        $line = <$FILE> || q{} ;
               close $FILE ;
      -        $line = ( $line ) ? $line: "error !EMPTY! [$file]" ;
      +        chomp $line ;
               return $line ;
       }
       
      +sub tests_firstline {
      +        is( 1 , string_to_file( "blabla\n", 'tmp/firstline.txt' ), 'tests_firstline: put blabla in tmp/firstline.txt' ) ;
      +        is( 'blabla' , firstline( 'tmp/firstline.txt' ), 'tests_firstline: get blabla from tmp/firstline.txt' ) ;
      +        is( undef , firstline( 'tmp/noexist.txt' ), 'tests_firstline: get blabla from tmp/noexist.txt' ) ;
      +        is( 1 , string_to_file( q{}, 'tmp/firstline2.txt' ), 'tests_firstline: put empty string in tmp/firstline2.txt' ) ;
      +        is( q{} , firstline( 'tmp/firstline2.txt' ), 'tests_firstline: get empty string from tmp/firstline2.txt' ) ;
      +        is( 1 , string_to_file( "\n", 'tmp/firstline3.txt' ), 'tests_firstline: put CR in tmp/firstline3.txt' ) ;
      +        is( q{} , firstline( 'tmp/firstline3.txt' ), 'tests_firstline: get empty string from tmp/firstline3.txt' ) ;
      +
      +        return ;
      +}
      +
       
       sub file_to_string {
       	my( $file ) = @_ ;
       	my @string ;
      -	open( my $FILE, '<', $file )  or die_clean( "error [$file]: $! " ) ;
      +	open my $FILE, '<', $file or die_clean( "Error with file $file : $! " ) ;
       	@string = <$FILE> ;
       	close $FILE ;
      -	return join('', @string ) ;
      +	return( join q{}, @string ) ;
       }
       
       
      @@ -6743,116 +7373,203 @@ sub string_to_file {
       	sysopen( FILE, $file, O_WRONLY|O_TRUNC|O_CREAT, 0600) or die_clean( "$! $file" ) ;
       	print FILE $string ;
       	close FILE ;
      -	return(  ) ;
      -}
      -
      +	return 1 ;
      +}
      +
      +q^
      +This is a multiline comment.
      +Based on David Carter discussion, to do:
      +* Call parameters stay the same.
      +* Now always "return( $string, $error )". Descriptions below.
      +OK * Still    capture STDOUT via "1> $output_tmpfile" to finish in $string and "return( $string, $error )"
      +OK * Now also capture STDERR via "2> $error_tmpfile"  to finish in $error  and "return( $string, $error )"
      +OK * in case of CHILD_ERROR, return( undef, $error ) 
      +  and print $error, with folder/UID/maybeSubject context,
      +  on console and at the end with the final error listing. Count this as a sync error.
      +* in case of good command, take final $string as is, unless void. In case $error with value then print it.
      +* in case of good command and final $string empty, consider it like CHILD_ERROR =>
      +  return( undef, $error ) and print $error, with folder/UID/maybeSubject context,
      +  on console and at the end with the final error listing. Count this as a sync error. 
      +^ if 0 ; # End of multiline comment.
       
       sub pipemess {
       	my ( $string, @commands ) = @_ ;
      -	my $input_tmpfile  = "$tmpdir/imapsync_tmp_file.$PROCESS_ID.inp.txt" ;
      -	my $output_tmpfile = "$tmpdir/imapsync_tmp_file.$PROCESS_ID.out.txt" ;
      +	my $error = q{} ;
               foreach my $command ( @commands ) {
      -        	string_to_file( $string, $input_tmpfile  ) ;
      -			` $command < $input_tmpfile > $output_tmpfile ` ;
      -			if ( $CHILD_ERROR ) {
      -				my $cmd_exit_value = $CHILD_ERROR >> 8 ;
      -				my $cmd_end_signal = $CHILD_ERROR & 127 ;
      -                                my $signal_log = ( $cmd_end_signal ) ? " signal $cmd_end_signal\n" : "\n" ;
      -				print "Failure: --pipemess command \"$command\" died with exit value $cmd_exit_value" 
      -                                .  $signal_log ;
      -				unlink( $input_tmpfile, $output_tmpfile ) ;
      -				return( ) ;
      -			}
      -			$string = file_to_string( $output_tmpfile ) ;
      +                my $input_tmpfile  = "$tmpdir/imapsync_tmp_file.$PROCESS_ID.inp.txt" ;
      +                my $output_tmpfile = "$tmpdir/imapsync_tmp_file.$PROCESS_ID.out.txt" ;
      +                my $error_tmpfile  = "$tmpdir/imapsync_tmp_file.$PROCESS_ID.err.txt" ;
      +                string_to_file( $string, $input_tmpfile  ) ;
      +                ` $command < $input_tmpfile 1> $output_tmpfile 2> $error_tmpfile ` ;
      +                my $is_command_ko = $CHILD_ERROR ;
      +                my $error_cmd = file_to_string( $error_tmpfile ) ;
      +                chomp( $error_cmd ) ;
      +		$string = file_to_string( $output_tmpfile ) ;
      +                my $string_len = length( $string ) ;
      +                unlink $input_tmpfile, $output_tmpfile, $error_tmpfile ;
      +
      +		if ( $is_command_ko or ( ! $string_len ) ) {
      +			my $cmd_exit_value = $CHILD_ERROR >> 8 ;
      +			my $cmd_end_signal = $CHILD_ERROR & 127 ;
      +                        my $signal_log = ( $cmd_end_signal ) ? " signal $cmd_end_signal and" : q{} ;
      +                        my $error_log = qq{Failure: --pipemess command "$command" ended with$signal_log "$string_len" characters exit value "$cmd_exit_value" and STDERR "$error_cmd"\n} ;
      +			myprint( $error_log ) ;
      +			if ( wantarray ) {
      +                                return @{ [ undef, $error_log ] }
      +                        }else{
      +                                return ;
      +                        }
      +		}
      +                if ( $error_cmd ) {
      +                        $error .= qq{STDERR of --pipemess "$command": $error_cmd\n} ;
      +                        myprint(  qq{STDERR of --pipemess "$command": $error_cmd\n} ) ;
      +                }
      +        }
      +        #myprint( "[$string]\n"  ) ;
      +        if ( wantarray ) {
      +                return ( $string, $error ) ;
      +        }else{
      +                return $string ;
               }
      -        #print "[$string]\n" ;
      -	unlink( $input_tmpfile, $output_tmpfile ) ;
      -	return( $string ) ;
       }
       
      +
      +
       sub tests_pipemess {
      -	
      +
       	SKIP: {
      -		skip( 'Not on MSWin32', 3 ) if ('MSWin32' ne $OSNAME) ;
      +                Readonly my $NB_WIN_tests_pipemess => 3 ;
      +		skip( 'Not on MSWin32', $NB_WIN_tests_pipemess ) if ('MSWin32' ne $OSNAME) ;
       		# Windows
       		# "type" command does not accept redirection of STDIN with <
       		# "sort" does
       		ok( "nochange\n" eq pipemess( 'nochange', 'sort' ), 'pipemess: nearly no change by sort' ) ;
      -		ok( "nochange2\n" eq pipemess( 'nochange2', ( 'sort', 'sort' ) ), 'pipemess: nearly no change by sort,sort' ) ;
      +		ok( "nochange2\n" eq pipemess( 'nochange2', qw( sort sort ) ), 'pipemess: nearly no change by sort,sort' ) ;
       		# command not found
      -		diag( "Warning and failure about cacaprout are on purpose" ) ;
      -		ok( ! defined( pipemess( '', 'cacaprout' ) ), 'pipemess: command not found' ) ;
      -	
      +		#diag( 'Warning and failure about cacaprout are on purpose' ) ;
      +		ok( ! defined( pipemess( q{}, 'cacaprout' ) ), 'pipemess: command not found' ) ;
      +
       	} ;
      -	
      +
      +        my ( $stringT, $errorT ) ;
      +
       	SKIP: {
      -		skip( 'On MSWin32', 6 ) if ('MSWin32' eq $OSNAME) ;
      +                Readonly my $NB_UNX_tests_pipemess => 25 ;
      +		skip( 'Not on Unix', $NB_UNX_tests_pipemess ) if ('MSWin32' eq $OSNAME) ;
       		# Unix
       		ok( 'nochange' eq pipemess( 'nochange', 'cat' ), 'pipemess: no change by cat' ) ;
      -		
      +
       		ok( 'nochange2' eq pipemess( 'nochange2', 'cat', 'cat' ), 'pipemess: no change by cat,cat' ) ;
      -		
      +
       		ok( "     1\tnumberize\n" eq pipemess( "numberize\n", 'cat -n' ), 'pipemess: numberize by cat -n' ) ;
       		ok( "     1\tnumberize\n     2\tnumberize\n" eq pipemess( "numberize\nnumberize\n", 'cat -n' ), 'pipemess: numberize by cat -n' ) ;
      -		
      +
       		ok( "A\nB\nC\n" eq pipemess( "A\nC\nB\n", 'sort' ), 'pipemess: sort' ) ;
       
       		# command not found
      -		diag( "Warning and failure about cacaprout are on purpose" ) ;
      -		ok( ! defined( pipemess( '', 'cacaprout' ) ), 'pipemess: command not found' ) ;
      +		#diag( 'Warning and failure about cacaprout are on purpose' ) ;
      +		is( undef, pipemess( q{}, 'cacaprout' ), 'pipemess: command not found' ) ;
      +
      +                # success with true but no output at all
      +                is( undef, pipemess( q{blabla}, 'true' ), 'pipemess: true but no output' ) ;
      +
      +                # failure with false and no output at all
      +                is( undef, pipemess( q{blabla}, 'false' ), 'pipemess: false and no output' ) ;
      +
       		# Failure since pipemess is not a real pipe, so first cat wait for standard input
      -		# ok( ! defined pipemess( '', 'cat|cat' ), 'pipemess: failure by cat|cat' ) ;
      +		is( q{blabla}, pipemess( q{blabla}, '( cat|cat ) ' ), 'pipemess: ok by ( cat|cat )' ) ;
      +
      +
      +                ( $stringT, $errorT ) = pipemess( 'nochange', 'cat' ) ;
      +                is( $stringT, 'nochange', 'pipemess: list context, no change by cat, string' ) ;
      +                is( $errorT, q{}, 'pipemess: list context, no change by cat, no error' ) ;
      +                
      +                ( $stringT, $errorT ) = pipemess( 'dontcare', 'true' ) ;
      +                is( $stringT, undef, 'pipemess: list context, true but no output, string' ) ;
      +                like( $errorT, qr{Failure: --pipemess command "true" ended with "0" characters exit value "0" and STDERR ""},  'pipemess: list context, true but no output, error' ) ;
      +
      +                ( $stringT, $errorT ) = pipemess( 'dontcare', 'false' ) ;
      +                is( $stringT, undef, 'pipemess: list context, false and no output, string' ) ;
      +                like( $errorT, qr{Failure: --pipemess command "false" ended with "0" characters exit value "1" and STDERR ""},  'pipemess: list context, false and no output, error' ) ;
      +
      +                ( $stringT, $errorT ) = pipemess( 'dontcare', 'echo -n blablabla' ) ;
      +                is( $stringT, q{blablabla}, 'pipemess: list context, "echo -n blablabla", string' ) ;
      +                is( $errorT, q{},  'pipemess: list context, "echo blablabla", error' ) ;
      +
      +                
      +                ( $stringT, $errorT ) = pipemess( 'dontcare', '( echo -n blablabla 3>&1 1>&2 2>&3 )' ) ;
      +                is( $stringT, undef, 'pipemess: list context, "no output STDERR blablabla", string' ) ;
      +                like( $errorT,  qr{blablabla"$},  'pipemess: list context, "no output STDERR blablabla", error' ) ;
      +
      +
      +                ( $stringT, $errorT ) = pipemess( 'dontcare', '( echo -n blablabla 3>&1 1>&2 2>&3 )', 'false' ) ;
      +                is( $stringT, undef, 'pipemess: list context, "no output STDERR blablabla then false", string' ) ;
      +                like( $errorT,  qr{blablabla"$},  'pipemess: list context, "no output STDERR blablabla then false", error' ) ;
      +
      +                ( $stringT, $errorT ) = pipemess( 'dontcare', 'false', '( echo -n blablabla 3>&1 1>&2 2>&3 )' ) ;
      +                is( $stringT, undef, 'pipemess: list context, "false then STDERR blablabla", string' ) ;
      +                like( $errorT,  qr{Failure: --pipemess command "false" ended with "0" characters exit value "1" and STDERR ""},  'pipemess: list context, "false then STDERR blablabla", error' ) ;
      +
      +                ( $stringT, $errorT ) = pipemess( 'dontcare', '( echo rrrrr ; echo -n error_blablabla 3>&1 1>&2 2>&3 )' ) ;
      +                like( $stringT, qr{rrrrr}, 'pipemess: list context, "STDOUT rrrrr STDERR error_blablabla", string' ) ;
      +                like( $errorT,  qr{STDERR.*error_blablabla},  'pipemess: list context, "STDOUT rrrrr STDERR error_blablabla", error' ) ;
      +
       	}
      -	return(  ) ;
      +
      +        ( $stringT, $errorT ) = pipemess( 'dontcare', 'cacaprout' ) ;
      +        is( $stringT, undef, 'pipemess: list context, cacaprout not found, string' ) ;
      +        like( $errorT, qr{Failure: --pipemess command "cacaprout" ended with "0" characters exit value.*}, 'pipemess: list context, cacaprout not found, error' ) ;
      +
      +	return ;
       }
       
       sub tests_is_a_release_number {
      -	ok(is_a_release_number(1.351), 'is_a_release_number 1.351');
      -	ok(is_a_release_number(42.4242), 'is_a_release_number 42.4242');
      -	ok(is_a_release_number(imapsync_version()), 'is_a_release_number imapsync_version()');
      -	ok(! is_a_release_number('blabla' ), '! is_a_release_number blabla');
      -	return(  ) ;
      +	ok(is_a_release_number($RELEASE_NUMBER_EXAMPLE_1), 'is_a_release_number 1.351') ;
      +	ok(is_a_release_number($RELEASE_NUMBER_EXAMPLE_2), 'is_a_release_number 42.4242') ;
      +	ok(is_a_release_number(imapsync_version()), 'is_a_release_number imapsync_version()') ;
      +	ok(! is_a_release_number('blabla' ), '! is_a_release_number blabla') ;
      +	return ;
       }
       
       sub is_a_release_number {
       	my $number = shift;
      -	
      -	return( $number =~ m{\d\.\d+}xo ) ;
      +
      +	return( $number =~ m{^\d+\.\d+$}xo ) ;
       }
       
       sub check_last_release {
       
       	my $public_release = not_long_imapsync_version_public(  ) ;
      -	$debug and print "check_last_release: [$public_release]\n" ;
      +	$debug and myprint( "check_last_release: [$public_release]\n"  ) ;
       	return('unknown') if ($public_release eq 'unknown') ;
       	return('timeout') if ($public_release eq 'timeout') ;
       	return('unknown') if (! is_a_release_number( $public_release ) ) ;
      -	
      +
       	my $imapsync_here  = imapsync_version();
      -	
      +
       	if ($public_release > $imapsync_here) {
       		return("New imapsync release $public_release available");
       	}else{
      -		return("This current imapsync is up to date");
      +		return( 'This imapsync is up to date') ;
       	}
       }
       
       sub imapsync_version  {
      -	my $rcs_imapsync = '$Id: imapsync,v 1.684 2016/03/17 08:35:03 gilles Exp gilles $ ' ;
      +	my $rcs_imapsync = '$Id: imapsync,v 1.727 2016/08/19 10:30:36 gilles Exp gilles $ ' ;
               my $imapsync_version ;
      -        
      +
       	if ( $rcs_imapsync =~ m{,v\s+(\d+\.\d+)}xo ) {
       		$imapsync_version = $1
               } else {
      -        	$imapsync_version = "UNKNOWN" ;
      +                $imapsync_version = 'UNKNOWN' ;
               }
       	return( $imapsync_version ) ;
       }
       
      -sub tests_imapsync_basename { 
      +sub tests_imapsync_basename {
       	ok( imapsync_basename() =~ m/imapsync/, 'imapsync_basename: match imapsync');
       	ok( 'blabla'   ne imapsync_basename(), 'imapsync_basename: do not equal blabla');
      -	return(  ) ;
      +	return ;
       }
       
       sub imapsync_basename {
      @@ -6862,17 +7579,17 @@ sub imapsync_basename {
       }
       
       sub imapsync_version_public {
      -	
      +
       	my $local_version = imapsync_version();
       	my $imapsync_basename = imapsync_basename();
      -	my $agent_info = "$OSNAME system, perl " 
      -		. sprintf("%vd", $PERL_VERSION) 
      +	my $agent_info = "$OSNAME system, perl "
      +		. mysprintf( '%vd', $PERL_VERSION)
       		. ", Mail::IMAPClient $Mail::IMAPClient::VERSION"
       		. " $imapsync_basename";
       	my $sock = IO::Socket::INET->new(
       		PeerAddr => 'imapsync.lamiral.info',
      -		PeerPort => '80',
      -		Proto => 'tcp' 
      +		PeerPort => 80,
      +		Proto    => 'tcp',
                       ) ;
       	return( 'unknown' ) if not $sock ;
       	print $sock
      @@ -6880,47 +7597,47 @@ sub imapsync_version_public {
       		"User-Agent: imapsync/$local_version ($agent_info)\n",
       		"Host: ks.lamiral.info\n\n";
       	my @line = <$sock>;
      -	close($sock);
      -	my $last_release = $line[-1];
      -	chomp($last_release);
      -	return($last_release);
      +	close $sock ;
      +	my $last_release = $line[$LAST];
      +	chomp $last_release ;
      +	return($last_release) ;
       }
       
       sub not_long_imapsync_version_public {
      -	#print "Entering not_long_imapsync_version_public\n";
      +	#myprint( "Entering not_long_imapsync_version_public\n" ) ;
       
       	my $val;
      -	
      +
       	# Doesn't work with gethostbyname (see perlipc)
       	#local $SIG{ALRM} = sub { die "alarm\n" };
      -	
      +
       	if ('MSWin32' eq $OSNAME) {
       		local $SIG{ALRM} = sub { die "alarm\n" };
       	}else{
      -	
      +
               	POSIX::sigaction(SIGALRM,
      -                         POSIX::SigAction->new(sub { croak "alarm" }))
      -        		or print "Error setting SIGALRM handler: $!\n";
      +                         POSIX::SigAction->new(sub { croak 'alarm' } ) )
      +        		or myprint( "Error setting SIGALRM handler: $!\n"  ) ;
       	}
      -	
      +
       	my $ret = eval {
      -		alarm(3) ;
      +		alarm 3 ;
       		{
       			$val = imapsync_version_public(  ) ;
                               #sleep 4 ;
      -			#print "End of imapsync_version_public\n" ;
      +			#myprint( "End of imapsync_version_public\n"  ) ;
       		}
      -		alarm(0) ;
      +		alarm 0 ;
                       1 ;
       	} ;
      -        #print "eval [$ret]\n" ;
      +        #myprint( "eval [$ret]\n"  ) ;
       	if ( ( not $ret ) or $@ ) {
      -		#print "$@";
      +		#myprint( "$@" ) ;
       		if ($@ =~ /alarm/) {
       		# timed out
       			return('timeout');
       		}else{
      -			alarm(0);
      +			alarm 0 ;
       			return('unknown'); # propagate unexpected errors
       		}
       	}else {
      @@ -6930,18 +7647,18 @@ sub not_long_imapsync_version_public {
       }
       
       sub localhost_info {
      -	
      -	my($infos) = join("", 
      -	    "Here is a [$OSNAME] system (", 
      -	    join(" ", 
      +
      +	my($infos) = join q{},
      +	    "Here is a [$OSNAME] system (",
      +	    join(q{ },
       	         uname(),
       	         ),
                        ")\n",
      -	         "With perl ", 
      -	         sprintf("%vd", $PERL_VERSION),
      -	         " Mail::IMAPClient  $Mail::IMAPClient::VERSION",
      -            ) ;
      -	return($infos);
      +	         'with Perl ',
      +	         mysprintf( '%vd', $PERL_VERSION),
      +	         " Mail::IMAPClient $Mail::IMAPClient::VERSION",
      +             ;
      +	return($infos) ;
       }
       
       sub memory_consumption {
      @@ -6949,23 +7666,41 @@ sub memory_consumption {
       	return( ( memory_consumption_of_pids(  ) )[0] );
       }
       
      +sub tests_memory_consumption {
      +
      +	like( memory_consumption(  ),  qr{\d+},'memory_consumption no args') ;
      +	like( memory_consumption( 1 ), qr{\d+},'memory_consumption 1') ;
      +	like( memory_consumption( $PROCESS_ID ), qr{\d+},"memory_consumption_of_pids $PROCESS_ID") ;
      +
      +	like( memory_consumption_ratio(), qr{\d+},   'memory_consumption_ratio' ) ;
      +	like( memory_consumption_ratio(1), qr{\d+},  'memory_consumption_ratio 1' ) ;
      +	like( memory_consumption_ratio(10), qr{\d+}, 'memory_consumption_ratio 10' ) ;
      +
      +	like( memory_consumption(), qr{\d+}, "memory_consumption\n" ) ;
      +	return ;
      +}
      +
      +
      +
       sub memory_consumption_of_pids {
       
       	my @pid = @_;
       	@pid = (@pid) ? @pid : ($PROCESS_ID) ;
      -	
      -	#print "PIDs: @PID\n";
      +
      +	#myprint( "PIDs: @pid\n" ) ;
       	my @val;
       	if ('MSWin32' eq $OSNAME) {
       		@val = memory_consumption_of_pids_win32(@pid);
       	}else{
       		# Unix
      -		my @ps = qx{ ps -o vsz -p @pid };
      +		my @ps = qx{ ps -o vsz -p @pid } ;
      +                #myprint( @ps ) ;
                       #my @ps = backtick( "ps -o vsz -p @pid" ) ;
       		shift @ps; # First line is column name "VSZ"
      -		chomp @ps; 
      -		# convert to 
      -		@val = map { $_ * 1024 } @ps;
      +		chomp @ps;
      +		# convert to octets
      +                
      +		@val = map { $_ * $KIBI } @ps;
       	}
       	return( @val ) ;
       }
      @@ -6976,26 +7711,26 @@ sub memory_consumption_of_pids_win32 {
       	my %PID;
       	# hash of pids as key values
       	map { $PID{$_}++ } @PID;
      -	
      +
       	# Does not work but should reading the tasklist documentation
       	#@ps = qx{ tasklist /FI "PID eq @PID" };
      -	
      +
       	my @ps = qx{ tasklist /NH /FO CSV } ;
               #my @ps = backtick( 'tasklist /NH /FO CSV' ) ;
      -	#print "-" x 80, "\n", @ps, "-" x 80, "\n";
      +	#myprint( "-" x $STD_CHAR_PER_LINE, "\n", @ps, "-" x $STD_CHAR_PER_LINE, "\n" ) ;
       	my @val;
       	foreach my $line (@ps) {
      -		my($name, $pid, $mem) = (split(',', $line))[0,1,4];
      +		my($name, $pid, $mem) = (split ',', $line )[0,1,4];
       		next if (! $pid);
      -		#print "[$name][$pid][$mem]";
      +		#myprint( "[$name][$pid][$mem]" ) ;
       		if ($PID{remove_qq($pid)}) {
      -			#print "MATCH !\n";
      -			chomp($mem);
      +			#myprint( "MATCH !\n" ) ;
      +			chomp $mem ;
       			$mem = remove_qq($mem);
       			$mem = remove_Ko($mem);
       			$mem = remove_not_num($mem);
      -			#print "[$mem]\n";
      -			push(@val, $mem * 1024);
      +			#myprint( "[$mem]\n" ) ;
      +			push @val, $mem * $KIBI;
       		}
       	}
       	return(@val);
      @@ -7008,53 +7743,53 @@ sub backtick {
               open3( $writer, $reader, $err, $command ) ;
               @output = <$reader>;  #Output here
               #my @errors = <$err>;    #Errors here, instead of the console
      -        $debugdev and print @output ;
      +        $debugdev and myprint( @output  ) ;
               return( @output ) ;
       }
       
       sub tests_backtick {
      -        
      +
               SKIP: {
       		skip( 'Tests for MSWin32', 3 ) if ('MSWin32' ne $OSNAME) ;
       		my @output ;
      -		@output = backtick( "echo Hello World!" ) ;
      +		@output = backtick( 'echo Hello World!' ) ;
       		# Add \r on Windows.
       		ok( "Hello World!\r\n" eq $output[0], 'backtick: echo Hello World!' ) ;
      -		$debug and print "[@output]" ;
      +		$debug and myprint( "[@output]"  ) ;
       		@output = backtick( 'echo Hello & echo World!' ) ;
       		ok( "Hello \r\n" eq $output[0], 'backtick: echo Hello & echo World!' ) ;
       		ok( "World!\r\n" eq $output[1], 'backtick: echo Hello & echo World!' ) ;
      -		$debug and print "[@output][$output[0]][$output[1]]" ;
      +		$debug and myprint( "[@output][$output[0]][$output[1]]"  ) ;
               } ;
       	SKIP: {
       		skip( 'Tests for Unix', 3 ) if ('MSWin32' eq $OSNAME) ;
       		my @output ;
      -		@output = backtick( "echo Hello World!" ) ;
      +		@output = backtick( 'echo Hello World!' ) ;
       		ok( "Hello World!\n" eq $output[0], 'backtick: echo Hello World!' ) ;
      -		$debug and print "[@output]" ;
      +		$debug and myprint( "[@output]"  ) ;
       		@output = backtick( "echo Hello\necho World!" ) ;
       		ok( "Hello\n" eq $output[0], 'backtick: echo Hello; echo World!' ) ;
       		ok( "World!\n" eq $output[1], 'backtick: echo Hello; echo World!' ) ;
      -		$debug and print "[@output]" ;
      +		$debug and myprint( "[@output]"  ) ;
       	}
      -        return(  ) ;
      +        return ;
       }
       
       sub remove_not_num {
      -	
      +
       	my $string = shift;
       	$string =~ tr/0-9//cd;
      -	#print "tr [$string]\n";
      +	#myprint( "tr [$string]\n" ) ;
       	return($string);
       }
       
       sub tests_remove_not_num {
       
      -	ok('123' eq remove_not_num(123), 'remove_not_num( 123 )');
      -	ok('123' eq remove_not_num('123'), "remove_not_num( '123' )");
      -	ok('123' eq remove_not_num('12 3'), "remove_not_num( '12 3' )");
      -	ok('123' eq remove_not_num('a 12 3 Ko'), "remove_not_num( 'a 12 3 Ko' )");
      -	return(  ) ;
      +	ok('123' eq remove_not_num(123), 'remove_not_num( 123 )' ) ;
      +	ok('123' eq remove_not_num('123'), q{remove_not_num( '123' )} ) ;
      +	ok('123' eq remove_not_num('12 3'), q{remove_not_num( '12 3' )} ) ;
      +	ok('123' eq remove_not_num('a 12 3 Ko'), q{remove_not_num( 'a 12 3 Ko' )} ) ;
      +	return ;
       }
       
       sub remove_Ko {
      @@ -7083,20 +7818,6 @@ sub memory_consumption_ratio {
       	return($consu / $base);
       }
       
      -sub tests_memory_consumption {
      -
      -	ok(print join("\n", memory_consumption_of_pids()), " memory_consumption_of_pids\n");
      -	ok(print join("\n", memory_consumption_of_pids('1')), " memory_consumption_of_pids 1\n");
      -	ok(print join("\n", memory_consumption_of_pids('1', $PROCESS_ID)), " memory_consumption_of_pids 1 $PROCESS_ID\n");
      -
      -	ok(print memory_consumption_ratio(), " memory_consumption_ratio \n");
      -	ok(print memory_consumption_ratio(1), " memory_consumption_ratio 1\n");
      -	ok(print memory_consumption_ratio(10), " memory_consumption_ratio 10\n");
      -	
      -	ok(print memory_consumption(), " memory_consumption\n");
      -	return(  ) ;
      -}
      -
       
       sub date_from_rcs {
       	my $d = shift ;
      @@ -7105,82 +7826,82 @@ sub date_from_rcs {
               if ($d =~ m{(\d{4})/(\d{2})/(\d{2})\s(\d{2}):(\d{2}):(\d{2})}xo ) {
                       # Handles the following format
                       # 2015/07/10 11:05:59 -- Generated by RCS Date tag.
      -		#print "$d\n" ;
      -                #print "header: [$1][$2][$3][$4][$5][$6]\n" ;
      +		#myprint( "$d\n"  ) ;
      +                #myprint( "header: [$1][$2][$3][$4][$5][$6]\n"  ) ;
                       my ($year, $month, $day, $hour, $min, $sec) = ($1,$2,$3,$4,$5,$6) ;
                       $month = $num2mon{$month} ;
                       $d = "$day-$month-$year $hour:$min:$sec +0000" ;
      -		#print "$d\n" ;
      +		#myprint( "$d\n"  ) ;
       	}
       	return( $d ) ;
       }
       
       sub tests_date_from_rcs {
      -	ok('19-Sep-2015 16:11:07 +0000' 
      +	ok('19-Sep-2015 16:11:07 +0000'
       	eq date_from_rcs('Date: 2015/09/19 16:11:07 '), 'date_from_rcs from RCS date' ) ;
      -	return(  ) ;
      +	return ;
       }
       
       sub good_date {
               # two incoming formats:
               # header    Tue, 24 Aug 2010 16:00:00 +0200
       	# internal       24-Aug-2010 16:00:00 +0200
      -	
      +
               # outgoing format: internal date format
               #   24-Aug-2010 16:00:00 +0200
      -	
      +
           my $d = shift ;
      -    return ('') if not defined($d);
      +    return(q{}) if not defined $d;
       
       	SWITCH: {
           	if ( $d =~ m{(\d?)(\d-...-\d{4})(\s\d{2}:\d{2}:\d{2})(\s(?:\+|-)\d{4})?}xo ) {
      -		#print "internal: [$1][$2][$3][$4]\n" ;
      +		#myprint( "internal: [$1][$2][$3][$4]\n"  ) ;
       		my ($day_1, $date_rest, $hour, $zone) = ($1,$2,$3,$4) ;
      -		$day_1 = '0' if ($day_1 eq '') ;
      -		$zone  = ' +0000'  if not defined($zone) ;
      +		$day_1 = '0' if ($day_1 eq q{}) ;
      +		$zone  = ' +0000'  if not defined $zone ;
       		$d = $day_1 . $date_rest . $hour . $zone ;
                       last SWITCH ;
               }
      -        
      +
       	if ($d =~ m{(?:\w{3,},\s)?(\d{1,2}),?\s+(\w{3,})\s+(\d{2,4})\s+(\d{1,2})(?::|\.)(\d{1,2})(?:(?::|\.)(\d{1,2}))?\s*((?:\+|-)\d{4})?}xo ) {
               	# Handles any combination of following formats
                       # Tue, 24 Aug 2010 16:00:00 +0200 -- Standard
                       # 24 Aug 2010 16:00:00 +0200 -- Missing Day of Week
                       # Tue, 24 Aug 97 16:00:00 +0200 -- Two digit year
      -                # Tue, 24 Aug 1997 16.00.00 +0200 -- Periods instead of colons 
      +                # Tue, 24 Aug 1997 16.00.00 +0200 -- Periods instead of colons
                       # Tue, 24 Aug 1997  16:00:00 +0200 -- Extra whitespace between year and hour
                       # Tue, 24 Aug 1997 6:5:2 +0200 -- Single digit hour, min, or second
                       # Tue, 24, Aug 1997 16:00:00 +0200 -- Extra comma
       
      -                #print "header: [$1][$2][$3][$4][$5][$6][$7][$8]\n";
      +                #myprint( "header: [$1][$2][$3][$4][$5][$6][$7][$8]\n" ) ;
                       my ($day, $month, $year, $hour, $min, $sec, $zone) = ($1,$2,$3,$4,$5,$6,$7,$8);
                       $year = '19' . $year if length($year) == 2 && $year =~ m/^[789]/xo;
                       $year = '20' . $year if length($year) == 2;
      -                 
      +
                       $month = substr $month, 0, 3 if length($month) > 4;
      -                $day = sprintf("%02d", $day);
      -                $hour = sprintf("%02d", $hour);
      -                $min = sprintf("%02d", $min);
      -                $sec  = '00' if not defined($sec);
      -                $sec = sprintf("%02d", $sec);
      -                $zone  = '+0000' if not defined($zone);
      -                $d = "$day-$month-$year $hour:$min:$sec $zone";
      +                $day  = mysprintf( '%02d', $day);
      +                $hour = mysprintf( '%02d', $hour);
      +                $min  = mysprintf( '%02d', $min);
      +                $sec  = '00' if not defined  $sec  ;
      +                $sec  = mysprintf( '%02d', $sec ) ;
      +                $zone = '+0000' if not defined  $zone  ;
      +                $d    = "$day-$month-$year $hour:$min:$sec $zone" ;
       		last SWITCH ;
       	}
      -    
      +
       	if ($d =~ m{(?:.{3})\s(...)\s+(\d{1,2})\s(\d{1,2}):(\d{1,2}):(\d{1,2})\s(?:\w{3})?\s?(\d{4})}xo ) {
               	# Handles any combination of following formats
                       # Sun Aug 20 11:55:09 2006
                       # Wed Jan 24 11:58:38 MST 2007
                       # Wed Jan  2 08:40:57 2008
       
      -                #print "header: [$1][$2][$3][$4][$5][$6]\n";
      +                #myprint( "header: [$1][$2][$3][$4][$5][$6]\n" ) ;
                       my ($month, $day, $hour, $min, $sec, $year) = ($1,$2,$3,$4,$5,$6);
      -                $day = sprintf("%02d", $day);
      -                $hour = sprintf("%02d", $hour);
      -                $min = sprintf("%02d", $min);
      -                $sec = sprintf("%02d", $sec);
      -                $d = "$day-$month-$year $hour:$min:$sec +0000";
      +                $day  = mysprintf( '%02d', $day  ) ;
      +                $hour = mysprintf( '%02d', $hour ) ;
      +                $min  = mysprintf( '%02d', $min  ) ;
      +                $sec  = mysprintf( '%02d', $sec  ) ;
      +                $d    = "$day-$month-$year $hour:$min:$sec +0000" ;
       		last SWITCH ;
       	}
               my %num2mon = qw( 01 Jan 02 Feb 03 Mar 04 Apr 05 May 06 Jun 07 Jul 08 Aug 09 Sep 10 Oct 11 Nov 12 Dec ) ;
      @@ -7188,72 +7909,72 @@ sub good_date {
               if ($d =~ m{(\d{4})/(\d{2})/(\d{2})\s(\d{2}):(\d{2}):(\d{2})}xo ) {
                       # Handles the following format
                       # 2015/07/10 11:05:59 -- Generated by RCS Date tag.
      -		#print "$d\n" ;
      -                #print "header: [$1][$2][$3][$4][$5][$6]\n" ;
      +		#myprint( "$d\n"  ) ;
      +                #myprint( "header: [$1][$2][$3][$4][$5][$6]\n"  ) ;
                       my ($year, $month, $day, $hour, $min, $sec) = ($1,$2,$3,$4,$5,$6) ;
                       $month = $num2mon{$month} ;
                       $d = "$day-$month-$year $hour:$min:$sec +0000" ;
      -		#print "$d\n" ;
      +		#myprint( "$d\n"  ) ;
       		last SWITCH ;
       	}
      -	
      +
               if ($d =~ m{(\d{2})/(\d{2})/(\d{2})\s(\d{2}):(\d{2}):(\d{2})}xo ) {
                       # Handles the following format
                       # 02/06/09 22:18:08 -- Generated by AVTECH TemPageR devices
       
      -                #print "header: [$1][$2][$3][$4][$5][$6]\n";
      +                #myprint( "header: [$1][$2][$3][$4][$5][$6]\n" ) ;
                       my ($month, $day, $year, $hour, $min, $sec) = ($1,$2,$3,$4,$5,$6);
                       $year = '20' . $year;
                       $month = $num2mon{$month};
                       $d = "$day-$month-$year $hour:$min:$sec +0000";
       		last SWITCH ;
       	}
      -    
      +
       	if ($d =~ m{\w{6,},\s(\w{3})\w+\s+(\d{1,2}),\s(\d{4})\s(\d{2}):(\d{2})\s(AM|PM)}xo ) {
               	# Handles the following format
                       # Saturday, December 14, 2002 05:00 PM - KBtoys.com order confirmations
       
                       my ($month, $day, $year, $hour, $min, $apm) = ($1,$2,$3,$4,$5,$6);
       
      -                $hour += 12 if $apm eq 'PM';
      -                $day = sprintf("%02d", $day);
      -                $d = "$day-$month-$year $hour:$min:00 +0000";
      +                $hour += 12 if $apm eq 'PM' ;
      +                $day = mysprintf( '%02d', $day ) ;
      +                $d = "$day-$month-$year $hour:$min:00 +0000" ;
                       last SWITCH ;
       	}
      -    
      +
       	if ($d =~ m{(\w{3})\s(\d{1,2})\s(\d{4})\s(\d{2}):(\d{2}):(\d{2})\s((?:\+|-)\d{4})}xo ) {
               	# Handles the following format
                       # Saturday, December 14, 2002 05:00 PM - jr.com order confirmations
       
                       my ($month, $day, $year, $hour, $min, $sec, $zone) = ($1,$2,$3,$4,$5,$6,$7);
       
      -                $day = sprintf("%02d", $day);
      +                $day = mysprintf( '%02d', $day ) ;
                       $d = "$day-$month-$year $hour:$min:$sec $zone";
                       last SWITCH ;
       	}
      -    
      +
       	if ($d =~ m{(\d{1,2})-(\w{3})-(\d{4})}xo ) {
               	# Handles the following format
                       # 21-Jun-2001 - register.com domain transfer email circa 2001
       
                       my ($day, $month, $year) = ($1,$2,$3);
      -                $day = sprintf("%02d", $day);
      +                $day = mysprintf( '%02d', $day);
                       $d = "$day-$month-$year 11:11:11 +0000";
       		last SWITCH ;
       	}
      -        
      +
           	# unknown or unmatch => return same string
           	return($d);
           }
      -    
      +
           $d = qq("$d") ;
           return( $d ) ;
      -} 
      +}
       
       
       sub tests_good_date {
       
      -	ok('' eq good_date(), 'good_date no arg');
      +	ok(q{} eq good_date(), 'good_date no arg');
       	ok('"24-Aug-2010 16:00:00 +0200"' eq good_date('24-Aug-2010 16:00:00 +0200'), 'good_date internal 2digit zone');
       	ok('"24-Aug-2010 16:00:00 +0000"' eq good_date('24-Aug-2010 16:00:00'), 'good_date internal 2digit no zone');
       	ok('"01-Sep-2010 16:00:00 +0200"' eq good_date( '1-Sep-2010 16:00:00 +0200'), 'good_date internal SP 1digit');
      @@ -7282,7 +8003,7 @@ sub tests_good_date {
               ok('"21-Jun-2001 11:11:11 +0000"' eq good_date('21-Jun-2001'), 'good_date register.com domain transfer');
               ok('"18-Nov-2012 18:34:38 +0100"' eq good_date('Sun, 18 Nov 2012 18:34:38 +0100'), 'good_date pop2imap bug (Westeuropäische Normalzeit)');
       	ok('"19-Sep-2015 16:11:07 +0000"' eq good_date('Date: 2015/09/19 16:11:07 '), 'good_date from RCS date' ) ;
      -	return(  ) ;
      +	return ;
       }
       
       
      @@ -7296,8 +8017,8 @@ sub tests_list_keys_in_2_not_in_1 {
       	ok( 0 == compare_lists( [],        [ list_keys_in_2_not_in_1( {'a' => 1, 'b' => 1}, {'a' => 1, 'b' => 1}) ]), 'list_keys_in_2_not_in_1: {a, b} {a, b}');
       	ok( 0 == compare_lists( [],        [ list_keys_in_2_not_in_1( {'a' => 1, 'b' => 1, 'c' => 1}, {'a' => 1, 'b' => 1}) ]), 'list_keys_in_2_not_in_1: {a, b, c} {a, b}');
       	ok( 0 == compare_lists( ['b'],     [ list_keys_in_2_not_in_1( {'a' => 1, 'c' => 1}, {'a' => 1, 'b' => 1}) ]), 'list_keys_in_2_not_in_1: {a, b, c} {a, b}');
      -	
      -	return(  ) ;
      +
      +	return ;
       }
       
       sub list_keys_in_2_not_in_1 {
      @@ -7305,10 +8026,10 @@ sub list_keys_in_2_not_in_1 {
       	my $folders1_ref = shift;
       	my $folders2_ref = shift;
       	my @list;
      -	
      -	foreach my $folder ( sort keys %$folders2_ref ) {
      -		next if exists($folders1_ref->{$folder});
      -		push(@list, $folder);
      +
      +	foreach my $folder ( sort keys %{ $folders2_ref } ) {
      +		next if exists $folders1_ref->{$folder};
      +		push @list, $folder;
       	}
       	return(@list);
       }
      @@ -7320,52 +8041,273 @@ sub list_folders_in_2_not_in_1 {
       	@h2_folders_not_in_h1 = list_keys_in_2_not_in_1( \%h1_folders_all, \%h2_folders_all) ;
       	map { $h2_folders_not_in_h1{$_} = 1} @h2_folders_not_in_h1 ;
       	@h2_folders_not_in_h1 = list_keys_in_2_not_in_1( \%h2_folders_from_1_all, \%h2_folders_not_in_h1) ;
      -	
      +
       	return( reverse @h2_folders_not_in_h1 );
       }
       
      -sub delete_folders_in_2_not_in_1 { 
      +sub delete_folders_in_2_not_in_1 {
       
       	foreach my $folder (@h2_folders_not_in_1) {
      -		if ( defined( $delete2foldersonly ) and eval( "\$folder !~ $delete2foldersonly" ) ) {
      -			print "Not deleting $folder because of --delete2foldersonly $delete2foldersonly\n" ;
      +		if ( defined  $delete2foldersonly  and eval "\$folder !~ $delete2foldersonly" ) {
      +			myprint( "Not deleting $folder because of --delete2foldersonly $delete2foldersonly\n"  ) ;
       			next ;
       		}
      -		if ( defined( $delete2foldersbutnot ) and eval( "\$folder =~ $delete2foldersbutnot" ) ) {
      -			print "Not deleting $folder because of --delete2foldersbutnot $delete2foldersbutnot\n" ;
      +		if ( defined  $delete2foldersbutnot  and eval "\$folder =~ $delete2foldersbutnot" ) {
      +			myprint( "Not deleting $folder because of --delete2foldersbutnot $delete2foldersbutnot\n"  ) ;
       			next ;
       		}
       		my $res = $dry ; # always success in dry mode!
       		$imap2->unsubscribe( $folder ) if ( ! $dry ) ;
       		$res = $imap2->delete( $folder ) if ( ! $dry ) ;
       		if ( $res ) {
      -			print "Delete $folder", "$dry_message", "\n" ;
      +			myprint( "Deleted $folder", "$dry_message", "\n"  ) ;
       		}else{
      -			print "Delete $folder failure", "\n" ;
      +			myprint( "Deleting $folder failed", "\n"  ) ;
       		}
       	}
      -	return(  ) ;
      +	return ;
      +}
      +
      +sub delete_folder {
      +        my ( $sync, $imap, $folder, $Side ) = @_ ;
      +        if ( ! $sync )   { return ; }
      +        if ( ! $imap )   { return ; }
      +        if ( ! $folder ) { return ; }
      +        $Side ||= 'HostX' ;
      +        
      +        my $res = $sync->{dry} ; # always success in dry mode!
      +        if ( ! $sync->{dry} ) {
      +                $imap->unsubscribe( $folder ) ;
      +                $res = $imap->delete( $folder ) ;
      +        }
      +        if ( $res ) {
      +        	myprint( "$Side deleted $folder", $sync->{dry_message}, "\n"  ) ;
      +                return 1 ;
      +        }else{
      +        	myprint( "$Side deleting $folder failed", "\n"  ) ;
      +                return ;
      +        }
      +}
      +
      +sub delete1emptyfolders {
      +        my $sync = shift ;
      +        if ( ! $sync ) { return ; } # abort if no parameter
      +        if ( ! $sync->{delete1emptyfolders} ) { return ; } # abort if --delete1emptyfolders off
      +        my $imap = $sync->{imap1} ;
      +        if ( ! $imap ) { return ; } # abort if no imap
      +        if ( $imap->IsUnconnected(  ) ) { return ; } # abort if diesconnected
      +        
      +        my %folders_kept ;
      +        myprint( qq{Host1 deleting empty folders\n} ) ;
      +        foreach my $folder ( reverse sort @{ $sync->{h1_folders_wanted} } ) {
      +                my $parenthood = $imap->is_parent( $folder ) ;
      +                if ( defined $parenthood and $parenthood ) {
      +                        myprint( "Host1 folder $folder has subfolders\n" ) ;
      +                        $folders_kept{ $folder }++ ;
      +                        next ;
      +                }
      +                my $nb_messages_select = examine_folder_and_count( $imap, $folder, 'Host1' ) ;
      +                if ( ! defined $nb_messages_select ) { next ; } # Select failed => Neither continue nor keep this folder }
      +                my $nb_messages_search = scalar( @{ $imap->messages(  ) } ) ;
      +                if ( 0 != $nb_messages_select and 0 != $nb_messages_search ) {
      +                        myprint( "Host1 folder $folder has messages: $nb_messages_search (search) $nb_messages_select (select)\n" ) ;
      +                        $folders_kept{ $folder }++ ;
      +                        next ;
      +                }
      +                if ( 0 != $nb_messages_select + $nb_messages_search ) {
      +                        myprint( "Host1 folder $folder odd messages count: $nb_messages_search (search) $nb_messages_select (select)\n" ) ;
      +                        $folders_kept{ $folder }++ ;
      +                        next ;
      +                }
      +                # Here we must have 0 messages by messages() aka "SEARCH ALL" and also "EXAMINE"
      +                if ( uc $folder eq 'INBOX' ) {
      +                        myprint( "Host1 Not deleting $folder\n" ) ;
      +                        $folders_kept{ $folder }++ ;
      +                        next ; 
      +                }
      +                myprint( "Host1 deleting empty folder $folder\n" ) ;
      +                # can not delete a SELECTed or EXAMINEd folder so closing it
      +                # could changed be SELECT INBOX
      +                $imap->close(  ) ; # close after examine does not expunge; anyway expunging an empty folder... 
      +                if ( delete_folder( $sync, $imap, $folder, 'Host1' ) ) {
      +                        next ; # Deleted, good!
      +                }else{
      +                        $folders_kept{ $folder }++ ;
      +                        next ; # Not deleted, bad!
      +                }
      +        }
      +        remove_deleted_folders_from_wanted_list( $sync, %folders_kept ) ;
      +        myprint( qq{Host1 ended deleting empty folders\n} ) ;
      +        return ;
      +}
      +
      +sub remove_deleted_folders_from_wanted_list {
      +        my ( $sync, %folders_kept ) = @ARG ;
      +        
      +        my @h1_folders_wanted_init = @{ $sync->{h1_folders_wanted} } ;
      +        my @h1_folders_wanted_last ;
      +        foreach my $folder ( @h1_folders_wanted_init ) {
      +                if ( $folders_kept{ $folder } ) {
      +                        push @h1_folders_wanted_last, $folder ;
      +                }
      +        }
      +        @{ $sync->{h1_folders_wanted} } = @h1_folders_wanted_last ;
      +        return ;
      +}
      +
      +sub examine_folder_and_count {
      +        my ( $imap, $folder, $Side ) = @_ ;
      +        $Side ||= 'HostX' ;
      +        
      +        if ( ! examine_folder( $imap, $folder, $Side ) ) {
      +                return ;
      +        }
      +        my $nb_messages_select = count_from_select( $imap->History ) ;
      +        return $nb_messages_select ;
      +}
      +
      +
      +sub tests_delete1emptyfolders {
      +
      +        is( undef, delete1emptyfolders(  ), q{delete1emptyfolders: undef} ) ;
      +        my $syncT ;
      +        is( undef, delete1emptyfolders( $syncT ), q{delete1emptyfolders: undef 2} ) ;
      +        my $imapT ;
      +        $syncT->{imap1} = $imapT ;
      +        is( undef, delete1emptyfolders( $syncT ), q{delete1emptyfolders: undef imap} ) ;
      +        
      +        require Test::MockObject ;
      +        $imapT = Test::MockObject->new(  ) ;
      +        $syncT->{imap1} = $imapT ;
      +
      +        $imapT->set_true( 'IsUnconnected' ) ;
      +        is( undef, delete1emptyfolders( $syncT ), q{delete1emptyfolders: Unconnected imap} ) ;
      +
      +        # Now connected tests
      +        $imapT->set_false( 'IsUnconnected' ) ;
      +        $imapT->mock( 'LastError', sub { q{LastError mocked} } ) ;
      +        
      +        $syncT->{delete1emptyfolders} = 0 ;
      +        tests_delete1emptyfolders_unit(
      +                $syncT,
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                q{tests_delete1emptyfolders: --delete1emptyfolders OFF}
      +        ) ;
      +
      +        # All are parents => no deletion at all
      +        $imapT->set_true( 'is_parent' ) ;
      +        $syncT->{delete1emptyfolders} = 1 ;
      +        tests_delete1emptyfolders_unit(
      +                $syncT,
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                q{tests_delete1emptyfolders: --delete1emptyfolders ON}
      +        ) ;
      +
      +        # No parents but examine false for all => skip all
      +        $imapT->set_false( 'is_parent', 'examine' ) ;
      +        
      +        tests_delete1emptyfolders_unit(
      +                $syncT,
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                [  ],
      +                q{tests_delete1emptyfolders: EXAMINE fails}
      +        ) ;
      +
      +        # examine ok for all but History bad => skip all
      +        $imapT->set_true( 'examine' ) ;
      +        $imapT->mock( 'History', sub { ( q{History badly mocked} ) } ) ;
      +        tests_delete1emptyfolders_unit(
      +                $syncT,
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                [  ],
      +                q{tests_delete1emptyfolders: examine ok but History badly mocked so count messages fails}
      +        ) ;
      +
      +        # History good but some messages EXISTS == messages() => no deletion
      +        $imapT->mock( 'History', sub { ( q{* 2 EXISTS} ) } ) ;
      +        $imapT->mock( 'messages', sub { [ qw{ UID_1 UID_2 } ] } ) ;
      +        tests_delete1emptyfolders_unit(
      +                $syncT,
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                q{tests_delete1emptyfolders: History EXAMINE ok, several messages}
      +        ) ;
      +
      +        # 0 EXISTS but != messages() => no deletion
      +        $imapT->mock( 'History', sub { ( q{* 0 EXISTS} ) } ) ;
      +        $imapT->mock( 'messages', sub { [ qw{ UID_1 UID_2 } ] } ) ;
      +        tests_delete1emptyfolders_unit(
      +                $syncT,
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                q{tests_delete1emptyfolders: 0 EXISTS but 2 by messages()}
      +        ) ;
      +
      +        # 1 EXISTS but != 0 == messages() => no deletion
      +        $imapT->mock( 'History', sub { ( q{* 1 EXISTS} ) } ) ;
      +        $imapT->mock( 'messages', sub { [ ] } ) ;
      +        tests_delete1emptyfolders_unit(
      +                $syncT,
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                q{tests_delete1emptyfolders: 1 EXISTS but 0 by messages()}
      +        ) ;
      +
      +        # 0 EXISTS and 0 == messages() => deletion except INBOX
      +        $imapT->mock( 'History', sub { ( q{* 0 EXISTS} ) } ) ;
      +        $imapT->mock( 'messages', sub { [ ] } ) ;
      +        $imapT->set_true( qw{ delete close unsubscribe } ) ;
      +        $syncT->{dry_message} = q{ (not really since in a mocked test)} ;
      +        tests_delete1emptyfolders_unit(
      +                $syncT,
      +                [ qw{ INBOX DELME1 DELME2 } ],
      +                [ qw{ INBOX } ],
      +                q{tests_delete1emptyfolders: 0 EXISTS 0 by messages() delete folders, keep INBOX}
      +        ) ;
      +
      +
      +
      +
      +        return ;
       }
       
      +sub tests_delete1emptyfolders_unit {
      +        my $syncT  = shift ;
      +        my $folders1wanted_init_ref = shift ;
      +        my $folders1wanted_after_ref = shift ;
      +        my $comment = shift || q{delete1emptyfolders:} ;
      +        
      +        my @folders1wanted_init  = @{ $folders1wanted_init_ref } ;
      +        my @folders1wanted_after = @{ $folders1wanted_after_ref } ;
      +
      +        @{ $syncT->{h1_folders_wanted} } = @folders1wanted_init ;
      +        
      +        is_deeply( $syncT->{h1_folders_wanted}, \@folders1wanted_init, qq{$comment, init check} ) ;
      +        delete1emptyfolders( $syncT ) ;
      +        is_deeply( $syncT->{h1_folders_wanted}, \@folders1wanted_after, qq{$comment, after check} ) ;
      +        return ;
      +}
       
       sub extract_header {
               my $string = shift ;
      -        
      -        my ( $header ) = split( /\n\n/x, $string ) ;
      -        if ( ! $header ) { return( '' ) ; }
      -        #print "[$header]\n" ;
      +
      +        my ( $header ) = split  /\n\n/x, $string ;
      +        if ( ! $header ) { return( q{} ) ; }
      +        #myprint( "[$header]\n"  ) ;
               return( $header ) ;
       }
       
       sub tests_extract_header {
       
      -        
      +
       my $h = <<'EOM';
       Message-Id: <20100428101817.A66CB162474E@plume.est.belle>
       Date: Wed, 28 Apr 2010 12:18:17 +0200 (CEST)
       From: gilles@louloutte.dyndns.org (Gilles LAMIRAL)
       EOM
      -chomp( $h ) ;
      +chomp $h ;
       ok( $h eq extract_header(
       <<'EOM'
       Message-Id: <20100428101817.A66CB162474E@plume.est.belle>
      @@ -7378,41 +8320,41 @@ EOM
       ), 'extract_header: 1') ;
       
       
      -     
      -	return(  ) ;
      +
      +	return ;
       }
       
       sub decompose_header{
               my $string = shift ;
      -        
      +
               # a hash, for a keyword header KEY value are list of strings [VAL1, VAL1_other, etc]
               # Think of multiple "Received:" header lines.
               my $header = {  } ;
      -        
      +
               my ($key, $val ) ;
      -        my @line = split( /\n|\r\n/x, $string ) ;
      +        my @line = split /\n|\r\n/x, $string ;
               foreach my $line ( @line ) {
      -                #print "DDD $line\n" ;
      +                #myprint( "DDD $line\n"  ) ;
                       # End of header
                       last if ( $line =~ m{^$}xo ) ;
                       # Key: value
                       if ( $line =~ m/(^[^:]+):\s(.*)/xo ) {
                               $key = $1 ;
                               $val = $2 ;
      -                        $debugdev and print "DDD KV [$key] [$val]\n" ;
      -                        push( @{ $header->{ $key } }, $val ) ;
      +                        $debugdev and myprint( "DDD KV [$key] [$val]\n"  ) ;
      +                        push  @{ $header->{ $key } }, $val  ;
                       # blanc and value => value from previous line continues
                       }elsif( $line =~ m/^(\s+)(.*)/xo ) {
                               $val = $2 ;
      -                        $debugdev and print "DDD  V [$val]\n" ;
      -                        @{ $header->{ $key } }[ -1 ] .= " $val" if $key ;
      +                        $debugdev and myprint( "DDD  V [$val]\n"  ) ;
      +                        @{ $header->{ $key } }[ $LAST ] .= " $val" if $key ;
                       # dirty line?
                       }else{
                               next ;
                       }
               }
       
      -        #print Data::Dumper->Dump( [ $header ] ) ;
      +        #myprint( Data::Dumper->Dump( [ $header ] )  ) ;
       
               return( $header ) ;
       }
      @@ -7421,7 +8363,7 @@ sub decompose_header{
       sub tests_decompose_header{
       
               my $header_dec ;
      -        
      +
               $header_dec = decompose_header(
       <<'EOH'
       KEY_1: VAL_1
      @@ -7437,28 +8379,28 @@ KEY_5 BLANC:  VAL_5
       KEY_6_BAD_BODY: VAL_6
       EOH
               ) ;
      -        
      -        ok( 'VAL_3' 
      +
      +        ok( 'VAL_3'
               eq $header_dec->{ 'KEY_3' }[0], 'decompose_header: VAL_3' ) ;
       
      -        ok( 'VAL_1' 
      +        ok( 'VAL_1'
               eq $header_dec->{ 'KEY_1' }[0], 'decompose_header: VAL_1' ) ;
       
      -        ok( 'VAL_1_other' 
      +        ok( 'VAL_1_other'
               eq $header_dec->{ 'KEY_1' }[1], 'decompose_header: VAL_1_other' ) ;
       
      -        ok( 'VAL_2 VAL_2_+ VAL_2_++' 
      +        ok( 'VAL_2 VAL_2_+ VAL_2_++'
               eq $header_dec->{ 'KEY_2' }[0], 'decompose_header: VAL_2 VAL_2_+ VAL_2_++' ) ;
       
      -        ok( 'VAL_4 VAL_4_+' 
      +        ok( 'VAL_4 VAL_4_+'
               eq $header_dec->{ 'KEY_4' }[0], 'decompose_header: VAL_4 VAL_4_+' ) ;
       
      -        ok( ' VAL_5' 
      +        ok( ' VAL_5'
               eq $header_dec->{ 'KEY_5 BLANC' }[0], 'decompose_header: KEY_5 BLANC' ) ;
       
      -        ok( not( defined( $header_dec->{ 'KEY_6_BAD_BODY' }[0] ) ), 'decompose_header: KEY_6_BAD_BODY' ) ;
      +        ok( not( defined  $header_dec->{ 'KEY_6_BAD_BODY' }[0]  ), 'decompose_header: KEY_6_BAD_BODY' ) ;
      +
       
      -        
               $header_dec = decompose_header(
       <<'EOH'
       Message-Id: <20100428101817.A66CB162474E@plume.est.belle>
      @@ -7467,7 +8409,7 @@ From: gilles@louloutte.dyndns.org (Gilles LAMIRAL)
       EOH
               ) ;
       
      -        ok( '<20100428101817.A66CB162474E@plume.est.belle>' 
      +        ok( '<20100428101817.A66CB162474E@plume.est.belle>'
               eq $header_dec->{ 'Message-Id' }[0], 'decompose_header: 1' ) ;
       
               $header_dec = decompose_header(
      @@ -7478,8 +8420,8 @@ Received: by plume.est.belle (Postfix, from userid 1000)
       Subject: test:eekahceishukohpe
       EOH
       ) ;
      -        ok( 
      -'by plume.est.belle (Postfix, from userid 1000) id 120A71624742; Wed, 28 Apr 2010 01:46:40 +0200 (CEST)' 
      +        ok(
      +'by plume.est.belle (Postfix, from userid 1000) id 120A71624742; Wed, 28 Apr 2010 01:46:40 +0200 (CEST)'
               eq $header_dec->{ 'Received' }[0], 'decompose_header: 2' ) ;
       
               $header_dec = decompose_header(
      @@ -7510,45 +8452,45 @@ KEY_3: VAL_3
       KEY_1: VAL_1_other
       EOH
               ) ;
      -        
      -        ok( 'VAL_3' 
      +
      +        ok( 'VAL_3'
               eq $header_dec->{ 'KEY_3' }[0], 'decompose_header: Bad header VAL_3' ) ;
       
      -        ok( 'VAL_1_other' 
      +        ok( 'VAL_1_other'
               eq $header_dec->{ 'KEY_1' }[0], 'decompose_header: Bad header VAL_1_other' ) ;
       
      -        ok( 'VAL_2 VAL_2_+ VAL_2_++' 
      +        ok( 'VAL_2 VAL_2_+ VAL_2_++'
               eq $header_dec->{ 'KEY_2' }[0], 'decompose_header: Bad header VAL_2 VAL_2_+ VAL_2_++' ) ;
       
      -	return(  ) ;
      +	return ;
       }
       
       sub epoch {
               # incoming format:
       	# internal date 24-Aug-2010 16:00:00 +0200
      -	
      +
               # outgoing format: epoch
       
       
               my $d = shift ;
      -        return ('') if not defined($d);
      +        return(q{}) if not defined $d;
       
               my ( $mday, $month, $year, $hour, $min, $sec, $sign, $zone_h, $zone_m ) ;
               my $time ;
      -        
      +
               if ( $d =~ m{(\d{1,2})-([A-Z][a-z]{2})-(\d{4})\s(\d{2}):(\d{2}):(\d{2})\s((?:\+|-))(\d{2})(\d{2})}xo ) {
      -                #print "internal: [$1][$2][$3][$4][$5][$6][$7][$8][$9]\n" ;
      -                ( $mday, $month, $year, $hour, $min, $sec, $sign, $zone_h, $zone_m ) 
      +                #myprint( "internal: [$1][$2][$3][$4][$5][$6][$7][$8][$9]\n"  ) ;
      +                ( $mday, $month, $year, $hour, $min, $sec, $sign, $zone_h, $zone_m )
                       =  ( $1,   $2,     $3,    $4,    $5,  $6,    $7,     $8,     $9 ) ;
      -                #print "( $mday, $month, $year, $hour, $min, $sec, $sign, $zone_h, $zone_m )\n" ;
      -                
      +                #myprint( "( $mday, $month, $year, $hour, $min, $sec, $sign, $zone_h, $zone_m )\n"  ) ;
      +
                       $sign = +1 if ( '+' eq $sign ) ;
      -                $sign = -1 if ( '-' eq $sign ) ;
      -                
      -                $time = timegm( $sec, $min, $hour, $mday, $month_abrev{$month}, $year ) 
      +                $sign = $MINUS_ONE if ( '-' eq $sign ) ;
      +
      +                $time = timegm( $sec, $min, $hour, $mday, $month_abrev{$month}, $year )
                               - $sign * ( 3600 * $zone_h + 60 * $zone_m ) ;
      -                
      -                #print( "$time ", scalar(localtime($time)), "\n");
      +
      +                #myprint( "$time ", scalar localtime($time), "\n");
               }
               return( $time ) ;
       }
      @@ -7565,7 +8507,7 @@ sub tests_epoch {
               ok( '1280671200' eq epoch( '1-Aug-2010 12:00:00 -0200' ), 'epoch 1-Aug-2010 12:00:00 -0200 -> 1280671200' ) ;
               ok( '1280671200' eq epoch( '1-Aug-2010 16:01:00 +0201' ), 'epoch 1-Aug-2010 16:01:00 +0201 -> 1280671200' ) ;
               ok( '1280671200' eq epoch( '1-Aug-2010 14:01:00 +0001' ), 'epoch 1-Aug-2010 14:01:00 +0001 -> 1280671200' ) ;
      -	return(  ) ;
      +	return ;
       }
       
       sub add_header {
      @@ -7578,15 +8520,15 @@ sub tests_add_header {
       	ok( 'Message-Id: ' eq add_header(), 'add_header no arg' ) ;
       	ok( 'Message-Id: <123456789@imapsync>' eq add_header(123456789), 'add_header 123456789' ) ;
       
      -	return(  ) ;
      +	return ;
       }
       
       sub tests_Banner{
       
       	my $imap = Mail::IMAPClient->new(  ) ;
      -        ok( 'lalala' eq $imap->Banner('lalala'), "Banner set lalala" ) ;
      -        ok( 'lalala' eq $imap->Banner(), "Banner returns lalala" ) ;
      -	return(  ) ;
      +        ok( 'lalala' eq $imap->Banner('lalala'), 'Banner set lalala' ) ;
      +        ok( 'lalala' eq $imap->Banner(), 'Banner returns lalala' ) ;
      +	return ;
       }
       
       
      @@ -7597,17 +8539,17 @@ sub max_line_length {
               my $max = 0 ;
       
               while ( $string =~ m/([^\n]*\n?)/msxg ) {
      -        	$max = max( $max, length( $1 ) ) ;
      +        	$max = max( $max, length $1 ) ;
               }
       	return( $max ) ;
       }
       
       sub tests_max_line_length {
      -	ok( 0 == max_line_length( '' ), 'max_line_length: 0 == null string' ) ;
      +	ok( 0 == max_line_length( q{} ), 'max_line_length: 0 == null string' ) ;
       	ok( 1 == max_line_length( "\n" ), 'max_line_length: 1 == \n' ) ;
       	ok( 1 == max_line_length( "\n\n" ), 'max_line_length: 1 == \n\n' ) ;
       	ok( 1 == max_line_length( "\n" x 500 ), 'max_line_length: 1 == 500 \n' ) ;
      -	ok( 1 == max_line_length( "a" ), 'max_line_length: 1 == a' ) ;
      +	ok( 1 == max_line_length( 'a' ), 'max_line_length: 1 == a' ) ;
       	ok( 2 == max_line_length( "a\na" ), 'max_line_length: 2 == a\na' ) ;
       	ok( 2 == max_line_length( "a\na\n" ), 'max_line_length: 2 == a\na\n' ) ;
       	ok( 3 == max_line_length( "a\nab\n" ), 'max_line_length: 3 == a\nab\n' ) ;
      @@ -7617,65 +8559,65 @@ sub tests_max_line_length {
       	ok( 4 == max_line_length( "a\nab\nabc\n" ), 'max_line_length: 4 == a\nab\nabc\n' ) ;
       	ok( 5 == max_line_length( "a\nabcd\nabc\n" ), 'max_line_length: 5 == a\nabcd\nabc\n' ) ;
       	ok( 5 == max_line_length( "a\nabcd\nabc\n\nabcd\nabcd\nabcd\nabcd\nabcd\nabcd\nabcd\nabcd" ), 'max_line_length: 5 == a\nabcd\nabc\n\nabcd\nabcd\nabcd\nabcd\nabcd\nabcd\nabcd\nabcd' ) ;
      -	return(  ) ;
      +	return ;
       }
       
       sub setlogfile {
               my( $mysync ) = shift ;
               $mysync->{logdir}  = defined $mysync->{logdir}  ? $mysync->{logdir}  : 'LOG_imapsync' ;
      -        $mysync->{logfile} = defined $mysync->{logfile} ? "$mysync->{logdir}/$mysync->{logfile}" : 
      +        $mysync->{logfile} = defined $mysync->{logfile} ? "$mysync->{logdir}/$mysync->{logfile}" :
                       logfile( $mysync->{timestart}, $mysync->{user2}, $mysync->{logdir} ) ;
      -        #print "logdir  = $mysync->{logdir}\n" ;
      -        #print "logfile = $mysync->{logfile}\n" ;
      +        #myprint( "logdir  = $mysync->{logdir}\n"  ) ;
      +        #myprint( "logfile = $mysync->{logfile}\n"  ) ;
               return( $mysync->{logfile} ) ;
       }
       
       sub tests_setlogfile {
      -        my $mysync = { 
      +        my $mysync = {
                       timestart => 2,
                       user2     => 'user2',
               } ;
       
      -        ok( 'LOG_imapsync/1970_01_01_01_00_02_user2.txt' eq setlogfile( $mysync ), 
      +        ok( 'LOG_imapsync/1970_01_01_01_00_02_user2.txt' eq setlogfile( $mysync ),
                       'setlogfile: default is like LOG_imapsync/1970_01_01_01_00_02_user2.txt' ) ;
       
               $mysync->{logdir}  = undef ;
               $mysync->{logfile} = undef ;
      -        ok( 'LOG_imapsync/1970_01_01_01_00_02_user2.txt' eq setlogfile( $mysync ), 
      +        ok( 'LOG_imapsync/1970_01_01_01_00_02_user2.txt' eq setlogfile( $mysync ),
                       'setlogfile: logdir undef, LOG_imapsync/1970_01_01_01_00_02_user2.txt' ) ;
       
      -        $mysync->{logdir} = '' ;
      +        $mysync->{logdir} = q{} ;
               $mysync->{logfile} = undef ;
      -        ok( '1970_01_01_01_00_02_user2.txt' eq setlogfile( $mysync ), 
      +        ok( '1970_01_01_01_00_02_user2.txt' eq setlogfile( $mysync ),
                       'setlogfile: logdir empty, 1970_01_01_01_00_02_user2.txt' ) ;
       
               $mysync->{logdir} = 'vallogdir' ;
               $mysync->{logfile} = undef ;
      -        ok( 'vallogdir/1970_01_01_01_00_02_user2.txt' eq setlogfile( $mysync ), 
      +        ok( 'vallogdir/1970_01_01_01_00_02_user2.txt' eq setlogfile( $mysync ),
                       'setlogfile: logdir vallogdir, vallogdir/1970_01_01_01_00_02_user2.txt' ) ;
       
               $mysync->{logdir}  = 'vallogdir' ;
               $mysync->{logfile} = 'vallogfile.txt' ;
      -        ok( 'vallogdir/vallogfile.txt' eq setlogfile( $mysync ), 
      +        ok( 'vallogdir/vallogfile.txt' eq setlogfile( $mysync ),
                       'setlogfile: logdir vallogdir, logfile vallogfile.txt, vallogdir/vallogfile.txt' ) ;
       
      -        return(  ) ;
      +        return ;
       }
       
       
       sub logfile {
       	my ( $time, $suffix, $dir ) = @_ ;
      -	
      +
       	$time   ||= 0 ;
      -	$suffix ||= '' ;
      -	my $sep_suffix = ( $suffix ) ? '_' : '' ;
      -        $dir    ||= '' ;
      -	my $sep_dir = ( $dir ) ? '/' : '' ;
      -	
      -	my $date_str = POSIX::strftime( "%Y_%m_%d_%H_%M_%S", localtime( $time ) ) ;
      +	$suffix ||= q{} ;
      +	my $sep_suffix = ( $suffix ) ? '_' : q{} ;
      +        $dir    ||= q{} ;
      +	my $sep_dir = ( $dir ) ? '/' : q{} ;
      +
      +	my $date_str = POSIX::strftime( '%Y_%m_%d_%H_%M_%S', localtime $time ) ;
               my $logfile = "${dir}${sep_dir}${date_str}${sep_suffix}${suffix}.txt" ;
      -	$debug and print "date_str: $date_str\n" ;
      -	$debug and print "logfile : $logfile\n" ;
      +	$debug and myprint( "date_str: $date_str\n"  ) ;
      +	$debug and myprint( "logfile : $logfile\n"  ) ;
       	return( $logfile ) ;
       }
       
      @@ -7691,40 +8633,40 @@ sub tests_logfile {
       			ok( '1970_01_01_00_01_01.txt' eq logfile( 61 ),         'logfile: 0          => 1970_01_01_00_01_01.txt' ) ;
       			ok( '2010_08_24_14_00_00.txt' eq logfile( 1282658400 ), 'logfile: 1282658400 => 2010_08_24_14_00_00.txt' ) ;
       			ok( '2010_08_24_14_01_01.txt' eq logfile( 1282658461 ), 'logfile: 1282658461 => 2010_08_24_14_01_01.txt' ) ;
      -			ok( '2010_08_24_14_01_01_poupinette.txt' eq logfile( 1282658461, "poupinette" ), 'logfile: 1282658461 poupinette => 2010_08_24_14_01_01_poupinette.txt' ) ;
      +			ok( '2010_08_24_14_01_01_poupinette.txt' eq logfile( 1282658461, 'poupinette' ), 'logfile: 1282658461 poupinette => 2010_08_24_14_01_01_poupinette.txt' ) ;
                       }
       		POSIX::tzset unless ('MSWin32' eq $OSNAME) ;
       	} ;
      -	return(  ) ;
      +	return ;
       }
       
      -sub tests_million_folders_baby {
      -	my @long = ( 1 .. 1_000_000 ) ;
      -	my $pasglop ;
      -	foreach my $elem (  ( 1 .. 1_000_000 ) ) {
      -		$debug and print "$elem " ;
      -		if ( not grep { /\Q$elem\E/o } @long ) {
      -			$pasglop++ ;
      -		}
      -	}
      -	print "$pasglop\n" ;
      -        return(  ) ;
      -}
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
       
       sub tests_million_folders_baby_2 {
      -	my %long ; 
      +	my %long ;
       	@long{ 1 .. 900_000 } = (1) x 900_000 ;
      -	#print %long, "\n" ;
      +	#myprint( %long, "\n"  ) ;
       	my $pasglop = 0 ;
       	foreach my $elem (  1 .. 900_000 ) {
      -		#$debug and print "$elem " ;
      -		if ( not exists( $long{ $elem } ) ) {
      +		#$debug and myprint( "$elem "  ) ;
      +		if ( not exists  $long{ $elem }  ) {
       			$pasglop++ ;
       		}
       	}
               ok( 0 == $pasglop, 'tests_million_folders_baby_2: search among 900_000' ) ;
      -	# print "$pasglop\n" ;
      -        return(  ) ;
      +	# myprint( "$pasglop\n"  ) ;
      +        return ;
       }
       
       
      @@ -7732,36 +8674,49 @@ sub tests_million_folders_baby_2 {
       sub tests_always_fail {
       	ok( 0 == 1, '0 == 1' ) ;
       	ok( 1 == 1, '1 == 1' ) ;
      -        return(  ) ;
      +        return ;
       }
       
       sub logfileprepa {
       	my $logfile = shift ;
      -	
      +
       	my $dirname = dirname( $logfile ) ;
       	is_valid_directory( $dirname ) || return( 0 ) ;
       	return( 1 ) ;
       }
       
       sub teelaunch {
      -	my $logfile = shift ;
      -	logfileprepa( $logfile ) || croak "Error creating directory for $logfile : $!" ;
      +        my $mysync = shift ;
      +	my $logfile = $mysync->{logfile} ;
      +	logfileprepa( $logfile ) || croak "Error no valid directory to write log file $logfile : $!" ;
       	my $logfile_handle ;
      -	open $logfile_handle, '>', $logfile 
      +	open $logfile_handle, '>', $logfile
       	  or croak( "Can not open $logfile for write: $!" ) ;
       	my $tee = IO::Tee->new( $logfile_handle, \*STDOUT ) ;
       	*STDERR = *$tee{IO} ;
       	select $tee ;
      -	return(  ) ;
      +        $tee->autoflush( 1 ) ;
      +        $mysync->{logfile_handle} = $logfile_handle ;
      +        $mysync->{tee} = $tee ;
      +	return $logfile_handle ;
      +}
      +
      +sub getpwuid_any_os {
      +        my $uid = shift ;
      +
      +        return( scalar  getlogin ) if ( 'MSWin32' eq $OSNAME ) ; # Windows system
      +        return( scalar  getpwuid $uid ) ; # Unix system
       }
       
      +
      +
       sub usage {
       	my $localhost_info = localhost_info();
       	my $thank = thank_author();
      -	my $imapsync_release = '';
      -	$imapsync_release = check_last_release() if (not defined($releasecheck));
      +	my $imapsync_release = q{};
      +	$imapsync_release = check_last_release() if (not defined $releasecheck);
               my $escape_char = ( 'MSWin32' eq $OSNAME ) ? '^' : '\\';
      -        print <<"EOF";
      +        myprint( <<"EOF" ) ;
       
        usage: $0 [options]
       
      @@ -7800,8 +8755,8 @@ sub usage {
                              See all possibilities in the new() method of IO::Socket::SSL
                              http://search.cpan.org/perldoc?IO::Socket::SSL#Description_Of_Methods
        --sslargs2     str  : Pass any ssl parameter for host2 ssl or tls connection.
      -                       See --sslargs1 
      -					   
      +                       See --sslargs1
      +
        --timeout1     int  : Connection timeout in seconds for host1.
                              Default is 120 and 0 means no timeout at all.
        --timeout2     int  : Connection timeout in seconds for host2.
      @@ -7855,9 +8810,9 @@ sub usage {
                              It does it by adding two --regextrans2 options before
                              all others. Add --debug to see what's really going on.
       
      - --automap           : guesses folders mapping, for folders like 
      + --automap           : guesses folders mapping, for folders like
                              "Sent", "Junk", "Drafts", "All", "Archive", "Flagged".
      - --f1f2    str1=str2 : Force folder str1 to be synced to str2, 
      + --f1f2    str1=str2 : Force folder str1 to be synced to str2,
                              --f1f2 overrides --automap and --regextrans2.
        --regextrans2  reg  : Apply the whole regex to each destination folders.
        --regextrans2  reg  : and this one. etc.
      @@ -7898,7 +8853,7 @@ sub usage {
        --pipemess     cmd  : Apply this cmd command to each message content
                              before the copy.
        --pipemess     cmd  : and this one, etc.
      - 
      +
        --disarmreadreceipts : Disarms read receipts (host2 Exchange issue)
       
        --regexmess    reg  : Apply the whole regex to each message before transfer.
      @@ -8049,18 +9004,18 @@ EOF
       
       
       sub usage_complete {
      -	print <<'EOF' ;
      ---skipheader   reg     : Don't take into account header keyword 
      +	myprint( <<'EOF'  ) ;
      +--skipheader   reg     : Don't take into account header keyword
                                matching  reg    ex: --skipheader 'X.*'
      -        
      ---skipsize             : Don't take message size into account to compare 
      +
      +--skipsize             : Don't take message size into account to compare
                                messages on both sides. On by default.
       			 Use --no-skipsize for using size comparaison.
       --allowsizemismatch    : allow RFC822.SIZE != fetched msg size
                                consider also --skipsize to avoid duplicate messages
                                when running syncs more than one time per mailbox
       
      ---reconnectretry1  int : reconnect to host1 if connection is lost up to 
      +--reconnectretry1  int : reconnect to host1 if connection is lost up to
                                 int  times per imap command (default is 3)
       --reconnectretry2  int : same as --reconnectretry1 but for host2
       --split1      int      : split the requests in several parts on host1.
      @@ -8069,273 +9024,276 @@ sub usage_complete {
       --split2      int      : same thing on host2.
       --nofixInboxINBOX      : Don't fix Inbox INBOX mapping.
       EOF
      -	return(  ) ;
      +	return ;
       }
       
       
       
       sub get_options {
      -	my $numopt = scalar( @ARGV ) ;
      -	my $argv   = join( "\x00", @ARGV ) ;
      -	
      +	# In CGI context arguments are not in @ARGV but in QUERY_STRING variable (with GET).
      +	my $numopt = scalar  @ARGV  || length $ENV{'QUERY_STRING'} ;
      +	my $argv   = join "\x00", @ARGV ;
      +
       	if ( $argv =~ m/-delete\x002/x ) {
      -		print "May be you mean --delete2 instead of --delete 2\n" ;
      -		exit( 1 ) ;
      +		myprint( "May be you mean --delete2 instead of --delete 2\n"  ) ;
      +		exit 1 ;
       	}
      -        my $opt_ret = GetOptions(
      -        "debug!"        => \$debug,
      -        "debugLIST!"    => \$debugLIST,
      -        "debugcontent!" => \$debugcontent,
      -        "debugsleep!"   => \$debugsleep,
      -        "debugflags!"   => \$debugflags,
      -        "debugimap!"    => \$debugimap,
      -        "debugimap1!"   => \$debugimap1,
      -        "debugimap2!"   => \$debugimap2,
      -        "debugdev!"     => \$debugdev,
      -        "debugmemory!"  => \$debugmemory,
      -        "debugfolders!" => \$sync->{debugfolders},
      -        "debugssl=i"    => \$sync->{debugssl},
      -
      -        "host1=s"     => \$host1,
      -        "host2=s"     => \$host2,
      -        "port1=i"     => \$port1,
      -        "port2=i"     => \$port2,
      -        "user1=s"     => \$user1,
      -        "user2=s"     => \$user2,
      -        "domain1=s"   => \$domain1,
      -        "domain2=s"   => \$domain2,
      -        "password1=s" => \$password1,
      -        "password2=s" => \$password2,
      -        "passfile1=s" => \$passfile1,
      -        "passfile2=s" => \$passfile2,
      -        "authmd5!"    => \$authmd5,
      -        "authmd51!"   => \$authmd51,
      -        "authmd52!"   => \$authmd52,
      -        "sep1=s"      => \$sep1,
      -        "sep2=s"      => \$sep2,
      -        "folder=s"    => \@folder,
      -        "folderrec=s" => \@folderrec,
      -        "include=s"   => \@include,
      -        "exclude=s"   => \@exclude,
      -        "folderfirst=s" => \@folderfirst,
      -        "folderlast=s" => \@folderlast,
      -        "prefix1=s"   => \$prefix1,
      -        "prefix2=s"   => \$prefix2,
      -	"subfolder2=s" => \$subfolder2,
      -        "fixslash2!"   => \$fixslash2,
      -        "fixInboxINBOX!" => \$fixInboxINBOX,
      -        "regextrans2=s" => \@regextrans2,
      -        "mixfolders!" => \$mixfolders,
      -        "skipemptyfolders!" => \$skipemptyfolders,
      -        "regexmess=s" => \@regexmess,
      -        "skipmess=s" => \@skipmess,
      -        "pipemess=s" => \@pipemess,
      -	"pipemesscheck!" => \$pipemesscheck, 
      -        "disarmreadreceipts!" => \$disarmreadreceipts,
      -        "regexflag=s" => \@regexflag,
      -        "filterflags!" => \$filterflags,
      -        "flagsCase!"  => \$flagsCase,
      -        "syncflagsaftercopy!" => \$syncflagsaftercopy,
      -        "delete|delete1!" => \$delete,
      -        "delete2!"    => \$delete2,
      -        "delete2duplicates!" => \$delete2duplicates,
      -        "delete2folders!"    => \$delete2folders,
      -        "delete2foldersonly=s" => \$delete2foldersonly,
      -        "delete2foldersbutnot=s" => \$delete2foldersbutnot,
      -        "syncinternaldates!" => \$syncinternaldates,
      -        "idatefromheader!"   => \$idatefromheader,
      -        "syncacls!"   => \$syncacls,
      -        "maxsize=i"   => \$maxsize,
      -        "minsize=i"   => \$minsize,
      -        "maxage=i"    => \$maxage,
      -        "minage=i"    => \$minage,
      -        "search=s"    => \$search,
      -        "search1=s"   => \$search1,
      -        "search2=s"   => \$search2,
      -        "foldersizes!" => \$foldersizes,
      -        "foldersizesatend!" => \$foldersizesatend,
      -        "dry!"        => \$dry,
      -        "expunge!"    => \$expunge,
      -        "expunge1!"    => \$expunge1,
      -        "expunge2!"    => \$expunge2,
      -        "uidexpunge2!" => \$uidexpunge2,
      -        "subscribed!" => \$subscribed,
      -        "subscribe!"  => \$subscribe,
      -        "subscribeall|subscribe_all!"  => \$subscribeall,
      -        "justbanner!" => \$justbanner,
      -        "justconnect!"=> \$justconnect,
      -        "justfolders!"=> \$justfolders,
      -        "justfoldersizes!" => \$justfoldersizes,
      -        "fast!"       => \$fast,
      -        "version"     => \$version,
      -        "help"        => \$help,
      -        "timeout=i"   => \$timeout,
      -        "timeout1=i"   => \$sync->{h1}->{timeout},
      -        "timeout2=i"   => \$sync->{h2}->{timeout},
      -        "skipheader=s" => \$skipheader,
      -        "useheader=s" => \@useheader,
      -        "wholeheaderifneeded!"   => \$wholeheaderifneeded,
      -        "messageidnodomain!" => \$messageidnodomain,
      -        "skipsize!"   => \$skipsize,
      -        "allowsizemismatch!" => \$allowsizemismatch,
      -        "fastio1!"     => \$fastio1,
      -        "fastio2!"     => \$fastio2,
      -        "ssl1!"        => \$ssl1,
      -        "ssl2!"        => \$ssl2,
      -        "ssl1_SSL_version=s" => \$sync->{h1}->{sslargs}->{SSL_version},
      -        "ssl2_SSL_version=s" => \$sync->{h2}->{sslargs}->{SSL_version},
      -        "sslargs1=s%"        => \$sync->{h1}->{sslargs},
      -        "sslargs2=s%"        => \$sync->{h2}->{sslargs},
      -        "tls1!"        => \$tls1,
      -        "tls2!"        => \$tls2,
      -        "uid1!"        => \$uid1,
      -        "uid2!"        => \$uid2,
      -        "authmech1=s" => \$authmech1,
      -        "authmech2=s" => \$authmech2,
      -        "authuser1=s" => \$authuser1,
      -        "authuser2=s" => \$authuser2,
      -        "proxyauth1"  => \$proxyauth1,
      -        "proxyauth2"  => \$proxyauth2,
      -        "split1=i"    => \$split1,
      -        "split2=i"    => \$split2,
      -        "buffersize=i" => \$buffersize,
      -        "reconnectretry1=i" => \$reconnectretry1,
      -        "reconnectretry2=i" => \$reconnectretry2,
      -        "tests!"       => \$tests,
      -        "testsdebug|tests_debug!" => \$testsdebug,
      -        "testslive!"   => \$testslive,
      -        "justlogin!"  => \$justlogin,
      -        "tmpdir=s"    => \$tmpdir,
      -        "pidfile=s"    => \$pidfile,
      -        "pidfilelocking!" => \$pidfilelocking,                                 
      -        "releasecheck!" => \$releasecheck,
      -        "modules_version!" => \$modules_version,
      -        "usecache!"    => \$usecache,
      -        "cacheaftercopy!" => \$cacheaftercopy,
      -        "debugcache!" => \$debugcache,
      -        "useuid!"     => \$useuid,
      -        "addheader!"  => \$addheader,
      -        "exitwhenover=i" => \$exitwhenover,
      -        "checkselectable!" => \$checkselectable,
      -        "checkmessageexists!" => \$checkmessageexists,
      -        "expungeaftereach!" => \$expungeaftereach,
      -        "abletosearch!" => \$abletosearch,
      -        "showpasswords!" => \$showpasswords,
      -        "maxlinelength=i" => \$maxlinelength, 
      -        "maxlinelengthcmd=s" => \$maxlinelengthcmd, 
      -        "minmaxlinelength=i" => \$minmaxlinelength, 
      -        "debugmaxlinelength!" => \$debugmaxlinelength,
      -        "fixcolonbug!"           => \$fixcolonbug,
      -        "create_folder_old!"     => \$create_folder_old,
      -        "maxmessagespersecond=f" => \$maxmessagespersecond,
      -        "maxbytespersecond=i"    => \$maxbytespersecond,
      -        "skipcrossduplicates!"   => \$skipcrossduplicates,
      -        "debugcrossduplicates!"  => \$debugcrossduplicates,
      -        "log!"                   => \$log,
      -        "logfile=s"        => \$sync->{logfile},
      -        "logdir=s"         => \$sync->{logdir},
      -        "errorsmax=i"      => \$errorsmax,
      -        "errorsdump!"      => \$errorsdump,
      -        "fetch_hash_set=s" => \$fetch_hash_set,
      -        "automap!"         => \$sync->{automap},
      -        "justautomap!"     => \$sync->{justautomap},
      -        "id!"              => \$sync->{id},
      -        "f1f2=s%"          => \$sync->{f1f2},
      -        "justfolderlists!" => \$sync->{justfolderlists},
      +	$sync->{f1f2} = {} ;
      +        my $opt_ret = Imapsync::Getopt::Long::GetOptions(
      +        'debug!'        => \$debug,
      +        'debuglist!'    => \$debuglist,
      +        'debugcontent!' => \$debugcontent,
      +        'debugsleep=f'  => \$sync->{debugsleep},
      +        'debugflags!'   => \$debugflags,
      +        'debugimap!'    => \$debugimap,
      +        'debugimap1!'   => \$debugimap1,
      +        'debugimap2!'   => \$debugimap2,
      +        'debugdev!'     => \$debugdev,
      +        'debugmemory!'  => \$sync->{debugmemory},
      +        'debugfolders!' => \$sync->{debugfolders},
      +        'debugssl=i'    => \$sync->{debugssl},
      +	'debugbasket=s' => \@debugbasket,
      +	'debugcgi!'     => \$debugcgi,
      +        'host1=s'     => \$host1,
      +        'host2=s'     => \$host2,
      +        'port1=i'     => \$port1,
      +        'port2=i'     => \$port2,
      +	'inet4'       => \$sync->{inet4},
      +	'inet6'       => \$sync->{inet6},
      +        'user1=s'     => \$user1,
      +        'user2=s'     => \$user2,
      +        'domain1=s'   => \$domain1,
      +        'domain2=s'   => \$domain2,
      +        'password1=s' => \$password1,
      +        'password2=s' => \$password2,
      +        'passfile1=s' => \$passfile1,
      +        'passfile2=s' => \$passfile2,
      +        'authmd5!'    => \$authmd5,
      +        'authmd51!'   => \$authmd51,
      +        'authmd52!'   => \$authmd52,
      +        'sep1=s'      => \$sep1,
      +        'sep2=s'      => \$sep2,
      +        'folder=s'    => \@folder,
      +        'folderrec=s' => \@folderrec,
      +        'include=s'   => \@include,
      +        'exclude=s'   => \@exclude,
      +        'folderfirst=s' => \@folderfirst,
      +        'folderlast=s' => \@folderlast,
      +        'prefix1=s'   => \$prefix1,
      +        'prefix2=s'   => \$prefix2,
      +	'subfolder2=s' => \$subfolder2,
      +        'fixslash2!'   => \$fixslash2,
      +        'fixInboxINBOX!' => \$fixInboxINBOX,
      +        'regextrans2=s' => \@regextrans2,
      +        'mixfolders!' => \$mixfolders,
      +        'skipemptyfolders!' => \$skipemptyfolders,
      +        'regexmess=s' => \@regexmess,
      +        'skipmess=s' => \@skipmess,
      +        'pipemess=s' => \@pipemess,
      +	'pipemesscheck!' => \$pipemesscheck,
      +        'disarmreadreceipts!' => \$disarmreadreceipts,
      +        'regexflag=s' => \@regexflag,
      +        'filterflags!' => \$filterflags,
      +        'flagscase!'  => \$flagscase,
      +        'syncflagsaftercopy!' => \$syncflagsaftercopy,
      +        'delete|delete1!' => \$delete,
      +        'delete2!'    => \$delete2,
      +        'delete2duplicates!' => \$delete2duplicates,
      +        'delete2folders!'    => \$delete2folders,
      +        'delete2foldersonly=s' => \$delete2foldersonly,
      +        'delete2foldersbutnot=s' => \$delete2foldersbutnot,
      +        'syncinternaldates!' => \$syncinternaldates,
      +        'idatefromheader!'   => \$idatefromheader,
      +        'syncacls!'   => \$syncacls,
      +        'maxsize=i'   => \$maxsize,
      +        'minsize=i'   => \$minsize,
      +        'maxage=i'    => \$maxage,
      +        'minage=i'    => \$minage,
      +        'search=s'    => \$search,
      +        'search1=s'   => \$search1,
      +        'search2=s'   => \$search2,
      +        'foldersizes!' => \$foldersizes,
      +        'foldersizesatend!' => \$foldersizesatend,
      +        'dry!'        => \$dry,
      +        'expunge!'    => \$expunge,
      +        'expunge1!'    => \$expunge1,
      +        'expunge2!'    => \$expunge2,
      +        'uidexpunge2!' => \$uidexpunge2,
      +        'subscribed!' => \$subscribed,
      +        'subscribe!'  => \$subscribe,
      +        'subscribeall|subscribe_all!'  => \$subscribeall,
      +        'justbanner!' => \$justbanner,
      +        'justconnect!'=> \$justconnect,
      +        'justfolders!'=> \$justfolders,
      +        'justfoldersizes!' => \$justfoldersizes,
      +        'fast!'       => \$fast,
      +        'version'     => \$version,
      +        'help'        => \$help,
      +        'timeout=i'   => \$timeout,
      +        'timeout1=i'   => \$sync->{h1}->{timeout},
      +        'timeout2=i'   => \$sync->{h2}->{timeout},
      +        'skipheader=s' => \$skipheader,
      +        'useheader=s' => \@useheader,
      +        'wholeheaderifneeded!'   => \$wholeheaderifneeded,
      +        'messageidnodomain!' => \$messageidnodomain,
      +        'skipsize!'   => \$skipsize,
      +        'allowsizemismatch!' => \$allowsizemismatch,
      +        'fastio1!'     => \$fastio1,
      +        'fastio2!'     => \$fastio2,
      +        'ssl1!'        => \$ssl1,
      +        'ssl2!'        => \$ssl2,
      +        'ssl1_ssl_version=s' => \$sync->{h1}->{sslargs}->{SSL_version},
      +        'ssl2_ssl_version=s' => \$sync->{h2}->{sslargs}->{SSL_version},
      +        'sslargs1=s%'        => \$sync->{h1}->{sslargs},
      +        'sslargs2=s%'        => \$sync->{h2}->{sslargs},
      +        'tls1!'        => \$tls1,
      +        'tls2!'        => \$tls2,
      +        'uid1!'        => \$uid1,
      +        'uid2!'        => \$uid2,
      +        'authmech1=s' => \$authmech1,
      +        'authmech2=s' => \$authmech2,
      +        'authuser1=s' => \$authuser1,
      +        'authuser2=s' => \$authuser2,
      +        'proxyauth1'  => \$proxyauth1,
      +        'proxyauth2'  => \$proxyauth2,
      +        'split1=i'    => \$split1,
      +        'split2=i'    => \$split2,
      +        'buffersize=i' => \$buffersize,
      +        'reconnectretry1=i' => \$reconnectretry1,
      +        'reconnectretry2=i' => \$reconnectretry2,
      +        'tests!'       => \$tests,
      +        'testsdebug|tests_debug!' => \$testsdebug,
      +        'testslive!'   => \$testslive,
      +        'justlogin!'  => \$justlogin,
      +        'tmpdir=s'    => \$tmpdir,
      +        'pidfile=s'    => \$sync->{pidfile},
      +        'pidfilelocking!' => \$sync->{pidfilelocking},
      +        'releasecheck!' => \$releasecheck,
      +        'modulesversion|modules_version!' => \$modulesversion,
      +        'usecache!'    => \$usecache,
      +        'cacheaftercopy!' => \$cacheaftercopy,
      +        'debugcache!' => \$debugcache,
      +        'useuid!'     => \$useuid,
      +        'addheader!'  => \$addheader,
      +        'exitwhenover=i' => \$exitwhenover,
      +        'checkselectable!' => \$checkselectable,
      +        'checkmessageexists!' => \$checkmessageexists,
      +        'expungeaftereach!' => \$expungeaftereach,
      +        'abletosearch!' => \$abletosearch,
      +        'showpasswords!' => \$showpasswords,
      +        'maxlinelength=i' => \$maxlinelength,
      +        'maxlinelengthcmd=s' => \$maxlinelengthcmd,
      +        'minmaxlinelength=i' => \$minmaxlinelength,
      +        'debugmaxlinelength!' => \$debugmaxlinelength,
      +        'fixcolonbug!'           => \$fixcolonbug,
      +        'create_folder_old!'     => \$create_folder_old,
      +        'maxmessagespersecond=f' => \$maxmessagespersecond,
      +        'maxbytespersecond=i'    => \$maxbytespersecond,
      +        'skipcrossduplicates!'   => \$skipcrossduplicates,
      +        'debugcrossduplicates!'  => \$debugcrossduplicates,
      +        'log!'                   => \$sync->{log},
      +        'logfile=s'        => \$sync->{logfile},
      +        'logdir=s'         => \$sync->{logdir},
      +        'errorsmax=i'      => \$sync->{errorsmax},
      +        'errorsdump!'      => \$sync->{errorsdump},
      +        'fetch_hash_set=s' => \$fetch_hash_set,
      +        'automap!'         => \$sync->{automap},
      +        'justautomap!'     => \$sync->{justautomap},
      +        'id!'              => \$sync->{id},
      +        'f1f2=s%'          => \$sync->{f1f2},
      +        'justfolderlists!' => \$sync->{justfolderlists},
      +        'delete1emptyfolders' => \$sync->{delete1emptyfolders},
               ) ;
       
      -        $debug and print "get options: [$opt_ret]\n" ;
      -        
      +
      +	$debugcgi and myprint( map { "$_ => $ENV{$_}\n" } sort keys  %ENV   ) ;
      +	$debugcgi and myprint( "@debugbasket\n"  ) ;
      +        $debug and myprint( "get options: [$opt_ret]\n"  ) ;
      +
               # just the version
      -        print imapsync_version(  ), "\n" and exit if ( $version ) ;
      +        myprint( imapsync_version(  ), "\n" ) and exit 0 if ( $version ) ;
               # $tmpdir is used in tests_pipemess()
       	$tmpdir ||= File::Spec->tmpdir(  ) ;
       	if ( $tests or $testsdebug ) {
       		$test_builder = Test::More->builder ;
       		if ( $tests ) { tests(  ) ; }
       		if ( $testsdebug ) { testsdebug(  ) ; }
      -		$test_builder->reset(  ) ;
      +		#$test_builder->reset(  ) ;
       		exit ;
       	}
      -	
      -	$help = 1 if ! $numopt;
      +
      +	#$help = 1 if ! $numopt;
       	load_modules(  );
       
       	# exit with --help option or no option at all
      -        usage(  ) and exit(  ) if ( $help or not $numopt ) ;
      +	$debug and myprint( "numopt:$numopt\n"  ) ;
      +        usage(  ) and exit  if ( $help or not $numopt ) ;
       
       	# don't go on if options are not all known.
      -        exit( EX_USAGE(  ) ) unless ( $opt_ret ) ;
      +        exit $EX_USAGE unless ( $opt_ret ) ;
       
       	# init live varaiables
       	testslive(  ) if ( $testslive ) ;
       
      -	return(  ) ;
      +	return ;
       }
       
       sub testslive {
      -	$host1 = "test1.lamiral.info" ;
      -	$user1 = "test1" ;
      -	$password1 = "secret1" ;
      -	$host2 = "test2.lamiral.info" ;
      -	$user2 = "test2" ;
      -	$password2 ="secret2" ;
      -	return(  ) ;
      +	$host1 = 'test1.lamiral.info' ;
      +	$user1 = 'test1' ;
      +	$password1 = 'secret1' ;
      +	$host2 = 'test2.lamiral.info' ;
      +	$user2 = 'test2' ;
      +	$password2 ='secret2' ;
      +	return ;
       }
       
       sub testsdebug {
             SKIP: {
      -		skip "No test in normal run" if ( not $testsdebug ) ;
      -                #tests_jux_utf8(  ) ;
      -                #tests_jux_utf8_list(  ) ;
      -                #tests_cache_folder(  ) ;
      -                #tests_cache_dir_fix(  ) ;
      -                #tests_cache_dir_fix_win(  ) ;
      -                #tests_touch(  ) ;
      -                #tests_regexmess(  ) ;
      -                #tests_skipmess(  ) ;
      -		#tests_backtick(  ) ;
      -                #eval { tests_mkpath(  ) ; } ;
      -		#tests_always_fail(  ) ;
      -                #tests_pipemess(  ) ;
      -                #tests_logfile(  ) ;
      -                #tests_setlogfile(  ) ;
      -		#tests_guess_separator(  ) ;
      -                #tests_imap2_folder_name(  ) ;
      -		#tests_guess_prefix(  ) ;
      -		#tests_epoch(  ) ;
      -		#tests_good_date(  ) ;
      -		#tests_format_for_imap_arg(  ) ;
      -		#tests_imapsync_id(  ) ;
      -		#tests_date_from_rcs(  ) ;
      -                tests_quota_extract_storage_limit_in_bytes(  ) ;
      -                tests_quota_extract_storage_current_in_bytes(  ) ;
      -		#tests_million_folders_baby_2(  ) ;
      -                #tests_guess_special(  ) ;
      -		done_testing(  ) ;
      -                note("End of imapsync --tests_debug") ;
      +                skip 'No test in normal run' if ( not $testsdebug ) ;
      +                #tests_bytes_display_string(  ) ;
      +                #tests_ucsecond(  ) ;
      +                #tests_mkpath(  ) ;
      +                #eval { tests_mkpath(  ) ; } or ok( 0 == 1,  'tests_mkpath fail badly?' ) ;
      +                #tests_format_for_imap_arg(  ) ;
      +                #tests_is_a_release_number(  ) ;
      +                #tests_delete1emptyfolders(  ) ;
      +                #tests_memory_consumption(  ) ;
      +                #tests_imap2_folder_name() ;
      +                #tests_length_ref(  ) ;
      +		#tests_is_valid_directory(  ) ;
      +                #tests_firstline(  ) ;
      +                #tests_diff_or_NA(  ) ;
      +                #tests_match_number(  ) ;
      +                #tests_all_defined(  ) ;
      +                #tests_guess_separator(  ) ;
      +                tests_pipemess(  ) ;
      +                #tests_message_for_host2(  ) ;
      +                done_testing(  ) ;
      +                note('End of imapsync --tests_debug') ;
               }
      -        return(  ) ;
      +        return ;
       }
       
       sub tests {
       
             SKIP: {
      -                skip "No test in normal run" if ( not $tests ) ;
      +                skip 'No test in normal run' if ( not $tests ) ;
                       tests_folder_routines(  ) ;
      -                tests_compare_lists();
      +                tests_compare_lists(  ) ;
                       tests_regexmess();
                       tests_skipmess(  ) ;
                       tests_flags_regex();
      +                tests_ucsecond(  ) ;
                       tests_permanentflags();
                       tests_flags_filter(  ) ;
                       tests_separator_invert(  ) ;
      -                tests_imap2_folder_name();
      +                tests_imap2_folder_name() ;
                       tests_command_line_nopassword();
                       tests_good_date(  ) ;
                       tests_max();
                       tests_remove_not_num();
      -                tests_memory_consumption();
      +                tests_memory_consumption( ) ;
                       tests_is_a_release_number();
                       tests_imapsync_basename();
                       tests_list_keys_in_2_not_in_1();
      @@ -8346,9 +9304,8 @@ sub tests {
                       tests_clean_cache(  ) ;
                       tests_clean_cache_2(  ) ;
                       tests_touch(  ) ;
      -                tests_ucsecond(  ) ;
      -                tests_flagsCase(  ) ;
      -                eval { tests_mkpath(  ) ; } or ok( 0 == 1,  "tests_mkpath fail badly?" ) ;
      +                tests_flagscase(  ) ;
      +                eval { tests_mkpath(  ) ; } or ok( 0 == 1,  'tests_mkpath fail badly?' ) ;
                       tests_extract_header(  ) ;
                       tests_decompose_header(  ) ;
                       tests_epoch(  ) ;
      @@ -8374,7 +9331,6 @@ sub tests {
                       tests_setlogfile(  ) ;
                       tests_jux_utf8(  ) ;
                       tests_pipemess(  ) ;
      -                #tests_always_fail(  ) ;
                       tests_jux_utf8_list(  ) ;
                       tests_guess_prefix(  ) ;
                       tests_guess_separator(  ) ;
      @@ -8384,10 +9340,19 @@ sub tests {
                       tests_quota_extract_storage_limit_in_bytes(  ) ;
                       tests_quota_extract_storage_current_in_bytes(  ) ;
                       tests_guess_special(  ) ;
      -                done_testing( 597 ) ;
      -                note("End of imapsync --tests") ;
      +		tests_is_valid_directory(  ) ;
      +                tests_delete1emptyfolders(  ) ;
      +                tests_message_for_host2(  ) ;
      +                tests_length_ref(  ) ;
      +                tests_firstline(  ) ;               
      +                tests_diff_or_NA(  ) ;
      +                #tests_always_fail(  ) ;
      +                tests_match_number(  ) ;
      +                tests_all_defined(  ) ;
      +                done_testing( 693 ) ;
      +                note('End of imapsync --tests') ;
               }
      -        return(  ) ;
      +        return ;
       }
       
       
      @@ -8399,15 +9364,15 @@ package Mail::IMAPClient;
       sub Tls {
       	my $self  = shift ;
       	my $value = shift ;
      -	if ( defined( $value ) ) { $self->{TLS} = $value }
      +	if ( defined  $value  ) { $self->{TLS} = $value }
       	return $self->{TLS};
       }
       
       sub Reconnect_counter {
       	my $self  = shift ;
               my $value = shift ;
      -	$self->{Reconnect_counter} = 0 if ( not defined( $self->{Reconnect_counter} ) ) ;
      -	if ( defined( $value ) ) { $self->{Reconnect_counter} = $value }
      +	$self->{Reconnect_counter} = 0 if ( not defined  $self->{Reconnect_counter}  ) ;
      +	if ( defined  $value  ) { $self->{Reconnect_counter} = $value }
       	return( $self->{Reconnect_counter} ) ;
       }
       
      @@ -8427,4 +9392,97 @@ sub capability_update {
       }
       
       
      +package Imapsync::Getopt::Long ;
      +# Started as a copy of Luke Ross Getopt::Long::CGI
      +# https://metacpan.org/release/Getopt-Long-CGI
      +# So this section is under the same license as Getopt-Long-CGI Luke Ross wants it,
      +# which was Perl 5.6 or later licenses at the date of the copy.
      +
      +use strict ;
      +use warnings ;
      +
      +use Getopt::Long(  ) ;
      +
      +
      +sub GetOptions {
      +    my %options = @_ ;
      +
      +    if ( not $ENV{SERVER_SOFTWARE} ) {
      +        # Not CGI - pass upstream for normal command line handling
      +        return Getopt::Long::GetOptions( %options ) ;
      +    }
      +    my $b_ref = $options{'debugbasket=s'} ;
      +    require CGI ;
      +    require CGI::Carp ;
      +    CGI::Carp->import( 'fatalsToBrowser' ) ;
      +
      +    my $cgi = CGI->new(  ) ;
      +    $cgi->param( 'debugcgi' ) and myprint( "

      Current Values

      \n" . $cgi->Dump ) ; + + foreach my $key (sort keys %options) { + my $val = $options{$key}; + #push( @{$b_ref}, "opt:[$key] val:[$val]" . ( ('SCALAR' eq ref($val) and defined $$val ) ? " [$$val]" : q{} ) . "\n" ) ; + if ( $key !~ m/^([\w\d\|]+)([=:][isf])?([\+!\@\%])?$/ ) { + push @{$b_ref}, "Unknown opt: [$key]\n" ; + next ; # Unknown item + } + + my $name = [split '|', $1, 1 ]->[0]; + + if (($3 || q{}) eq '+') { + ${ $val } = $cgi->param($name); # "Incremental" integer + } elsif ($2) { + my @values = $cgi->param($name); + my $type = $2; + if (($3 || q{}) eq '%' or ref($val) eq 'HASH') { + my %values = map { split /=/, $_, 1 } @values; + if ($type =~ m/i$/) { + foreach my $k (keys %values) { + $values{$k} = int $values{$k} ; + } + } elsif ($type =~ m/f$/) { + foreach my $k (keys %values) { + $values{$k} = 0 + $values{$k} + } + } + if ( ref($val) eq 'CODE') { + while(my($k, $v) = each %values) { + $val->($name, $k, $v); + } + } elsif ( 'REF' eq ref $val ) { + #push( @{$b_ref}, "refref($$val): " . ref($$val) . " %values= ", %values, "\n\n" ) ; + %{ ${ $val } } = %values; + } else { + #push( @{$b_ref}, "ref($val): " . ref($val) . " %values= ", %values, "\n\n" ) ; + %{ $val } = %values; + } + } else { + if ($type =~ m/i$/) { + @values = map { int $_ } @values; + } elsif ($type =~ m/f$/) { + @values = map { 0 + $_ } @values; + } + if (($3 || q{}) eq '@' or ref($val) eq 'ARRAY') { + if (ref($val) eq 'CODE') { + $val->($name, \@values) + } else { + @{ $val } = @values ; + } + } else { + if (ref($val) eq 'CODE') { + $val->($name, $values[0]); + } else { + ${ $val } = $values[0]; + } + } + } + } else { + # Checkbox + ${ $val } = $cgi->param($name) ? 1 : undef ; + #push( @{$b_ref}, "param($name) ref($val): " . ref($val) . " val=[$$val]\n\n" ) ; + } + } + return( 1 ) ; +} + diff --git a/index.shtml b/index.shtml index 68224c3..ebb1b11 100644 --- a/index.shtml +++ b/index.shtml @@ -1,10 +1,10 @@ - + + + - - Official imapsync migration tool ( release <!--#exec cmd="cat ./VERSION"--> ) @@ -40,11 +40,12 @@
  • Installation
  • Documentation
  • -
  • Vote for better imapsync and services
  • -
  • News about imapsync and previous releases
  • -
  • List of the 66 imap server softwares supported by imapsync
  • +
  • Vote for a better imapsync and better services
  • +
  • News about imapsync , previous and next releases
  • +
  • List of the 69 imap server softwares supported by imapsync
  • Similar softwares and external services
  • -
  • Discuss or search on the mailing-list
  • +
  • Discuss or search on the mailing-list
  • +
  • Bottom of this page
  • @@ -58,12 +59,11 @@

    Welcome to the imapsync web site!

    - - -
    - + - + + +

    Copy all your emails elsewhere!

    @@ -156,12 +156,12 @@ See detailed explanation and motivation here when
    work - cel: +33 6 20 79 76 06 + cel: +33 6 19 22 03 54
    work - home: +33 951 84 42 42 + home: +33 9 51 84 42 42
    work @@ -195,13 +195,13 @@ See detailed explanation and motivation here when

    - Buy complete and latest imapsync for €50 EUR.
    + Buy complete and latest imapsync for €50 EUR.
    There is no trial version but I offer 30-day money back guarantee.
    After buying and downloading imapsync, go to the installation documentation.

    -For €50 EUR you will get: +For €50 EUR you will get:

    @@ -504,117 +510,30 @@ lists what may be coded or done in the future. like repeated in the LICENSE file (the detour is worth it).

    -

    Vote for better imapsync and services (back to menu) -

    - - -
    - -
    - - - -
    - -
    - - -
    - -
    - - -
    - -
    - -
    - -
    - - - - -
    - -
    - -
    -

    Discuss or search on the English imapsync mailing-list (back to menu) -

    - -

    - The English public mailing-list may be the best way to get free and gratis support (not as quick as the professional support).
    - You can write to the mailing-list even if you're not subscribed to it.
    - In that case you will receive a confirmation message each time you post (to avoid spam). -

    - -

    - To write on the mailing-list, the address is: - imapsync@linux-france.org (English language list, hosted in France)
    -

    - -

    - To subscribe, send a message to: - imapsync-subscribe@listes.linux-france.org
    -

    - -

    - To unsubscribe, send a message to: - imapsync-unsubscribe@listes.linux-france.org
    -

    - -

    - To contact the person in charge for the list: - imapsync-request@listes.linux-france.org
    -

    - -

    - The list archives are available at - - http://linux-france.org/prj/imapsync_list/
    - So consider that the list is public, anyone can see your post.
    - Use a pseudonym or do not post to - this list if you want to stay private.
    -

    - -
    -

    Search in the imapsync list archives: - - - (change the keywords with your own request and press Enter) -

    -
    - -

    -Thank you for your participation to the English imapsync mailing-list! -

    +

    -
    - - - - -
    - - Valid XHTML 1.0 Strict - - - - CSS Valide ! - - - -Viewable With Any Browser - + + + + CSS Valide ! + + +

    @@ -622,7 +541,7 @@ like repeated in the LICENSE file (the detour is worth it This document last modified on -($Id: index.shtml,v 1.286 2016/03/16 13:34:20 gilles Exp gilles $)
    +($Id: index.shtml,v 1.305 2016/08/18 09:55:44 gilles Exp gilles $)
    Top of the page

    diff --git a/tests.sh b/tests.sh index ac77e27..94cb044 100644 --- a/tests.sh +++ b/tests.sh @@ -1,6 +1,6 @@ #!/bin/sh -# $Id: tests.sh,v 1.272 2016/03/07 02:54:02 gilles Exp gilles $ +# $Id: tests.sh,v 1.282 2016/08/19 17:53:47 gilles Exp gilles $ # Example 1: # CMD_PERL='perl -I./W/Mail-IMAPClient-3.38/lib' sh -x tests.sh @@ -33,7 +33,7 @@ CMD_PERL=${CMD_PERL:-$CMD_PERL_3xx} exec 3>&2 # #set -x # debug mode. See what is running -set -e # exit on first failure +#set -e # exit on first failure #### functions definitions @@ -42,31 +42,51 @@ echo3() { echo "$@" >&3 } +echolog() { + echo "`date_ymdhms` : $@" >> W/.tests.errors.txt + echo3 Last errors listed in W/.tests.errors.txt +} + run_test() { - echo3 "#### $test_count $1" + echo3 "#### $tests_count $1" $1 - if test x"$?" = x"0"; then + run_test_status=$? + if test x"$run_test_status" = x"0"; then echo "$1 passed" else - echo "$1 failed" + echo3 "$1 failed" fi + return $run_test_status } run_tests() { for t in "$@"; do test X"$t" = X3 && CMD_PERL=$CMD_PERL_3xx && continue - test_count=`expr 1 + $test_count` + tests_count=`expr 1 + $tests_count` # - run_test "$t" - - sleep 1 + if ! run_test "$t"; then + tests_failed_count=`expr 1 + $tests_failed_count` + tests_failed_list="$tests_failed_list $t" + fi + sleep 0 done + if test 0 -eq $tests_failed_count; then + echo3 "ALL $tests_count TESTS SUCCESSFUL" + echolog "ALL $tests_count TESTS SUCCESSFUL" + return 0 + else + # At least one failed + echo3 "FAILED $tests_failed_count/$tests_count TESTS: $tests_failed_list" + echolog "FAILED $tests_failed_count/$tests_count TESTS: $tests_failed_list" + return 1 + fi } #### Variable definitions -test_count=0 +tests_count=0 +tests_failed_count=0 ##### The tests functions @@ -95,6 +115,8 @@ no_args() { # ll_bigmail() # ll_memory_consumption +# mailboxes toto -> delme -> delme used on ll_delself + sendtestmessage() { email=${1:-"tata"} rand=${2:-"`pwgen 16 1`"} @@ -106,6 +128,7 @@ sendtestmessage() { can_send() { + return 1 test X`hostname` = X"plume" && return 0; test X`hostname` = X"vadrouille" && return 0; test X`hostname` = X"petite" && return 0; @@ -147,11 +170,12 @@ passwords_dollar() { } passwords_parenthese() { - $CMD_PERL ./imapsync --host1 $HOST1 --user1 ee --password1 '(secret' --host2 $HOST2 --user2 ee --password2 '(secret' --showpasswords --debugimap1 - #$CMD_PERL ./imapsync --host1 $HOST1 --user1 ee --password1 'secret)' --host2 $HOST2 --user2 ee --password2 '(secret' --showpasswords --debugimap1 + #$CMD_PERL ./imapsync --host1 $HOST1 --user1 ee --password1 '( secret' --host2 $HOST2 --user2 ee --password2 '(secret' --showpasswords --debugimap1 + $CMD_PERL ./imapsync --host1 $HOST1 --user1 ee --password1 'secret )' --host2 $HOST2 --user2 ee --password2 '(secret' --showpasswords --debugimap1 } + first_sync_dry() { $CMD_PERL ./imapsync \ --host1 $HOST1 --user1 toto \ @@ -198,7 +222,7 @@ ll_errors() { --passfile1 ../../var/pass/secret.tata \ --host2 $HOST2 --user2 titi \ --passfile2 ../../var/pass/secret.titi \ - --nofoldersizes --folder INBOX.errors --regexflag 's/.*/PasGlop \\PasGlopRe/' --errorsmax 500 --delete2 + --nofoldersizes --folder INBOX.errors --regexflag 's/.*/PasGlop \\PasGlopRe/' --errorsmax 5 --delete2 #--pipemess 'grep lalalala' --nopipemesscheck --dry --debugcontent --debugflags } @@ -212,6 +236,7 @@ ll_debug() { } ll_debugcontent() { + can_send && sendtestmessage $CMD_PERL ./imapsync \ --host1 $HOST1 --user1 tata \ --passfile1 ../../var/pass/secret.tata \ @@ -229,7 +254,7 @@ ll_debugmemory() { --passfile1 ../../var/pass/secret.tata \ --host2 $HOST2 --user2 titi \ --passfile2 ../../var/pass/secret.titi \ - --debugmemory --nofoldersizes + --debugmemory --nofoldersizes --folder INBOX } @@ -264,29 +289,29 @@ pidfile() { } ll_pidfilelocking() { + rm -f /var/tmp/imapsync_test_pidfilelocking.pid + echo ll_pidfilelocking 01 $CMD_PERL ./imapsync \ --host1 $HOST1 --user1 tata \ --passfile1 ../../var/pass/secret.tata \ --host2 $HOST2 --user2 titi \ --passfile2 ../../var/pass/secret.titi \ --folder INBOX --pidfile /var/tmp/imapsync_test_pidfilelocking.pid \ - --pidfilelocking --justconnect - echo "Exited $?" - ! test -f /var/tmp/imapsync_test_pidfilelocking.pid - touch /var/tmp/imapsync_test_pidfilelocking.pid - if $CMD_PERL ./imapsync \ + --pidfilelocking --justconnect || return 1 + echo ll_pidfilelocking 02 + ! test -f /var/tmp/imapsync_test_pidfilelocking.pid || return 1 + echo ll_pidfilelocking 03 + touch /var/tmp/imapsync_test_pidfilelocking.pid || return 1 + echo ll_pidfilelocking 04 + ! $CMD_PERL ./imapsync \ --host1 $HOST1 --user1 tata \ --passfile1 ../../var/pass/secret.tata \ --host2 $HOST2 --user2 titi \ --passfile2 ../../var/pass/secret.titi \ --folder INBOX --pidfile /var/tmp/imapsync_test_pidfilelocking.pid \ - --pidfilelocking --justconnect; then - echo "Exited $?"; ! : - else - echo "Exited $?" - fi - - test -f /var/tmp/imapsync_test_pidfilelocking.pid + --pidfilelocking --justconnect || return 1 + echo ll_pidfilelocking 05 + test -f /var/tmp/imapsync_test_pidfilelocking.pid || return 1 rm /var/tmp/imapsync_test_pidfilelocking.pid } @@ -303,7 +328,6 @@ nomodules_version() { } - ll_ask_password() { { sleep 2; cat ../../var/pass/secret.tata; @@ -558,8 +582,22 @@ ll_pipemess() { --passfile1 ../../var/pass/secret.tata \ --host2 $HOST2 --user2 titi \ --passfile2 ../../var/pass/secret.titi \ - --folder INBOX.few_emails --pipemess 'cat' --pipemess 'reformime -r7' + --folder INBOX.few_emails --pipemess 'cat' --pipemess 'reformime -r7' + cmd_status=$? echo "sudo rm -rf /home/vmail/titi/.few_emails/" + return $cmd_status +} + +ll_pipemess_catcat() { + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 tata \ + --passfile1 ../../var/pass/secret.tata \ + --host2 $HOST2 --user2 titi \ + --passfile2 ../../var/pass/secret.titi \ + --folder INBOX.few_emails --pipemess '(cat|cat)' --pipemess 'reformime -r7' + cmd_status=$? + echo "sudo rm -rf /home/vmail/titi/.few_emails/" + return $cmd_status } ll_pipemess_nocmd() { @@ -773,6 +811,15 @@ ll_justfolders() { } +ll_justfolders_delete1emptyfolders() { + ./W/learn/create_folder localhost tata `cat /g/var/pass/secret.tata` INBOX.Empty INBOX.Empty.Empty INBOX.Empty.Empty.Empty + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 tata \ + --passfile1 ../../var/pass/secret.tata \ + --host2 $HOST2 --user2 titi \ + --passfile2 ../../var/pass/secret.titi \ + --justfolders --delete1emptyfolders --include Empty --folder INBOX --folderfirst INBOX.Empty.Empty +} ll_justfolders_skipemptyfolders() { $CMD_PERL ./imapsync \ @@ -1057,6 +1104,35 @@ ll_justfoldersizes_noexist() } +ll_reconnect_on_signal_debugimap() +{ +# in another terminal: +# +: <<'EOF' +while echo ENTER TO STOP; read a ; do +killall --signal STOP -v -u vmail imapd +echo ENTER to CONT; read a +killall --signal CONT -v -u vmail imapd +done +EOF + + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 tata \ + --passfile1 ../../var/pass/secret.tata \ + --host2 $HOST2 --user2 titi \ + --passfile2 ../../var/pass/secret.titi \ + --debugsleep 3.5 --debugimap +} + +ll_reconnect_on_signal() +{ + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 tata \ + --passfile1 ../../var/pass/secret.tata \ + --host2 $HOST2 --user2 titi \ + --passfile2 ../../var/pass/secret.titi +} + ll_dev_reconnect() @@ -1072,19 +1148,16 @@ while :; do done # or while read y; do - killall -u vmail imapd; + killall -v -u vmail imapd done - EOF - can_send && sendtestmessage -# can_send && sendtestmessage $CMD_PERL ./imapsync \ --host1 $HOST1 --user1 tata \ --passfile1 ../../var/pass/secret.tata \ --host2 $HOST2 --user2 titi \ --passfile2 ../../var/pass/secret.titi \ --folder INBOX --useuid \ - --delete2 --expunge2 + --reconnectretry2 0 --reconnectretry1 0 } ll_dev_reconnect_ssl_tls() @@ -1142,7 +1215,7 @@ EOF --host2 $HOST2 --tls2 --user2 titi \ --passfile2 ../../var/pass/secret.titi \ --folder INBOX --useuid \ - --delete2 --debugsleep --debugimap + --delete2 --debugsleep 5 --debugimap } @@ -1852,8 +1925,7 @@ ll_nochildren() --passfile1 ../../var/pass/secret.tata \ --host2 w00d0310.kasserver.com --user2 m0331832 \ --passfile2 ../../var/pass/secret.kasserver \ - --justfolders \ - --debugimap + --folderrec INBOX.A --subfolder2 inferior_top_level } @@ -2165,7 +2237,7 @@ ll_disarmreadreceipts() --nofoldersizes \ --disarmreadreceipts \ --debugcontent --debug --dry - echo "sudo sh -c 'rm /home/vmail/titi/.regexmess/cur/*'" + echo "sudo sh -c 'rm /home/vmail/titi/.disarm/cur/*'" } @@ -2449,6 +2521,16 @@ ll_ssl1_tls1_justconnect() { --justconnect --debugimap } +ll_ssl_justconnect_SSL_VERIFY_PEER() { + $CMD_PERL ./imapsync \ + --host1 $HOST1 \ + --ssl1 \ + --justconnect \ + --host2 imap.gmail.com \ + --ssl2 \ + --sslargs2 SSL_verify_mode=1 +#--sslargs2 SSL_ca_file=/etc/ssl/certs/ca-certificates.crt +} ll_justconnect_devel() { @@ -2558,16 +2640,29 @@ ll_authmech_XOAUTH_gmail() { ll_authmech_xoauth_gmail() { ll_authmech_XOAUTH_gmail; } ll_authmech_XOAUTH2_gmail() { - ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \ + ! ping -c1 imap.gmail.com || { $CMD_PERL ./imapsync \ --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \ --passfile1 ../../var/pass/secret.xoauth2 \ --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com \ --passfile2 ../../var/pass/secret.xoauth2 \ --justlogin \ - --authmech1 XOAUTH2 --authmech2 XOAUTH2 --debug + --authmech1 XOAUTH2 --authmech2 XOAUTH2 --debug | grep unauthorized_client ; } } ll_authmech_xoauth2_gmail() { ll_authmech_XOAUTH2_gmail; } +ll_authmech_XOAUTH2_json_gmail() { + ! ping -c1 imap.gmail.com || { $CMD_PERL ./imapsync \ + --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \ + --password1 ../../var/pass/secret.xoauth2.json \ + --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com \ + --password2 ../../var/pass/secret.xoauth2.json \ + --justlogin \ + --authmech1 XOAUTH2 --authmech2 XOAUTH2 --debug | grep unauthorized_client ; } +} +ll_authmech_xoauth2_json_gmail() { ll_authmech_XOAUTH2_json_gmail; } + + + ll_authmech_XOAUTH2_gmail_proxy() { ! ping -c1 imap.gmail.com || https_proxy=http://localhost:8080/ $CMD_PERL ./imapsync \ --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \ @@ -2703,8 +2798,30 @@ ll_delete_reverse_useuid() { --useuid } +ll_delself() { + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 toto \ + --passfile1 ../../var/pass/secret.toto \ + --host2 $HOST2 --user2 delme \ + --passfile2 ../../var/pass/secret.delme + + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 delme \ + --passfile1 ../../var/pass/secret.delme \ + --host2 $HOST2 --user2 delme \ + --passfile2 ../../var/pass/secret.delme \ + --delete --noexpungeaftereach + + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 delme \ + --passfile1 ../../var/pass/secret.delme \ + --host2 $HOST2 --user2 delme \ + --passfile2 ../../var/pass/secret.delme \ + --justfolders --delete2folders --regextrans2 "s/.*/INBOX/" --foldersizes +} + ll_maxmessagespersecond() { ll_delete_reverse @@ -2859,7 +2976,7 @@ ll_bigmail() { --passfile1 ../../var/pass/secret.big1 \ --host2 $HOST2 --user2 big2 \ --passfile2 ../../var/pass/secret.big2 \ - --folder INBOX.bigmail + --folder INBOX.bigmail --debugmemory --nofoldersizes echo 'sudo sh -c "rm -v /home/vmail/big2/.bigmail/cur/*"' } @@ -3385,7 +3502,7 @@ gmail_gmail_justlogin() { --ssl2 \ --user2 imapsync.gl@gmail.com \ --passfile2 ../../var/pass/secret.imapsync.gl_gmail \ - --justlogin --id + --justlogin --id --debugimap } @@ -3726,7 +3843,7 @@ ll_usecache_INBOX() { --passfile1 ../../var/pass/secret.tata \ --host2 $HOST2 --user2 titi \ --passfile2 ../../var/pass/secret.titi \ - --usecache --foldersizes \ + --usecache \ --folder INBOX } @@ -3864,6 +3981,27 @@ l_office365() --folder INBOX --tmpdir /var/tmp --usecache --regextrans2 's/INBOX/tata/' --delete2 --expunge2 } +l_office365_SSL_verify_mode() +{ + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 tata \ + --passfile1 ../../var/pass/secret.tata \ + --host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \ + --passfile2 ../../var/pass/secret.outlook.com \ + --justlogin --sslargs2 SSL_verify_mode=1 +} + +l_office365_justconnect_tls_SSL_verify_mode_1() +{ + $CMD_PERL ./imapsync \ + --host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \ + --passfile1 ../../var/pass/secret.outlook.com \ + --host2 outlook.office365.com --tls2 --user2 gilles.lamiral@outlook.com \ + --passfile2 ../../var/pass/secret.outlook.com \ + --justconnect --sslargs2 SSL_verify_mode=1 +} + + l_office365_justlogin() { $CMD_PERL ./imapsync \ @@ -3884,6 +4022,38 @@ l_office365_justlogin_2() --justlogin } + + +l_office365_justconnect_inet4_inet6() +{ + # force ipv4 + $CMD_PERL ./imapsync \ + --host1 imap-mail.outlook.com --ssl1 \ + --host2 outlook.office365.com --ssl2 \ + --justconnect --inet4 + + # force ipv6 + $CMD_PERL ./imapsync \ + --host1 imap-mail.outlook.com --ssl1 \ + --host2 outlook.office365.com --ssl2 \ + --justconnect --inet6 + + # outlook.office365.com gives ipv6 2a01:111:f400:2fa2::2 + # this one must fail + ! $CMD_PERL ./imapsync \ + --host1 imap-mail.outlook.com --ssl1 \ + --host2 2a01:111:f400:2fa2::2 --ssl2 \ + --justconnect --inet4 + + # outlook.office365.com gives ipv4 40.96.19.210 + # this one should fail but is does not + $CMD_PERL ./imapsync \ + --host1 imap-mail.outlook.com --ssl1 \ + --host2 40.96.19.210 --ssl2 \ + --justconnect --inet6 +} + + l_office365_justlogin_tls() { $CMD_PERL ./imapsync \ @@ -4466,6 +4636,23 @@ huge_folder() echo3 "[$date1] [$date2]" } +huge_message_ks() +{ + date1=`date` + { $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 tata \ + --passfile1 ../../var/pass/secret.tata \ + --host2 $HOST2 --user2 tete \ + --passfile2 ../../var/pass/secret.tete \ + --folder INBOX --minsize 100000000 \ + --tmpdir /var/tmp --debugmemory --nofoldersizes + } + date2=`date` + echo3 "[$date1] [$date2]" + echo3 'rm -f /home/tete/Maildir/cur/*' +} + + huge_folder_ks() { date1=`date` @@ -4479,10 +4666,12 @@ huge_folder_ks() } date2=`date` echo3 "[$date1] [$date2]" - echo3 'rm -f /home/tete/Maildir/.Junk.2009/cur/*' + echo3 'rm -f /home/tete/Maildir/.Junk.2010/cur/*' } + + huge_folder_useuid() { date1=`date` @@ -4602,9 +4791,26 @@ dprof_bigmail() } date2=`date` echo3 "[$date1] [$date2]" - mv tmon.out dprof_bigmail_tmon.out - dprofpp -O 30 dprof_bigmail_tmon.out - dprofpp -O 30 -I dprof_bigmail_tmon.out + mv tmon.out W/dprof_bigmail_tmon.out + dprofpp -O 30 W/dprof_bigmail_tmon.out + dprofpp -O 30 -I W/dprof_bigmail_tmon.out +} + +dprof2_bigmail() +{ + date1=`date` + { $CMD_PERL -d:Profile ./imapsync \ + --host1 $HOST1 --user1 tata \ + --passfile1 ../../var/pass/secret.tata \ + --host2 $HOST2 --user2 titi \ + --passfile2 ../../var/pass/secret.titi \ + --folder INBOX.bigmail --debugmemory --dry + echo 'sudo sh -c "rm -v /home/vmail/titi/.bigmail/cur/*"' || \ + true + } + date2=`date` + echo3 "[$date1] [$date2]" + mv prof.out W/dprof2_bigmail_tmon.out } @@ -4636,6 +4842,8 @@ gmail_gmail gmail_gmail_INBOX gmail_gmail_folderfirst yahoo_xxxx +l_office365_justconnect_inet4_inet6 +l_office365_justconnect_tls_SSL_verify_mode_1 ll_unknow_option ll_ask_password ll_bug_folder_name_with_blank @@ -4645,7 +4853,8 @@ ll_folder_noexist ll_folder_mixfolders ll_oneemail ll_buffersize -ll_justfolders +ll_justfolders +ll_justfolders_delete1emptyfolders ll_justfolders_skipemptyfolders ll_prefix12 ll_nosyncinternaldates @@ -4679,8 +4888,11 @@ ll_regexmess_scwchu ll_skipmess ll_skipmess_8bits ll_skipmess_Content_Type_Message_partial -ll_pipemess_nocmd -ll_pipemess +ll_pipemess_nocmd +ll_pipemess_false +ll_pipemess_true +ll_pipemess +ll_pipemess_catcat ll_flags ll_regex_flag ll_regex_flag_bad @@ -4696,6 +4908,8 @@ ll_tls_justlogin ll_tls ll_authmech_PLAIN ll_authmech_XOAUTH_gmail +ll_authmech_xoauth2_gmail +ll_authmech_xoauth2_json_gmail ll_authmech_LOGIN ll_authmech_CRAMMD5 ll_authmech_PREAUTH @@ -4736,23 +4950,20 @@ l() { echo "$mandatory_tests" "$other_tests" } -# mandatory tests - -run_tests perl_syntax - - -# All tests +# minimal and fatal tests -test $# -eq 0 && run_tests $mandatory_tests -# here only if previous line all pass (set -e) -test $# -eq 0 && ./i3 --version >> .test_3xx +run_tests perl_syntax || exit 1 -# selective tests - -test $# -gt 0 && run_tests "$@" - -# If there, all is good - -echo3 ALL $test_count TESTS SUCCESSFUL +if test $# -eq 0; then + # mandatory tests + if run_tests $mandatory_tests; then + ./i3 --version >> .test_3xx + return 0 + fi +else + # selective tests + run_tests "$@" + return $? +fi diff --git a/tmp/firstline.txt b/tmp/firstline.txt new file mode 100644 index 0000000..d35e62f --- /dev/null +++ b/tmp/firstline.txt @@ -0,0 +1 @@ +blabla diff --git a/tmp/firstline2.txt b/tmp/firstline2.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tmp/firstline2.txt diff --git a/tmp/firstline3.txt b/tmp/firstline3.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tmp/firstline3.txt @@ -0,0 +1 @@ +