in reply to regex probs.

your regex works (you can verify this by looking at the contents of $1), but you're not putting it into @template correctly.

try this syntax, which forces the results of the regex into the proper context through the use of the outermost set of parens : @template = ($xtemplate =~ /(.*?)filename.ext\*{4}/s);

Replies are listed 'Best First'.
Re: putting regex results into an array. (boo)
by apprentice (Scribe) on Aug 24, 2001 at 00:24 UTC
    1 - Yes, the regex works fine, but so does all of the code. I.e., I see nothing wrong with the context, but maybe I'm not grokking something. I threw parentheses around the *{4}filename.ext*{4} portion of the regex and it was stored in the array properly, too.

    2 - Perhaps maddfisherman was looking in $template1 instead of $template[0] ?

    apprentice
      One thing I missed the first look, you need to escape the "@template" in the string like this "\@template" else your string, and hence the first element of @template will not have "@template".

      apprentice