Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 636 lines (439 sloc) 11.948 kB
f16111a @szabgab add two more raw files
authored
1 0:00:04.340,0:00:07.590
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
2 Hi! Welcome again to the channel and this time
f16111a @szabgab add two more raw files
authored
3
4 0:00:07.590,0:00:10.319
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
5 I am going to start a tutorial for Perl
f16111a @szabgab add two more raw files
authored
6
7 0:00:10.319,0:00:13.439
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
8 ... or probably call it a tutorial for Modern Perl
f16111a @szabgab add two more raw files
authored
9
10 0:00:13.439,0:00:16.869
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
11 even though 'Modern' is a buzzword
f16111a @szabgab add two more raw files
authored
12
13 0:00:16.869,0:00:18.249
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
14 but
f16111a @szabgab add two more raw files
authored
15
16 0:00:18.249,0:00:20.510
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
17 it also has a meaning here.
f16111a @szabgab add two more raw files
authored
18
19 0:00:20.510,0:00:22.199
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
20 Well, trying to show
f16111a @szabgab add two more raw files
authored
21
22 0:00:22.199,0:00:25.039
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
23 stuff that at least
f16111a @szabgab add two more raw files
authored
24
25 0:00:25.039,0:00:29.429
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
26 ... that needs modern version of Perl that was
27 released in the last couple of years
f16111a @szabgab add two more raw files
authored
28
29 0:00:29.429,0:00:32.970
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
30 based on perl 5.010 probably.
f16111a @szabgab add two more raw files
authored
31
32 0:00:32.970,0:00:36.020
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
33 There should be this book here;
f16111a @szabgab add two more raw files
authored
34
c06c75d @alanhaggai Remove line 'if u'
alanhaggai authored
35 0:00:36.020,0:00:39.790
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
36 so there it is; this book
f16111a @szabgab add two more raw files
authored
37
38 0:00:39.790,0:00:41.370
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
39 'Modern Perl', it is called
f16111a @szabgab add two more raw files
authored
40
41 0:00:41.370,0:00:47.200
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
42 and I would not follow this book, obviously I
43 will follow my
f16111a @szabgab add two more raw files
authored
44
45 0:00:47.200,0:00:49.230
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
46 training material that I have been using
f16111a @szabgab add two more raw files
authored
47
48 0:00:49.230,0:00:52.780
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
49 with the slight differences because the format is
50 different
f16111a @szabgab add two more raw files
authored
51
52 0:00:52.780,0:00:54.370
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
53 for the training
f16111a @szabgab add two more raw files
authored
54
55 0:00:54.370,0:00:57.990
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
56 but I really recommend to two buy this book or you
57 can actually download it
f16111a @szabgab add two more raw files
authored
58
59 0:00:57.990,0:00:59.280
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
60 free of charge as PDF.
f16111a @szabgab add two more raw files
authored
61
62 0:00:59.280,0:01:02.580
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
63 If you cannot afford it
f16111a @szabgab add two more raw files
authored
64
65 0:01:02.580,0:01:06.120
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
66 you do not want to invest money in it, go ahead and
67 download it;
f16111a @szabgab add two more raw files
authored
68
69 0:01:06.120,0:01:08.170
70 will show the link
71
72 0:01:08.170,0:01:11.310
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
73 somewhere later on
f16111a @szabgab add two more raw files
authored
74
75 0:01:11.310,0:01:12.409
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
76 anyway ...
f16111a @szabgab add two more raw files
authored
77
78 0:01:12.409,0:01:15.979
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
79 the book is really good and I recommend you
f16111a @szabgab add two more raw files
authored
80
81 0:01:15.979,0:01:16.990
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
82 read it
f16111a @szabgab add two more raw files
authored
83
84 0:01:16.990,0:01:21.690
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
85 even though it is not really a tutorial or not
86 really a basic learning book.
f16111a @szabgab add two more raw files
authored
87
88 0:01:21.690,0:01:25.830
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
89 So let us see what we are going to use. We are
90 going to use
f16111a @szabgab add two more raw files
authored
91
92 0:01:25.830,0:01:28.850
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
93 the Strawberry Perl distribution.
f16111a @szabgab add two more raw files
authored
94
95 0:01:28.850,0:01:30.859
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
96 Actually a derivative of the Strawberry Perl
97 distribution
f16111a @szabgab add two more raw files
authored
98
99 0:01:30.859,0:01:32.360
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
100 Padre
f16111a @szabgab add two more raw files
authored
101
102 0:01:32.360,0:01:34.520
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
103 on Strawberry package.
f16111a @szabgab add two more raw files
authored
104
105 0:01:34.520,0:01:38.080
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
106 We are going to use that though we could actually
107 use any version of
f16111a @szabgab add two more raw files
authored
108
109 0:01:38.080,0:01:39.180
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
110 perl for this
f16111a @szabgab add two more raw files
authored
111
112 0:01:39.180,0:01:42.060
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
113 but this just makes it easier
f16111a @szabgab add two more raw files
authored
114
115 0:01:42.060,0:01:45.240
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
116 The first thing we do is go to the website of
f16111a @szabgab add two more raw files
authored
117
118 0:01:45.240,0:01:47.950
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
119 Padre (http://padre.perlide.org/)
f16111a @szabgab add two more raw files
authored
120
121 0:01:47.950,0:01:49.220
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
122 here you can see it
f16111a @szabgab add two more raw files
authored
123
124 0:01:49.220,0:01:52.890
e9420b6 @wesjdj Correct the English transcription.
wesjdj authored
125 click on the download link
f16111a @szabgab add two more raw files
authored
126
127 0:01:52.890,0:01:56.630
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
128 scroll down a little bit. There is a link to
129 download the latest version of
f16111a @szabgab add two more raw files
authored
130
131 0:01:56.630,0:01:58.890
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
132 Padre on Strawberry.
f16111a @szabgab add two more raw files
authored
133
134 0:01:58.890,0:02:00.050
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
135 This includes
f16111a @szabgab add two more raw files
authored
136
137 0:02:00.050,0:02:03.350
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
138 both the perl compiler/interpreter
f16111a @szabgab add two more raw files
authored
139
140 0:02:03.350,0:02:05.049
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
141 and
f16111a @szabgab add two more raw files
authored
142
143 0:02:05.049,0:02:09.069
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
144 an open environment (an editor basically) which is
145 called Padre
f16111a @szabgab add two more raw files
authored
146
147 0:02:09.069,0:02:14.370
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
148 and lots of modules that you are going to need for
149 the development.
f16111a @szabgab add two more raw files
authored
150
151 0:02:14.370,0:02:16.459
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
152 So, I recommend to download this one
f16111a @szabgab add two more raw files
authored
153
154 0:02:16.459,0:02:20.879
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
155 Double click on it and follow the instructions
f16111a @szabgab add two more raw files
authored
156
157 0:02:20.879,0:02:21.849
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
158 install it.
f16111a @szabgab add two more raw files
authored
159
160 0:02:21.849,0:02:23.599
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
161 Once you install it, you will have,
f16111a @szabgab add two more raw files
authored
162
163 0:02:23.599,0:02:25.160
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
164 in the start menu
f16111a @szabgab add two more raw files
authored
165
166 0:02:25.160,0:02:27.089
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
167 if you go to 'All Programs'
f16111a @szabgab add two more raw files
authored
168
169 0:02:27.089,0:02:31.309
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
170 'Strawberry Perl' and click on the butterfly
171 (here the blue one)
f16111a @szabgab add two more raw files
authored
172
173 0:02:31.309,0:02:34.969
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
174 which is opening the IDE.
f16111a @szabgab add two more raw files
authored
175
176 0:02:34.969,0:02:37.349
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
177 Once you have opened the IDE,
f16111a @szabgab add two more raw files
authored
178
179 0:02:37.349,0:02:40.799
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
180 here you have the empty space to type text.
f16111a @szabgab add two more raw files
authored
181
182 0:02:40.799,0:02:43.799
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
183 What we are going to do is
f16111a @szabgab add two more raw files
authored
184
185 0:02:43.799,0:02:49.019
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
186 go to the 'File' menu option and 'New' (the second
187 'New' here) and click on
f16111a @szabgab add two more raw files
authored
188
189 0:02:49.019,0:02:50.639
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
190 'Perl 5 Script'.
f16111a @szabgab add two more raw files
authored
191
192 0:02:50.639,0:02:54.789
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
193 This will generate a Perl 5 script for you.
f16111a @szabgab add two more raw files
authored
194
195 0:02:54.789,0:02:58.469
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
196 I will explain the parts later.
f16111a @szabgab add two more raw files
authored
197
198 0:02:58.469,0:03:03.109
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
199 What you need to do is type in:
f16111a @szabgab add two more raw files
authored
200
201 0:03:03.109,0:03:04.629
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
202 print "hello world\n";
f16111a @szabgab add two more raw files
authored
203
204 0:03:04.629,0:03:06.889
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
205 This is the standard thing
f16111a @szabgab add two more raw files
authored
206
207 0:03:06.889,0:03:11.839
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
208 and then we have to save it because it is an
209 unsaved file. Without saving the
f16111a @szabgab add two more raw files
authored
210
211 0:03:11.839,0:03:13.299
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
212 editor cannot run it.
f16111a @szabgab add two more raw files
authored
213
214 0:03:13.299,0:03:18.879
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
215 So we save it
f16111a @szabgab add two more raw files
authored
216
217 0:03:18.879,0:03:21.849
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
218 (let us say we call it, hello world, 'hw.pl').
f16111a @szabgab add two more raw files
authored
219
220 0:03:21.849,0:03:25.309
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
221 Let us save it.
f16111a @szabgab add two more raw files
authored
222
223 0:03:25.309,0:03:29.569
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
224 Once I save it, I can run it via 'Run' -> 'Run
225 Script' or pressing F5.
f16111a @szabgab add two more raw files
authored
226
227 0:03:29.569,0:03:30.709
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
228 It will bring a window,
f16111a @szabgab add two more raw files
authored
229
230 0:03:30.709,0:03:32.629
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
231 a popup window,
f16111a @szabgab add two more raw files
authored
232
233 0:03:32.629,0:03:35.329
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
234 and you will see 'hello world' printed.
f16111a @szabgab add two more raw files
authored
235
236 0:03:35.329,0:03:39.129
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
237 'Press any key continue . . .': This is something
238 that Windows adds
f16111a @szabgab add two more raw files
authored
239
240 0:03:39.129,0:03:43.409
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
241 in order to let us see the actual output otherwise
242 it would
f16111a @szabgab add two more raw files
authored
243
244 0:03:43.409,0:03:44.640
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
245 close immediately
f16111a @szabgab add two more raw files
authored
246
247 0:03:44.640,0:03:48.039
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
248 this window and we would not see the output.
f16111a @szabgab add two more raw files
authored
249
250 0:03:48.039,0:03:50.839
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
251 So, just press some key and you are good;
f16111a @szabgab add two more raw files
authored
252
253 0:03:50.839,0:03:53.579
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
254 you can go on.
f16111a @szabgab add two more raw files
authored
255
256 0:03:53.579,0:03:57.659
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
257 So, that is a basic example to write a really
258 simple Perl script;
f16111a @szabgab add two more raw files
authored
259
260 0:03:57.659,0:03:59.380
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
261 let us go over these parts.
f16111a @szabgab add two more raw files
authored
262
263 0:03:59.380,0:04:03.949
e9420b6 @wesjdj Correct the English transcription.
wesjdj authored
264 So the first line is called a ‘shebang’. It is
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
265 mostly used for Unix systems
f16111a @szabgab add two more raw files
authored
266
267 0:04:03.949,0:04:08.739
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
268 but it does not matter even if you put it on a
269 Windows machine.
f16111a @szabgab add two more raw files
authored
270
271 0:04:08.739,0:04:10.229
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
272 So it does not really matter.
f16111a @szabgab add two more raw files
authored
273
274 0:04:10.229,0:04:12.110
e9420b6 @wesjdj Correct the English transcription.
wesjdj authored
275 use 5.6;
f16111a @szabgab add two more raw files
authored
276
277 0:04:12.110,0:04:14.849
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
278 This means that
f16111a @szabgab add two more raw files
authored
279
280 0:04:14.849,0:04:16.799
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
281 when you run the script
f16111a @szabgab add two more raw files
authored
282
283 0:04:16.799,0:04:20.169
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
284 it will check first if your perl is at least
f16111a @szabgab add two more raw files
authored
285
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
286 0:04:20.169,0:04:24.830
287 5.6 version.
f16111a @szabgab add two more raw files
authored
288
289 0:04:24.830,0:04:29.590
e9420b6 @wesjdj Correct the English transcription.
wesjdj authored
290 This is actually a very ancient version of
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
291 perl,
f16111a @szabgab add two more raw files
authored
292
293 0:04:29.590,0:04:32.209
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
294 the 5.6 version,
f16111a @szabgab add two more raw files
authored
295
296 0:04:32.209,0:04:36.389
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
297 so, we are going to use a newer one and we are
298 going to require a newer one.
f16111a @szabgab add two more raw files
authored
299
300 0:04:36.389,0:04:39.739
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
301 So I change this to: use 5.010;
f16111a @szabgab add two more raw files
authored
302
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
303 0:04:39.739,0:04:46.510
304 Specifically, this one will also enable a couple
305 of new features in the language.
f16111a @szabgab add two more raw files
authored
306
307 0:04:46.510,0:04:51.679
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
308 use strict; and use warnings; are two additional,
f16111a @szabgab add two more raw files
authored
309
310 0:04:51.679,0:04:53.470
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
311 basically compiler flags,
f16111a @szabgab add two more raw files
authored
312
313 0:04:53.470,0:04:56.639
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
314 that make the perl
f16111a @szabgab add two more raw files
authored
315
316 0:04:56.639,0:04:57.949
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
317 interpreter work
f16111a @szabgab add two more raw files
authored
318
319 0:04:57.949,0:04:59.169
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
320 slightly differently,
f16111a @szabgab add two more raw files
authored
321
322 0:04:59.169,0:05:00.699
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
323 in a more strict way, and
f16111a @szabgab add two more raw files
authored
324
325 0:05:00.699,0:05:02.919
326 to provide you warnings
327
328 0:05:02.919,0:05:04.729
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
329 in order to avoid
f16111a @szabgab add two more raw files
authored
330
331 0:05:04.729,0:05:05.389
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
332 certain
f16111a @szabgab add two more raw files
authored
333
334 0:05:05.389,0:05:10.290
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
335 issues. So I would recommend everytime for every
336 script to start with these three
f16111a @szabgab add two more raw files
authored
337
338 0:05:10.290,0:05:11.110
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
339 entries;
f16111a @szabgab add two more raw files
authored
340
341 0:05:11.110,0:05:14.050
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
342 the shebang is not that important for us.
f16111a @szabgab add two more raw files
authored
343
344 0:05:14.050,0:05:16.080
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
345 Then once we have the;
f16111a @szabgab add two more raw files
authored
346
347 0:05:16.080,0:05:20.440
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
348 what you can see here is that 'print' the keyword
349 of Perl,
f16111a @szabgab add two more raw files
authored
350
351 0:05:20.440,0:05:24.340
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
352 any string is going to be between quotes;
f16111a @szabgab add two more raw files
authored
353
354 0:05:24.340,0:05:27.360
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
355 here we put them in between double quotes
f16111a @szabgab add two more raw files
authored
356
357 0:05:27.360,0:05:29.580
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
358 and backslash 'n' (\n) here
f16111a @szabgab add two more raw files
authored
359
360 0:05:29.580,0:05:30.360
361 means that
362
363 0:05:30.360,0:05:31.750
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
364 when it is printed out
f16111a @szabgab add two more raw files
authored
365
366 0:05:31.750,0:05:33.259
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
367 it will be
f16111a @szabgab add two more raw files
authored
368
369 0:05:33.259,0:05:35.449
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
370 printing a newline at the end.
f16111a @szabgab add two more raw files
authored
371
372 0:05:35.449,0:05:38.930
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
373 As you can see, the statement ends with a
f16111a @szabgab add two more raw files
authored
374
375 0:05:38.930,0:05:40.469
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
376 semicolon here.
f16111a @szabgab add two more raw files
authored
377
378 0:05:40.469,0:05:43.430
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
379 Because I used ...
f16111a @szabgab add two more raw files
authored
380
381 0:05:43.430,0:05:45.169
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
382 I require already 5.010,
f16111a @szabgab add two more raw files
authored
383
384 0:05:45.169,0:05:46.940
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
385 it already adds a new future
f16111a @szabgab add two more raw files
authored
386
387 0:05:46.940,0:05:51.800
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
388 to the language that did not exist earlier. So, I
389 can remove the 'print' and instead of
f16111a @szabgab add two more raw files
authored
390
391 0:05:51.800,0:05:53.180
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
392 that, write 'say'
f16111a @szabgab add two more raw files
authored
393
394 0:05:53.180,0:05:56.069
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
395 and then I can eliminate also the newline;
f16111a @szabgab add two more raw files
authored
396
397 0:05:56.069,0:05:58.960
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
398 and if I press F5 now,
f16111a @szabgab add two more raw files
authored
399
400 0:05:58.960,0:06:02.340
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
401 it already saves the file and prints it out,
f16111a @szabgab add two more raw files
authored
402
403 0:06:02.340,0:06:04.800
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
404 so you will see the result of the new version,
f16111a @szabgab add two more raw files
authored
405
406 0:06:04.800,0:06:06.939
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
407 and see it is the same.
f16111a @szabgab add two more raw files
authored
408
409 0:06:06.939,0:06:09.219
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
410 It still works.
f16111a @szabgab add two more raw files
authored
411
412 0:06:09.219,0:06:12.929
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
413 So, you do not have to type so much if you use
414 5.010
f16111a @szabgab add two more raw files
authored
415
416 0:06:12.929,0:06:15.889
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
417 and you can use the 'say' keyword, you do not have
418 to add the newline.
f16111a @szabgab add two more raw files
authored
419
420 0:06:15.889,0:06:20.429
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
421 That is fine but we would like to have some
422 interaction with the outside world.
f16111a @szabgab add two more raw files
authored
423
424 0:06:20.429,0:06:24.460
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
425 So, let us say, let us ask the user 'what
f16111a @szabgab add two more raw files
authored
426
427 0:06:24.460,0:06:26.340
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
428 is his name'.
f16111a @szabgab add two more raw files
authored
429
430 0:06:26.340,0:06:29.789
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
431 'What is your name?'.
f16111a @szabgab add two more raw files
authored
432
433 0:06:29.789,0:06:31.969
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
434 So, we are going to ask the person.
f16111a @szabgab add two more raw files
authored
435
436 0:06:31.969,0:06:35.979
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
437 Then we will need to get the information from the
438 user.
f16111a @szabgab add two more raw files
authored
439
440 0:06:35.979,0:06:40.049
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
441 So, I define a new variable (the first variable we
442 have)
f16111a @szabgab add two more raw files
authored
443
444 0:06:40.049,0:06:41.629
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
445 which is called '$name'.
f16111a @szabgab add two more raw files
authored
446
447 0:06:41.629,0:06:44.449
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
448 I used the 'my' keyword to define it.
f16111a @szabgab add two more raw files
authored
449
450 0:06:44.449,0:06:49.389
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
451 To declare a variable, '$' (dollar) is always the
452 prefix of every scalar variable.
f16111a @szabgab add two more raw files
authored
453
454 0:06:49.389,0:06:50.409
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
455 Well
f16111a @szabgab add two more raw files
authored
456
457 0:06:50.409,0:06:52.050
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
458 in this case,
f16111a @szabgab add two more raw files
authored
459
460 0:06:52.050,0:06:54.270
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
461 the name of the variable is '$name',
f16111a @szabgab add two more raw files
authored
462
463 0:06:54.270,0:06:55.030
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
464 and then
f16111a @szabgab add two more raw files
authored
465
466 0:06:55.030,0:06:58.579
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
467 we use
f16111a @szabgab add two more raw files
authored
468
469 0:06:58.579,0:07:00.020
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
470 this operator,
f16111a @szabgab add two more raw files
authored
471
472 0:07:00.020,0:07:04.169
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
473 which is reading from the standard input (from the
474 keyboard)
f16111a @szabgab add two more raw files
authored
475
476 0:07:04.169,0:07:05.819
e9420b6 @wesjdj Correct the English transcription.
wesjdj authored
477 one line until
f16111a @szabgab add two more raw files
authored
478
479 0:07:05.819,0:07:06.680
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
480 the user
f16111a @szabgab add two more raw files
authored
481
482 0:07:06.680,0:07:07.849
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
483 presses 'Enter'.
f16111a @szabgab add two more raw files
authored
484
485 0:07:07.849,0:07:11.050
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
486 So, the result will go into this $ variable called
f16111a @szabgab add two more raw files
authored
487
488 0:07:11.050,0:07:14.029
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
489 '$name' and then we would like to print it out
f16111a @szabgab add two more raw files
authored
490
491 0:07:14.029,0:07:15.800
e9420b6 @wesjdj Correct the English transcription.
wesjdj authored
492 so we say 'hello'
f16111a @szabgab add two more raw files
authored
493
494 0:07:15.800,0:07:19.059
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
495 and we add '$name'.
f16111a @szabgab add two more raw files
authored
496
497 0:07:19.059,0:07:23.639
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
498 As you can see you can embed variables into
499 strings and it will be
f16111a @szabgab add two more raw files
authored
500
501 0:07:23.639,0:07:26.419
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
502 printed out.
f16111a @szabgab add two more raw files
authored
503
504 0:07:26.419,0:07:29.160
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
505 Let us continue this example.
f16111a @szabgab add two more raw files
authored
506
507 0:07:29.160,0:07:31.270
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
508 Let us run this example now.
f16111a @szabgab add two more raw files
authored
509
510 0:07:31.270,0:07:32.470
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
511 So I press F5.
f16111a @szabgab add two more raw files
authored
512
513 0:07:32.470,0:07:37.599
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
514 It asks me what my name is,
f16111a @szabgab add two more raw files
authored
515
516 0:07:37.599,0:07:40.610
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
517 so I type in say ... 'foo', press 'Enter' and it
518 will tell me 'hello foo'.
f16111a @szabgab add two more raw files
authored
519
520 0:07:40.610,0:07:42.549
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
521 That is great so far.
f16111a @szabgab add two more raw files
authored
522
523 0:07:42.549,0:07:48.509
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
524 Now let us be a bit more polite and let us ask
525 'How
f16111a @szabgab add two more raw files
authored
526
527 0:07:48.509,0:07:51.020
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
528 are you?'.
f16111a @szabgab add two more raw files
authored
529
530 0:07:51.020,0:07:56.739
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
531 Let us go on with this. I press F5, it asks my
532 name,
f16111a @szabgab add two more raw files
authored
533
534 0:07:56.739,0:07:58.459
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
535 still called 'foo';
f16111a @szabgab add two more raw files
authored
536
537 0:07:58.459,0:08:01.080
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
538 and when it prints out, you see that
f16111a @szabgab add two more raw files
authored
539
540 0:08:01.080,0:08:04.120
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
541 after 'foo', it prints out a newline
f16111a @szabgab add two more raw files
authored
542
543 0:08:04.120,0:08:06.629
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
544 and only then the ',' (comma).
f16111a @szabgab add two more raw files
authored
545
546 0:08:06.629,0:08:09.279
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
547 Why is that?
f16111a @szabgab add two more raw files
authored
548
549 0:08:09.279,0:08:13.289
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
550 So, when we printed, when we typed in the response
551 'foo'
f16111a @szabgab add two more raw files
authored
552
553 0:08:13.289,0:08:15.819
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
554 we had to press 'Enter' in order to
f16111a @szabgab add two more raw files
authored
555
556 0:08:15.819,0:08:17.059
557 tell the
558
559 0:08:17.059,0:08:20.520
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
560 Windows and Padre Perl that the input ended;
f16111a @szabgab add two more raw files
authored
561
562 0:08:20.520,0:08:24.849
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
563 that the name can be added to the '$name' variable.
f16111a @szabgab add two more raw files
authored
564
565 0:08:24.849,0:08:28.210
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
566 And, we did not remove that newline, so here
f16111a @szabgab add two more raw files
authored
567
568 0:08:28.210,0:08:31.279
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
569 we have the new line and it is printed out
f16111a @szabgab add two more raw files
authored
570
571 0:08:31.279,0:08:35.300
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
572 even though we do not really see in it in this
573 code,
f16111a @szabgab add two more raw files
authored
574
575 0:08:35.300,0:08:37.350
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
576 and because it is such a special case,
f16111a @szabgab add two more raw files
authored
577
578 0:08:37.350,0:08:42.050
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
579 Perl has a special function for it to remove that
580 thing.
f16111a @szabgab add two more raw files
authored
581
582 0:08:42.050,0:08:44.120
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
583 So, I type in 'chomp',
f16111a @szabgab add two more raw files
authored
584
585 0:08:44.120,0:08:47.300
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
586 which is the function to remove a newline
f16111a @szabgab add two more raw files
authored
587
588 0:08:47.300,0:08:51.050
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
589 from the end of a string. I provide the name of a
590 variable.
f16111a @szabgab add two more raw files
authored
591
592 0:08:51.050,0:08:52.500
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
593 This will remove
f16111a @szabgab add two more raw files
authored
594
595 0:08:52.500,0:08:55.510
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
596 the trailing newline from this string
f16111a @szabgab add two more raw files
authored
597
598 0:08:55.510,0:08:57.750
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
599 running the script again,
f16111a @szabgab add two more raw files
authored
600
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
601 0:08:57.750,0:09:01.060
602 am still called 'foo',
f16111a @szabgab add two more raw files
authored
603
604 0:09:01.060,0:09:04.760
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
605 but this time as you can see the newline is gone
606 from there
f16111a @szabgab add two more raw files
authored
607
608 0:09:04.760,0:09:06.910
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
609 and it is working fine.
f16111a @szabgab add two more raw files
authored
610
611 0:09:06.910,0:09:09.860
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
612 I think that is enough for the first
f16111a @szabgab add two more raw files
authored
613
614 0:09:09.860,0:09:11.200
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
615 tutorial.
f16111a @szabgab add two more raw files
authored
616
617 0:09:11.200,0:09:14.150
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
618 There are some exercises going to be
f16111a @szabgab add two more raw files
authored
619
620 0:09:14.150,0:09:15.170
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
621 in the
f16111a @szabgab add two more raw files
authored
622
623 0:09:15.170,0:09:19.270
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
624 blog that is associated with this
f16111a @szabgab add two more raw files
authored
625
626 0:09:19.270,0:09:20.450
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
627 screencast.
f16111a @szabgab add two more raw files
authored
628
629 0:09:20.450,0:09:24.680
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
630 Please follow the link below and you will find
631 exercises, you can
f16111a @szabgab add two more raw files
authored
632
633 0:09:24.680,0:09:26.910
12e0894 @alanhaggai Update English transcript for Modern Perl Tutorial #1
alanhaggai authored
634 play with them and I hope to see in the next
635 chapter. Bye bye.
Something went wrong with that request. Please try again.