Hi,
Basically, I want to be able to write in a perl script:

print VALUE, "\n";

and have it print out the value returned by a subroutine. Something like
(which won't compile):

use warnings
use constant VALUE => foo();
print VALUE, "\n"; # print 42
sub foo {return 42}

But all that produces is (as is to be expected):
Undefined subroutine &main::foo called at try.pl line 2.
BEGIN failed--compilation aborted at try.pl line 2.

I could do:

use warnings;
print VALUE(),"\n";
sub VALUE {return 42}

but I want to write it as:
print VALUE, "\n";
not :
print VALUE(), "\n";

That is - all I'm really wanting to do is avoid the brackets ... but I don't
know how to achieve that.

Any help appreciated.

Cheers,
Rob


_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to