L
Leor Zolman
(Sorry, I posted this in comp.lang.perl first before a different
newsreader showed me the existence of this sub-group; there seems to
be more activity here.)
I'm probably going to feel really stupid when I see the answer, but
I'm now stuck nevertheless... I need to match a leading literal '*',
and Perl isn't getting the idea. Reading from standard input, typing
"const" into the program below yields "just const" as expected, but
typing "*const" ALSO results in "just const", rather than "*const" as
I would have hoped.
This is a simplification of a much more complex r.e. where I need to
detect an asterisk immediately preceding "const" in the middle of the
r.e., and it isn't working there either.
How am I being brain-dead?
-leor
while (<>)
{
if (/const/)
{
print "just const\n\n";
}
elsif (/\*const/) # should match leading literal '*', no???
{
print "*const\n\n";
}
else
{
print "None.\n";
}
}
newsreader showed me the existence of this sub-group; there seems to
be more activity here.)
I'm probably going to feel really stupid when I see the answer, but
I'm now stuck nevertheless... I need to match a leading literal '*',
and Perl isn't getting the idea. Reading from standard input, typing
"const" into the program below yields "just const" as expected, but
typing "*const" ALSO results in "just const", rather than "*const" as
I would have hoped.
This is a simplification of a much more complex r.e. where I need to
detect an asterisk immediately preceding "const" in the middle of the
r.e., and it isn't working there either.
How am I being brain-dead?
-leor
while (<>)
{
if (/const/)
{
print "just const\n\n";
}
elsif (/\*const/) # should match leading literal '*', no???
{
print "*const\n\n";
}
else
{
print "None.\n";
}
}