develooper Front page | perl.perl5.porters | Postings from August 2001

Interpolating function call in here documents causes out-of-order execution

Thread Next
From:
Yusuf Goolamabbas
Date:
August 30, 2001 20:39
Subject:
Interpolating function call in here documents causes out-of-order execution
Message ID:
20010831033858.30397.qmail@yusufg.portal2.com
Had sent this to beginners@perl.org earlier but didn't see it in the
archive and I'm not sure if this is a perl bug

RedHat Linux 7.1 with kernel 2.4.8-ac7
This is perl, v5.6.0 built for i386-linux

The following test program

#!/usr/bin/perl

sub main() {
$key = 5 ;
print <<"TARGET" ;
Foobar
Snafu
${\(interp($key))}
TARGET
}

sub interp {
 my ($arg) = @_ ;
 print "Hello World, $arg \n" ;
 return;
}

main();

gives the following output
--
Hello World 5
Foobar
Snafu

--

I am stumped at this out-of-order execution path, Am I doing something
wrong ?

Regards, Yusuf

-- 
Yusuf Goolamabbas
yusufg@outblaze.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About