develooper Front page | perl.beginners | Postings from February 2012

Re: Use of uninitialized value within %dict in concatenation (.) orstring at

Thread Previous | Thread Next
From:
lina
Date:
February 18, 2012 19:56
Subject:
Re: Use of uninitialized value within %dict in concatenation (.) orstring at
Message ID:
CAG9cJm=byU1WChjNHsqOzcxvo9kpjddd6XLXdRpaqFfrWSejdw@mail.gmail.com
On Sun, Feb 19, 2012 at 3:34 AM, Shawn H Corey <shawnhcorey@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-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About