Re: Printing a constant array

2008-12-28 Thread Jenda Krynicky
From: Rob Dixon > bacoms wrote: > > > > Ho, I wanted to declare an HTML list as a constant array and then > > print it but cannot work out the stntax. > > > > This is what I've coded; > > > > use constant NAVTABSLIST => ["\n", > >

Re: Printing a constant array

2008-12-28 Thread Rob Dixon
bacoms wrote: > > Ho, I wanted to declare an HTML list as a constant array and then > print it but cannot work out the stntax. > > This is what I've coded; > > use constant NAVTABSLIST => ["\n", > " > \n", >

Re: Printing a constant array

2008-12-28 Thread bacoms
Thanks Shawn and Chas for replying. For the moment I'll use the print @{ NAVTABSLIST() }; solution. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Printing a constant array

2008-12-27 Thread Mr. Shawn H. Corey
On Sat, 2008-12-27 at 12:52 -0500, Chas. Owens wrote: > I too have worked at places that have these sorts of obnoxious > policies. Most often I have found that the policy has been created by > lazy sysadmins who don't want to take the time to install the modules > (or learn how, since often they d

Re: Printing a constant array

2008-12-27 Thread Chas. Owens
On Sat, Dec 27, 2008 at 12:15, Mr. Shawn H. Corey wrote: > On Sat, 2008-12-27 at 11:51 -0500, Chas. Owens wrote: >> * only if you have Readonly::XS installed, otherwise it uses a tied >> variable that throws an error when STORE is called. > > The problem with Readonly et al. is that it is not a st

Re: Printing a constant array

2008-12-27 Thread Mr. Shawn H. Corey
On Sat, 2008-12-27 at 11:51 -0500, Chas. Owens wrote: > * only if you have Readonly::XS installed, otherwise it uses a tied > variable that throws an error when STORE is called. The problem with Readonly et al. is that it is not a standard module. I have worked in places that do not allow anythin

Re: Printing a constant array

2008-12-27 Thread Chas. Owens
On Sat, Dec 27, 2008 at 11:04, Mr. Shawn H. Corey wrote: snip > Perl does not have true constants. What `use constant` does is create a > sub that returns the value. That means you can use it as a sub in all > your code. snip Just out of curiosity, what is your definition of a "true constant"?

Re: Printing a constant array

2008-12-27 Thread Chas. Owens
On Sat, Dec 27, 2008 at 06:10, bacoms wrote: > Ho, I wanted to declare an HTML list as a constant array and then > print it but cannot work out the stntax. > > This is what I've coded; > > use constant NAVTABSLIST => ["\n", snip > pr...@navtabslist. snip You may be better served by the Readonly m

Re: Printing a constant array

2008-12-27 Thread Mr. Shawn H. Corey
On Sat, 2008-12-27 at 03:10 -0800, bacoms wrote: > Ho, I wanted to declare an HTML list as a constant array and then > print it but cannot work out the stntax. > > This is what I've coded; > > use constant NAVTABSLIST => ["\n", > " > \n", >