in reply to Re: Syntax question...
in thread Syntax question (Perl 5.005)...

Interesting. I copied your code and tried to run on my machine and got an error. Perhaps this is due to the fact I'm running on Perl 5.005.

gonzo:/export/home/fredk/docs/test: more foo.pl #!/usr/local/bin/perl use strict; package foo; sub bar { print "Works\n"; } package main; my $var = "bar"; foo->$var; gonzo:/export/home/fredk/docs/test: ./foo.pl syntax error at ./foo.pl line 10, near "$var;" Execution of ./foo.pl aborted due to compilation errors.
UPDATE

This works if I change foo->$var to foo->$var();

Can someone confirm this is a 5.005 thing?

-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday