in reply to using Text::Balanced...
#!/usr/bin/perl -w use strict; use Text::Balanced qw ( extract_delimited extract_bracketed extract_quotelike extract_codeblock extract_variable extract_tagged extract_multiple gen_delimited_pat gen_extract_tagged ); my $source = 'Hello World, #name#!'; my ($cfml_expr_match, $next); eval { $cfml_expr_match = gen_delimited_pat(q{#},q{#}); $next = extract_delimited($source, '#','[^#]+','#'); print "There is only one \$@, so Inside my eval, .. got this: $@\n" if + $@; }; if ($@) { print "Hmm.. got this: $@\n"; } else { print "CFML: $cfml_expr_match\n"; print "next: $next\n"; } # some code here... print "\n"; __END__ CFML: (?:\#(?:[^\#]*(?:(?:\#\#)[^\#]*)*)\#) next: #name# ## If I use your '#','','#' params, the error i'd get is inside my eval, Hmm.. got this: Not a delimited pattern, detected at o +ffset 0
| ______crazyinsomniac_____________________________ Of all the things I've lost, I miss my mind the most. perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;" |
|
|---|