---
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.*
