Re: inline GREP filter...

2005-05-17 Thread John W. Krahn
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

Re: inline GREP filter...

2005-05-17 Thread Philip M. Gollucci
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;

inline GREP filter...

2005-05-17 Thread David Gilden
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; my $page =