in reply to Syntax question (Perl 5.005)...
This code works for me:
use strict; package foo; sub bar { print "Works\n" } package main; my $var = "bar"; foo->$var;
It's possible that your error is somewhere else. Perl's error messages are often, um, less then perfect at pointing to the real place the error is at.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Syntax question...
by freddo411 (Chaplain) on Nov 07, 2003 at 22:01 UTC |