Difference between revisions of "PERL/C2/More-Conditional-statements/Gujarati"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "{| border=1 |'''Time''' |'''Narration''' |- | 00:00 |Welcome to the spoken tutorial on ''' if-elsif-else ''' and '''switch''' conditional statements in Perl. |- | 00:07 |...")
 
Line 5: Line 5:
 
|-
 
|-
 
| 00:00
 
| 00:00
|Welcome to the spoken tutorial on ''' if-elsif-else ''' and '''switch''' conditional statements in Perl.
+
| પર્લમાં '''if-elsif-else''' (ઇફ-એલ્સઇફ-એલ્સ) અને '''switch''' (સ્વીચ) કંડીશનલ સ્ટેટમેંટો પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે.
+
     
 
|-
 
|-
 
| 00:07
 
| 00:07
| In this tutorial, we will learn about
+
| આ ટ્યુટોરીયલમાં આપણે આપેલ વિશે શીખીશું
  
 
|-
 
|-
|00:10
+
| 00:10
|The ''' if-elsif-else''' statement and ''' switch''' statement in '''Perl '''
+
| પર્લમાનું '''if-elsif-else''' સ્ટેટમેંટ અને '''switch''' સ્ટેટમેંટ
+
 
 
|-
 
|-
|00:15
+
| 00:15
| I am using '''Ubuntu Linux12.04''' operating system and '''Perl 5.14.2'''
+
| હું વાપરી રહ્યી છું ઉબુન્ટુ લીનક્સ 12.04 ઓપરેટીંગ સીસ્ટમ અને પર્લ 5.14.2        
+
 
 
|-
 
|-
|00:22
+
| 00:22
|I will also be using the '''gedit '''Text Editor.
+
| હું '''gedit''' ટેક્સ્ટ એડિટર પણ વાપરીશ.
 
   
 
   
 
|-
 
|-
|00:25
+
| 00:25
|You can use any text editor of your choice.
+
| તમે તમારી પસંદનું કોઈપણ ટેક્સ્ટ એડિટર વાપરી શકો છો.
 
   
 
   
 
|-
 
|-
 
| 00:29
 
| 00:29
| You should have basic knowledge of '''Variables '''and''' Comments '''in''' Perl.'''
+
| તમને પર્લનાં '''Variables''' (વેરીએબલો) અને '''Comments''' (કમેંટો) નું સાદું જ્ઞાન હોવું જરૂરી છે.
+
 
 
|-
 
|-
 
| 00:34
 
| 00:34
|and knowledge of ''' for, foreach, while''' and '''do-while''' loops and
+
| અને જાણ હોવી જોઈએ '''for, foreach, while''' (ફોર, ફોરઇચ, વ્હાઈલ) અને '''do-while''' (ડૂ-વ્હાઈલ) લૂપોની અને
  
 
|-
 
|-
 
| 00:38
 
| 00:38
| ''' if ''' and '''if-else''' statements will be an added advantage.
+
| '''if''' (ઇફ) અને '''if-else''' (ઇફ-એલ્સ) સ્ટેટમેંટો વિશે જાણ હોવી વધુ લાભદાયક રહેશે.
  
 
|-
 
|-
|00:43
+
| 00:43
|Please go through the relevant spoken tutorials on the '''spoken tutorial '''website.
+
| સંદર્ભિત સ્પોકન ટ્યુટોરીયલો માટે સ્પોકન ટ્યુટોરીયલની વેબસાઈટનો સંદર્ભ લો.
 
   
 
   
 
|-
 
|-
|00:48
+
| 00:48
|''' If-elsif-else''' statement in '''Perl''' can be used
+
| પર્લમાનાં '''If-elsif-else''' સ્ટેટમેંટનો ઉપયોગ
 
   
 
   
 
|-
 
|-
 
| 00:52
 
| 00:52
| to test multiple conditions and
+
| અનેક કંડીશનો તપાસવા માટે થઇ શકે છે અને
 
   
 
   
 
|-
 
|-
|00:54
+
| 00:54
|When all conditions fail then it executes the default '''else''' block
+
| જ્યારે તમામ કંડીશનો '''Fail''' (ફેઈલ) થાય ત્યારે તે મૂળભૂત '''else''' (એલ્સ) બ્લોકને એક્ઝીક્યુટ કરે છે.
 
   
 
   
 
|-
 
|-
|00:59
+
| 00:59
|The syntax of '''if-elsif-else''' statement is as follows
+
| '''if-elsif-else''' સ્ટેટમેંટનું સિન્ટેક્સ આપ્યા પ્રમાણે છે
+
 
 
|-
 
|-
|01:04
+
| 01:04
|''' if space''' open bracket ''' condition''' close bracket space Open curly bracket press Enter
+
| '''if space''' ખુલ્લો કૌંસ '''condition''' બંધ કૌંસ સ્પેસ ખુલ્લો છગડીયો કૌંસ શરૂ. '''Enter''' દબાવો
 
   
 
   
 
|-
 
|-
|01:13
+
| 01:13
|piece of code  to be executed when the condition is true semicolon
+
| કંડીશન '''true''' (ટ્રુ) હોવાની સ્થિતિમાં એક્ઝીક્યુટ થનાર કોડ અંશ અને અર્ધવિરામ
 
   
 
   
 
|-
 
|-
|01:18
+
| 01:18
|Press '''Enter '''
+
| '''Enter''' દબાવો
  
 
|-
 
|-
 
| 01:20
 
| 01:20
| Close curly bracket space '''elsif''' space open bracket ''' condition''' close bracket space open curly bracket
+
| છગડીયો કૌંસ બંધ સ્પેસ '''elsif''' સ્પેસ ખુલ્લો કૌંસ '''condition''' કૌંસ બંધ સ્પેસ છગડીયો કૌંસ શરૂ
  
 
|-
 
|-
|01:30
+
| 01:30
|Press '''Enter '''
+
| '''Enter''' દબાવો
  
 
|-
 
|-
|01:31
+
| 01:31
|another piece of code semicolon
+
| '''elsif''' કંડીશન ટ્રુ રહેવાની સ્થિતિમાં
 
   
 
   
 
|-
 
|-
|01:33
+
| 01:33
|to be executed when '''elsif condition''' is true
+
| એક્ઝીક્યુટ થનાર બીજો એક કોડ અંશ અને અર્ધવિરામ
+
 
 
|-
 
|-
|01:37
+
| 01:37
|Press '''Enter '''
+
| '''Enter''' દબાવો
+
 
 
|-
 
|-
|01:39
+
| 01:39
|close curly bracket space  ''' else''' space open curly bracket
+
| છગડીયો કૌંસ બંધ સ્પેસ '''else''' સ્પેસ છગડીયો કૌંસ શરૂ
 
   
 
   
 
|-
 
|-
|01:44
+
| 01:44
| Enter  
+
| '''Enter'''
 
   
 
   
 
|-
 
|-
 
| 01:45
 
| 01:45
|code semicolon  to be executed when both the above conditions are false semicolon
+
| ઉપરની બંને કંડીશનો '''false''' (ફોલ્સ) થવા પર એક્ઝીક્યુટ થનાર કોડ અને અર્ધવિરામ
  
 
|-
 
|-
|01:51
+
| 01:51
|Press '''Enter '''
+
| '''Enter''' દબાવો
 
   
 
   
 
|-
 
|-
|01:52
+
| 01:52
| close curly bracket
+
| છગડીયો કૌંસ બંધ
  
 
|-
 
|-
 
| 01:55
 
| 01:55
| First, the ''' if ''' condition is checked and executed if the condition is true.  
+
| પહેલા, '''if''' કંડીશન તપાસવામાં આવશે અને તે ટ્રુ હોય તો તે એક્ઝીક્યુટ થશે.
 
   
 
   
 
|-
 
|-
|02:01
+
| 02:01
|If not, then the ''' else if''' condition is checked and executed if it is true.  
+
| જો નથી, તો '''else if''' કંડીશન તપાસવામાં આવશે અને ટ્રુ હોવા પર તે એક્ઝીક્યુટ થશે.
 
   
 
   
 
|-
 
|-
|02:06     
+
| 02:06     
|Otherwise, the code within '''else''' block is executed.  
+
| નહી તો, '''else''' બ્લોક અંતર્ગત આવેલ કોડ એક્ઝીક્યુટ થાય છે.
+
 
 
|-
 
|-
|02:11
+
| 02:11
|Now let us look at an example of '''if-elsif-else''' statement.  
+
| હવે ચાલો '''if-elsif-else''' સ્ટેટમેંટનું ઉદાહરણ જોઈએ.
+
 
 
|-
 
|-
|02:16
+
| 02:16
|Open the Terminal and type
+
| ટર્મિનલ ખોલો અને ટાઈપ કરો
+
 
 
|-
 
|-
|02:19
+
| 02:19
 
| '''gedit conditionalBlocks dot pl space ampersand'''
 
| '''gedit conditionalBlocks dot pl space ampersand'''
 
    
 
    
 
|-
 
|-
|02:26
+
| 02:26
| and press '''Enter'''
+
| અને '''Enter''' દબાવો
 
   
 
   
 
|-
 
|-
|02:28
+
| 02:28
|This will open the ''' conditionalBlocks.pl''' file in '''gedit. '''
+
| આનાથી '''gedit''' માં '''conditionalBlocks.pl''' ફાઈલ ખુલશે.
 
   
 
   
 
|-
 
|-
|02:33
+
| 02:33
|Type the following piece of code as displayed on the screen.  
+
| સ્ક્રીન પર દર્શાવ્યા પ્રમાણે આપેલ કોડ ટાઈપ કરો.
 
   
 
   
 
|-
 
|-
 
| 02:38     
 
| 02:38     
| We have assigned the value  ''' 'Perl' ''' to variable language.
+
| આપણે '''language''' (લેંગવેજ) આ વેરીએબલને વેલ્યુ ''' 'Perl' ''' એસાઈન કરી છે.
  
 
|-
 
|-
|02:44
+
| 02:44
|Note that, '''eq''' is  '''string comparison''' operator.  
+
| નોંધ લો, '''eq''' '''string comparison''' (સ્ટ્રીંગ કમ્પેરીઝન) ઓપરેટર છે.
+
 
 
|-
 
|-
|02:49
+
| 02:49
| And then we have the various conditons that we want to check.
+
| અને ત્યારબાદ આપણી પાસે વિવિધ કંડીશનો છે જેને આપણે તપાસવા ઈચ્છીએ છીએ.
 
   
 
   
 
|-
 
|-
|02:55
+
| 02:55
|Now, press ctrl+s to save the file.  
+
| હવે, ફાઈલ સંગ્રહવા માટે '''ctrl+s''' દબાવો.
 
+
 
 
|-
 
|-
|02:58
+
| 02:58
|Then switch to terminal and execute file directly.  
+
| ત્યારબાદ ટર્મિનલ પર જઈને ફાઈલને સીધેસીધી એક્ઝીક્યુટ કરો.
 
   
 
   
 
|-
 
|-
 
| 03:02
 
| 03:02
| Type, '''perl conditionalBlocks dot pl '''
+
| ટાઈપ કરો, '''perl conditionalBlocks dot pl'''
 
   
 
   
 
|-
 
|-
|03:09
+
| 03:09
|Note: I am skipping the compilation step. It is not a mandatory step for executing Perl scripts.  
+
| નોંધ લો: હું કમ્પાઈલેશન પગલાને અવગણી જાવ છું. પર્લ સ્ક્રીપ્ટ એક્ઝીક્યુટ કરવા માટે તે અનિવાર્ય પગલું નથી.
+
 
 
|-
 
|-
| 03:16
+
| 03:16
| If there is any compilation error,  
+
| જો કોઈ કમ્પાઈલેશન એરર આવે તો,
+
 
 
|-
 
|-
|   03:18
+
| 03:18
| execution will throw an error and will stop execution of script
+
| એક્ઝીક્યુટ કરતી વેળાએ એક એરર ફેંકાય છે અને સ્ક્રીપ્ટ એક્ઝીક્યુટ થતી થોભી જાય છે.
 
   
 
   
 
|-
 
|-
 
| 03:23
 
| 03:23
| Now press '''Enter.'''
+
| હવે '''Enter''' દબાવો.
 
   
 
   
 
|-
 
|-
|03:25
+
| 03:25
|The output shown on the terminal is
+
| ટર્મિનલ પર આ પ્રમાણે આઉટપુટ દેખાય છે.
+
 
 
|-
 
|-
 
| 03:27
 
| 03:27
| ''' Hi, I am Perl '''
+
| ''' Hi, I am Perl '''
 
   
 
   
 
|-
 
|-
 
| 03:29
 
| 03:29
| Now, let us look at our next case.  
+
| હવે, ચાલો આપણા આગળના કેસ તરફે જોઈએ.
+
 
 
|-
 
|-
|03:31
+
| 03:31
|Switch to '''gedit. '''
+
| '''gedit''' પર જાવ.
 
   
 
   
 
|-
 
|-
|03:33  
+
| 03:33  
|Assign ''' 'Java' ''' to variable language as shown.  
+
| દર્શાવ્યા પ્રમાણે '''language''' વેરીએબલ માટે ''' 'Java' ''' એસાઈન કરો.
+
 
 
|-
 
|-
| 03:37
+
| 03:37
| Press '''ctrl+s''' to save the file.  
+
| ફાઈલ સંગ્રહવા માટે '''ctrl+s''' દબાવો.
 
   
 
   
 
|-
 
|-
|03:40
+
| 03:40
|Switch to the terminal and execute the file.  
+
| ટર્મિનલ પર જાવ અને ફાઈલને એક્ઝીક્યુટ કરો.
 
   
 
   
 
|-
 
|-
|03:43
+
| 03:43
|Type ''' perl conditionalBlocks dot pl '''
+
| ટાઈપ કરો ''' perl conditionalBlocks dot pl '''
 
   
 
   
 
|-
 
|-
| 03:50
+
| 03:50
| and press '''Enter.'''
+
| અને '''Enter''' દબાવો.
 
   
 
   
 
|-
 
|-
|   03:53
+
| 03:53
| The output shown on terminal is ''' Hi, I am Java '''
+
| ટર્મિનલ પર દર્શાવવામાં આવેલ આઉટપુટ આ પ્રમાણે છે ''' Hi, I am Java '''
+
 
 
|-
 
|-
| 03:59
+
| 03:59
| Again let us switch back to '''gedit. '''
+
| ફરીથી ચાલો '''gedit''' પર જાવ.
 
   
 
   
 
|-
 
|-
 
| 04:03
 
| 04:03
| Now, let us assign  ''' 'English' ''' to the ''' language''' variable.  
+
| હવે, ચાલો ''' language''' વેરીએબલ માટે ''' 'English' ''' એસાઈન કરીએ.
  
 
|-
 
|-
 
| 04:07
 
| 04:07
| Press ''' ctrl+s ''' to save the file.  
+
| ફાઈલ સંગ્રહવા માટે ''' ctrl+s ''' દબાવો.
+
 
 
|-
 
|-
|04:09
+
| 04:09
|Switch to the terminal and execute the file.  
+
| ટર્મિનલ પર જાવ અને ફાઈલને એક્ઝીક્યુટ કરો.
 
    
 
    
 
|-
 
|-
|04:13
+
| 04:13
|Type '''perl conditionalBlocks dot pl '''
+
| ટાઈપ કરો '''perl conditionalBlocks dot pl'''
 
   
 
   
 
|-
 
|-
|04:18
+
| 04:18
|and press '''Enter.'''
+
| અને '''Enter''' દબાવો.
 
   
 
   
 
|-
 
|-
|04:19
+
| 04:19
|The output shown on terminal is
+
| ટર્મિનલ પર દર્શાવવામાં આવેલ આઉટપુટ આ પ્રમાણે છે.
  
 
|-
 
|-
|04:22
+
| 04:22
|'''I am not a computer language '''
+
| '''I am not a computer language '''
+
 
 
|-
 
|-
 
| 04:27
 
| 04:27
| The 3 cases imply that;  
+
| 3 કેસો આ પ્રમાણે સૂચિત કરે છે;
  
 
|-
 
|-
 
| 04:29
 
| 04:29
| Only one ''' if block''' that satisfies the condition will be executed.
+
| કંડીશન સંતોષનાર ફક્ત એક જ ''' if block''' એક્ઝીક્યુટ થશે.
 
   
 
   
 
|-
 
|-
|04:35
+
| 04:35
| otherwise the default ''' else block''' will get execute.  
+
| નહીતર મૂળભૂત ''' else block''' એક્ઝીક્યુટ થશે.
  
 
|-
 
|-
|04:39
+
| 04:39
|We can have multiple ''' elsif''' conditions as per our requirement, like this.  
+
| આપણી જરૂર અનુસાર, આપણી પાસે આ પ્રમાણેનાં અનેક ''' elsif''' કંડીશનો હોઈ શકે છે.
+
 
 
|-
 
|-
|04:46
+
| 04:46
|Here is an assignment for you -  
+
| અહીં તમારી માટે એક એસાઈનમેંટ છે -
+
 
 
|-
 
|-
|04:48
+
| 04:48
|Write an ''' if-elsif-else''' statement to print 
+
| આપેલ પ્રીંટ કરવા માટે ''' if-elsif-else''' સ્ટેટમેંટ લખો.
+
 
 
|-
 
|-
|04:51
+
| 04:51
|''' “I am a Science graduate” ''' if '''stream''' is ''' science '''
+
| '''stream''' જો ''' science ''' હોય તો ''' “I am a Science graduate” '''
  
 
|-
 
|-
|04:55
+
| 04:55
|'''“I am a Commerce graduate” ''' if '''stream''' is '''commerce'''  
+
| '''stream''' જો '''commerce''' હોય તો '''“I am a Commerce graduate” '''
 
+
 
 
|-
 
|-
|04:59
+
| 04:59
|''' “I am an Arts graduate” ''' if ''' stream''' is neither ''' science''' or '''commerce '''
+
| અને ''' stream''' જો ''' science''' કે '''commerce ''' આમાંની કોઈપણ ન હોય તો ''' “I am an Arts graduate” '''
+
 
 
|-
 
|-
|05:06
+
| 05:06
|Now let us learn about the '''switch''' statement.  
+
| હવે ચાલો '''switch''' (સ્વીચ) સ્ટેટમેંટ વિશે શીખીએ.
 
   
 
   
 
|-
 
|-
| 05:10
+
| 05:10
| Till Perl 5.8, there was no '''switch''' statement in '''Perl.'''
+
| પર્લ 5.8 સુધી, '''switch''' (સ્વીચ) સ્ટેટમેંટ ન હતું.
 
   
 
   
 
|-
 
|-
| 05:14
+
| 05:14
| After that, '''Switch module''' was introduced,  
+
| ત્યાર પછીથી, '''Switch module''' (સ્વીચ મોડ્યુલ) નો પરિચય થયો,
 
   
 
   
 
|-
 
|-
|05:18
+
| 05:18
|which provided the functionality of ''' switch''' statement.  
+
| જેણે ''' switch''' સ્ટેટમેંટની કાર્યક્ષમતા પૂરી પાડી.
 
   
 
   
 
|-
 
|-
| 05:22
+
| 05:22
| Note: ''' Modules''' in '''Perl''' will be covered in subsequent tutorials.  
+
| નોંધ લો: '''Perl''' માનાં ''' Modules''' (મોડ્યુલો) આવનારા ટ્યુટોરીયલોમાં આવરી લેવાશે.
  
 
|-
 
|-
| 05:27
+
| 05:27
| The syntax of ''' switch''' is as follows:  
+
| ''' switch''' નું સિન્ટેક્સ આ પ્રમાણે છે:
 
   
 
   
 
|-
 
|-
 
| 05:30
 
| 05:30
| use '''Switch''' semicolon
+
| use '''Switch''' અર્ધવિરામ
  
 
|-
 
|-
| 05:32
+
| 05:32
| Press '''Enter'''  
+
| '''Enter''' દબાવો
  
 
|-
 
|-
| 05:34
+
| 05:34
| '''switch ''' space open bracket '''dollar value''' close bracket space open curly bracket
+
| '''switch ''' સ્પેસ ખુલ્લો કૌંસ '''dollar value''' કૌંસ બંધ સ્પેસ છગડીયો કૌંસ શરૂ
  
 
|-
 
|-
|05:42
+
| 05:42
|Press '''Enter '''
+
| '''Enter ''' દબાવો
 
   
 
   
 
|-
 
|-
| 05:44
+
| 05:44
| '''case ''' space 1 space open curly bracket ''' executes when dollar value equal to 1''' close curly bracket.  
+
| '''case ''' સ્પેસ 1 સ્પેસ છગડીયો કૌંસ શરૂ '''dollar value equal to 1''' હોવા પર એક્ઝીક્યુટ થશે છગડીયો કૌંસ બંધ.
 
   
 
   
 
|-
 
|-
| 05:53
+
| 05:53
| Press '''Enter'''  
+
| '''Enter''' દબાવો
  
 
|-
 
|-
|05:55
+
| 05:55
|'''case ''' space single quote '''a ''' single quote space open curly bracket ''' executes when dollar value equal to''' single quote ''' a ''' single quote close curly bracket
+
| '''case ''' સ્પેસ એકલ અવતરણ '''a ''' એકલ અવતરણ સ્પેસ છગડીયો કૌંસ શરૂ '''dollar value equal to''' એકલ અવતરણ ''' a ''' એકલ અવતરણ હોવા પર એક્ઝીક્યુટ થશે છગડીયો કૌંસ બંધ
 
   
 
   
 
|-
 
|-
 
| 06:09
 
| 06:09
| Press ''' Enter '''
+
| ''' Enter ''' દબાવો
  
 
|-
 
|-
 
| 06:10
 
| 06:10
|''' else''' space open curly bracket ''' executes when dollar value does not match any of the cases '''
+
| ''' else''' સ્પેસ છગડીયો કૌંસ શરૂ '''dollar value''' ઉપર આપેલ કોઈપણ કેસથી ન મળે તો એક્ઝીક્યુટ થશે
 
   
 
   
 
|-
 
|-
|06:18
+
| 06:18
|Close curly bracket
+
| છગડીયો કૌંસ બંધ
  
 
|-
 
|-
|06:19
+
| 06:19
|Press '''Enter '''
+
| '''Enter ''' દબાવો
  
 
|-
 
|-
 
| 06:20
 
| 06:20
| close curly bracket
+
| છગડીયો કૌંસ બંધ
  
 
|-
 
|-
| 06:22
+
| 06:22
| Let us understand '''switch''' using a sample program.  
+
| ચાલો સેમ્પલ પ્રોગ્રામ વાપરીને '''switch''' સમજીએ.
+
 
 
|-
 
|-
| 06:26
+
| 06:26
| Open the Terminal and type
+
| ટર્મિનલ ખોલો અને ટાઈપ કરો
 
   
 
   
 
|-
 
|-
|06:29
+
| 06:29
 
| ''' gedit sampleSwitch dot pl space ampersand'''
 
| ''' gedit sampleSwitch dot pl space ampersand'''
 
   
 
   
 
|-
 
|-
|06:36
+
| 06:36
|and press '''Enter'''
+
| અને '''Enter''' દબાવો
 
   
 
   
 
|-
 
|-
|06:38
+
| 06:38
|Now, type the sample program as shown on the screen.  
+
| હવે, સ્ક્રીન પર દર્શાવ્યા પ્રમાણે સેમ્પલ પ્રોગ્રામ ટાઈપ કરો.
 
 
 
 
 
|-
 
|-
 
| 06:43
 
| 06:43
| Let us understand how the ''' switch''' statement works.  
+
| ચાલો સમજીએ કે ''' switch''' સ્ટેટમેંટ કેવી રીતે કામ કરે છે.
+
 
 
|-
 
|-
|06:46
+
| 06:46
| The '''use Switch''' statement includes the '''Switch''' module inside the '''Perl''' code.  
+
| '''use Switch''' સ્ટેટમેંટ '''Perl''' કોડ અંતર્ગત '''Switch''' મોડ્યુલ ધરાવે છે.
  
 
|-
 
|-
|06:54
+
| 06:54
| Note: We will learn about '''use keyword''' in detail in subsequent tutorials.  
+
| નોંધ લો: આપણે '''use keyword''' વિશે વિગતમાં આવનારા ટ્યુટોરીયલોમાં શીખીશું.
  
 
|-
 
|-
|07:00
+
| 07:00
| Now we'll test the different cases.
+
| અત્યારે આપણે વિવિધ કિસ્સાઓને તપાસ કરીશું.
  
 
|-
 
|-
|07:03
+
| 07:03
| We have assigned ''' 'Perl' ''' to the variable ''' $var'''
+
| આપણે વેરીએબલ ''' $var''' ને ''' 'Perl' ''' વેલ્યુ એસાઈન કરી છે.
+
 
 
|-
 
|-
|07:08
+
| 07:08
| The value in variable ''' $var''' is checked in the switch statement.  
+
| સ્વીચ સ્ટેટમેંટમાં વેરીએબલ ''' $var''' ની વેલ્યુ તપાસ થાય છે.
  
 
|-
 
|-
|07:14
+
| 07:14
| In the first case, it matches with the case ''' 'Perl'.'''  
+
| પહેલા કેસમાં, તે કેસ ''' 'Perl' ''' થી મેળ ખાય છે.
  
 
|-
 
|-
|07:19
+
| 07:19
| So the code written against this '''case''' will be executed.  
+
| જેથી કરીને આ '''case''' (કેસ) આગળ લખેલ કોડ એક્ઝીક્યુટ થશે.
  
 
|-
 
|-
|07:24
+
| 07:24
| Press ''' ctrl+s''' to '''save''' the file.  
+
| ફાઈલ સંગ્રહવા માટે ''' ctrl+s''' દબાવો.
  
 
|-
 
|-
|07:27
+
| 07:27
| Now, switch to terminal and execute the script
+
| હવે, ટર્મિનલ પર જઈને સ્ક્રીપ્ટ એક્ઝીક્યુટ કરો.
  
 
|-
 
|-
|07:31
+
| 07:31
 
| '''perl sampleSwitch.pl'''
 
| '''perl sampleSwitch.pl'''
  
 
|-
 
|-
|07:36
+
| 07:36
| press '''Enter'''  
+
| '''Enter''' (એન્ટર) દબાવો
  
 
|-
 
|-
|07:38
+
| 07:38
| The following output is shown on the terminal
+
| ટર્મિનલ પર આપેલ આઉટપુટ દેખાય છે
  
 
|-
 
|-
|07:41
+
| 07:41
|''' I am Perl '''
+
| ''' I am Perl '''
  
 
|-
 
|-
|07:43
+
| 07:43
| Switch back to ''' sampleSwitch.pl''' in '''gedit.'''  
+
| '''gedit''' માં ''' sampleSwitch.pl''' પર પાછા જાવ.
  
 
|-
 
|-
|07:48
+
| 07:48
| Now, let us assign  ''' 'Linux' ''' to the variable ''' $var '''
+
| હવે, વેરીએબલ ''' $var ''' ને ચાલો ''' 'Linux' ''' વેલ્યુ એસાઈન કરીએ
  
 
|-
 
|-
|07:52
+
| 07:52
|Press ''' Ctrl S''' to save the file.
+
| ફાઈલ સંગ્રહવા માટે ''' Ctrl S''' દબાવો.
  
 
|-
 
|-
|07:57
+
| 07:57
| Again, the value of variable ''' $var''' will be checked in switch.  
+
| ફરીથી, સ્વીચમાં ''' $var''' આ વેરીએબલની વેલ્યુ તપાસવામાં આવશે.
  
 
|-
 
|-
|08:03
+
| 08:03
| It matches with the case  ''' 'Linux' '''
+
| આ કેસ ''' 'Linux' ''' થી મેળ ખાશે.
  
 
|-
 
|-
|08:05
+
| 08:05
| So code written against this case will get executed.  
+
| જેથી કરીને આ કેસ આગળ લખેલ કોડ એક્ઝીક્યુટ થશે.
  
 
|-
 
|-
|08:10
+
| 08:10
| Now, switch to terminal and execute the script
+
| હવે, ટર્મિનલ પર જઈને સ્ક્રીપ્ટ એક્ઝીક્યુટ કરો
  
 
|-
 
|-
|08:15
+
| 08:15
 
| '''perl sampleSwitch.pl'''
 
| '''perl sampleSwitch.pl'''
  
 
|-
 
|-
|08:19
+
| 08:19
| Press '''Enter'''
+
| '''Enter''' દબાવો
  
 
|-
 
|-
|08:21
+
| 08:21
| The following output is shown on the terminal
+
| ટર્મિનલ પર આપેલ આઉટપુટ દેખાય છે
  
 
|-
 
|-
|08:24
+
| 08:24
 
| ''' I am Linux'''  
 
| ''' I am Linux'''  
  
 
|-
 
|-
|08:26
+
| 08:26
| Switch to ''' sampleSwitch.pl''' in ''' gedit.'''  
+
| ''' gedit ''' માં ''' sampleSwitch.pl''' પર જાવ.
  
 
|-
 
|-
|08:30
+
| 08:30
| Similarly, if variable ''' $var''' has value ''' 'Java' ''', then second case will be checked.  
+
| એજ પ્રમાણે, જો વેરીએબલ ''' $var''' ની વેલ્યુ ''' 'Java' ''' હોય, તો બીજી કેસ તપાસવામાં આવશે.
  
 
|-
 
|-
|08:38
+
| 08:38
| Now, let us assign  ''' 'English' ''' to the variable ''' $var'''
+
| હવે, ચાલો વેરીએબલ ''' $var''' ને ''' 'English' ''' વેલ્યુ એસાઈન કરીએ.
  
 
|-
 
|-
|08:42
+
| 08:42
| Again, the value of variable ''' $var ''' will be checked in switch.  
+
| ફરીથી, સ્વીચમાં વેરીએબલ ''' $var ''' ની વેલ્યુ તપાસવામાં આવશે.
  
 
|-
 
|-
|08:47
+
| 08:47
|It does not match any of the  ''' case''' statements.  
+
| આ કોઈપણ ''' case''' (કેસ) સ્ટેટમેંટોથી મેળ ખાતી નથી.
  
 
|-
 
|-
|08:50
+
| 08:50
| So the ''' else ''' statement will be executed.  
+
| જેથી ''' else ''' (એલ્સ) સ્ટેટમેંટ એક્ઝીક્યુટ થશે.
  
 
|-
 
|-
|08:54
+
| 08:54
| Now, switch to terminal and execute the script
+
| હવે, ટર્મિનલ પર જઈને સ્ક્રીપ્ટ એક્ઝીક્યુટ કરો
  
 
|-
 
|-
|09:00
+
| 09:00
 
| ''' perl sampleSwitch.pl'''
 
| ''' perl sampleSwitch.pl'''
  
 
|-
 
|-
|09:07
+
| 09:07
| and Press ''' Enter'''
+
| અને ''' Enter''' દબાવો
  
 
|-
 
|-
|09:09
+
| 09:09
| The following output is shown on the terminal -  
+
| ટર્મિનલ પર આપેલ આઉટપુટ દૃશ્યમાન થાય છે -
  
 
|-
 
|-
|09:12
+
| 09:12
|''' I am not a computer language '''
+
| ''' I am not a computer language '''
  
 
|-
 
|-
|09:17
+
| 09:17
| The 3 cases imply that:  
+
| 3 કેસો આ પ્રમાણે સૂચવે છે:
  
 
|-
 
|-
|09:20
+
| 09:20
| The value of the expression decides the ''' case ''' to be executed
+
| એક્સપ્રેશનની વેલ્યુ કયો ''' case ''' (કેસ) એક્ઝીક્યુટ કરવો છે તે નક્કી કરે છે
  
 
|-
 
|-
|09:25
+
| 09:25
| Only the valid ''' case''' will be executed and
+
| ફક્ત માન્ય ''' case''' (કેસ) જ એક્ઝીક્યુટ થશે અને
  
 
|-
 
|-
|09:28
+
| 09:28
| When there is no valid '''case''', then the default ''' else ''' case will be executed
+
| જ્યારે કોઈપણ માન્ય '''case''' ન હોય, ત્યારે મૂળભૂત ''' else ''' કેસ એક્ઝીક્યુટ થશે.
  
 
|-
 
|-
|09:35
+
| 09:35
| It is not mandatory to write the '''else case. '''
+
| '''else case ''' (એલ્સ કેસ) લખવું અનિવાર્ય નથી.
  
 
|-
 
|-
|09:39
+
| 09:39
| In such a scenario,  
+
| આવી સ્થિતિમાં,
  
 
|-
 
|-
|09:41
+
| 09:41
| if none of the ''' cases''' match
+
| જો કોઈપણ ''' cases''' (કેસીસ) મળતા ના આવે
  
 
|-
 
|-
|09:44
+
| 09:44
| then there will be no output from the ''' switch''' statement.  
+
| તો ''' switch''' (સ્વીચ) સ્ટેટમેંટ તરફથી કોઈપણ આઉટપુટ આવશે નહી.
  
 
|-
 
|-
|09:48
+
| 09:48
| Here is another assignment for you -  
+
| અહીં તમારી માટે બીજું એક એસાઈનમેંટ છે -
  
 
|-
 
|-
|09:50
+
| 09:50
| Re-write the previous assignment
+
| ''' switch''' (સ્વીચ) સ્ટેટમેંટ વાપરીને
 
+
 
|-
 
|-
|09:53
+
| 09:53
| given earlier in this tutorial using ''' switch''' statement.  
+
| આ ટ્યુટોરીયલમાં આપેલ પહેલાનું એસાઈનમેંટ ફરીથી લખો.
  
 
|-
 
|-
|09:57
+
| 09:57
| Let us summarize.  
+
| ચાલો સારાંશ લઈએ.
  
 
|-
 
|-
|09:59
+
| 09:59
| In this tutorial, we have learnt -  
+
| આ ટ્યુટોરીયલમાં, આપણે આપેલ શીખ્યા -
  
 
|-
 
|-
|10:01
+
| 10:01
| ''' if-elsif-else''' statement and
+
| પર્લમાનું ''' if-elsif-else''' સ્ટેટમેંટ અને
  
 
|-
 
|-
|10:04
+
| 10:04
| '''switch''' statement in '''Perl '''
+
| '''switch''' સ્ટેટમેંટ
  
 
|-
 
|-
|10:05
+
| 10:05
| '''using sample programs. '''
+
| સેમ્પલ પ્રોગ્રામ દ્વારા સમજ્યા.
  
 
|-
 
|-
|10:08
+
| 10:08
|Watch the video available at the following link
+
| આપેલ લીંક પર ઉપલબ્ધ વિડીયો નિહાળો.
 
    
 
    
 
|-
 
|-
|10:12
+
| 10:12
|It summaries the Spoken Tutorial project
+
| તે સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટનો સારાંશ આપે છે.
 
   
 
   
 
|-
 
|-
|10:15
+
| 10:15
|If you do not have good bandwidth, you can download and watch it
+
| જો તમારી પાસે સારી બેન્ડવિડ્થ ન હોય તો, તમે વિડીયો ડાઉનલોડ કરીને જોઈ શકો છો.
 
   
 
   
 
|-
 
|-
 
| 10:20
 
| 10:20
| The Spoken Tutorial Project Team  Conducts workshops using spoken tutorials
+
| સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટ ટીમ સ્પોકન ટ્યુટોરીયલોનાં ઉપયોગથી વર્કશોપોનું આયોજન કરે છે.
 
   
 
   
 
|-
 
|-
|10:25
+
| 10:25
|Gives certificates to those who pass an online  test
+
| જેઓ ઓનલાઈન પરીક્ષા પાસ કરે છે તેઓને પ્રમાણપત્રો આપે છે.
 
   
 
   
 
|-
 
|-
|10:30
+
| 10:30
|For more details, please write to contact at spoken hyphen tutorial dot org
+
| વધુ વિગતો માટે, કૃપા કરી, '''contact@spoken-tutorial.org''' પર લખો.
 
   
 
   
 
|-
 
|-
 
| 10:36
 
| 10:36
| Spoken Tutorial Project is a part of the Talk to a  Teacher project
+
| સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટ ટોક ટુ અ ટીચર પ્રોજેક્ટનો એક ભાગ છે.
 
   
 
   
 
|-
 
|-
|10:40
+
| 10:40
|It is supported by the National Mission on Education through ICT, MHRD, Government of India.
+
| જેને આઈસીટી, એમએચઆરડી, ભારત સરકાર મારફતે શિક્ષણ પર નેશનલ મિશન દ્વારા આધાર અપાયેલ છે.
 
   
 
   
 
|-
 
|-
|10:47
+
| 10:47
|More information on this Mission is available at spoken hyphen tutorial dot org slash NMEICT hyphen Intro
+
| આ મિશન પર વધુ માહિતી આપેલ લીંક પર ઉપલબ્ધ છે. '''http://spoken-tutorial.org/NMEICT-Intro'''
 
   
 
   
 
|-
 
|-
 
| 10:58
 
| 10:58
| Hope you enjoyed this Perl tutorial.  
+
| આશા રાખું છું કે તમને આ પર્લ ટ્યુટોરીયલ ગમ્યું હશે.
 
   
 
   
 
|-
 
|-
|11:00
+
| 11:00
|This is Amol signing off.
+
| '''IIT Bombay''' તરફથી હું, જ્યોતી સોલંકી વિદાય લઉં છું.
 
   
 
   
 
|-
 
|-
|11:03
+
| 11:03
|Thanks for joining.
+
| જોડાવાબદ્દલ આભાર.
 
   
 
   
 
|}
 
|}

Revision as of 10:32, 17 October 2014

Time Narration
00:00 પર્લમાં if-elsif-else (ઇફ-એલ્સઇફ-એલ્સ) અને switch (સ્વીચ) કંડીશનલ સ્ટેટમેંટો પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે.
00:07 આ ટ્યુટોરીયલમાં આપણે આપેલ વિશે શીખીશું
00:10 પર્લમાનું if-elsif-else સ્ટેટમેંટ અને switch સ્ટેટમેંટ
00:15 હું વાપરી રહ્યી છું ઉબુન્ટુ લીનક્સ 12.04 ઓપરેટીંગ સીસ્ટમ અને પર્લ 5.14.2
00:22 હું gedit ટેક્સ્ટ એડિટર પણ વાપરીશ.
00:25 તમે તમારી પસંદનું કોઈપણ ટેક્સ્ટ એડિટર વાપરી શકો છો.
00:29 તમને પર્લનાં Variables (વેરીએબલો) અને Comments (કમેંટો) નું સાદું જ્ઞાન હોવું જરૂરી છે.
00:34 અને જાણ હોવી જોઈએ for, foreach, while (ફોર, ફોરઇચ, વ્હાઈલ) અને do-while (ડૂ-વ્હાઈલ) લૂપોની અને
00:38 if (ઇફ) અને if-else (ઇફ-એલ્સ) સ્ટેટમેંટો વિશે જાણ હોવી વધુ લાભદાયક રહેશે.
00:43 સંદર્ભિત સ્પોકન ટ્યુટોરીયલો માટે સ્પોકન ટ્યુટોરીયલની વેબસાઈટનો સંદર્ભ લો.
00:48 પર્લમાનાં If-elsif-else સ્ટેટમેંટનો ઉપયોગ
00:52 અનેક કંડીશનો તપાસવા માટે થઇ શકે છે અને
00:54 જ્યારે તમામ કંડીશનો Fail (ફેઈલ) થાય ત્યારે તે મૂળભૂત else (એલ્સ) બ્લોકને એક્ઝીક્યુટ કરે છે.
00:59 if-elsif-else સ્ટેટમેંટનું સિન્ટેક્સ આપ્યા પ્રમાણે છે
01:04 if space ખુલ્લો કૌંસ condition બંધ કૌંસ સ્પેસ ખુલ્લો છગડીયો કૌંસ શરૂ. Enter દબાવો
01:13 કંડીશન true (ટ્રુ) હોવાની સ્થિતિમાં એક્ઝીક્યુટ થનાર કોડ અંશ અને અર્ધવિરામ
01:18 Enter દબાવો
01:20 છગડીયો કૌંસ બંધ સ્પેસ elsif સ્પેસ ખુલ્લો કૌંસ condition કૌંસ બંધ સ્પેસ છગડીયો કૌંસ શરૂ
01:30 Enter દબાવો
01:31 elsif કંડીશન ટ્રુ રહેવાની સ્થિતિમાં
01:33 એક્ઝીક્યુટ થનાર બીજો એક કોડ અંશ અને અર્ધવિરામ
01:37 Enter દબાવો
01:39 છગડીયો કૌંસ બંધ સ્પેસ else સ્પેસ છગડીયો કૌંસ શરૂ
01:44 Enter
01:45 ઉપરની બંને કંડીશનો false (ફોલ્સ) થવા પર એક્ઝીક્યુટ થનાર કોડ અને અર્ધવિરામ
01:51 Enter દબાવો
01:52 છગડીયો કૌંસ બંધ
01:55 પહેલા, if કંડીશન તપાસવામાં આવશે અને તે ટ્રુ હોય તો તે એક્ઝીક્યુટ થશે.
02:01 જો નથી, તો else if કંડીશન તપાસવામાં આવશે અને ટ્રુ હોવા પર તે એક્ઝીક્યુટ થશે.
02:06 નહી તો, else બ્લોક અંતર્ગત આવેલ કોડ એક્ઝીક્યુટ થાય છે.
02:11 હવે ચાલો if-elsif-else સ્ટેટમેંટનું ઉદાહરણ જોઈએ.
02:16 ટર્મિનલ ખોલો અને ટાઈપ કરો
02:19 gedit conditionalBlocks dot pl space ampersand
02:26 અને Enter દબાવો
02:28 આનાથી gedit માં conditionalBlocks.pl ફાઈલ ખુલશે.
02:33 સ્ક્રીન પર દર્શાવ્યા પ્રમાણે આપેલ કોડ ટાઈપ કરો.
02:38 આપણે language (લેંગવેજ) આ વેરીએબલને વેલ્યુ 'Perl' એસાઈન કરી છે.
02:44 નોંધ લો, eqstring comparison (સ્ટ્રીંગ કમ્પેરીઝન) ઓપરેટર છે.
02:49 અને ત્યારબાદ આપણી પાસે વિવિધ કંડીશનો છે જેને આપણે તપાસવા ઈચ્છીએ છીએ.
02:55 હવે, ફાઈલ સંગ્રહવા માટે ctrl+s દબાવો.
02:58 ત્યારબાદ ટર્મિનલ પર જઈને ફાઈલને સીધેસીધી એક્ઝીક્યુટ કરો.
03:02 ટાઈપ કરો, perl conditionalBlocks dot pl
03:09 નોંધ લો: હું કમ્પાઈલેશન પગલાને અવગણી જાવ છું. પર્લ સ્ક્રીપ્ટ એક્ઝીક્યુટ કરવા માટે તે અનિવાર્ય પગલું નથી.
03:16 જો કોઈ કમ્પાઈલેશન એરર આવે તો,
03:18 એક્ઝીક્યુટ કરતી વેળાએ એક એરર ફેંકાય છે અને સ્ક્રીપ્ટ એક્ઝીક્યુટ થતી થોભી જાય છે.
03:23 હવે Enter દબાવો.
03:25 ટર્મિનલ પર આ પ્રમાણે આઉટપુટ દેખાય છે.
03:27 Hi, I am Perl
03:29 હવે, ચાલો આપણા આગળના કેસ તરફે જોઈએ.
03:31 gedit પર જાવ.
03:33 દર્શાવ્યા પ્રમાણે language વેરીએબલ માટે 'Java' એસાઈન કરો.
03:37 ફાઈલ સંગ્રહવા માટે ctrl+s દબાવો.
03:40 ટર્મિનલ પર જાવ અને ફાઈલને એક્ઝીક્યુટ કરો.
03:43 ટાઈપ કરો perl conditionalBlocks dot pl
03:50 અને Enter દબાવો.
03:53 ટર્મિનલ પર દર્શાવવામાં આવેલ આઉટપુટ આ પ્રમાણે છે Hi, I am Java
03:59 ફરીથી ચાલો gedit પર જાવ.
04:03 હવે, ચાલો language વેરીએબલ માટે 'English' એસાઈન કરીએ.
04:07 ફાઈલ સંગ્રહવા માટે ctrl+s દબાવો.
04:09 ટર્મિનલ પર જાવ અને ફાઈલને એક્ઝીક્યુટ કરો.
04:13 ટાઈપ કરો perl conditionalBlocks dot pl
04:18 અને Enter દબાવો.
04:19 ટર્મિનલ પર દર્શાવવામાં આવેલ આઉટપુટ આ પ્રમાણે છે.
04:22 I am not a computer language
04:27 આ 3 કેસો આ પ્રમાણે સૂચિત કરે છે;
04:29 કંડીશન સંતોષનાર ફક્ત એક જ if block એક્ઝીક્યુટ થશે.
04:35 નહીતર મૂળભૂત else block એક્ઝીક્યુટ થશે.
04:39 આપણી જરૂર અનુસાર, આપણી પાસે આ પ્રમાણેનાં અનેક elsif કંડીશનો હોઈ શકે છે.
04:46 અહીં તમારી માટે એક એસાઈનમેંટ છે -
04:48 આપેલ પ્રીંટ કરવા માટે if-elsif-else સ્ટેટમેંટ લખો.
04:51 stream જો science હોય તો “I am a Science graduate”
04:55 stream જો commerce હોય તો “I am a Commerce graduate”
04:59 અને stream જો science કે commerce આમાંની કોઈપણ ન હોય તો “I am an Arts graduate”
05:06 હવે ચાલો switch (સ્વીચ) સ્ટેટમેંટ વિશે શીખીએ.
05:10 પર્લ 5.8 સુધી, switch (સ્વીચ) સ્ટેટમેંટ ન હતું.
05:14 ત્યાર પછીથી, Switch module (સ્વીચ મોડ્યુલ) નો પરિચય થયો,
05:18 જેણે switch સ્ટેટમેંટની કાર્યક્ષમતા પૂરી પાડી.
05:22 નોંધ લો: Perl માનાં Modules (મોડ્યુલો) આવનારા ટ્યુટોરીયલોમાં આવરી લેવાશે.
05:27 switch નું સિન્ટેક્સ આ પ્રમાણે છે:
05:30 use Switch અર્ધવિરામ
05:32 Enter દબાવો
05:34 switch સ્પેસ ખુલ્લો કૌંસ dollar value કૌંસ બંધ સ્પેસ છગડીયો કૌંસ શરૂ
05:42 Enter દબાવો
05:44 case સ્પેસ 1 સ્પેસ છગડીયો કૌંસ શરૂ dollar value equal to 1 હોવા પર એક્ઝીક્યુટ થશે છગડીયો કૌંસ બંધ.
05:53 Enter દબાવો
05:55 case સ્પેસ એકલ અવતરણ a એકલ અવતરણ સ્પેસ છગડીયો કૌંસ શરૂ dollar value equal to એકલ અવતરણ a એકલ અવતરણ હોવા પર એક્ઝીક્યુટ થશે છગડીયો કૌંસ બંધ
06:09 Enter દબાવો
06:10 else સ્પેસ છગડીયો કૌંસ શરૂ dollar value ઉપર આપેલ કોઈપણ કેસથી ન મળે તો એક્ઝીક્યુટ થશે
06:18 છગડીયો કૌંસ બંધ
06:19 Enter દબાવો
06:20 છગડીયો કૌંસ બંધ
06:22 ચાલો સેમ્પલ પ્રોગ્રામ વાપરીને switch સમજીએ.
06:26 ટર્મિનલ ખોલો અને ટાઈપ કરો
06:29 gedit sampleSwitch dot pl space ampersand
06:36 અને Enter દબાવો
06:38 હવે, સ્ક્રીન પર દર્શાવ્યા પ્રમાણે સેમ્પલ પ્રોગ્રામ ટાઈપ કરો.
06:43 ચાલો સમજીએ કે switch સ્ટેટમેંટ કેવી રીતે કામ કરે છે.
06:46 use Switch સ્ટેટમેંટ Perl કોડ અંતર્ગત Switch મોડ્યુલ ધરાવે છે.
06:54 નોંધ લો: આપણે use keyword વિશે વિગતમાં આવનારા ટ્યુટોરીયલોમાં શીખીશું.
07:00 અત્યારે આપણે વિવિધ કિસ્સાઓને તપાસ કરીશું.
07:03 આપણે વેરીએબલ $var ને 'Perl' વેલ્યુ એસાઈન કરી છે.
07:08 સ્વીચ સ્ટેટમેંટમાં વેરીએબલ $var ની વેલ્યુ તપાસ થાય છે.
07:14 પહેલા કેસમાં, તે કેસ 'Perl' થી મેળ ખાય છે.
07:19 જેથી કરીને આ case (કેસ) આગળ લખેલ કોડ એક્ઝીક્યુટ થશે.
07:24 ફાઈલ સંગ્રહવા માટે ctrl+s દબાવો.
07:27 હવે, ટર્મિનલ પર જઈને સ્ક્રીપ્ટ એક્ઝીક્યુટ કરો.
07:31 perl sampleSwitch.pl
07:36 Enter (એન્ટર) દબાવો
07:38 ટર્મિનલ પર આપેલ આઉટપુટ દેખાય છે
07:41 I am Perl
07:43 gedit માં sampleSwitch.pl પર પાછા જાવ.
07:48 હવે, વેરીએબલ $var ને ચાલો 'Linux' વેલ્યુ એસાઈન કરીએ
07:52 ફાઈલ સંગ્રહવા માટે Ctrl S દબાવો.
07:57 ફરીથી, સ્વીચમાં $var આ વેરીએબલની વેલ્યુ તપાસવામાં આવશે.
08:03 આ કેસ 'Linux' થી મેળ ખાશે.
08:05 જેથી કરીને આ કેસ આગળ લખેલ કોડ એક્ઝીક્યુટ થશે.
08:10 હવે, ટર્મિનલ પર જઈને સ્ક્રીપ્ટ એક્ઝીક્યુટ કરો
08:15 perl sampleSwitch.pl
08:19 Enter દબાવો
08:21 ટર્મિનલ પર આપેલ આઉટપુટ દેખાય છે
08:24 I am Linux
08:26 gedit માં sampleSwitch.pl પર જાવ.
08:30 એજ પ્રમાણે, જો વેરીએબલ $var ની વેલ્યુ 'Java' હોય, તો બીજી કેસ તપાસવામાં આવશે.
08:38 હવે, ચાલો વેરીએબલ $var ને 'English' વેલ્યુ એસાઈન કરીએ.
08:42 ફરીથી, સ્વીચમાં વેરીએબલ $var ની વેલ્યુ તપાસવામાં આવશે.
08:47 આ કોઈપણ case (કેસ) સ્ટેટમેંટોથી મેળ ખાતી નથી.
08:50 જેથી else (એલ્સ) સ્ટેટમેંટ એક્ઝીક્યુટ થશે.
08:54 હવે, ટર્મિનલ પર જઈને સ્ક્રીપ્ટ એક્ઝીક્યુટ કરો
09:00 perl sampleSwitch.pl
09:07 અને Enter દબાવો
09:09 ટર્મિનલ પર આપેલ આઉટપુટ દૃશ્યમાન થાય છે -
09:12 I am not a computer language
09:17 3 કેસો આ પ્રમાણે સૂચવે છે:
09:20 એક્સપ્રેશનની વેલ્યુ કયો case (કેસ) એક્ઝીક્યુટ કરવો છે તે નક્કી કરે છે
09:25 ફક્ત માન્ય case (કેસ) જ એક્ઝીક્યુટ થશે અને
09:28 જ્યારે કોઈપણ માન્ય case ન હોય, ત્યારે મૂળભૂત else કેસ એક્ઝીક્યુટ થશે.
09:35 else case (એલ્સ કેસ) લખવું અનિવાર્ય નથી.
09:39 આવી સ્થિતિમાં,
09:41 જો કોઈપણ cases (કેસીસ) મળતા ના આવે
09:44 તો switch (સ્વીચ) સ્ટેટમેંટ તરફથી કોઈપણ આઉટપુટ આવશે નહી.
09:48 અહીં તમારી માટે બીજું એક એસાઈનમેંટ છે -
09:50 switch (સ્વીચ) સ્ટેટમેંટ વાપરીને
09:53 આ ટ્યુટોરીયલમાં આપેલ પહેલાનું એસાઈનમેંટ ફરીથી લખો.
09:57 ચાલો સારાંશ લઈએ.
09:59 આ ટ્યુટોરીયલમાં, આપણે આપેલ શીખ્યા -
10:01 પર્લમાનું if-elsif-else સ્ટેટમેંટ અને
10:04 switch સ્ટેટમેંટ
10:05 સેમ્પલ પ્રોગ્રામ દ્વારા સમજ્યા.
10:08 આપેલ લીંક પર ઉપલબ્ધ વિડીયો નિહાળો.
10:12 તે સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટનો સારાંશ આપે છે.
10:15 જો તમારી પાસે સારી બેન્ડવિડ્થ ન હોય તો, તમે વિડીયો ડાઉનલોડ કરીને જોઈ શકો છો.
10:20 સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટ ટીમ સ્પોકન ટ્યુટોરીયલોનાં ઉપયોગથી વર્કશોપોનું આયોજન કરે છે.
10:25 જેઓ ઓનલાઈન પરીક્ષા પાસ કરે છે તેઓને પ્રમાણપત્રો આપે છે.
10:30 વધુ વિગતો માટે, કૃપા કરી, contact@spoken-tutorial.org પર લખો.
10:36 સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટ ટોક ટુ અ ટીચર પ્રોજેક્ટનો એક ભાગ છે.
10:40 જેને આઈસીટી, એમએચઆરડી, ભારત સરકાર મારફતે શિક્ષણ પર નેશનલ મિશન દ્વારા આધાર અપાયેલ છે.
10:47 આ મિશન પર વધુ માહિતી આપેલ લીંક પર ઉપલબ્ધ છે. http://spoken-tutorial.org/NMEICT-Intro
10:58 આશા રાખું છું કે તમને આ પર્લ ટ્યુટોરીયલ ગમ્યું હશે.
11:00 IIT Bombay તરફથી હું, જ્યોતી સોલંકી વિદાય લઉં છું.
11:03 જોડાવાબદ્દલ આભાર.

Contributors and Content Editors

Jyotisolanki, PoojaMoolya