Re: Variable Creation

2001-05-17 Thread Peter Scott
At 11:34 AM 5/17/2001 +0100, Alberto Manuel Brandao Simoes wrote: >On Thu, May 17, 2001 at 11:23:00AM +0200, Jos Boumans wrote: >( Alberto, >( >( let's start with something very basic: >( DO NOT use variables as variable names! >( > Let's see if I can explain what I'm doing. I'm writing a

Re: Variable Creation

2001-05-17 Thread Peter Scott
At 09:03 AM 5/17/2001 +0100, Alberto Manuel Brandao Simoes wrote: > Hellows > > I'm writing a module and, as all modules should be, I'm using > strict. So, I >need to 'declare' every variable. What I want, is to do something like: > > $varname = "myvar"; > @$varna

[ADV] Symbol Table (was Re: Variable Creation)

2001-05-17 Thread Jeff Pinyan
On May 17, Paul Johnson said: >You can't. You are trying to use symbolic references and when you have >strict turned on you are promising not to do that. >my $varname = "myvar"; >{ >no strict "refs"; >no strict "vars"; >@$varname = ('a','b','c'); >} It's important to know one thing

Re: Variable Creation

2001-05-17 Thread Jeff Pinyan
On May 17, Alberto Manuel Brandao Simoes said: >RULE ---> FILE* > >::t { > for (@FILE) { > #do something > } >} > >The idea is, when parsing the RULE, create the FILE array so that the user can >browse it. This is done by an eval, so I can construct a string initializing

Re: Variable Creation

2001-05-17 Thread Alberto Manuel Brandao Simoes
On Thu, May 17, 2001 at 11:23:00AM +0200, Jos Boumans wrote: ( Alberto, ( ( let's start with something very basic: ( DO NOT use variables as variable names! ( Let's see if I can explain what I'm doing. I'm writing a 'compiler', well... interpreter for a grammar style language. There woul

Re: Variable Creation

2001-05-17 Thread Paul Johnson
On Thu, May 17, 2001 at 09:03:33AM +0100, Alberto Manuel Brandao Simoes wrote: > > Hellows > > I'm writing a module and, as all modules should be, I'm using strict. I trust you've got warnings turned on too. > So, I need to 'declare' every variable. What I want, is to do >

Re: Variable Creation

2001-05-17 Thread Jos Boumans
Alberto, let's start with something very basic: DO NOT use variables as variable names! seeing MJD already wrote a very nice piece about why that's a bad idea, i'll just refer you to his site: http://perl.plover.com/varvarname.html Now, what *should* you do? 1. if you want multiple values for