PERL/C3/Special-Variables-in-PERL/Khasi

From Script | Spoken-Tutorial
Jump to: navigation, search
Time
Narration
00:01 Ngi pdiangsngewbha ia phi sha ka Spoken Tutorial halor ka Special variables in Perl.
00:04 Ha kane ka jinghikai, ngin ia pule shaphang ki:

Global special variables Special command line variables Global special constants.

00:13 Na ka bynta kane ka jinghikai, nga pyndonkam da ka:

Ubuntu Linux 12.04 operating system Perl 5.14.2 bad ka gedit Text Editor. Phi lah ban pyndonkam da kano kano ka text editor katkum ka jingkwah jong phi.

00:27 Kum ka jingdonkam ba hashwa, phi dei ban don ia ka jingtip shaphang ka Perl Programming.
00:32 Lada phim don, sngewbha leit sha ka jinghikai ba iadei ha ka Perl spoken tutorials ha ka spoken tutorial website.
00:38 Kiei ki special variables?
00:41 Special variables kidei ki predefined variables kiba don ia ka jingmut ba kyrpang ha ka Perl.
00:46 Kine kim donkam ban initialized hashwa ban pyndonkam.
00:50 Ia kine la pyndonkam ban bat bad buh ia ki results jong ki searches,environment variables bad flags ban control ia ka debugging.
00:58 Nyngkong, ngin ia pule shaphang ki Global special variables.
01:02 '$_': (Dollar Underscore). Une udei u special variable ba lah ju kham pyndonkam.
01:06 $_ - Dollar Underscore udei u default parameter na ka bynta ki functions bad pattern-searching strings.
01:14 To ngin ia pyrshang ban sngewthuh ia ka jingpyndonkam jong u '$_' (Dollar Underscore) variable da kaba pyndonkam ia ka sample program.
01:20 Ngan plie ia ka special dot pl file kaba nga lah dep shna lypa.
01:26 Leit sha ka terminal bad type: gedit special dot pl ampersand bad shon Enter.
01:32 special dot pl file ka lah plie mynta ha ka gedit. Type ia u code kumba la pyni ha ka screen. To ngan batai mynta ia u code.
01:42 Don 2 tylli ki foreach loops hangne. Baroh kine ki foreach loops kin sa execute ia kajuh ka result.
01:49 Ha man ka jingiaid jong ka loop, ka string kaba mynta ka lah shah buh ha u '$_'.
01:54 Bad la pyndonkam ia ka da ka print statement, da kaba lah long hi. U $_ (Dollar Underscore) u save ia ka jingpyndonkam jong uwei pat u variable $color uba tam.
02:03 Shon Ctrl+S ban save ia ka file.
02:06 Nangta phai sha ka terminal bad execute ia ka Perl script da kaba type perl special dot pl bad shon Enter.
02:13 Hangne, baroh ar ki foreach loops ki ai ia kajuh ka output.
02:18 Mynta, to ngin ia peit ia kawei pat ka nuksa ban batai kumno u '$_' (Dollar Underscore) variable _u long implicit.

Leit biang sha ka special dot pl file.

02:27 Type ia u code kumba la pyni ha ka screen.
02:30 Kane ka program ka read ia ka text file "first.txt" kawei pa kawei ka lain. Nangta ka loop lyngba ka DATA file, haduh ba baroh ki lain lah read lut.
02:40 print $_ variable ka print ia ki contents jong ka line ba mynta na ka 'first.txt' file.

Ha ka 'while' loop, ka jingpyndonkam ia u '$_' kalong implicit.

02:51 Ngin sa iohi shibun kum kine ha ka jinghikai ba shadien.
02:55 At the rate underscore udei u special variable uba la pyndonkam ban buh ia ki subroutine parameters.
03:01 Arguments na ka bynta ka subroutine lah buh ha kane ka array variable.
03:06 Array operations kum ka pop/shift lah ban leh ha kane ka variable, kumba ngi leh ha ka normal arrays.
03:13 Ngan pyni ia ka nuksa na ka bynta kane. To ngin ia phai biang sha ka special dot pl file sa shisien.
03:19 Type ia u code kumba la pyni ha ka screen.
03:22 Kane ka program kan pynphai ia u value ba heh duh napdeng ar tylli ki number.

@_ (At the rate underscore) udei u local array uba buh ia ar tylli ki arguments, dollar 'a' comma dollar 'b'.

03:35 Kata kadei, lah buh hapoh u dollar underscore index of zero bad dollar underscore index of one
03:43 Ka print statement ka print ia u number ba heh duh napdeng ki numbers ba lah ai.
03:47 Shon Ctrl+S ban save ia ka file.
03:51 Phai sha ka terminal bad execute ia ka Perl script da kaba type perl special dot pl bad shon Enter.
03:58 U value ba heh duh u lah paw kum ka outpur. To ngin ia iaid shakhmat.
04:02 Environment variables lah pynituh da u percentage (%) bud da u dak heh 'ENV'.
04:10 Environment variables kadon ia ka copy jong ka environment variables, ba mynta kum kane harum.
04:17 To ngin ia pyrshang ban sngewthuh ia u  %ENV variable da kaba pyndonkam ia ka sample program.
04:23 Ngin ia phai biang sha ka special dot pl file.
04:26 Type ia u code harum kumba la pyni ha ka screen.
04:30 Shon Ctrl+S ban save ia ka file. Phai sha ka terminal bad execute ia ka Perl script.
04:37 Type: perl special dot pl bad shon Enter.
04:42 Ngi lah ban iohi ia ka jingtip ba bniah jong ka environment ba mynta kum ka PWD (present working directory), username, language bad kiwei kiwei.
04:51 Hadien kane, ngin ia peit shaphang kawei pat ka special variable dollar zero.
04:55 Ka special variable dollar zero ('$0') kadon ia ka kyrteng jong ka Perl program ba mynta kaba lah shah execute.
05:02 Ia kane la ju pyndonkam na ka bynta ka logging.
05:05 Kum ka nuksa: Nga don ia ka file kaba kyrteng 'First.pl' kaba nga pyndonkam ia u '$0' variable, kumba la pyni hangne.
05:14 Ha kapor ba execute, kan sa print ia ka filename First dot pl.
05:19 Perl kadon ia ka built-in function kaba la khot sort kaba sort ia ka array.
05:24 U comparison function un sa ia nujor ia ki parameters jong ki da kaba pyndonkam ia u numerical comparison operator.
05:30 Une u operator la pynithuh da u lesser than equal to greater than symbols, kumba la pyni hangne.
05:38 To ngin ia peit ia ka nuksa na ka bynta kane.
05:40 Plie ia ka terminal bad type: gedit sort.pl ampersand bad shon Enter.
05:47 sort.pl file lah plie mynta ha ka 'gedit' Text Editor. Type ia u code harum kumba la pyni ha ka screen.
05:56 To ngan batai ia u code. Ka lain ba nyngkong ka declare ia ka array jong ki number.
06:02 U numerical comparison operator un sa ia nujor ia ar tylli ki values jong ki number.
06:08 Dollar a bad dollar b kidei ki special package local variables ha kaba ki values badei ban ia nujor lah sei.
06:16 Bad kane ka sort function kan sa sort ia ki numbers ha ka order kaba kiew.
06:21 To mynta ngin ia save bad execute ia ka program.
06:25 Phai biang sha ka terminal bad type: perl sort.pl bad shon Enter.
06:31 Ngi lah ban iohi ba ki number lah sort ha ka order kaba kiew.
06:35 To ngin ia peit ia uwei pat u variable ba kyrpang u dollar exclamation.
06:39 'dollar exclamation lada lah pyndonkam ha u string context, u pynphai ia ka system error string.

Hangne ka nuksa ia ka jingpyndonkam jong ka.

06:48 Lada ka file 'hello.txt' kam don, kan sa print ia ka error message, kum: "Cannot open file for reading : No such file or directory".
06:59 To mynta ngin ia peit sa ia uwei pat u special variable uba kyrteng u, dollar at the rate.
07:04 Une pat udei uwei u variable uba ju kham pyndonkam bha. U pynphai ia ka error message, ba la pynphai na ka eval lane require command.
07:12 Kane ka nuksa kan sa print: "could not divide Illegal division by zero".
07:17 dollar dollar udei sa uwei pat u special variable. Une u buh ia ka process ID jong ka Perl interpreter, kaba run ia kane ka script.
07:26 Ia u diamond operator la pyndonkam ban read ia man ki lain na ki file ba lah ai ha u command line.
07:32 To ngin ia peit ia ka nuksa na ka bynta kane.
07:35 Plie ia ka terminal bad type: gedit commandline.pl ampersand bad shon Enter.
07:42 'commandline.pl' file ka lah plie mynta ha ka gedit.
07:46 Type ia u code kumba la pyni ha ka screen.
07:49 Save ia ka file.
07:51 To ngan pyni iaphi ia ka text kaba nga don kaba kyrteng ka sample dot txt file.
07:56 Mynta, run ia ka program na ka command line da kaba type: perl commandline dot pl space sample dot txt bad shon Enter.
08:07 Kane kadei ka text kaba ngi don ha kasample dot txt file.
08:11 Lada ym don kino kino ki files ba lah ai, ka read na ka standard input kata na ka keyboard.
08:17 Perl kadon ia ka array at the rate capital A R G V u variable ba kyrpang. Une u buh ia baroh ki values na ka command line.
08:27 Ynda pyndonkam ia u at the rate capital A R G V, ym donkam ban declare ia ki variables.
08:33 Ki values na ka command line ki lah buh hi dalade ha une u variable.
08:37 To mynta ngin ia phai sha ka Global Special Constants.
08:41 underscore underscore E N D (baroh ha ki dak heh )underscore underscore ka pynithuh ia ka logical end jong ka program.
08:50 Kano kano ka text kaba bud da ka special variable ka shah iehnoh hadien kane ka statement.
08:55 underscore underscore FILE (ha ki dak heh) underscore underscore ka pynithuh ia ka filename jong ka program, ha ka por ba lah pyndonkam ia ka.
09:06 underscore underscore LINE (in capital letters) underscore underscore ka pynithuh ia ka line number ba mynta.
09:13 underscore underscore PACKAGE (ha ki dak heh) underscore underscore ka pynithuh ia ka kyrteng jong ka package ba mynta ha ka por ba compile lane undefined lada kam don ka package ba mynta.
09:25 Ngin ia peit ia ka sample program halor kumno la pyndonkam ia kaGlobal Special Constants .
09:30 Plie ia ka terminal bad type: gedit specialconstant dot pl ampersand bad shon Enter.
09:39 specialconstant dot pl file ka lah plie mynta ha ka gedit.
09:44 Type ia u code harum kumba la pyni ha ka screen. To ngan batai mynta ia u code.
09:50 Ki literals ba kyrpang "PACKAGE, FILE, LINE" ki ieng ha ka jaka ka kyrteng ka package, ka filename ba mynta bad u line number, ha kata kapor ha ka program.
10:00 To ngin ia execute ia ka program.
10:02 Phai biang sha ka terminal bad type: perl specialconstant.pl bad shon Enter.
10:09 Ngi iohi ia ka kyrteng jong ka package ba mynta, ka filename bad ka line number jong ka program jong ngi.
10:15 Da kane ngi lah poi sha kaba kut jong kane ka jinghikai. To ngin ia batai kyllum.
10:19 Ha kane ka jinghikai, ngi lah pule shaphang katto katne ki special variables kiba shait kham pyndonkam ha ka Perl.
10:25 Kum ka kam na ka bynta jong phi, leh ia kane harum. Thoh ia ka Perl script ban sort ia ki array harum jong ki numbers ha ka order ba kiew bad ba hiar.
10:34 Kynmaw: Na ka bynta ka order kaba kiew, pyndonkam ia u code harum na ka bynta ban ia nujor.
10:39 Print ia ka result ba lah sort da kaba pyndonkam ia ka while loop bad special variable $_ (Dollar Underscore).
10:45 Save bad execute ia ka program.
10:47 Mynta check ia ka result.
10:49 Ka video ha ka link harum ka kyllum lang ia ka Spoken Tutorial project. Sngewbha download bad peit ia ka.
10:56 Ka kynhun jong ka Spoken Tutorial project ka pynlong ia ki workshops bad ka ai certificate sha kito kiba pass ha ki online tests.
11:03 Na ka bynta ki jingtip ba bniah, sngewbha thoh sha ngi.
11:06 Ia ka Spoken Tutorial project la bei tyngka da ka NMEICT, MHRD, Sorkar India.
11:13 Khambun ki jingtip halor kane ka mission kidon ha ka link harum.
11:17 Ma nga U Pdiangburom na Shillong, nga pynkut ia kane. Khublei shibun.

Contributors and Content Editors

Pdiangburom