NAME

Business::ISRC - Perl extension for manipulating International Standard Recording Code (ISRC)

SYNOPSIS

  use Business::ISRC;

  # create object (validate string)
  my $isrc = Business::ISRC->new("usl4q0702458")
      or die "invalid isrc format";

  $isrc->country_code;    # US
  $isrc->country_name;    # Unites States
  $isrc->registrant_code; # L4Q
  $isrc->year; # 07
  $isrc->designation_code; # 02458

  # get normalized string
  print $isrc; # US-L4Q-07-02458

  # or this is the same as above
  print $isrc->as_string();

DESCRIPTION

This module provides data container for ISRC. ISRC is an unique code for identifying sound recordings and music videos internationally. You can use this to validate or normalize ISRC strings.

visit ifpi site for details of ISRC definition:

ISRC Handbook(HTML) http://www.ifpi.org/content/section_resources/isrc_handbook.html

ISRC FORMAT

ISRC string is made up for these five parts:

  sample: US-L4Q-07-02458

  name  letters desc
  -------------------------------------
  ISRC  (4)   - prefix (omittable)
  US    (2)   - country code (ISO 3166-1-Alpha-2)
  L4Q   (3)   - registrant code. case insensitive.
  07    (2)   - year (1980=>80, 2012=>12)
  02458 (5)   - designation code, track serial number.

ACCESSOR

all accessors are created by mk_ro_accessors of Class::Accessor::Fast. so all fields are read-only.

  raw_string       # first argument of new()
  country_code
  country_name
  registrant_code
  year
  designation_code

you can get value like this:

  my $rc = $isrc->registrant_code;

METHOD

new()

Construct Business::ISRC object. return if failed to parse given ISRC string. if the name for the given country code in ISRC was not found in Locale::Country module, new() also return (nothing).

as_string()

return normalized string. you can specify these options:

  my $str = $isrc->as_string(
      add_prefix => 1, # add "ISRC-" prefix
      no_dash    => 1, # delete dash from string
  );

as_default_string()

  same as as_string() with no option.

SEE ALSO

Business::UPC

AUTHOR

Nakano Kyohei (bonar) <bonamonchy@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2008 by nakano kyohei (bonar)

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.