David Gilden wrote:
Hello,
Hello,
In the following I was thinking it would just print out: "Hello"
#!/usr/bin/perl -w
$S = "Hello, Perl!";
($R) = grep {/\w+/} $S;
grep() filters lists so if an element of the list on the right contains \w+ it
will be passed through to the left but other elements wi
David Gilden wrote:
Hello,
In the following I was thinking it would just print out: "Hello"
#!/usr/bin/perl -w
$S = "Hello, Perl!";
($R) = grep {/\w+/} $S;
print "$R\n";
I am trying for some sort of inline filtering so I can do the following:
#!/usr/bin/perl -w
use CGI qw/:standard/;
use strict;