richill has asked for the wisdom of the Perl Monks concerning the following question:
When I run
$| = 1; my $Qcount = 10; my $Qstart = 0; my $Qint = 3; my @StorageArray; sub incStart { for ( $x = $_[0] ; $x < $_[1] ; $x++ ) { if ( ( $x % $_[2] ) == 0 ) { print $x . "\n"; push (@StorageArray, $x); } } } print "test " . incStart( $Qstart, $Qcount, $Qint ) . "\n";
I expected the output
test0 3 6 9
Instead I get
0 3 6 9 test
I've set the output bufffer to 1 so why dont I get the output I want? There must be something else I dont understand involved. What is it please?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Buffering and output help needed
by shmem (Chancellor) on Oct 07, 2006 at 12:22 UTC | |
|
Re: Buffering and output help needed
by Joost (Canon) on Oct 07, 2006 at 12:26 UTC | |
by richill (Monk) on Oct 07, 2006 at 12:55 UTC | |
by Joost (Canon) on Oct 07, 2006 at 13:10 UTC | |
by richill (Monk) on Oct 07, 2006 at 13:42 UTC |