hak0983 has asked for the wisdom of the Perl Monks concerning the following question:

Hiya, im having slight trouble with some code. I need the number typed into the entry area to be the line that my parser stops at. Here is what i have, but it doesnt seem to work. Any ideas? Cheers
#TextAreA my $mw1= $mw->Scrolled("Text")->pack(); #line entry my $mw2= $mw->Scrolled("Entry", -text=>"Start at line" -command => [ \&parser8, $mw1 ]) ->pack(-side=>'bottom'); my $grammar = q { start: open text close open: "/*" text: /[\w|\s|\d]+/ close: "*/" }; my $parser = Parse::RecDescent->new($grammar); if ( defined( $parser->start( $text1->get( "1.0", "$mw2")))) { print "NO ERROR\n"; } else { print "ERROR\n"; } }

Replies are listed 'Best First'.
Re: Entry Get line start problem!
by zentara (Cardinal) on Mar 28, 2005 at 20:26 UTC
    I'm not an expert with Parse::RecDescent, but I can't figure out what you are trying to do in your code. It would really be nice if you could post a small , but complete script which demonstrates your problem. From what I can decipher, you are not getting anything from $mw2(Entry)? Maybe:
    $parser->start( $text1->get( "1.0", "$mw2"))) #should be more like $parser->start( $text1->get( "1.0", $mw2->get() ))
    But I've never tried deeply nesting method calls of different widgets.

    I'm not really a human, but I play one on earth. flash japh