-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlearningperl5.pl
29 lines (22 loc) · 1.05 KB
/
learningperl5.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl
use strict;
use warnings;
# this will take the options from command line argument. instead of getting input from the keyboard, it comes from the user choice of input.
# while (defined(my $line = <>)) {
# chomp($line);/,<,/,,,,,,,,,,,,,<<<<<<<<<<,,,,,,,,,,,,,,,,,,/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////;'b0o/;.o99i.i i
# print "I saw $line\n";
# }
# Simpler way of writing the above.
while(<>) {
chomp;
print "It was $_ that i saw\n";
}
# this will take the options from std input. foreach example and print it in a list contxt. which means it will take the arguments first and then print it..
# foreach (<STDIN>) {
# print "foreach i saw $_\n";
# }
# this will take the option from std input. while example. it will be done in line by line, which mean it will print for ever input given on the STDIN.
# while (defined($_ = <STDIN>)) {
# print "while i saw $_\n";
# }
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccc