ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is variable context in perl ?

user-image
تم إضافة السؤال من قبل Sameer Ahmed Z , Project Assitant , Indian Institute of Science
تاريخ النشر: 2016/06/06
Mohammad kasid
من قبل 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
من قبل 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

Rajiv Biswal
من قبل Rajiv Biswal

There are three type of variable context available in perl

1. Boolean context

2. Void context

3. Interpolative context

المزيد من الأسئلة المماثلة