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

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with '{| border=1 | '''Time''' | '''Narration''' |- | 00:01 |Welcome to the spoken tutorial on if and if-else conditional statements in Perl. |- | 00:07 | In this tutorial, we will…')
 
 
(7 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
|-
 
|-
 
| 00:01
 
| 00:01
|Welcome to the spoken tutorial on if and if-else conditional statements in Perl.
+
| પર્લમા ''' if and if-else conditional statements'''  પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે.  
 
   
 
   
 
|-
 
|-
 
| 00:07
 
| 00:07
| In this tutorial, we will learn about;  
+
| આ ટ્યુટોરીયલમાં, આપણે આપેલ વિશે શીખીશું;  
  
 
|-
 
|-
 
|00:09
 
|00:09
|'''if ''' statement and
+
| '''if ''' સ્ટેટમેન્ટ અને
  
 
|-
 
|-
 
|00:11
 
|00:11
|''' if-else''' statement in Perl
+
|પર્લમા ''' if-else''' સ્ટેટમેન્ટ. હું વાપરી રહ્યી છું ઉબુન્ટુ લીનક્સ 12.04''' ઓપરેટીંગ સીસ્ટમ અને પર્લ '''Perl 5.14.2'''
+
|-
+
|00:12
+
| I am using '''Ubuntu Linux12.04''' operating system and '''Perl 5.14.2'''
+
 
   
 
   
 
|-
 
|-
 
|00:20
 
|00:20
|I will also be using the '''gedit Text Editor'''.
+
|તેમજ હું '''gedit''' ટેક્સ્ટ એડીટર પણ વાપરીશ.
 
    
 
    
 
|-
 
|-
 
|00:24
 
|00:24
|You can use any text editor of your choice.
+
| તમે તમારા પસંદનું કોઈપણ ટેક્સ્ટ એડીટર વાપરી શકો છો. .
 
   
 
   
 
|-
 
|-
 
| 00:28
 
| 00:28
| You should have basic knowledge of '''Variables '''and''' Comments '''in''' Perl.'''
+
| તમને પર્લમાં વેરીએબલો અને કમેંટોની સામાન્ય જાણકારી હોવી અનિવાર્ય છે.  
 
   
 
   
 
|-
 
|-
 
|00:33
 
|00:33
|Knowledge of '''for''', '''foreach''' , '''while and  do-while '''loops in '''Perl''' will be an added advantage.
+
|પર્લમાં for અને foreach લૂપ્સ નું જ્ઞાન હોવાથી વધારાના લાભ થશે.  
  
 
|-
 
|-
 
|00:40
 
|00:40
|Please go through the relevant spoken tutorials on the spoken tutorial website.  
+
| સ્પોકન ટ્યુટોરીયલ વેબસાઈટ પર સંદર્ભિત સ્પોકન ટ્યુટોરીયલોનો સંદર્ભ લો.  
 
   
 
   
 
|-
 
|-
 
| 00:45
 
| 00:45
| Perl provides the following conditional statements -  
+
| પર્લ આપેલ કંડીશનલ સ્ટેટમેન્ટ પૂરી પાડે છે -
 
   
 
   
 
|-
 
|-
 
|00:49
 
|00:49
|'''if'''
+
|'''if''' (ઇફ), '''if-else ''' (ઇફ)
+
|-
+
|00:50
+
|'''if-else '''
+
 
   
 
   
 
|-
 
|-
 
|00:51
 
|00:51
|'''if-elsif-else''' and
+
|'''if-elsif-else''' અને ( ઇફ -એલ્સઇફ -એલ્સ) ,
 
   
 
   
 
|-
 
|-
 
|00:53
 
|00:53
|'''switch '''
+
|'''switch ''' (સ્વીચ), આ ટ્યુટોરીયલમાં આપણે '''if '''અને  '''If-else''' સ્ટેટમેન્ટ ને આવરી લેશું.
   
+
|-
+
|00:54
+
|In this tutorial, we'll cover '''if '''and '''If-else''' statements
+
 
   
 
   
 
|-
 
|-
 
|00:59
 
|00:59
|'''if'''  statement in '''Perl''' can be used
+
| પર્લમાં ઇફ સ્ટેટમેન્ટ નો ઉપયોગ
 
   
 
   
 
|-
 
|-
 
| 01:01
 
| 01:01
| to execute a piece of code only when a specified condition is satisfied.  
+
| જયારે નિર્દિષ્ટ કન્ડીશન સંતુષ્ટજનક હોય ત્યારેજ કોડ ના ભાગ ને એક્ઝીક્યુટ કરે છે.
  
 
|-
 
|-
 
|01:07
 
|01:07
|The syntax of '''if''' conditional statement is as follows
+
| '''if''' કન્ડીશન  સ્ટેટમેન્ટનું સિન્ટેક્સ આપ્યા પ્રમાણે છે:
 
   
 
   
 
|-
 
|-
 
|01:11
 
|01:11
|'''if '''space open bracket '''condition''' close bracket space Open curly bracket
+
|'''if '''space ખુલ્લું કૌંસ'''condition''' બંધ કૌંસ '''space''' ખુલ્લો છગડીયો કૌંસ 
 
   
 
   
 
|-
 
|-
 
|01:19
 
|01:19
|'''Enter'''
+
|'''Enter''' (એન્ટર), કોડનો એ ભાગ જેને એક્ઝીક્યુટ કરવું છે જો કન્ડીશન '''true''' હોય
+
|-
+
|01:20
+
|Piece of code semicolon, to be executed when the condition is true
+
 
   
 
   
 
|-
 
|-
 
|01:25
 
|01:25
| '''Enter''', Close curly bracket
+
| '''Enter''', (એન્ટર) બંધ છગડીયો કૌંસ
 
   
 
   
 
|-
 
|-
 
|01:29
 
|01:29
|The code inside the '''if''' statement will be executed only when the condition is true.  
+
|જો કન્ડીશન  '''true''' હોય તો જ  '''if''' સ્ટેટમેન્ટના અંદરનો  કોડ એક્ઝીક્યુટ થશે.
 
   
 
   
 
|-
 
|-
 
|01:36
 
|01:36
| Now let us look at an example of '''if ''' statement.  
+
| ચાલો ઇફ સ્ટેટમેન્ટ ના ઉદાહરણ જોઈએ.
 
   
 
   
 
|-
 
|-
 
| 01:40
 
| 01:40
|Open the Terminal and type
+
| ટર્મિનલ ખોલો અને ટાઈપ કરો;
 
   
 
   
 
|-
 
|-
Line 113: Line 97:
 
|-
 
|-
 
|01:49
 
|01:49
|and press '''Enter'''
+
|અને Enter (એન્ટર) દબાવો.
 
   
 
   
 
|-
 
|-
 
|01:52
 
|01:52
|This will open the '''conditionalBlocks.pl''' file in gedit.  
+
| આનાથી''' gedit''' માં '''conditionalBlocks.pl''' ફાઈલ ખુલશે.
 
   
 
   
 
|-
 
|-
 
|01:57
 
|01:57
|Type the following piece of code as displayed on the screen.  
+
|આપેલ કોડનો ભાગ સ્ક્રીન પર દ્રશ્યમાન થાય છે.
 
   
 
   
 
|-
 
|-
 
|02:02
 
|02:02
|Here we have specified a condition for '''if''' which checks the value of variable count.  
+
|અહી ઇફ માટે કન્ડીશન નિર્દિષ્ટ છે જે વેરીએબલ '''count''' ની વેલ્યુ તપાસશે.
 
   
 
   
 
|-
 
|-
 
|02:09
 
|02:09
| Note the '''equal to equal to''' sign here. This is the '''comparison''' operator.  
+
| નોધ લો  '''equal to equal to''' ચિન્હ અહી  '''comparison''' ઓપરેટર છે.
  
 
|-
 
|-
 
|02:15
 
|02:15
|The condition '''$count equal to equal to 5 ''' is checked against the value of variable count.  
+
|કન્ડીશન  '''$count equal to equal to 5 ''' વેરીએબલ '''count''' ની વેલ્યુ તપાસશે.  
  
 
|-
 
|-
 
|02:23
 
|02:23
|When it is equal to 5, the code within the '''if''' block will get executed.  
+
|જયારે તે  '''equal to 5''' હોય છે ત્યારે  ઇફ બ્લોક અંદરનો કોડ એક્ઝીક્યુટ થયા છે.  
 
   
 
   
 
|-
 
|-
 
| 02:28
 
| 02:28
|Now, press '''ctrl+s''' to '''save''' the file.  
+
|ફાઈલને સંગ્રહવા માટે Ctrl+S દબાવો.  
  
 
|-
 
|-
 
|02:32
 
|02:32
|Then switch to the terminal.  
+
|હવે, ટર્મિનલ પર સ્વીચ કરો.  
  
 
|-
 
|-
 
|02:36
 
|02:36
| Make sure that you are in the directory in which you have saved your file.  
+
| ખાતરી કરો કે જે ડિરેક્ટરી માં તમે તમારી ફાઈલ સેવ કરી છે તમે ત્યાં છો.
 
   
 
   
 
|-
 
|-
 
|02:41
 
|02:41
|Type the following to check for any compilation or syntax error -  
+
| કોઈપણ કમ્પાઈલેશન અથવા સિન્ટેક્સ એરર છે કે તે તપાસવા માટે ટાઈપ કરો-
+
 
 
|-
 
|-
 
|02:46
 
|02:46
Line 161: Line 145:
 
|-
 
|-
 
| 02:53
 
| 02:53
and press '''Enter. '''
+
અને Enter (એન્ટર) દબાવો.  
 
   
 
   
 
|-
 
|-
 
|02:55
 
|02:55
|The following line will be displayed on the terminal window  
+
|ટર્મિનલ વિન્ડો પર આપેલ લાઈન દેખાશે.
   
+
 
 
|-
 
|-
 
|  02:59
 
|  02:59
Line 173: Line 157:
 
|-
 
|-
 
|  03:04
 
|  03:04
| As there is no compilation or syntax error, we will execute the Perl script by typing -  
+
| કોઈપણ કમ્પાઈલેશન અથવા સિન્ટેક્સ એરર ન હોવાથી આપણે આ ટાઈપ કરીને પર્લ સ્ક્રીપ્ટ એક્ઝીક્યુટ કરીશું -
+
 
 
|-
 
|-
 
|03:10
 
|03:10
Line 181: Line 165:
 
|-
 
|-
 
| 03:14
 
| 03:14
| and press '''Enter'''
+
| અને Enter (એન્ટર) દબાવો.
 
   
 
   
 
|-
 
|-
 
|03:16
 
|03:16
|The following output will be shown on terminal.  
+
| ટર્મિનલ પર આપેલ આઉટપુટ દેખાશે.
 
   
 
   
 
|-
 
|-
Line 193: Line 177:
 
|-
 
|-
 
| 03:23
 
| 03:23
|Switch back to gedit
+
| ''' gedit''' પર પાછા જઈએ.
 
   
 
   
 
|-
 
|-
 
|03:26
 
|03:26
|Alternately, we can write the above ''' if''' statement as-
+
|વૈકલ્પિક રીતે આપણે ઉપરના ઇફ સ્ટેટમેન્ટ ને આ રીતે લખી શકીએ છીએ ,
 
   
 
   
 
|-
 
|-
Line 205: Line 189:
 
|-
 
|-
 
|  03:57
 
|  03:57
|Now, let us look at '''if-else''' statement.  
+
| હવે ચાલો '''if-else''' સ્ટેટમેન્ટ જોઈએ.  
 
   
 
   
 
|-
 
|-
 
|04:01
 
|04:01
|This statement is used when user wants to execute
+
| આ સ્ટેટમેન્ટ જયારે યુઝરને એક્ઝીક્યુટ કરવું હોય ત્યારે વાપરવા માં આવે છે.
 
   
 
   
 
|-
 
|-
 
|04:06
 
|04:06
|one piece of code when the condition is true and
+
| જયારે કન્ડીશન '''true''' હોય તો એક કોડ નો ભાગ  અને
 
   
 
   
 
|-
 
|-
 
|  04:09
 
|  04:09
| another piece of code when the condition is false  
+
| બીજો કોડ નો ભાગ જયારે કન્ડીશન '''false''' હોય
  
 
|-
 
|-
|   04:13
+
| 04:13
| The syntax for '''if-else''' condition is as follows -  
+
| '''if-else''' કન્ડીશનનું સિન્ટેક્સ આપ્યા પ્રમાણે છે-
  
 
|-
 
|-
 
|  04:17
 
|  04:17
| '''if ''' space open bracket '''condition''' close bracket space open curly bracket Press '''Enter'''.  
+
| '''if ''' space ખુલ્લું કૌંસ '''condition'''બંધ કૌંસ  space ખુલ્લો છગડીયો કૌંસ એન્ટર ટાઈપ કરો.
 
   
 
   
 
|-
 
|-
 
| 04:27
 
| 04:27
|piece of code semicolon  
+
| કોડ નો ભાગ  '''semicolon'''
  
 
|-
 
|-
 
| 04:29
 
| 04:29
to be executed when '''if''' condition is true,
+
| એક્ઝીક્યુટ  થશે જો કન્ડીશન '''true''' હોય
 
   
 
   
 
|-
 
|-
 
|04:32
 
|04:32
|Press '''Enter '''
+
| '''Enter ''' દબાવો.
  
 
|-
 
|-
 
|04:34
 
|04:34
|close curly bracket space '''else''' space open curly bracket '''Enter'''
+
|બંધ છગડીયો કૌંસ '''space''' '''else''' space ખુલ્લો છગડીયો કૌંસ  '''Enter'''
 
   
 
   
 
|-
 
|-
 
|04:41
 
|04:41
| another piece of code semicolon  
+
| બીજા કોડ નો ભાગ  '''semicolon'''
 
   
 
   
 
|-
 
|-
 
|04:43
 
|04:43
|to be executed when if condition is false  
+
| કન્ડીશન '''false''' હોય તો એક્ઝીક્યુટ કરવા માટે
  
 
|-
 
|-
 
|04:47
 
|04:47
|Press '''Enter''' close curly bracket
+
| '''Enter''' દબાવો  બંધ છગડીયો કૌંસ.
  
 
|-
 
|-
 
|04:51
 
|04:51
| Now again, go to the '''conditionalBlocks.pl''' file which we have already created in gedit.  
+
| હવે ફરીથી  '''conditionalBlocks.pl'' ફાઈલ પર જાઓ જે આપણે  પેહલાથીજ '''gedit.''' માં બનાવી હતી.
 
   
 
   
 
|-
 
|-
 
| 04:58
 
| 04:58
Assign 4 to count variable then at the end of the if block type space
+
'''count''' વેરીએબલ ને '''4'''અન્સાઈ કરો પછી ઇફ બ્લોક ના અંત માં ટાઈપ કરો સ્પેસ
  
 
|-
 
|-
Line 269: Line 253:
 
|-
 
|-
 
|05:09
 
|05:09
| space open curly bracket press '''Enter '''
+
| '''space''' ખુલ્લો છગડીયો કૌંસ  '''Enter ''' દબાવો.
  
 
|-
 
|-
Line 277: Line 261:
 
|-
 
|-
 
|05:30
 
|05:30
|Press '''Enter''' and close '''curly bracket.'''
+
| '''Enter''' દબાવો અને બંધ છગડીયો કૌંસ.  
  
 
|-
 
|-
 
|05:34
 
|05:34
|Here, '''4''' is assigned to variable '''$count.  '''
+
| ''' અહી '''$count. વેરીએબલને '''4''' અસાઇન કર્યું છે.
 
   
 
   
 
|-
 
|-
 
|05:38
 
|05:38
|As the value of '''count''' variable does not match 5,
+
| જેમ  '''count''' વેરીએબલ '''5,''' વેલ્યુને મેળ ખાતું નથી .
  
 
|-
 
|-
 
|05:43
 
|05:43
|the code within the '''if''' block will not get execute
+
|કોડ  ઇફ બોલ્ક અંતર્ગત એક્ઝીક્યુટ નહી થાય.
 
   
 
   
 
|-
 
|-
 
|05:47
 
|05:47
|instead the code within the else block will get execute.
+
| કોડ ની જગ્યાએ એલ્સ બ્લોક અંતર્ગત એક્ઝીક્યુટ થશે.
 
   
 
   
 
|-
 
|-
 
|05:52
 
|05:52
|Now press ''' Ctrl+S''' to save the file.  
+
|ફાઈલને સંગ્રહવા માટે Ctrl+S દબાવો.  
 
   
 
   
 
|-
 
|-
 
|  05:56
 
|  05:56
| Now switch to terminal.  
+
| હવે ટર્મિનલ પર જાઓ.
 
   
 
   
 
|-
 
|-
 
|05:59
 
|05:59
|and type '''perl hyphen c conditionalBlocks dot pl''' to check for any compilation or syntax error
+
|કોઈપણ કમ્પાઈલેશન અથવા સિન્ટેક્સ એરર છે કે તે તપાસવા માટે ટાઈપ કરો:  '''perl hyphen c conditionalBlocks dot pl'''  
 
   
 
   
 
|-
 
|-
| 06:11
+
| 06:11
now, press '''Enter'''
+
|   હવે '''Enter''' દબાવો.
  
 
|-
 
|-
| 06:13
+
| 06:13
| The following line will be displayed on the terminal
+
| ટર્મિનલ પર આપેલ લાઈન  દેખાશે.
   
+
 
 
|-
 
|-
 
| 06:17
 
| 06:17
Line 321: Line 305:
 
|-
 
|-
 
|  06:20
 
|  06:20
|As there is no compilation or syntax error, we will now execute the Perl script.
+
|કોઈપણ કમ્પાઈલેશન અથવા સિન્ટેક્સ એરર ન હોવાથી આપણે આ ટાઈપ કરીને પર્લ સ્ક્રીપ્ટ એક્ઝીક્યુટ કરીશું -
 
   
 
   
 
|-
 
|-
 
|06:27
 
|06:27
|Type '''perl conditionalBlocks dot pl '''
+
|ટાઈપ કરો '''perl conditionalBlocks dot pl '''
  
 
|-
 
|-
 
|  06:33
 
|  06:33
| and press '''Enter'''
+
| અને '''Enter''' દબાવો.
  
 
|-
 
|-
 
|  06:35
 
|  06:35
| The following output will be shown on terminal.
+
| ટર્મિનલ પર આપેલ આઉટપુટ દેખાશે.  
  
 
|-
 
|-
Line 341: Line 325:
 
|-
 
|-
 
| 06:44
 
| 06:44
|Let us summarize.  
+
શારાંશ માટે
 
   
 
   
 
|-
 
|-
 
| 06:46
 
| 06:46
| In this tutorial, we have learnt -  
+
| આ ટ્યુટોરીયલમાં, આપણે શીખ્યા  -
 
   
 
   
 
|-
 
|-
 
|06:49
 
|06:49
|'''if''' and
+
|'''if''' (ઇફ)  અને પર્લમાં '''if-else''' ( ઇફ -એલ્સ) કન્ડીશન સ્ટેટમેન્ટ.
   
+
|-
+
|06:50
+
|'''if-else''' conditional statements in Perl
+
 
   
 
   
 
|-
 
|-
 
| 06:53
 
| 06:53
|   using sample programs.  
+
| અમુક સેમ્પલ પ્રોગ્રામોનો ઉપયોગ કરીને.  
  
 
|-
 
|-
 
|  06:55
 
|  06:55
| Here is assignment for you -
+
| અહીં તમારા માટે અસાઇનમેન્ટ છે -  
 
   
 
   
 
|-
 
|-
 
|  06:57
 
|  06:57
Print ''' “It is an open source language” '''
+
|   જયાએ વેરીએબલ ''' 'Perl' ''' વેલ્યુ ડિક્લેર કરેતો
  
 
|-
 
|-
 
|07:01
 
|07:01
| when the variable declared has value ''' 'Perl' '''
+
| ''' “It is an open source language” '''  
  
 
|-
 
|-
 
|07:04
 
|07:04
|otherwise print ''' “It's a proprietary language” '''
+
|નહી તો આ પ્રિન્ટ કરો''' “It's a proprietary language” '''
 
   
 
   
 
|-
 
|-
 
|07:08
 
|07:08
|Watch the video available at the following link
+
|આપેલ લીંક પર ઉપલબ્ધ વિડીયો નિહાળો.
  
 
|-
 
|-
 
|07:11
 
|07:11
|It summaries the Spoken Tutorial project
+
|તે સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટનો સારાંશ આપે છે.
 
   
 
   
 
|-
 
|-
 
|07:15
 
|07:15
|If you do not have good bandwidth, you can download and watch it
+
|જો તમારી પાસે સારી બેન્ડવિડ્થ ન હોય તો, તમે વિડીયો ડાઉનલોડ કરીને જોઈ શકો છો.
 
   
 
   
 
|-
 
|-
 
| 07:20
 
| 07:20
The Spoken Tutorial Project Team
+
સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટ ટીમ
  
 
|-
 
|-
 
| 07:22
 
| 07:22
| Conducts workshops using spoken tutorials
+
| સ્પોકન ટ્યુટોરીયલોનાં ઉપયોગથી વર્કશોપોનું આયોજન કરે છે.
 
   
 
   
 
|-
 
|-
 
|07:26
 
|07:26
|Gives certificates to those who pass an online  test
+
|જેઓ ઓનલાઈન પરીક્ષા પાસ કરે છે તેઓને પ્રમાણપત્રો આપે છે.
 
   
 
   
 
|-
 
|-
 
|07:31
 
|07:31
|For more details, please write to contact at spoken hyphen tutorial dot org
+
|વધુ વિગતો માટે, કૃપા કરી contact@spoken-tutorial.org પર લખો
 
   
 
   
 
|-
 
|-
 
| 07:37
 
| 07:37
Spoken Tutorial Project is a part of the Talk to a  Teacher project
+
સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટ ટોક ટુ અ ટીચર પ્રોજેક્ટનો એક ભાગ છે.
 
   
 
   
 
|-
 
|-
 
|07:42
 
|07:42
|It is supported by the National Mission on Education through ICT, MHRD, Government of India.
+
|જેને આઈસીટી, એમએચઆરડી, ભારત સરકાર મારફતે શિક્ષણ પર નેશનલ મિશન દ્વારા આધાર અપાયેલ છે. .
 
    
 
    
 
|-
 
|-
 
|07:50
 
|07:50
|More information on this Mission is available at spoken hyphen tutorial dot org slash NMEICT hyphen Intro
+
|આ મિશન પર વધુ માહિતી spoken hyphen tutorial dot org slash NMEICT hyphen Intro આ લીંક પર ઉપલબ્ધ છે.
 
   
 
   
 
|-
 
|-
 
| 08:00
 
| 08:00
Hope you enjoyed this Perl tutorial.  
+
આશા રાખું છું કે તમને આ પર્લ ટ્યુટોરીયલ ગમ્યું હશે.  
 
   
 
   
 
|-
 
|-
 
|08:04
 
|08:04
|This is Amol Brahmankar signing off.
+
|આઈઆઈટી બોમ્બે તરફથી હું, જ્યોતી સોલંકી વિદાય લઉં છું.  
 
    
 
    
 
|-
 
|-
 
|08:06
 
|08:06
|Thanks for joining.
+
|જોડાવાબદ્દલ આભાર.  
 
   
 
   
 
|}
 
|}

Latest revision as of 02:13, 4 March 2017

Time Narration
00:01 પર્લમા if and if-else conditional statements પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે.
00:07 આ ટ્યુટોરીયલમાં, આપણે આપેલ વિશે શીખીશું;
00:09 if સ્ટેટમેન્ટ અને
00:11 પર્લમા if-else સ્ટેટમેન્ટ. હું વાપરી રહ્યી છું ઉબુન્ટુ લીનક્સ 12.04 ઓપરેટીંગ સીસ્ટમ અને પર્લ Perl 5.14.2
00:20 તેમજ હું gedit ટેક્સ્ટ એડીટર પણ વાપરીશ.
00:24 તમે તમારા પસંદનું કોઈપણ ટેક્સ્ટ એડીટર વાપરી શકો છો. .
00:28 તમને પર્લમાં વેરીએબલો અને કમેંટોની સામાન્ય જાણકારી હોવી અનિવાર્ય છે.
00:33 પર્લમાં for અને foreach લૂપ્સ નું જ્ઞાન હોવાથી વધારાના લાભ થશે.
00:40 સ્પોકન ટ્યુટોરીયલ વેબસાઈટ પર સંદર્ભિત સ્પોકન ટ્યુટોરીયલોનો સંદર્ભ લો.
00:45 પર્લ આપેલ કંડીશનલ સ્ટેટમેન્ટ પૂરી પાડે છે -
00:49 if (ઇફ), if-else (ઇફ)
00:51 if-elsif-else અને ( ઇફ -એલ્સઇફ -એલ્સ) ,
00:53 switch (સ્વીચ), આ ટ્યુટોરીયલમાં આપણે if અને If-else સ્ટેટમેન્ટ ને આવરી લેશું.
00:59 પર્લમાં ઇફ સ્ટેટમેન્ટ નો ઉપયોગ
01:01 જયારે નિર્દિષ્ટ કન્ડીશન સંતુષ્ટજનક હોય ત્યારેજ કોડ ના ભાગ ને એક્ઝીક્યુટ કરે છે.
01:07 if કન્ડીશન સ્ટેટમેન્ટનું સિન્ટેક્સ આપ્યા પ્રમાણે છે:
01:11 if space ખુલ્લું કૌંસcondition બંધ કૌંસ space ખુલ્લો છગડીયો કૌંસ
01:19 Enter (એન્ટર), કોડનો એ ભાગ જેને એક્ઝીક્યુટ કરવું છે જો કન્ડીશન true હોય
01:25 Enter, (એન્ટર) બંધ છગડીયો કૌંસ
01:29 જો કન્ડીશન true હોય તો જ if સ્ટેટમેન્ટના અંદરનો કોડ એક્ઝીક્યુટ થશે.
01:36 ચાલો ઇફ સ્ટેટમેન્ટ ના ઉદાહરણ જોઈએ.
01:40 ટર્મિનલ ખોલો અને ટાઈપ કરો;
01:43 gedit conditionalBlocks dot pl space &(ampersand )
01:49 અને Enter (એન્ટર) દબાવો.
01:52 આનાથી gedit માં conditionalBlocks.pl ફાઈલ ખુલશે.
01:57 આપેલ કોડનો ભાગ સ્ક્રીન પર દ્રશ્યમાન થાય છે.
02:02 અહી ઇફ માટે કન્ડીશન નિર્દિષ્ટ છે જે વેરીએબલ count ની વેલ્યુ તપાસશે.
02:09 નોધ લો equal to equal to ચિન્હ અહી comparison ઓપરેટર છે.
02:15 કન્ડીશન $count equal to equal to 5 વેરીએબલ count ની વેલ્યુ તપાસશે.
02:23 જયારે તે equal to 5 હોય છે ત્યારે ઇફ બ્લોક અંદરનો કોડ એક્ઝીક્યુટ થયા છે.
02:28 ફાઈલને સંગ્રહવા માટે Ctrl+S દબાવો.
02:32 હવે, ટર્મિનલ પર સ્વીચ કરો.
02:36 ખાતરી કરો કે જે ડિરેક્ટરી માં તમે તમારી ફાઈલ સેવ કરી છે તમે ત્યાં છો.
02:41 કોઈપણ કમ્પાઈલેશન અથવા સિન્ટેક્સ એરર છે કે તે તપાસવા માટે ટાઈપ કરો-
02:46 perl hyphen c conditionalBlocks dot pl
02:53 અને Enter (એન્ટર) દબાવો.
02:55 ટર્મિનલ વિન્ડો પર આપેલ લાઈન દેખાશે.
02:59 conditionalBlocks.pl syntax OK
03:04 કોઈપણ કમ્પાઈલેશન અથવા સિન્ટેક્સ એરર ન હોવાથી આપણે આ ટાઈપ કરીને પર્લ સ્ક્રીપ્ટ એક્ઝીક્યુટ કરીશું -
03:10 perl conditionalBlocks dot pl
03:14 અને Enter (એન્ટર) દબાવો.
03:16 ટર્મિનલ પર આપેલ આઉટપુટ દેખાશે.
03:19 I am inside if statement
03:23 gedit પર પાછા જઈએ.
03:26 વૈકલ્પિક રીતે આપણે ઉપરના ઇફ સ્ટેટમેન્ટ ને આ રીતે લખી શકીએ છીએ ,
03:31 print space double quotes I am inside if statement slash n close double quotes space if open bracket dollar count space equal to equal to space 5 close bracket semicolon.
03:57 હવે ચાલો if-else સ્ટેટમેન્ટ જોઈએ.
04:01 આ સ્ટેટમેન્ટ જયારે યુઝરને એક્ઝીક્યુટ કરવું હોય ત્યારે વાપરવા માં આવે છે.
04:06 જયારે કન્ડીશન true હોય તો એક કોડ નો ભાગ અને
04:09 બીજો કોડ નો ભાગ જયારે કન્ડીશન false હોય
04:13 if-else કન્ડીશનનું સિન્ટેક્સ આપ્યા પ્રમાણે છે-
04:17 if space ખુલ્લું કૌંસ conditionબંધ કૌંસ space ખુલ્લો છગડીયો કૌંસ એન્ટર ટાઈપ કરો.
04:27 કોડ નો ભાગ semicolon
04:29 એક્ઝીક્યુટ થશે જો કન્ડીશન true હોય
04:32 Enter દબાવો.
04:34 બંધ છગડીયો કૌંસ space else space ખુલ્લો છગડીયો કૌંસ Enter
04:41 બીજા કોડ નો ભાગ semicolon
04:43 કન્ડીશન false હોય તો એક્ઝીક્યુટ કરવા માટે
04:47 Enter દબાવો બંધ છગડીયો કૌંસ.
04:51 હવે ફરીથી conditionalBlocks.pl ફાઈલ પર જાઓ જે આપણે પેહલાથીજ gedit.' માં બનાવી હતી.
04:58 count વેરીએબલ ને 4અન્સાઈ કરો પછી ઇફ બ્લોક ના અંત માં ટાઈપ કરો સ્પેસ
05:07 else
05:09 space ખુલ્લો છગડીયો કૌંસ Enter દબાવો.
05:14 print space double quotes I am inside else statement slash n close double quotes semicolon
05:30 Enter દબાવો અને બંધ છગડીયો કૌંસ.
05:34 અહી $count. વેરીએબલને 4 અસાઇન કર્યું છે.
05:38 જેમ count વેરીએબલ 5, વેલ્યુને મેળ ખાતું નથી .
05:43 કોડ ઇફ બોલ્ક અંતર્ગત એક્ઝીક્યુટ નહી થાય.
05:47 કોડ ની જગ્યાએ એલ્સ બ્લોક અંતર્ગત એક્ઝીક્યુટ થશે.
05:52 ફાઈલને સંગ્રહવા માટે Ctrl+S દબાવો.
05:56 હવે ટર્મિનલ પર જાઓ.
05:59 કોઈપણ કમ્પાઈલેશન અથવા સિન્ટેક્સ એરર છે કે તે તપાસવા માટે ટાઈપ કરો: perl hyphen c conditionalBlocks dot pl
06:11 હવે Enter દબાવો.
06:13 ટર્મિનલ પર આપેલ લાઈન દેખાશે.
06:17 conditionalBlocks.pl syntax OK
06:20 કોઈપણ કમ્પાઈલેશન અથવા સિન્ટેક્સ એરર ન હોવાથી આપણે આ ટાઈપ કરીને પર્લ સ્ક્રીપ્ટ એક્ઝીક્યુટ કરીશું -
06:27 ટાઈપ કરો perl conditionalBlocks dot pl
06:33 અને Enter દબાવો.
06:35 ટર્મિનલ પર આપેલ આઉટપુટ દેખાશે.
06:39 I am inside else statement
06:44 શારાંશ માટે
06:46 આ ટ્યુટોરીયલમાં, આપણે શીખ્યા -
06:49 if (ઇફ) અને પર્લમાં if-else ( ઇફ -એલ્સ) કન્ડીશન સ્ટેટમેન્ટ.
06:53 અમુક સેમ્પલ પ્રોગ્રામોનો ઉપયોગ કરીને.
06:55 અહીં તમારા માટે અસાઇનમેન્ટ છે -
06:57 જયાએ વેરીએબલ 'Perl' વેલ્યુ ડિક્લેર કરેતો
07:01 “It is an open source language”
07:04 નહી તો આ પ્રિન્ટ કરો “It's a proprietary language”
07:08 આપેલ લીંક પર ઉપલબ્ધ વિડીયો નિહાળો.
07:11 તે સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટનો સારાંશ આપે છે.
07:15 જો તમારી પાસે સારી બેન્ડવિડ્થ ન હોય તો, તમે વિડીયો ડાઉનલોડ કરીને જોઈ શકો છો.
07:20 સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટ ટીમ
07:22 સ્પોકન ટ્યુટોરીયલોનાં ઉપયોગથી વર્કશોપોનું આયોજન કરે છે.
07:26 જેઓ ઓનલાઈન પરીક્ષા પાસ કરે છે તેઓને પ્રમાણપત્રો આપે છે.
07:31 વધુ વિગતો માટે, કૃપા કરી contact@spoken-tutorial.org પર લખો
07:37 સ્પોકન ટ્યુટોરીયલ પ્રોજેક્ટ ટોક ટુ અ ટીચર પ્રોજેક્ટનો એક ભાગ છે.
07:42 જેને આઈસીટી, એમએચઆરડી, ભારત સરકાર મારફતે શિક્ષણ પર નેશનલ મિશન દ્વારા આધાર અપાયેલ છે. .
07:50 આ મિશન પર વધુ માહિતી spoken hyphen tutorial dot org slash NMEICT hyphen Intro આ લીંક પર ઉપલબ્ધ છે.
08:00 આશા રાખું છું કે તમને આ પર્લ ટ્યુટોરીયલ ગમ્યું હશે.
08:04 આઈઆઈટી બોમ્બે તરફથી હું, જ્યોતી સોલંકી વિદાય લઉં છું.
08:06 જોડાવાબદ્દલ આભાર.

Contributors and Content Editors

Jyotisolanki, PoojaMoolya