Re: Why wont this work? Package require question

2005-09-14 Thread Wiggins d'Anconia
Luinrandir wrote: $Player{Location}=Inn You are missing a semi-colon, and there is no reason to use double quotes above. require '$Player{Location}.pl'; #no error here, I think. Single quotes don't interpolate. '$Player{Location}'::HTML(); #error occurs here I'd hate to have to make a

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
@perl.org Sent: Wednesday, September 14, 2005 9:22 AM Subject: Re: Why wont this work? Package require question Luinrandir wrote: $Player{Location}=Inn You are missing a semi-colon, and there is no reason to use double quotes above. require '$Player{Location}.pl'; #no error here, I

Re: Why wont this work? Package require question

2005-09-14 Thread Wiggins d'Anconia
No need to top post, please don't. Luinrandir wrote: Ok.. and i'm actually going to top post for this... when done is should read $Player{Location}=Inn; require '$Player{Location}.pl'; whixh is the same as require 'Inn.pl'; Same problems exist. Single quotes do NOT interpolate,

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
OK I got this to work require $Player{Location}.pl; but not $Player{Location}::HTML(); #error or $Player{Location}::HTML(); # ignored completely! or '$Player{Location}::HTML()';# ignored completely! or '$Player{Location}'::HTML(); #error or $Player{Location}::HTML(); #error now what? hey.. and

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
Now you want to call the Inn::HTML() function, right? You can't easily do it if strict is turned on. Here's one way, though: my $glob = $main::{$Player{Location} . ::}{HTML}; $glob-(); ah yes.. must bottom post ok in the first line you set the var $glob to equal the package call

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
Now you want to call the Inn::HTML() function, right? You can't easily do it if strict is turned on. Here's one way, though: my $glob = $main::{$Player{Location} . ::}{HTML}; $glob-(); Ok.. that works.. why? what is -() -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
I also got this to work: $Player{Location}=Inn; $Player{Action}=Sell; require $Player{Location}.pl; # this code calls on the package # my $glob = $main::{$Player{Location} . ::}{$Player{Action}}; # $glob-(); #

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
but what if I want to pass a var? then $glob-($foo,$bar); ? Yes sir.. we have a winner But I still have no clue as to why this works... esp. $glob-(); just looked in my book.. am I dereferencing a reference? but hey! thanks anyway! Lou $Player{Location}=Inn;

RE: Why wont this work? Package require question

2005-09-14 Thread Bob Showalter
Jeff 'japhy' Pinyan wrote: Now you want to call the Inn::HTML() function, right? You can't easily do it if strict is turned on. Here's one way, though: my $glob = $main::{$Player{Location} . ::}{HTML}; $glob-(); Or just turn off strict for a sec: { no strict 'refs';

Re: Why wont this work? Package require question

2005-09-14 Thread Jeff 'japhy' Pinyan
On Sep 14, Luinrandir said: but what if I want to pass a var? then $glob-($foo,$bar); ? But I still have no clue as to why this works... esp. $glob-(); just looked in my book.. am I dereferencing a reference? Basically, yes. $glob ends up being a glob, a reference to everything with