Skip to content

Added Perl Seed Script ! issue #4 - #26

Merged
mkasberg merged 4 commits into
mkasberg:masterfrom
sdeseille:hacktoberfest/perl-seed
Oct 21, 2018
Merged

Added Perl Seed Script ! issue #4#26
mkasberg merged 4 commits into
mkasberg:masterfrom
sdeseille:hacktoberfest/perl-seed

Conversation

@sdeseille

Copy link
Copy Markdown
Contributor

Hi

Please find the Perl Seed Script.
Say me if it is Ok for you.

regards

@mkasberg

Copy link
Copy Markdown
Owner

Good work! 👍 Looks like the build is failing because you need to run chmod +x seeds/perl_seed.pl.

I'll give it a merge once the tests pass.

@mkasberg mkasberg mentioned this pull request Oct 21, 2018
Comment thread seeds/perl_seed.pl
}

sub plant_a_seed {
my $seed = shift;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use a named argument rather than shift? You defined $type up on line 10 but never used it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact "shift" get the first argument pass to function call.
At line 21 there is main program with function call and use of $type.

Write your code below

if ($water){
water_the_plant(${type}) ;
}
else {
plant_a_seed(${type});
}

But i understand why you don't find $type. I wrote it ${type}. I change that in same time as i add usage in help message.

Comment thread seeds/perl_seed.pl Outdated

=head1 SYNOPSIS
sample [options] [file ...]
Options:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may need to include the word usage in the output here to get the tests to pass.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok thank,
I add it very soon.

regards

Comment thread index.html
<option value="python">Python</option>
<option value="ruby">Ruby</option>
<option value="scala">Scala</option>
<option value="perl">Perl</option>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lists are in alphabetical order. Not a big deal - I'll merge it and rearrange them.

Comment thread test.sh
# things if we do some refactoring.

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
chmod +x $DIR/seeds/*.*

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than doing this, I've just been checking all the scripts into Git with the x bit set. Again, not a big deal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants