my $buffer; foosub( $buffer); print $buffer, "\n"; sub foosub { my $buffer = shift; $buffer = "Hello, world"; }