#This is the main script #!/usr/bin/perl use strict; use Tk; use Cwd; use warnings; use product_search; use missing_articles; require Tk::DialogBox; require Tk::LabEntry; use Spreadsheet::WriteExcel; $tx = $mainFrame->Scrolled(qw/Text -font normal -width 73 -height 15 -wrap word -scrollbars e/ )->pack; tie *STDOUT, 'Tk::Text', $tx; #click Tk button and it calls a module passing the argument and the user input product_search::search($si1, $fullSearch); #### #!/cygdrive/c/Perl/bin/perl package product_search; use strict; use strip_product_numbers; sub search { # Grab parameters that are passed to this module my ($si1, $fullSearch) = @_; # As it finds a product that matches, it processes it (strips product number from title, etc) then should print it print "$product\n\n"; } 1;