INABA Hitoshi > Char-Latin8-0.89 > Elatin8



Annotate this POD

View/Report Bugs
Module Version: 0.89   Source   Latest Release: Char-Latin8-0.92


Elatin8 - Run-time routines for


  use Elatin8;


  # "no Elatin8;" not supported


This module is a run-time routines of the Because the automatically uses this module, you need not use directly.




This Elatin8 module first appeared in ActivePerl Build 522 Built under MSWin32 Compiled at Nov 2 1999 09:52:28


INABA Hitoshi <>






Split string
  @split = Elatin8::split(/pattern/,$string,$limit);
  @split = Elatin8::split(/pattern/,$string);
  @split = Elatin8::split(/pattern/);
  @split = Elatin8::split('',$string,$limit);
  @split = Elatin8::split('',$string);
  @split = Elatin8::split('');
  @split = Elatin8::split();
  @split = Elatin8::split;

  This function scans a string given by $string for separators, and splits the
  are determined by repeated pattern matching, using the regular expression given
  at all, Elatin8::split returns the original string as a single substring, If it

  If $limit is specified and positive, the function splits into no more than that
  is omitted, the function splits the $_ string. If /pattern/ is also omitted or
  is the literal space, " ", the function split on whitespace, /\s+/, after
  skipping any leading whitespace.

  use otherwise.

  String of any length can be split:

  @chars  = Elatin8::split(//,  $word);
  @fields = Elatin8::split(/:/, $line);
  @words  = Elatin8::split(" ", $paragraph);
  @lines  = Elatin8::split(/^/, $buffer);

  wherever it matches the null string between characters; nonnull matches will
  width.) For example:

  print join(":" => Elatin8::split(/ */, "hi there"));

  Elatin8::split's pattern is exempt from that wrinkle.)

  The $limit parameter splits only part of a string:

  my ($login, $passwd, $remainder) = Elatin8::split(/:/, $_, 3);


  returned. Here's a simple example:


  which produces the list value:


  if you say:


  you get the value:


  once, use /$variable/o.

  splits on whitespace just as Elatin8::split with no arguments does. Thus,
  string and to collapse intervaning stretches of whitespace into a single

  $string = join(" ", Elatin8::split(" ", $string));

  The following example splits an RFC822 message header into a hash containing

  %head = ("FRONTSTUFF", Elatin8::split(/^(\S*?):\s*/m, $header));


  open(PASSWD, "/etc/passwd");
  while (<PASSWD>) {
      chomp; # remove trailing newline.

  word-frequency hash.

  while (<>) {
      for my $word (Elatin8::split()) {

  The inverse of Elatin8::split is join, except that join can only join with the
  fields, use unpack.
  $tr = Elatin8::tr($variable,$bind_operator,$searchlist,$replacementlist,$modifier);

  This is the transliteration (sometimes erroneously called translation) operator,
  everybody's humble opinion.

  This function scans a Latin-8 string character by character and replaces all
  occurrences of the characters found in $searchlist with the corresponding character
  If no Latin-8 string is specified via =~ operator, the $_ variable is translated.
  $modifier are:

  Modifier   Meaning
  c          Complement $searchlist.
  d          Delete found but unreplaced characters.
  s          Squash duplicate replaced characters.
  r          Return transliteration and leave the original string untouched.


Chop string
  $chop = Elatin8::chop(@list);
  $chop = Elatin8::chop();
  $chop = Elatin8::chop;

  This function chops off the last character of a string variable and returns the
  character chopped. The Elatin8::chop function is used primary to remove the newline
  since Elatin8::chop always shortens the string no matter what's there, and chomp
  is more selective. If no argument is given, the function chops the $_ variable.

  You cannot Elatin8::chop a literal, only a variable. If you Elatin8::chop a list of
  variables, each string in the list is chopped:

  @lines = `cat myfile`;

  You can Elatin8::chop anything that is an lvalue, including an assignment:

  Elatin8::chop($cwd = `pwd`);
  Elatin8::chop($answer = <STDIN>);

  This is different from:

  $answer = Elatin8::chop($tmp = <STDIN>); # WRONG

  which puts a newline into $answer because Elatin8::chop returns the character
  intended here is with substr:


  But this is more commonly written as:


  In the most general case, Elatin8::chop can be expressed using substr:

  $last_code = Elatin8::chop($var);


  substr($caravan, -5) = '';

  form of substr, creating something of a quintuple Elatin8::chop;


Index string
  $byte_pos = Elatin8::index($string,$substr,$byte_offset);
  $byte_pos = Elatin8::index($string,$substr);

  This function searches for one string within another. It returns the byte position
  based at 0. If the substring is not found, the function returns one less than the

  $byte_pos = -1;
  while (($byte_pos = Elatin8::index($string, $lookfor, $byte_pos)) > -1) {
      print "Found at $byte_pos\n";
Reverse index string
  $byte_pos = Elatin8::rindex($string,$substr,$byte_offset);
  $byte_pos = Elatin8::rindex($string,$substr);

  This function works just like Elatin8::index except that it returns the byte
  position of the last occurrence of $substring in $string (a reverse Elatin8::index).
  The function returns -1 if $substring is not found. $byte_offset, if specified,
  string backward, say:

  $byte_pos = length($string);
  while (($byte_pos = Latin8::rindex($string, $lookfor, $byte_pos)) >= 0) {
      print "Found at $byte_pos\n";
Lower case string
  $lc = Elatin8::lc($string);
  $lc = Elatin8::lc_;

  This function returns a lowercased version of Latin-8 $string (or $_, if
  $string is omitted). This is the internal function implementing the \L escape
  in double-quoted strings.

  You can use the Elatin8::fc function for case-insensitive comparisons via Latin8
Lower case first character of string
  $lcfirst = Elatin8::lcfirst($string);
  $lcfirst = Elatin8::lcfirst_;

  This function returns a version of Latin-8 $string with the first character
  implementing the \l escape in double-quoted strings.
Upper case string
  $uc = Elatin8::uc($string);
  $uc = Elatin8::uc_;

  This function returns an uppercased version of Latin-8 $string (or $_, if
  $string is omitted). This is the internal function implementing the \U escape
  in interpolated strings. For titlecase, use Elatin8::ucfirst instead.

Upper case first character of string
  $ucfirst = Elatin8::ucfirst($string);
  $ucfirst = Elatin8::ucfirst_;

  mapping instead. This is the internal function implementing the \u escape in
  double-quoted strings.

  to lowercase, use:

  $titlecase = Elatin8::ucfirst(substr($word,0,1)) . Elatin8::lc(substr($word,1));



  Do not use:

  $do_not_use = Elatin8::ucfirst(Elatin8::lc($word));

  certain characters. The titlecase of something that's been lowercased doesn't
  always produce the same thing titlecasing the original produces.

  every character in a string.

  See also P.287 A Case of Mistaken Identity
  in Chapter 6: Unicode
Fold case string
  P.860 fc
  in Chapter 27: Functions

  $fc = Elatin8::fc($string);
  $fc = Elatin8::fc_;

  New to Latin8 software, this function returns the full Unicode-like casefold of
  Latin-8 $string (or $_, if omitted). This is the internal function implementing
  the \F escape in double-quoted strings.



  Elatin8::fc($a) eq Elatin8::fc($b)

  modifier, because Latin8 software has always used casefolding semantics for
  comparisons like this:

  sub fc_eq ($$) {
      my($a,$b) = @_;
Make ignore case string
  @ignorecase = Elatin8::ignorecase(@string);

  This function is internal use to m/ /i, s/ / /i, split / /i and qr/ /i.
Make capture number
  $capturenumber = Elatin8::capture($string);

  This function is internal use to m/ /, s/ / /, split / / and qr/ /.
Make character
  $chr = Elatin8::chr($code);
  $chr = Elatin8::chr_;

  This function returns a programmer-visible character, character represented by
  that $code in the character set. For example, Elatin8::chr(65) is "A" in either
  ASCII or Latin-8, not Unicode. For the reverse of Elatin8::chr, use Latin8::ord.
Filename expansion (globbing)
  @glob = Elatin8::glob($string);
  @glob = Elatin8::glob_;

  This function returns the value of $string with filename expansions the way a
  function implementing the <*> and glob operator.
  This function function when the pathname ends with chr(0x5C) on MSWin32.


  of the pattern by perl.

  The Elatin8::glob function grandfathers the use of whitespace to separate multiple
  by an "f", use either of:

  @spacies = <"*e f*">;
  @spacies = Elatin8::glob('"*e f*"');
  @spacies = Elatin8::glob(q("*e f*"));


  @spacies = Elatin8::glob("'*${var}e f*'");
  @spacies = Elatin8::glob(qq("*${var}e f*"));

  Another way on MSWin32

  # relative path

  # absolute path

syntax highlighting: