Just tried it, like i posted, and it worked like a champ thank you so much.
Lib template
package PKG; use strict; use sharedFunctions; my $LOGFH = undef; my $writelog = undef; #constructor sub new { my ($self) = {}; bless($self); return $self; } sub import { shift; $LOGFH = ${$_[0]}; $writelog = ${$_[1]}; }

MAIN:
use sharedFunctions; #$files{log}{file} => logfile.log my $writelog = Thread::Semaphore->new(); #sequential log writing open my $LOGFH ,">", $files{log}{file}; #disable write buffer my $stdout = select($LOGFH); $| = 1; select($stdout); require PKG; PKG->import(\$LOGFH, \$writelog); my $pk = PKG->new();

sharedFunctions:
package sharedFunctions; use warnings; use strict; use File::Basename; use Cwd; use Data::Dumper; use Exporter; our @ISA = qw(Exporter); our @EXPORT = qw($hexdec $sourcepath @dayofweek @monthnames %files); #SCALERS: our $hexdec = "[0-9a-fA-F]"; our $sourcepath = dirname(Cwd::abs_path(__FILE__)); #Where am I locate +d at? unless ($sourcepath =~ m/\\$/) { $sourcepath .= "\\"; } #ARRAYS: our @dayofweek = ("Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"); our @monthnames = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "A +ug", "Sep", "Oct", "Nov", "Dec"); #HASHES: our %files = ( file1 => $sourcepath."jobstatus1.txt", #XML test status files for +recovery file2 => $sourcepath."jobstatus2.txt", #XML test status files for +recovery logfile => $sourcepath."diag.log", reports => $sourcepath."Report\\", config => $sourcepath."diagConfig.dat", station => $sourcepath."station_number.txt", hardware => $sourcepath."hardware_details.xml", update => $sourcepath."perlupdate.log", source => $sourcepath."SOURCE", temp => $sourcepath."TEMP.txt", log => { file => $sourcepath."diag.log", fileNameLen => -22.22, funNameLen => -21.21, lineNumLen => 5, timeLen => 24.24, }, license => { temp => "lic.temp", encryptLicenseInfo_utility => $sourcepath."generateLicenseKey. +exe", decryptLicenseKey_utility => $sourcepath."decryptLicenseKey.ex +e", encrypt => $sourcepath."generateLicenseKey.exe", decrypt => $sourcepath."decryptLicenseKey.exe", }, );

In reply to Re^2: many files one log file by glenn
in thread many files one log file by glenn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.