Skip to content

Commit 9790bb7

Browse files
authored
Update/add perl answers (iluwatar#197)
* New questions and spell check (iluwatar#181) Added new questions related with KVM, Libvirt and DNF * Add CPAN Perl answers - What is CPAN - How install a CPAN module
1 parent 64f3fc9 commit 9790bb7

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

exercises/perl/README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,47 @@ sub printMethod { print "A\n"; };
600600

601601
<details>
602602
<summary>What is cpan? And cpanm?</summary><br><b>
603+
604+
CPAN is the Comprehensive Perl Archive Network.
605+
606+
CPANM From the official [App::cpanminus](https://metacpan.org/pod/App::cpanminus):
607+
"App::cpanminus - get, unpack, build and install modules from CPAN".
608+
609+
[Find CPAN modules](https://metacpan.org/)
610+
603611
</b></details>
604612

605613
<details>
606-
<summary>How can you install a Perl module?</summary><br><b>
614+
<summary>How can you install cpanm and a Perl module?</summary><br><b>
615+
616+
There are some different alternatives to install Perl modules. We will use `cpanm`.
617+
618+
- Install `cpanm`:
619+
620+
```
621+
$ cpan App::cpanminus
622+
```
623+
624+
- Install the `Test` module with `cpanm`:
625+
626+
```
627+
cpanm Test
628+
```
629+
630+
Now we can test the `Test` installed module:
631+
632+
```
633+
$ perl -M'Test::Simple tests => 1' -e 'ok( 1 + 1 == 2 );'
634+
1..1
635+
ok 1
636+
```
637+
638+
```
639+
$ perl -M'Test::Simple tests => 1' -e 'ok( 1 + 1 == 3 );'
640+
1..1
641+
not ok 1
642+
# Failed test at -e line 1.
643+
# Looks like you failed 1 test of 1.
644+
```
645+
607646
</b></details>

0 commit comments

Comments
 (0)