develooper Front page | perl.beginners | Postings from May 2008

Re: assign default value to variables I assign from split

Thread Previous | Thread Next
From:
Dr.Ruud
Date:
May 14, 2008 13:48
Subject:
Re: assign default value to variables I assign from split
"Jenda Krynicky" schreef:
> Dr.Ruud:
>> Richard Lee:

>>> [$file1,$file2,$file3,$file4,$file5,$file6,$file10,$file25]
>>> I didn't want to put them in array
>>> since I need to use individual named variable later
>>
>> And why is that?
>
> Maybe because in the real code they are not $file1, $file2,...
> but rather $username, $password, $last_login, $created,
> $permissions, ...

Then you create named constants for that, with enumeration if you like;
or use a hash.


> And assigning the default is the last thing that's done to all of
> them.

There would be no problem to do that.

But better stop guessing and let Richard answer.

-- 
Affijn, Ruud

"Gewoon is een tijger."


Thread Previous | Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About