-
Notifications
You must be signed in to change notification settings - Fork 1
/
perl.Rmd
30 lines (22 loc) · 805 Bytes
/
perl.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
title: "Using knitractive with Perl"
author: "Jeroen Janssens"
date: "`r Sys.Date()`"
output: github_document
---
*View the corresponding [perl.Rmd file](https://raw.githubusercontent.com/jeroenjanssens/knitractive/master/vignettes/examples/perl.Rmd) to learn more about how this page was generated.*
```{r setup, include = FALSE}
knitractive::start("perl", rexpect::cmd_docker(image = "rakudo-star:2021.04"), prompt = "^(>|\\*)$")
```
Create a function in Perl.
```{perl}
sub hello($name = "World") {
say "Hello, $name!";
}
```
Use function in a later chunk.
```{perl}
hello();
hello('R Markdown');
```
*View the corresponding [perl.Rmd file](https://raw.githubusercontent.com/jeroenjanssens/knitractive/master/vignettes/examples/perl.Rmd) to learn more about how this page was generated.*