L
Leor Zolman
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 it
just saying "just const", rather than "*const".
This is a simplification of a much more complex r.e. where I need to detect an
asterisk immediately preceding "const", and it isn't working either.
How am I being brain-dead?
-leor
while (<>)
{
if (/const/)
{
print "just const\n\n";
}
elsif (/\*const/)
{
print "*const\n\n";
}
else
{
print "None.\n";
}
}
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 it
just saying "just const", rather than "*const".
This is a simplification of a much more complex r.e. where I need to detect an
asterisk immediately preceding "const", and it isn't working either.
How am I being brain-dead?
-leor
while (<>)
{
if (/const/)
{
print "just const\n\n";
}
elsif (/\*const/)
{
print "*const\n\n";
}
else
{
print "None.\n";
}
}