
Jasmine
Administrator
/ Moderator
Mar 4, 2002, 10:33 AM
Views: 1430
|
|
Re: [yapp] Split Function (off topic)
|
|
|
[url=http://search.cpan.org/search?dist=YAPE-Regex-Explain]YAPE::Regex::Explain is [ japhy ]'s baby. Here's what I use for the interface -- not pretty, but totally functional [perl]#!/usr/bin/perl use CGI; use YAPE::Regex::Explain; use strict; my $in = CGI->new(); my $regex; my $exp; { local $/; chomp( $regex = $in->param('regex') ) } print $in->header, $in->start_html( -title => 'YAPE' ), $in->start_form( -method => 'post'), $in->textarea( { -cols => '60', -rows => '3', -name => 'regex' } ), $in->submit( -value => 'Explain!' ), $in->end_form, $in->hr; $exp = YAPE::Regex::Explain->new( eval "qr/\$regex/" ); $exp->parse or $exp->error and die "explain error: " . $exp->error; print $in->pre( $exp->explain ), $in->end_html;[/perl] edit: fixed url
(This post was edited by Jasmine on Mar 4, 2002, 7:51 PM)
|