routine perl

Documentation for routine perl assembled from the following types:

class Junction

From Junction

(Junction) method perl

Defined as:

multi method perl(Junction:D:)

Collapses the Junction and returns a Str composed of perls of its components that evaluates to the equivalent Junction with equivalent components:

<a 42 c>.all.perl.put# OUTPUT: «all("a", IntStr.new(42, "42"), "c")␤»

class Mu

From Mu

(Mu) routine perl

multi method perl(--> Str)

Returns a Perlish representation of the object (i.e., can usually be re-evaluated with EVAL to regenerate the object). The exact output of perl is implementation specific, since there are generally many ways to write a Perl expression that produces a particular value.

class Range

From Range

(Range) method perl

Defined as

multi method perl(Range:D:)

Returns an implementation-specific string that produces an equivalent object when given to EVAL.

say (1..2).perl # OUTPUT: «1..2␤»

class Rat

From Rat

(Rat) method perl

multi method perl(Rat:D: --> Str:D)

Returns an implementation-specific string that produces an equivalent object when given to EVAL.

say (1/3).perl;                # OUTPUT: «<1/3>␤» 
say (2/4).perl;                # OUTPUT: «0.5␤»

class Complex

From Complex

(Complex) method perl

Defined as:

method perl(Complex:D: --> Str:D)

Returns an implementation-specific string that produces an equivalent object when given to EVAL.

say (1-3i).perl;                # OUTPUT: «<1-3i>␤»

class FatRat

From FatRat

(FatRat) method perl

multi method perl(FatRat:D: --> Str:D)

Returns an implementation-specific string that produces an equivalent object when given to EVAL.

say FatRat.new(12).perl# OUTPUT: «FatRat.new(1, 2)␤»

class IO::Path

From IO::Path

(IO::Path) method perl

Defined as:

method perl(IO::Path:D: --> Str:D)

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

"foo/bar".IO.perl.say;
# OUTPUT: IO::Path.new("foo/bar", :SPEC(IO::Spec::Unix), :CWD("/home/camelia"))

Note that this string includes the value of the .CWD attribute that is set to $*CWD when the path object was created, by default.

class IO::Path::QNX

From IO::Path::QNX

(IO::Path::QNX) method perl

Defined as:

method perl(IO::Path::QNX:D: --> Str:D)

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

IO::Path::QNX.new("foo/bar").perl.say;
# OUTPUT: IO::Path::QNX.new("foo/bar", :CWD("/home/camelia"))

Note that this string includes the value of the .CWD attribute that is set to $*CWD when the path object was created, by default.

class IO::Path::Unix

From IO::Path::Unix

(IO::Path::Unix) method perl

Defined as:

method perl(IO::Path::Unix:D: --> Str:D)

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

IO::Path::Unix.new("foo/bar").perl.say;
# OUTPUT: IO::Path::Unix.new("foo/bar", :CWD("/home/camelia"))

Note that this string includes the value of the .CWD attribute that is set to $*CWD when the path object was created, by default.

class IO::Path::Win32

From IO::Path::Win32

(IO::Path::Win32) method perl

Defined as:

method perl(IO::Path::Win32:D: --> Str:D)

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

IO::Path::Win32.new("foo/bar").perl.say;
# OUTPUT: IO::Path::Win32.new("foo/bar", :CWD("C:\\Users\\camelia"))

Note that this string includes the value of the .CWD attribute that is set to $*CWD when the path object was created, by default.

class IO::Path::Cygwin

From IO::Path::Cygwin

(IO::Path::Cygwin) method perl

Defined as:

method perl(IO::Path::Cygwin:D: --> Str:D)

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

IO::Path::Cygwin.new("foo/bar").perl.say;
# OUTPUT: IO::Path::Cygwin.new("foo/bar", :CWD("/home/camelia"))

Note that this string includes the value of the .CWD attribute that is set to $*CWD when the path object was created, by default.