in reply to Re: results printing error
in thread results printing error

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

Replies are listed 'Best First'.
Re^3: results printing error
by ww (Archbishop) on Apr 15, 2008 at 14:47 UTC

    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...