CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [yapp] Split Function (off topic): Edit Log



Jasmine
Administrator / Moderator

Mar 4, 2002, 10:33 AM


Views: 2868
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 Smile

[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)


Edit Log:
Post edited by Jasmine (Administrator) on Mar 4, 2002, 7:51 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives