Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What is variable context in perl ?

user-image
Question ajoutée par Sameer Ahmed Z , Project Assitant , Indian Institute of Science
Date de publication: 2016/06/06
Mohammad kasid
par Mohammad kasid , ICT Engineer (Sr. Database Administrator) , Ericsson Global India Ltd.

Perl treats same variable differently based on Context, i.e., situation where a variable is being used. 

Assuming an array @my_array=("MOHD","KASID")

if I am storing this array in two different context. 

@my_newarray =@my_array;

$Lenght_array=@my_array;

print "@my_newarray and $Lenght_array"

so the final result will be : MOHD KASID and2

 

sreenivasa murthy Raju
par sreenivasa murthy Raju , Technical Lead , Saudi Telecom Company

Perl has three basic Variables types such as

1.Scalars

2.Arrays

3.Hashes

Scalars are single values: numbers, strings, and so on

There are three type of variable context available in perl

1. Boolean context

2. Void context

3. Interpolative context

More Questions Like This