in reply to results printing error

Maybe you should try to pass he name of the file where you are to write the results instead of passing the opened filehandle. You should then open the file in the WP4_utility script.

Update: And, why not do it all in only one script with all the functionality of the utility in one function?

Replies are listed 'Best First'.
Re^2: results printing error
by steph_bow (Pilgrim) on Apr 15, 2008 at 13:37 UTC

    Thanks a lot olus

    But if I do that, each time a file is opened, the results will erase the precedent ones. Unless I use >> or am I mistaken ?

    update

    The main reason I used a child script was to test it directly on a file

    I also tried to use a function with sub but I do not know how to say that the return I would like is a print on file

      Is this (an outrageously simplified version of ) what you want?

      #!/usr/bin/perl use strict; use warnings; print STDOUT sub1(); sub sub1 { my $string = "foo bar \n"; $string .= $string; }

      Season to taste with an appropriate filehandle and sub.
        "taste" may improve with a hearty helping of perldoc...