>>>>> "S" == SqlSlinger <> writes:
S> Uri Guttman <> wrote in message news:<>...
>> >>>>> "GJ" == Glenn Jackman <> writes:
>>
>>
GJ> my @vars = qw(VARIABLE_ONE VARIABLE_NUMBER_TWO
GJ> a_really_long_VARIABLE_name);
>>
GJ> foreach (@vars) {
GJ> my $var = ucfirst lc;
GJ> $var =~ s/_(.)/\U$1/g;
GJ> }
>>
>> s/_?(.)([^_]*)/\U$1\L$2/g ;
>>
>> uri
S> Nice and compact, but doesn't isolate only variables containing an
S> underscore. If run against a source file, would match any word,
S> right?
probably but that could be fixed with some guard regex stuff. and it
wasn't in the spec which showed a qw list of tokens. you need to code to
what is posted (unless it is obvious the OP is having an XY problem or
way off base).
uri
--
Uri Guttman ------
--------
http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ----------------------------
http://jobs.perl.org