PERL/C3/Sample-PERL-program/Khasi

From Script | Spoken-Tutorial
Jump to: navigation, search
Time
Narration
00:01 Ngi pdiangsngewbha iaphi sha ka Spoken Tutorial halor ka Sample PERL program.
00:06 Ha kane ka jinghikai, ngin ia pule ban kynthup ia baroh ki mat phang ba kongsan kiba ngi lah iaid shakhmat ha ka sample Perl program.
00:14 Ban record ia kane ka jinghikai, nga pyndonkam da ka:

Ubuntu Linux 12.04 operating system Perl 5.14.2 bad ka gedit Text editor.

00:25 Phi lah ban pyndonkam kano kano ka text editor katkum kamon jong phi.
00:29 Kum ka jingdonkam hashwa kane, phi dei ban don ia ka jingtip shaphang ka Perl programming.
00:34 Lada phim don, te leit sha ki spoken tutorials jong ka Perl ha kane ka website.
00:39 Ka sample Perl program kan ai ia ka output jong bun ki weather forecast reports jong ka jaka.
00:46 weather dot pm kadei ka module file kaba don ia ka complex data-structure ban buh ia ka data ba donkam na ka bynta kane ka program.
00:54 Kadon ruh ia bun tylli ki functions ban pynmih ia ka report.
00:59 weather underscore report dot pl kadei ka Perl program kaba pyndonkam ia kane ka module file ban ai ia ka output ba donkam.
01:08 Kijuh ki code files kidon hapoh jong kane ka video ha ka website jong ngi.
01:13 Download bad unzip ia ki files ba lah ai ha kane ka code file link.
01:18 Mynta, to ngin ia peit ia ka sample Perl program jong ngi ka Weather dot pm.
01:24 U block jong u code ha kane ka program udon hapoh ka namespace Weather.
01:29 Perl ka pyntreikam ia ka namespace da kaba pyndonkam ia ka package keyword.
01:34 BEGIN block ka lum thup bad ka execute ha shwa ka main program.
01:40 Export ka ai lad ban export ia ki functions bad variables jong ki modules sha ka user’s namespace.
01:48 At the rate EXPORT bad at the rate EXPORT underscore OK kidei ki ar tylli ki variables ba kongsan kiba lah pyndonkam ha ka export operation.
01:57 At the rate EXPORT kadon ia ki list jong ki subroutines bad variables jong ka module.
02:03 Kine kin sa shah export sha ka caller namespace.
02:07 At the rate EXPORT underscore OK ka export ia ki symbols katkum ka jingdonkam.
02:14 Hangne nga lah pyndonkam ia ka references ban shna ia ka complex data-structures, ban buh ia ki data kiba donkam na ka bynta ka weather-report.
02:24 $weather_report kadei ka hash reference. “place” bad “nstate” kidon ia ki scalar values.
02:32 weekly” kadei hash jong u hash references.
02:37 Man ki sngi jong ka taiew kidon saw tylli ki keys -

max underscore temp min underscore temp sunrise sunset.

02:48 record underscore time” kadei ka array reference ryngkat ar tylli ki index values.
02:54 Nga don katto katne ki subroutines ban pyni ia ka weather report jong bun ki options.

To ngin ia peit kawei pa kawei.

03:01 Kane ka function ka print ia ka header information kum ka header jong ka report, place, state bad current date.
03:10 Mynta, to ngin ia peit ia ka function kaba bud ka display underscore daily underscore report.
03:16 Kane ka function ka print ia ka report ba man ka sngi ha ka screen, kaba shong katkum ka weekday input.
03:22 Ngi sei ia u parameter ba lah pass sha ka subroutine da kaba pyndonkam ia u shift function.
03:27 Nga lah pyndonkam ia u trim() function ban weng ia ki leading bad trailing space jong u parameter value.
03:34 Hangne u code na ka bynta ka trim() function.
03:37 Lc() function ka pynphai ia ka lowercase version jong ka input ba lah ai.
03:42 Ia lane lah pyndonkam ban iaid lait ia ka case-sensitivity.
03:45 Ka week-day, kaba pass kum u parameter na ka main program, lah assigned sha u local variable dollar week underscore day.
03:55 Ka print statements harum kan print ia ka data ba bud sha u week day ba lah ai.
04:01 Ngi pyndonkam ia ka arrow operator ban dereferenceia u value ha ka $weather underscore report.
04:09 Ynda ngi treikam bad ka references, ngi donkam ban sngewthuh ia ka data type kaba ngi lehdereferencing.
04:15 Lada u dei u hash, ngi donkam ban pass ia u key ha ki curly braces.
04:20 Lada u dei uarray, ngi donkam ban pyndonkam ia ki square brackets bad ki index values.
04:26 return function jong ka Perl ka pynphai ia u value.
04:29 Ia kane lah ban pyndonkam ha ka ban check ia ka status jong kafunction ha ka main program.
04:36 Ka function kaba bud kadei ka write underscore daily underscore report.
04:40 Kane ka function kan print ia ka report output sha ka file.
04:45 Ka open function ryngkat u greater than (>) symbol ka thew ia u WRITE mode.
04:50 Ka filename lah shna ryngkat bad ka kyrteng u weekday bad dot txt extension.
04:56 Ka print statements kan print ia ka data ba bud jong ka week day ba lah ai, sha ka file.
05:02 Kane kan print ia ka weekly report.
05:05 Nga lah declared ia ka foreach loop ban loop ia man ki weekday jong ka hash reference.
05:11 Nga lah pyndonkam ia ki curly brackets ban mihkhmat ia u hash reference bad u arrow operator ban dereference.
05:18 Nga lah pyndonkam ia ki “keys” in-built function ban loop lyngba ki keys jong u hash.
05:23 display underscore daily underscore report function kan print man u element jong uhash.
05:30 Mynta, to ngin ia peit ia ka Perl program, weather underscore report dot pl ha kaba ngin pyndonkam ia kane ka module file Weather dot pm.
05:40 Hangne, use strict bad use warnings kidei ki compiler flags kiba iarap ban iada na ka jingbakla ha ka common programming.
05:48 use Weather semicolon. Hangne, Weather kadei ka kyrteng jong ka module kaba nga lah pyndonkam ha kane ka program.
05:56 Ngi lah dep iohi ba ka functions kaba donkam na ka bynta kane ka program lah buh ha kane ka module.
06:03 Kam long kaba donkam ban ai ia u dot pm file extension hangne.
06:08 Ha kane ka program, ngan print ia ki reports ba iapher katkum ki options ba lah ai.
06:14 U nongpyndonkam udei ban pyndap ia ki options ban print:

Ia ka weather report ba man ka sngi jong kawei ka week day Weather report ba man ka sngi jong kawei ka week day sha ka output file Weather report bashi taiew.

06:27 Lada lah type ia ka option '1', kan sa pan na u user ban pyndap ia ka sngi jong ka taiew.
06:32 U diamond operator un sa read na ka STDIN, kata, na ka keyboard.
06:38 Kum ka nuksa, lada u user u pyndap 'monday', te ka assigned sha u variable dollar day option, uba dei u local variable.
06:47 Hadien kane, ngi lah ban iohi ba ngi ia call ia ar tylli ki functions-

display_header() bad display_daily_report().

06:56 Ngi lah export baroh ki functions ha kaWeather dot pm ryngkat ka “use Weather” statement ha kane ka file.
07:03 Te ym donkam ban peit ia ka functions hapoh ka package da kaba pyndonkam colon colon (::)package qualifier
07:10 Mynta to ngin ia peit ia ka option kaba bud.
07:13 Lada lah type ia ka opton '2', kan sa prompt ia u user ban pyndap ia ka sngi jong ka taiew.
07:19 $dayoption lah pass kum ka input parameter sha ka function write underscore daily underscore report.
07:27 return value na ka function lah buh ha ka variable dollar result.
07:33 Ka Print statement ka ong ia u user ban check ia ka text file na ka bynta ka output.
07:38 Ka filename ka lah shna ryngkat ka sngi jong ka taiew dot txt kum ka output file.
07:46 Lada lah type ia ka options '3', kan print ia ka weather report na ka bynta baroh ki sngi jong ka taiew.
07:51 display underscore weekly underscore report kadei ka kyrteng ka function jong ka weekly report.
07:57 Kane ka print statement kan dro ia u lain ba thiah na ka bynta katta sien ba lah kdew.
08:02 Kane kadei tang ban ai ia ka dur ba itynad jong ka report.
08:06 Khatduh, lada ka option kadei 4, kan sa iehnoh ia ka program.
08:11 Lada kano kano ka option palat ban ia kaba la kdew ka ai, ka print statement kan ong “Incorrect option”.
08:19 Hangne, ka exit value jong u '0', ka kdew ba ka program ka treikam pura.
08:25 Ka exit value lait na u '0' kamut ba ka jingbakla jong kano re kano kamih.
08:31 Mynta, to ngin ia execute ia ka program.
08:34 Phai sha ka terminal bad type perl weather underscore report dot pl bad shon Enter.
08:41 Ngi lah ban iohi saw tylli ki options ha ka screen.
08:45 Type '1 ' bad shon Enter.
08:48 Ngi lah shah prompt ban pyndap ia ka sngi jong ka taiew. Ngan type "monday" bad shon Enter.
08:56 Kane kadei ka header output ba lah sei na ka function display underscore header().
09:02 Mynta, ngi lah ban iohi ia ka weather report jong Monday.
09:06 Mynta, ngan execute ia ka program sa shisien ban batai sa ia kiwei ki options.
09:13 Type 2 bad shon Enter.
09:17 Ha ka prompt, ngi hap ban type kano kano ka sngi jong ka taiew. Ngan type "Wednesday" bad shon Enter.
09:25 Ngi lah ban iohi ia ka khubor: "Please check the file wednesday dot txt for report output".
09:32 Ka output ka lah thoh sha kane ka text file. To ngin ia plie ia ka file bad check ia ki contents.
09:38 Type: gedit wednesday dot txt bad shon Enter.
09:44 Ka output file ka lah shna ryngkat ka kyrteng jong ka week day ba lah pyndap, bad ka 'txt' extension.
09:51 Mynta, to ngin check ia ka option kaba bud.
09:54 Phai sha ka terminal bad type: perl weather underscore report dot pl bad shon Enter.
10:00 Type '3' bad shon Enter.
10:04 Ha kane kapor, ngi lah ban iohi ia ka weekly weather report.
10:08 Ki hash keys bad hash values lah buh ha ka random order.
10:13 Te, ka output ba lah pyni kam don jingiadei bad ka order ha kaba lah pyndap ia ki.
10:19 Da kane, ngi lah poi sha kaba kut jong kane ka jinghikai. To ngin ia batai kyllum.
10:24 Ha kane ka jinghikai, ngi lah iohi ia ka sample Perl program da kaba ngi iaid lyngba ia ki mat ba kongsan jong ki jinghikai ba hashwa.
10:32 Kum ka kam na ka bynta jongphi, thoh ia kaPerl program ba ia syriem employee underscore report.pl na ka bynta ban pyni ia ka employee salary, designation, department, leave_balance
10:45 Pass Employee ID lane Employee name kum ka input.
10:50 Thoh ia ka functions ba donkam ha ka module Employee dot pm file.
10:56 Ka video ha ka link harum ka batai kyllum ia ka spoken tutorial. Sngewbha download bad peit ia ka.
11:03 Ngi pynlong ia ki worshops bad ai certificates sha kito kiba pass ha ka online tests jong ngi. Na ka bynta ki jingtip ba bniah, sngewbha thoh sha ngi.
11:12 Ia ka Spoken Tutorial project la bei tyngka da ka NMEICT, MHRD, Sorkar India. Kham bun ki jingtip halor kane ka mission kidon ha kane ka link.
11:25 Ma nga u Pdiangburom na Shillong, nga pynkut ia kane. Khublei shibun.

Contributors and Content Editors

Pdiangburom