# class IO::Path::Win32

IO::Path pre-loaded with IO::Spec::Win32

## method perl

Defined as:

Returns a string that, when given passed through EVAL gives the original invocant back.

## (IO::Path) method dirname

Defined as:

Returns the directory name portion of the path object. That is, it returns the path excluding the volume and the base name. Unless the dirname consist of only the directory separator (i.e. it's the top directory), the trailing directory separator will not be included in the return value.

## (IO::Path) method volume

Defined as:

Returns the volume portion of the path object. On Unix system, this is always the empty string.

## (IO::Path) method parts

Defined as:

Returns a Map with the keys volume, dirname, basename whose values are the same as available via methods .volume, .dirname, and .basename respectively.

## (IO::Path) method perl

Defined as:

Returns a string that, when given passed through EVAL gives the original invocant back.

## (IO::Path) method succ

Defined as:

Returns a new IO::Path constructed from the invocant, with .basename changed by calling Str.succ on it.

## (IO::Path) method open

Defined as:

Opens the path as a file; the named options control the mode, and are the same as the open function accepts.

## (IO::Path) method pred

Defined as:

Returns a new IO::Path constructed from the invocant, with .basename changed by calling Str.pred on it.

## (IO::Path) method watch

Defined as:

Equivalent to calling IO::Notification.watch-path with the invocant as the argument.

## (IO::Path) method is-absolute

Defined as:

Returns True if the path is an absolute path, and False otherwise.

Note that on Windows a path that starts with a slash or backslash is still considered absolute even if no volume was given, as it is absolute for that particular volume:

## (IO::Path) method is-relative

Defined as:

Returns True if the path is a relative path, and False otherwise. Windows caveats for .is-absolute apply.

Defined as:

## (IO::Path) method spurt

Defined as:

Opens the file path for writing, and writes all of the $data into it. Will fail if it cannot succeed for any reason. The $data can be any Cool type or any Blob type. Arguments are as follows:

• :$enc — character encoding of the data. Takes same values as :$enc in IO::Handle.open. Defaults to utf8. Ignored if $data is a Blob. • :$append — open the file in append mode, preserving existing contents, and appending data to the end of the file.

## (IO::Path) sub mkdir

Defined as:

Creates a new directory, including its parent directories, as needed (similar to *nix utility mkdir with -p option). That is, mkdir "foo/bar/ber/meow" will create foo, foo/bar, and foo/bar/ber directories as well if they do not exist.

Returns the IO::Path object pointing to the newly created directory on success; fails with X::IO::Mkdir if directory cannot be created.

See also mode for explanation and valid values for $mode. ## (IO::Path) routine rmdir Defined as: Remove the invocant, or in sub form, all of the provided directories in the given list, which can contain any Cool object. Only works on empty directories. Method form returns True on success and throws an exception of type X::IO::Rmdir if the directory cannot be removed (e.g. the directory is not empty, or the path is not a directory). Subroutine form returns a list of directories that were successfully deleted. To delete non-empty directory, see rmtree in File::Directory::Tree module. ## (IO::Path) method chmod Defined as: Changes the POSIX permissions of a file or directory to $mode. Returns True on success; on failure, fails with X::IO::Chmod.

The mode is expected as an integer following the standard numeric notation, and is best written as an octal number:

Make sure you don't accidentally pass the intended octal digits as a decimal number (or string containing a decimal number):

## (IO::Path) routine rename

Defined as:

Renames a file or directory. Returns True on success; fails with X::IO::Rename if :$createonly is True and the $to path already exists or if the operation failed for some other reason.

Note: some renames will always fail, such as when the new name is on a different storage device. See also: move.

## (IO::Path) routine copy

Defined as:

Copies a file. Returns True on success; fails with X::IO::Copy if :$createonly is True and the $to path already exists or if the operation failed for some other reason, such as when $to and $from are the same file.

## (IO::Path) routine move

Defined as:

Copies a file and then removes the original. If removal fails, it's possible to end up with two copies of the file. Returns True on success; fails with X::IO::Move if :$createonly is True and the $to path already exists or if the operation failed for some other reason, such as when $to and $from are the same file.

To avoid copying, you can use rename, if the files are on the same storage device. It also works with directories, while move does not.

## (IO::Path) method Numeric

Defined as:

Coerces .basename to Numeric. Fails with X::Str::Numeric if base name is not numerical.

## (IO::Path) method Int

Defined as:

Coerces .basename to Int. Fails with X::Str::Numeric if base name is not numerical.

Defined as:

Create a new symbolic link $link to existing $target. Returns True on success; fails with X::IO::Symlink if the symbolic link could not be created. If $target does not exist, creates a dangling symbolic link. To create a hard link, see link. Note: on Windows, creation of symbolic links may require escalated privileges. Defined as: Create a new hard link $link to existing $target. Returns True on success; fails with X::IO::Link if the hard link could not be created. To create a symbolic link, see symlink. Defined as: Delete all specified ordinary files, links, or symbolic links for which there are privileges to do so. See rmdir to delete directories. The subroutine form returns the names of all the files in the list, excluding those for which the filesystem raised some error; since trying to delete a file that does not exist does not raise any error at that level, this list will include the names of the files in the list that do not exist. The method form returns True on success, or fails with X::IO::Unlink if the operation could not be completed. If the file to be deleted does not exist, the routine treats it as success. ## (IO::Path) method IO Defined as: Returns the invocant. ## (IO::Path) method SPEC Defined as: Returns the IO::Spec object that was (implicitly) specified at object creation time. ## (IO::Path) method modified Returns an Instant object indicating when the content of the file was last modified. Compare with changed. ## (IO::Path) method accessed Return an Instant object representing the timestamp when the file was last accessed. Note: depending on how the filesystem was mounted, the last accessed time may not update on each access to the file, but only on the first access after modifications. ## (IO::Path) method changed Returns an Instant object indicating the metadata of the file or directory was last changed (e.g. permissions, or files created/deleted in directory). Compare with modified. ## (IO::Path) method mode Return an IntStr object representing the POSIX permissions of a file. The Str part of the result is the octal representation of the file permission, like the form accepted by the chmod(1) utility. The result of this can be used in the other methods that take a mode as an argument. # Routines supplied by role IO IO::Path::Win32 inherits from class IO::Path, which does role IO, which provides the following routines: ## (IO) sub mkdir Defined as: Creates a new directory; see mode for explanation and valid values for $mode. Returns the IO::Path object pointing to the newly created directory on success; fails with X::IO::Mkdir if directory cannot be created.

Also creates parent directories, as needed (similar to *nix utility mkdir with -p option); that is, mkdir "foo/bar/ber/meow" will create foo, foo/bar, and foo/bar/ber directories if they do not exist, as well as foo/bar/ber/meow.

## (IO) sub chdir

Defined as:

Changes value of $*CWD variable to the provided $path, optionally ensuring the new path passes several file tests. NOTE: that this routine does NOT alter the process's current directory (see &*chdir).

## (IO) sub indir

Defined as:

Takes Callable &code and executes it after locally (to &code) changing $*CWD variable to an IO::Path object based on $path, optionally ensuring the new path passes several file tests. If $path is relative, it will be turned into an absolute path, even if an IO::Path object was given. NOTE: that this routine does NOT alter the process's current directory (see &*chdir). The $*CWD outside of the &code is not affected, even if &code explicitly assigns a new value to $*CWD. Returns the return value of &code on success. On failure to successfully change $*CWD, returns Failure. WARNING: keep in mind that lazily evaluated things might end up NOT having the $*CWD set by indir in their dynamic scope by the time they're actually evaluated. Either ensure the generators have their $*CWD set or eagerly evaluate them before returning the results from indir:

The routine's $path argument can be any object with an IO method that returns an IO::Path object. The available file tests are: • :d — check .d returns True • :r — check .r returns True • :w — check .w returns True • :x — check .x returns True • By default, only :d test is performed. ## (IO) sub print Defined as: Prints the given text on standard output (the $*OUT filehandle), coercing non-Str objects to Str by calling .Str method. Junction arguments autothread and the order of printed strings is not guaranteed.

To print text and include the trailing newline, use put.

## (IO) sub put

Defined as:

Same as print, except it uses print-nl (which prints a newline, by default) at the end. Junction arguments autothread and the order of printed strings is not guaranteed.

## (IO) sub say

Defined as:

Prints the "gist" of given objects. Same as put, except uses .gist method to obtain string representation of the object.

NOTE: the .gist method of some objects, such as Lists, returns only partial information about the object (hence the "gist"). If you mean to print textual information, you most likely want to use put instead.

Defined as:

## (IO) sub slurp

Defined as:

Slurps the contents of the entire file into a Str (or Buf if :bin). Accepts :bin and :enc optional named parameters, with the same meaning as open(); possible encodings are the same as in all the other IO methods and are listed in encoding routine. The routine will fail if the file does not exist, or is a directory. Without any arguments, sub slurp operates on $*ARGFILES, which defaults to $*IN in the absence of any filenames.

## (IO) sub spurt

Defined as:

The $path can be any object with an IO method that returns an IO::Path object. Calls IO::Path.spurt on the $path, forwarding any of the remaining arguments.

### Options

• :enc

• The encoding with which the contents will be written.

• :append

• Boolean indicating whether to append to a (potentially) existing file. If the file did not exist yet, it will be created. Defaults to False.

• :createonly

• Boolean indicating whether to fail if the file already exists. Defaults to False.

## (IO) sub shell

Runs a command through the system shell, which defaults to %*ENV<ComSpec> /c in Windows, /bin/sh -c otherwise. All shell meta characters are interpreted by the shell, including pipes, redirects, environment variable substitutions and so on. Shell escapes are a severe security concern and can cause confusion with unusual file names. Use run if you want to be safe.

The return value is of type Proc.

See Proc for more details, for example on how to capture output.

# Routines supplied by class Cool

IO::Path::Win32 inherits from class Cool, which provides the following routines:

## (Cool) routine abs

Defined as:

Coerces the invocant (or in the sub form, the argument) to Numeric and returns the absolute value (that is, a non-negative number).

## (Cool) method conj

Defined as:

Coerces the invocant to Numeric and returns the complex conjugate (that is, the number with the sign of the imaginary part negated).

## (Cool) routine sqrt

Defined as:

Coerces the invocant to Numeric (or in the sub form, the argument) and returns the square root, that is, a non-negative number that, when multiplied with itself, produces the original number.

## (Cool) method sign

Defined as:

Coerces the invocant to Numeric and returns its sign, that is, 0 if the number is 0, 1 for positive and -1 for negative values.

## (Cool) method rand

Defined as:

Coerces the invocant to Num and returns a pseudo-random value between zero and the number.

## (Cool) routine sin

Defined as:

Coerces the invocant (or in the sub form, the argument) to Numeric, interprets it as radians, returns its sine.

Note that Perl 6 is no computer algebra system, so sin(pi) typically does not produce an exact 0, but rather a very small floating-point number.

## (Cool) routine asin

Defined as:

Coerces the invocant (or in the sub form, the argument) to Numeric, and returns its arc-sine in radians.

## (Cool) routine cos

Defined as:

Coerces the invocant (or in sub form, the argument) to Numeric, interprets it as radians, returns its cosine.

## (Cool) routine acos

Defined as:

Coerces the invocant (or in sub form, the argument) to Numeric, and returns its arc-cosine in radians.

## (Cool) routine tan

Defined as:

Coerces the invocant (or in sub form, the argument) to Numeric, interprets it as radians, returns its tangent.

## (Cool) routine atan

Defined as:

Coerces the invocant (or in sub form, the argument) to Numeric, and returns its arc-tangent in radians.

## (Cool) routine atan2

Defined as:

Coerces the arguments (including the invocant in the method form) to Numeric, and returns their two-argument arc-tangent in radians.

## (Cool) routine sec

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, interprets it as radians, returns its secant, that is, the reciprocal of its cosine.

## (Cool) routine asec

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its arc-secant in radians.

## (Cool) routine cosec

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, interprets it as radians, returns its cosecant, that is, the reciprocal of its sine.

## (Cool) routine acosec

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its arc-cosecant in radians.

## (Cool) routine cotan

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, interprets it as radians, returns its cotangent, that is, the reciprocal of its tangent.

## (Cool) routine acotan

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its arc-cotangent in radians.

## (Cool) routine sinh

Defined as:

Coerces the invocant (or in method form, its argument) to Numeric, and returns its Sine hyperbolicus.

## (Cool) routine asinh

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its Inverse Sine hyperbolicus.

## (Cool) routine cosh

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its Cosine hyperbolicus.

## (Cool) routine acosh

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its Inverse Cosine hyperbolicus.

## (Cool) routine tanh

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, interprets it as radians and returns its Tangent hyperbolicus.

## (Cool) routine atanh

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its Inverse tangent hyperbolicus.

## (Cool) routine sech

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its Secant hyperbolicus.

## (Cool) routine asech

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its Inverse hyperbolic secant.

## (Cool) routine cosech

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its Hyperbolic cosecant.

## (Cool) routine acosech

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its Inverse hyperbolic cosecant.

## (Cool) routine cotanh

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its Hyperbolic cotangent.

## (Cool) routine acotanh

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns its Inverse hyperbolic cotangent.

## (Cool) routine cis

Defined as:

Coerces the invocant (or in sub form, its argument) to Numeric, and returns cos(argument) + i*sin(argument).

Defined as:

Coerces the arguments (including the invocant in the method form) to Numeric, and returns its Logarithm to base $base, or to base e (Euler's Number) if no base was supplied (Natural logarithm). Returns NaN if $base is negative. Throws an exception if $base is 1. ## (Cool) routine log10 Defined as: Coerces the invocant (or in the sub form, the invocant) to Numeric, and returns its Logarithm to base 10, that is, a number that approximately produces the original number when raised to the power of 10. Returns NaN for negative arguments and -Inf for 0. ## (Cool) routine exp Defined as: Coerces the arguments (including the invocant in the method from) to Numeric, and returns $base raised to the power of the first number. If no $base is supplied, e (Euler's Number) is used. ## (Cool) method unpolar Defined as: Coerces the arguments (including the invocant in the method form) to Numeric, and returns a complex number from the given polar coordinates. The invocant (or the first argument in sub form) is the magnitude while the argument (i.e. the second argument in sub form) is the angle. The angle is assumed to be in radians. ## (Cool) routine round Defined as: Coerces the invocant (or in sub form, its argument) to Numeric, and rounds it to the unit of $unit. If $unit is 1, rounds to the nearest integer. Always rounds up if the number is at mid-point: Pay attention to types when using this method, as ending up with the wrong type may affect the precision you seek to achieve. For Real types, the type of the result is the type of the argument (Complex argument gets coerced to Real, ending up a Num). If rounding a Complex, the result is Complex as well, regardless of the type of the argument. ## (Cool) routine floor Defined as: Coerces the invocant (or in sub form, its argument) to Numeric, and rounds it downwards to the nearest integer. ## (Cool) method fmt Defined as: Equivalent to calling sprintf with $format as format and the invocant as the second argument. The $format will be coerced to Stringy and defaults to '%s' ## (Cool) routine ceiling Defined as: Coerces the invocant (or in sub form, its argument) to Numeric, and rounds it upwards to the nearest integer. ## (Cool) routine truncate Defined as: Coerces the invocant (or in sub form, its argument) to Numeric, and rounds it towards zero. ## (Cool) routine ord Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns the Unicode code point number of the first code point. The inverse operation is chr. Mnemonic: returns an ordinal number ## (Cool) method path Defined as: DEPRECATED. Existed only in the Rakudo implementation and isn't part of any language released. Will issue deprecation warnings in future language versions and eventually will be removed entirely. Stringifies the invocant and converts it to IO::Path object. Use the .IO method instead. ## (Cool) routine chr Defined as: Coerces the invocant (or in sub form, its argument) to Int, interprets it as a Unicode code points, and returns a string made of that code point. The inverse operation is ord. Mnemonic: turns an integer into a character. ## (Cool) routine chars Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns the number of characters in the string. Please note that on the JVM, you currently get codepoints instead of graphemes. Graphemes are user visible characters. That is, this is what the user thinks of as a “character”. Graphemes can contain more than one codepoint. Typically the number of graphemes and codepoints differs when Prepend or Extend characters are involved (also known as Combining characters), but there are many other cases when this may happen. Another example is \c[ZWJ] (Zero-width joiner). You can check Grapheme_Cluster_Break property of a character in order to see how it is going to behave: You can read more about graphemes in the Unicode Standard, which Perl 6 tightly follows, using a method called NFG, normal form graphemes for efficiently representing them. ## (Cool) routine codes Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns the number of Unicode code points. The same result will be obtained with ords first obtains the actual codepoints, so there might be a difference in speed. ## (Cool) routine flip Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns a reversed version. ## (Cool) routine trim Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns the string with both leading and trailing whitespace stripped. ## (Cool) routine trim-leading Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns the string with leading whitespace stripped. ## (Cool) routine trim-trailing Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns the string with trailing whitespace stripped. ## (Cool) routine lc Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns it case-folded to lower case. ## (Cool) routine uc Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns it case-folded to upper case (capital letters). ## (Cool) routine fc Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns the result a Unicode "case fold" operation suitable for doing caseless string comparisons. (In general, the returned string is unlikely to be useful for any purpose other than comparison.) ## (Cool) routine tc Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns it with the first letter case-folded to title case (or where not available, upper case). ## (Cool) routine tclc Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns it with the first letter case-folded to title case (or where not available, upper case), and the rest of the string case-folded to lower case. ## (Cool) routine wordcase Defined as: Coerces the invocant (or in sub form, the first argument) to Str, and filters each word that smartmatches against $where through the &filter. With the default filter (first character to upper case, rest to lower) and matcher (which accepts everything), this title-cases each word:

With a matcher:

With a customer filter too:

## (Cool) routine samecase

Defined as:

Coerces the invocant (or in sub form, the first argument) to Str, and returns a copy of $string with case information for each individual character changed according to $pattern.

Note: The pattern string can contain three types of characters, i.e. uppercase, lowercase and caseless. For a given character in $pattern its case information determines the case of the corresponding character in the result. If $string is longer than $pattern, the case information from the last character of $pattern is applied to the remaining characters of $string. ## (Cool) routine uniprop Defined as: Returns the unicode property of the first character. If no property is specified returns the General Category. Returns a Bool for Boolean properties. ## (Cool) sub uniprops Defined as: Interprets the invocant as a Str, and returns the unicode property for each character as a Seq. If no property is specified returns the General Category. Returns a Bool for Boolean properties. Similar to uniprop ## (Cool) routine uniname Defined as: Interprets the invocant / first argument as a Str, and returns the Unicode codepoint name of the first codepoint of the first character. See uninames for a routine that works with multiple codepoints, and uniparse for the opposite direction. ## (Cool) routine uninames Defined as: Returns of a Seq of Unicode names for the all the codepoints in the Str provided. Note this example, which gets a Seq where each element is a Seq of all the codepoints in that character. See uniparse for the opposite direction. ## (Cool) routine unimatch Defined as: Checks if the given integer codepoint or the first letter of the string given have a unicode property equal to the value you give. If you supply the Unicode property to be checked it will only return True if that property matches the given value. ## (Cool) routine chop Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns it with the last character removed. ## (Cool) routine chomp Defined as: Coerces the invocant (or in sub form, its argument) to Str, and returns it with the last character removed, if it is a logical newline. ## (Cool) routine substr Defined as: Coerces the invocant (or in the sub form, the first argument) to Str, and calls Str.substr with the arguments. ## (Cool) routine substr-rw Defined as: Coerces the invocant (or in the sub form, the first argument) to Str, and calls Str.substr-rw with the arguments. ## (Cool) routine ords Defined as: Coerces the invocant (or in the sub form, the first argument) to Str, and returns a list of Unicode codepoints for each character. This is the list-returning version of ord. The inverse operation in chrs. If you are only interested in the number of codepoints, codes is a possibly faster option. ## (Cool) routine chrs Defined as: Coerces the invocant (or in the sub form, the argument list) to a list of integers, and returns the string created by interpreting each integer as a Unicode codepoint, and joining the characters. This is the list-input version of chr. The inverse operation is ords. ## (Cool) routine split Defined as: [1] Coerces the invocant (or in the sub form, the second argument) to Str, and splits it into pieces based on delimiters found in the string. If $delimiter is a string, it is searched for literally and not treated as a regex. You can also provide multiple delimiters by specifying them as a list; mixing Cool and Regex objects is OK.

By default, split omits the matches, and returns a list of only those parts of the string that did not match. Specifying one of the :k, :v, :kv, :p adverbs changes that. Think of the matches as a list that is interleaved with the non-matching parts.

The :v interleaves the values of that list, which will be either Match objects, if a Regex was used as a matcher in the split, or Str objects, if a Cool was used as matcher. If multiple delimiters are specified, Match objects will be generated for all of them, unless all of the delimiters are Cool.

:k interleaves the keys, that is, the indexes:

:kv adds both indexes and matches:

and :p adds them as Pairs, using the same types for values as :v does:

You can only use one of the :k, :v, :kv, :p adverbs in a single call to split.

Note that empty chunks are not removed from the result list. For that behavior, use the :skip-empty named argument:

## (Cool) routine lines

Defined as:

Coerces the invocant (and in sub form, the argument) to Str, decomposes it into lines (with the newline characters stripped), and returns the list of lines.

This method can be used as part of an IO::Path to process a file line-by-line, since IO::Path objects inherit from Cool, e.g.:

Without any arguments, sub lines operates on $*ARGFILES, which defaults to $*IN in the absence of any filenames.

To modify values in place use is copy to force a writable container.

## (Cool) method words

Defined as:

Coerces the invocant (or first argument, if it is called as a subroutine) to Str, and returns a list of words that make up the string (and if $limit is supplied and is not equal to Inf, only the first $limit words).

Cool is the base class for many other classes, and some of them, like Match, can be converted to a string. This is what happens in this case:

The example above shows the two ways words can be invoked, with the first argument turned into invocant by its signature. Of course, Inf is the default value of the second argument, so in both cases (and forms) it can be simply omited.

Only whitespace (including no-break space) counts as word boundaries

In this case, Perl 6 includes an (visible only in the source) no-break space; words still splits the (resulting) Str on it, even if the original array only had 4 elements:

Please see Str.words for more examples.

Defined as:

Returns all (or if supplied, at most $limit) matches of the invocant (method form) or the second argument (sub form) against the Regex as a list of strings. ## (Cool) method contains Defined as: Coerces the invocant Str, and calls Str.contains on it. Please refer to that version of the method for arguments and general syntax. Since Int is a subclass of Cool, 123 is coerced to a Str and then contains is called on it. Seqs are also subclasses of Cool, and they are stringified to a comma-separated form. In this case we are also using an Int, which is going to be stringified also; "233" is included in that sequence, so it returns True. Please note that this sequence is not lazy; the stringification of lazy sequences does not include each and every one of their components for obvious reasons. ## (Cool) routine index Defined as: Coerces the first two arguments (in method form, also counting the invocant) to Str, and searches for $needle in the string starting from $startpos. It returns the offset into the string where $needle was found, and an undefined value if it was not found.

See the documentation in type Str for examples.

Defined as:

## (Cool) routine roots

Defined as:

Coerces the first argument (and in method form, the invocant) to Numeric and the second ($n) to Int, and produces a list of $n Complex $n-roots, which means numbers that, raised to the $nth power, approximately produce the original number.

For example

## (Cool) method match

Defined as:

Coerces the invocant to Stringy and calls Str.match.

## (Cool) method subst

Defined as:

Coerces the invocant to Stringy and calls Str.subst.

## (Cool) method trans

Defined as:

Coerces the invocant to Str and calls Str.trans

## (Cool) method IO

Defined as:

Coerces the invocant to IO::Path.

Defined as:

## (Cool) routine unpolar

Defined as:

Returns a Complex with the coordinates corresponding to the angle in radians and magnitude corresponding to the object value or \$mag in the case it's being used as a sub

## (Cool) routine printf

Defined as:

As a method, takes the object as a format using the same language as Str.sprintf; as a sub, its first argument will be the format string, and the rest of the arguments will be substituted in the format following the format conventions.

## (Cool) routine sprintf

Defined as:

Formats and outputs a string, following the the same language as Str.sprintf, using as such format either the object (if called in method form) or the first argument (if called as a routine)