Perl Programming - Subroutine Definitions
Perl Programming - Subroutine Definitions
Get the entire Perl Programming course for 20% off: http://stoneriverelearning.com/courses/perl-programming-for-beginners-online-course?product_id=38639&coupon_code=YOUTUBE20
Welcome back, guys! In this lecture, we’re going to be working with subroutine definitions. Again, this is section 5, lecture 2. Let’s jump right into it.
Subroutine definitions. Before I’ll explain all this good stuff about subroutine definitions, we’ve previously had been working with built-in Perl subroutines. For example, the print subroutine which displays information visually on our screen that uses standard output. Again, for you previous programmers out there, instead of the name subroutine, they’re usually called methods or functions in other programming languages such as C, C++, and Java. But in Perl, they’re called subroutines.
What is a subroutine? A subroutine is nothing more again but a group of Perl instructions or statements to carry out a specific task. We’re going to actually define our own subroutines in Perl. In order to do this, we can use the keyword sub followed by the name of the subroutine. The name of the subroutine we still have to follow the rules of the Perl identifier just like defining variables. Then the indented block of code within curly braces. Within the curly braces, that’s where our Perl instructions will go to carry out the task or our Perl statements.
This is a little quick example of what a defined subroutine or user-defined subroutine looks like. Again, we have our keyword sub. Then we have our Perl identifier name or our subroutine name that we can define. I used a mixture of both letters and underscore, so print_name is the name of my subroutine followed by a pair of parentheses. At the bottom, I have my opening and closing curly braces. All I want to do is to carry out an instruction called print. Print is a built-in Perl subroutine as well.
Pretty much in a nutshell that’s the definition of a subroutine. We can define our own subroutines and we can use Perl built-in subroutines as well. If you guys have any questions, please feel free to let me know. I’ll see you guys in our next lecture.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Perl Programming - Subroutine Definitions», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.