On Sun, Feb 19, 2012 at 3:34 AM, Shawn H Corey <shawnhco...@gmail.com> wrote:
> On 12-02-18 11:40 AM, lina wrote:
>>>>
>>>> >>      elsif ( $xpm_file =~ /^"(\S+)[",]$/) {
>>
>> Are there some possibilities that something can be done for the part [",]?
>>
>> Make it recognize both end with " or ",
>
>
>  elsif( $xmp_file =~ /^\"([A-Za-z]+)\"\,?$/ ){
>    my $keys = $1;
>    my @result = ();
>    for my $key ( $keys =~ /(.)/g ){
>      if( defined( $dict{$key} )){
>        push @result, $dict{$key};
>      }
>    }
>    $xmp_file = join( q{ }, @result );


Thanks, I spent some time to get understanding.


        elsif ( $xpm_file =~ /^\"([A-Za-z]+)\"\,?$/) {
                $xpm_file =~ s/([A-Za-z])/$dict{$1}/g;
                $xpm_file =~ s/[",]//g;
                print $xpm_file;
                }
}

can below be done in perl,

$x =~ {s/a/b/g; s/c/d/g }

put several together,

thanks

>
>  }
>
>
> --
> Just my 0.00000002 million dollars worth,
>  Shawn
>
> Programming is as much about organization and communication
> as it is about coding.
>
> It's Mutual Aid, not fierce competition, that's the dominate
> force of evolution.  Of course, anyone who has worked in
> open source already knows this.
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to