[Koha-patches] [PATCH] Bugfix bug #2630

Frédéric DEMIANS f.demians at tamil.fr
Fri Sep 26 17:38:02 CEST 2008


Hi Galen,

>> - my $aisbn = $oldbiblio->{'isbn'};
>> - $aisbn =~ /(\d*[X]*)/;
>> - $oldbiblio->{amazonisbn} = $1;
>> + ($_) = $oldbiblio->{isbn} =~ /([\d-]*[X]*)/;
>> + s/-//g;
>
> Why are you assigning to $_? There's no need to do that, since $foo
> =~ s/-//g works perfectly well.

In UNIMARC this ISBN is valid in a biblio record: 2-84902-162-8XXX (2 ex.).

I want to clean it into: 284902162-8XXX before sending it to Amazon. 
This 2 lines of code are doing that. my $aisbn is not used elsewhere, 
that's the reason why I use $_. This works:

my $t = "2-84902-162-8XXX (2 ex.)";
($_) = $t =~ /([\d-]*[X]*)/;
print "$_\n";
s/-//g;
print "$_\n";


-- 
Frédéric DEMIANS
http://www.tamil.fr/u/fdemians.html



More information about the Koha-patches mailing list