"Teamsolco" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > To start, let me say this: > 1) I have both "Learning Perl 3rd Ed" and "Programming Perl 3rd Ed" > 2) I have read "Learning Perl 3rd Ed", and I use "Programming Perl 3rd Ed" as > reference. > 3) I have searched with Google for several key words related to my problem, but the > mass of junk I get back is not > helpful. > 4) The application source is roughly 450 lines long, and the FAQ for this list asks > users not to mass-post such things, > otherwise I'd post it here en-masse for help. > > And, most importantly: > A) I didn't write the application I'm working on, I extended it (to a great deal) > using the same programming style as > the original author (and other programmers before me), except that I've been > "cleaning up" the old code a great deal. > B) I understand this application is quite old, probably written in Perl 4 days, and > shows no OO influence (was > originally written as a down-and-dirty utility script). > > That said, please do not assume that I am incompetent; I'm just frustrated. I've > been programming for more than 20 > years, just not with Perl (no, I'm not a VB "programmer" -- my experience is > primarilly C). > > Now then, I've opened a can of worms by adding "use strict" and "use warnings" to > the source. Keep in mind that this > application was running JUST FINE before doing this. I'm only trying to 'modernize' > this old code. Having started with > a couple screen-fulls of resulting errors, I'm down to just one: "Can't use an > undefined value as a symbol > reference..." The partucular block that causes this error is: > > sub close_fifo { > close($hndFIFO); > } > > It's related open sub is: > > sub open_fifo { > close_fifo(); > > # Make sure the $hndFIFO file is a pipe. > unless (-p $path_fifo) { > unlink($path_fifo); > system("mkfifo $path_fifo") or die("Can't mkfifo $path_fifo: $!"); > chmod(0600, $path_fifo); > } > > # Open the $hndFIFO stream. > open($hndFIFO, "< $path_fifo") or die("Can't open $path_fifo: $!"); > } > > and, at the top of this source, I have declared $hndFIFO (along with the log file > handle) using our as in: > > our ($hndLOG, $hndFIFO); > > > Before applying the aforementioned pragmas, the FIFO handle was simply, FIFO. There > was no "our" declaration, at all, > and the variable/handle name was not prefixed with the scalar $ indicator. > Everything worked at that time... Clearly, > I'm trying to delcare the FIFO (and log file) file handles as global to the > application so that I can access them freely > in several other subs. What do I need to do to satisfy the strict pragma, while > accomplishing my goal? > > Thanks!! > > - William Kimball > "Programming is an art-form that fights back!" > >
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>