Home : Products : Gossamer Forum : Discussion :

Products: Gossamer Forum: Discussion: Re: [raphb] Why dymanic pages as opposed to HTMl?: Edit Log

Here is the list of edits for this post
Re: [raphb] Why dymanic pages as opposed to HTMl?
Quote:
uh - methods are allways called with "()".

Not in perl they aren't ;)

$this->is_a_method
$this->is_a_method_too()

Quote:
i don't see what your "my" does.

It declares the listed variables to be lexically confined to the enclosing block which means it prevents conflicts and pollution and allows you to do things like this (not that it is advisable):

Code:
sub foo {

print header;

my $var = 1;
print $var;
{
my $var = 2;
print $var;
{
my $var = 3;
print $var;
}
print $var;
}
print $var;
}

That will print: 12321

Code:
and what does your "%"? and what does your "{" do?

That tells you that the return value from the "result" method is a reference to a hash and so %{} dereferences the hashref into a normal hash.

Code:
and how would YOU do that?

Well the php version is just laborious :)

I could show you 5 or more variations in perl but how about this (for shits and giggles):

Code:
my @array = map { $_+=10 } map { 1 } 1..100;

Tongue

Last edited by:

Paul: Nov 15, 2002, 7:12 AM

Edit Log: