On Thu, Dec 20, 2001 at 11:22:16AM +0800, Leon wrote:
> Coming to the point, put qutoes on 'i am fred flintstone' and thats what
> you want; like this :-
> while ( < 'i am fred flintstone' >)
>
> -- results I got from your script after putting quotes ---
> matched: |i am |
So you're sugg
Like Michael Fowler wrote, the angle operators, when used like this,
glob file names. But since you don't have any special patterns it's
just returning the list of filenames from inside the '<' and '>'. If
you do a
print "$_\n";
inside the while loop you'll see that the strings hitting the
- Original Message -
From: "Michael Fowler" <[EMAIL PROTECTED]>
To: "Egor Brandt" <[EMAIL PROTECTED]>
> On Wed, Dec 19, 2001 at 10:14:00PM +0100, Egor Brandt wrote:
> > #!/usr/bin/perl -w
> > while ( < i am fred flintstone >) {
>
> The text between the angle brackets is not what you're
> No, that's some mutation by the original poster. We never suggest
> that, or even suggest it might work. I don't know why people end up
> doing that occasionally... it baffles me. I suppose it's like an
> experienced carpenter watching an apprentice beat a nail in with a
> screwdriver. "I wou
Normally when I hit reply, I will see the greater sign > on the original
post, but this time it is not there and I do not know how to set up the
outlook express. I will try to experiment with the outlook express later.
Sorry about that.
Coming to the point, put qutoes on 'i am fred flintstone
> "Michael" == Michael Fowler <[EMAIL PROTECTED]> writes:
Michael> I was referring to what the original text is trying to do,
Michael> not what his variation parses into. Are you saying Learning
Michael> Perl is using the glob operator to get a string to iterate
Michael> over? I wouldn't th
On Wed, Dec 19, 2001 at 03:25:15PM -0800, John W. Krahn wrote:
> Michael Fowler wrote:
> >
> > On Wed, Dec 19, 2001 at 10:14:00PM +0100, Egor Brandt wrote:
> > > #!/usr/bin/perl -w
> > > while ( < i am fred flintstone >) {
> >
> > The text between the angle brackets is not what you're matchi
Michael Fowler wrote:
>
> On Wed, Dec 19, 2001 at 10:14:00PM +0100, Egor Brandt wrote:
> > #!/usr/bin/perl -w
> > while ( < i am fred flintstone >) {
>
> The text between the angle brackets is not what you're matching against;
> it's either a filehandle that you're reading from, or a globbin
On Wed, Dec 19, 2001 at 10:14:00PM +0100, Egor Brandt wrote:
> #!/usr/bin/perl -w
> while ( < i am fred flintstone >) {
The text between the angle brackets is not what you're matching against;
it's either a filehandle that you're reading from, or a globbing pattern to
match files against in t
HI!
Studying 'Learning Perl, 3rd edition' I was stopped, suddenly, by C. 8's Exercise 1,
using the pattern_test program.
the following works fine:
#!/usr/bin/perl -w
while (< alfred >) {
if (/fred/) {
print "matched: |$`<$&>$'|\n";
} else {
print "no match.\n";
}
}
but when I try the followi
10 matches
Mail list logo