in reply to Passing values to external packages

The difference is the quotes around W3C::STRING. It's a function call in your first snippet, and a string literal in the second.

By the way, using <c>...</c> around code to post is an easy way to handle posting code on PerlMonks. It saves you from putting all the line breaks and escaping characters such as <.

Replies are listed 'Best First'.
Re^2: Passing values to external packages
by genyded (Novice) on Oct 05, 2007 at 15:56 UTC
    That makes complete sense! Thanks for the fast response and advice on posting tags.
    It gets a bit more complicated now because I need to append the value of a variable coming from an XML file to part of the function call value as follows:
    #... $value = $verify->{content}; #string value pulled from XML file ($valu +e = STRING) $wc3_type = W3C::.$value #will not work
    How can I append the scalar $value to the function call without it being a quoted value?

    TIA AGAIN!
      You could use a lookup table.
      my %validators = ( string => W3C::STRING, ... ); my $type = $verify->{content}; my $validator = $validators{lc($type)}; if (!defined($validator) || !dvalid($search, $validator)) { die }
Re^2: Passing values to external packages
by genyded (Novice) on Oct 05, 2007 at 16:58 UTC
    Well - more code than I had hope to write for this, but it works wonderfully. Thanks for the quick and helpful responses.