Skip to content

Commit

Permalink
Update installation notes and stubs for older versions of Perl (#674)
Browse files Browse the repository at this point in the history
* Update INSTALLATION description
  • Loading branch information
m-dango authored Jun 17, 2024
1 parent 0d7e51f commit c435e9c
Show file tree
Hide file tree
Showing 69 changed files with 141 additions and 6 deletions.
2 changes: 1 addition & 1 deletion concepts/packages-and-modules/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Symbols in the package's `@EXPORT` array will be imported by default.
Symbols in the package's `@EXPORT_OK` array must be imported explicitly.

Before Perl `v5.37`, a module would have to end in a true value (usually `1`) to indicate the module had loaded successfully.
This is no longer necessary when using the [`module_true`][module_true] feature.
This is not necessary when using the [`module_true`][module_true] feature.

## Exporting

Expand Down
2 changes: 1 addition & 1 deletion concepts/packages-and-modules/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Symbols in the package's `@EXPORT` array will be imported by default.
Symbols in the package's `@EXPORT_OK` array must be imported explicitly.

Before Perl `v5.37`, a module would have to end in a true value (usually `1`) to indicate the module had loaded successfully.
This is no longer necessary when using the [`module_true`][module_true] feature.
This is not necessary when using the [`module_true`][module_true] feature.

## Exporting

Expand Down
15 changes: 13 additions & 2 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# Installation

## Perl Version Notes
The track targets the latest stable release of Perl, but it is possible to use versions of Perl as old as 5.20.
If you are unable to use the version specified in the stub files, it is recomended to replace `use v5.XX;` with the following code:

```perl
use strict;
use warnings;
use feature qw<signatures>;
```

## Unix/Linux/Mac OSX
Perl is likely already installed. Run `perl -v` to check which version you have.
If your version is older than v5.20, or you would like to try out newer versions of Perl, take a look at 'Other Options'.
Perl is likely already installed, however it is possible that this may not be the latest version.
Run `perl -v` to check which version you have.
If you wish to use a later version, check the 'Other Options' section.

If you are using Fedora/Red Hat/CentOS, some core modules are not included with Perl.
Use the `yum install perl-core` command to install them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ sub describe_appointment ($date_string) {
my $time = _parse_datetime($date_string);
return sprintf('You have an appointment on %02d/%02d/%04d %d:%02d %s', 1, 31, 2019, 6, 4, 'PM');
}

1;
2 changes: 2 additions & 0 deletions exercises/concept/high-score-board/lib/HighScoreBoard.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ sub sort_players_by_score {

sub delete_player ($player) {
}

1;
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ sub remove_items ( $inventory, $items ) {
sub delete_item ( $inventory, $item ) {
return $inventory;
}

1;
2 changes: 2 additions & 0 deletions exercises/concept/language-list/lib/LanguageList.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ sub get_languages (@elements) {

sub has_language ($language) {
}

1;
2 changes: 2 additions & 0 deletions exercises/concept/lasagna/lib/Lasagna.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ sub total_time_in_minutes ( $number_of_layers, $actual_minutes_in_oven ) {

sub oven_alarm () {
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/accumulate/lib/Accumulate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<accumulate>;
sub accumulate ( $list, $func ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/all-your-base/lib/AllYourBase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ my @errors = (
sub rebase ( $digits, $input_base, $output_base ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/allergies/lib/Allergies.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ sub allergic_to ( $item, $score ) {
sub list_allergies ($score) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/anagram/lib/Anagram.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<match_anagrams>;
sub match_anagrams ( $subject, $candidates ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/atbash-cipher/lib/AtbashCipher.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ sub encode_atbash ($phrase) {
sub decode_atbash ($phrase) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/binary-search-tree/lib/BinarySearchTree.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ sub add ($self) {
sub sort ($self) {
return [];
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/binary-search/lib/BinarySearch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<binary_search>;
sub binary_search ( $array, $value ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/bob/lib/Bob.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ our @EXPORT_OK = qw<hey>;
sub hey ($msg) {
return undef; # Replace this with your own code to pass the tests.
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/bottle-song/lib/BottleSong.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ my %numbers = (
sub sing ( $bottles, $verses ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/clock/lib/Clock.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ sub add_minutes ( $self, $amount ) {
sub subtract_minutes ( $self, $amount ) {
return $self;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/crypto-square/lib/CryptoSquare.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<cipher>;
sub cipher ($text) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/custom-set/lib/CustomSet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ sub difference ( $self, $other ) {
sub union ( $self, $other ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/darts/lib/Darts.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ our @EXPORT_OK = qw<score_dart>;

sub score_dart ( $x, $y ) {
}

1;
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ sub sum_of_squares ($number) {
sub difference_of_squares ($number) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/etl/lib/ETL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<transform>;
sub transform ($data) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/food-chain/lib/FoodChain.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<recite>;
sub recite ( $start, $end ) {
return undef;
}

1;
1 change: 1 addition & 0 deletions exercises/practice/gigasecond/lib/Gigasecond.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ sub add_gigasecond ($time) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/grade-school/lib/GradeSchool.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ sub add ( $self, $student, $grade ) {
sub roster ( $self, $grade = undef ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/grains/lib/Grains.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ sub grains_on_square ($square) {
sub total_grains () {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/hamming/lib/Hamming.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<hamming_distance>;
sub hamming_distance ( $strand1, $strand2 ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/hello-world/lib/HelloWorld.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ our @EXPORT_OK = qw<hello>;
sub hello () {
return 'Goodbye, Mars!';
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/house/lib/House.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<recite>;
sub recite ( $start, $end ) {
return undef;
}

1;
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ sub plants ( $diagram, $student ) {

return undef;
}

1;
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<largest_product>;
sub largest_product ( $digits, $span ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/leap/lib/Leap.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ our @EXPORT_OK = qw<is_leap_year>;
sub is_leap_year ($year) {
return undef; # Replace this with your own code to pass the tests.
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/luhn/lib/Luhn.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<is_luhn_valid>;
sub is_luhn_valid ($number) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/matrix/lib/Matrix.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ sub extract_row ( $matrix, $row ) {
sub extract_column ( $matrix, $column ) {
return undef;
}

1;
1 change: 1 addition & 0 deletions exercises/practice/meetup/lib/Meetup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ sub meetup ($desc) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/minesweeper/lib/Minesweeper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<annotate>;
sub annotate ($minefield) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/nucleotide-count/lib/NucleotideCount.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<count_nucleotides>;
sub count_nucleotides ($strand) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/ocr-numbers/lib/OCRNumbers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<convert_ocr>;
sub convert_ocr ($string) {
return undef;
}

1;
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ sub smallest_palindrome ( $min, $max ) {
sub largest_palindrome ( $min, $max ) {
return undef;
}

1;
1 change: 1 addition & 0 deletions exercises/practice/pascals-triangle/lib/PascalsTriangle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ sub pascal_rows ($rows) {
return undef;
}

1;
1 change: 1 addition & 0 deletions exercises/practice/phone-number/lib/PhoneNumber.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ sub clean_number ($number) {
return undef;
}

1;
1 change: 1 addition & 0 deletions exercises/practice/pig-latin/lib/PigLatin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ sub translate ($phrase) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/prime-factors/lib/PrimeFactors.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<factors>;
sub factors ($number) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/proverb/lib/Proverb.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<proverb>;
sub proverb ($items) {
return undef;
}

1;
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<triplets_with_sum>;
sub triplets_with_sum ($sum) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/queen-attack/lib/Queen.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ has column => (
sub can_attack ( $self, $other ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/raindrops/lib/Raindrops.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<raindrop>;
sub raindrop ($number) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/rna-transcription/lib/RNA.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<to_rna>;
sub to_rna ($dna) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/robot-name/lib/RobotName.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ has name => ( is => 'rwp' );
sub reset_name ($self) {
return undef; # Replace this with your own code to pass the tests.
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/robot-simulator/lib/Robot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ has direction => (
sub enact ( $self, $instructions ) {
return $self;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/roman-numerals/lib/RomanNumerals.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<to_roman>;
sub to_roman ($number) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/saddle-points/lib/SaddlePoints.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<saddle_points>;
sub saddle_points ($matrix) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/say/lib/Say.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<say_number>;
sub say_number ($number) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/scrabble-score/lib/Scrabble.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<scrabble_score>;
sub scrabble_score ($word) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/secret-handshake/lib/SecretHandshake.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<handshake>;
sub handshake ($number) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/series/lib/Series.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<slices>;
sub slices ( $series, $slice_length ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/sieve/lib/Sieve.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<find_primes>;
sub find_primes ($limit) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/simple-cipher/lib/SimpleCipher.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ sub decode ($self) {
sub _build_key ($self) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/space-age/lib/SpaceAge.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<age_on_planet>;
sub age_on_planet ( $planet, $seconds ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/strain/lib/Strain.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ sub keep ( $input, $function ) {
sub discard ( $input, $function ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/sublist/lib/Sublist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<compare_lists>;
sub compare_lists ( $list1, $list2 ) {
return undef;
}

1;
2 changes: 2 additions & 0 deletions exercises/practice/sum-of-multiples/lib/SumOfMultiples.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ our @EXPORT_OK = qw<sum_of_multiples>;
sub sum_of_multiples ( $factors, $limit ) {
return undef;
}

1;
Loading

0 comments on commit c435e9c

Please sign in to comment.