in reply to accessor/mutator with AUTOLOAD

    $AUTOLOAD =~ s/${pkg}::([^(?:::)]+)$/$1/; Woops. Extended regex syntax does not work inside a character class. (It wouldn't be a character class if it did.) [^(?:::)] will match any single character that is not an open paren, a question mark, a colon, or a close paren.

It looks like you're trying to match a sequence of characters that does not include two colons in a row. This should work: s/${pkg}::((?:[^:]+|:(?!:))+)$/$1/; But I wonder if a simpler substitution would be more appropriate here: s/${pkg}:://;

Replies are listed 'Best First'.
Re: Re: accessor/mutator with AUTOLOAD
by rpc (Monk) on Jan 18, 2001 at 00:30 UTC
    You're right. Thanks for pointing that out.