Re: Declaring final variables
- From: "Ingo Menger" <quetzalcotl@xxxxxxxxxxxxxx>
- Date: 29 May 2006 01:57:34 -0700
vincente13@xxxxxxxxx wrote:
it seems like i dont have the module Readonly....any other workaround?
by the way im trying to create a static variable also..
i've read the manpage on creating a static variable..but i still dont
quite get it..
For e.g.
my $var;
my $string = "This is ".$var." my path";
$var="overwrite";
print $string;
if $var is static, then $string should print out "This is overwrite my
path"
This has nothing whatsoever to do with static variables.
How do i achieve this?
You want a subroutine (i.e. in java speak a "static method"):
sub qstring($) {
my $var = shift;
return "This is $var my path.";
}
my $string = qstring "overwrite";
print $string;
Appreciate any help.
.
- References:
- Declaring final variables
- From: vincente13
- Re: Declaring final variables
- From: Jürgen Exner
- Re: Declaring final variables
- From: vincente13
- Re: Declaring final variables
- From: DJ Stunks
- Re: Declaring final variables
- From: vincente13
- Declaring final variables
- Prev by Date: Re: Declaring final variables
- Next by Date: replace string with variable
- Previous by thread: Re: Declaring final variables
- Next by thread: Re: Declaring final variables
- Index(es):
Relevant Pages
|