diff options
Diffstat (limited to 'perl.html.markdown')
-rw-r--r-- | perl.html.markdown | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/perl.html.markdown b/perl.html.markdown index 08001ab0..88185e9d 100644 --- a/perl.html.markdown +++ b/perl.html.markdown @@ -8,9 +8,9 @@ contributors: - ["Dan Book", "http://github.com/Grinnz"] --- -Perl 5 is a highly capable, feature-rich programming language with over 25 years of development. +Perl is a highly capable, feature-rich programming language with over 25 years of development. -Perl 5 runs on over 100 platforms from portables to mainframes and is suitable for both rapid prototyping and large scale development projects. +Perl runs on over 100 platforms from portables to mainframes and is suitable for both rapid prototyping and large scale development projects. ```perl # Single line comments start with a number sign. @@ -217,6 +217,12 @@ open(my $log, ">>", "my.log") or die "Can't open my.log: $!"; my $line = <$in>; my @lines = <$in>; +# You can iterate through the lines in a file one at a time with a while loop: + +while (my $line = <$in>) { + print "Found apples\n" if $line =~ m/apples/; +} + # You can write to an open filehandle using the standard "print" # function. |