Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The following steps below outline how to make contributions to the existing proj

## Step 1 : Go through README file

- There are some coding challanges questions to solve in readme.md
- There are some coding challenges and questions to solve in readme.md
- You can go through it and choose the questions you love to solve

## Step 2: Choose your language
Expand Down
1 change: 1 addition & 0 deletions Perl/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pl linguist-language=Perl
33 changes: 33 additions & 0 deletions Perl/palindrome.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

$true = 1;
$false = 0;
$ignore_case = $true;

$string = "abbA";

if ( palindrome_string_test( $string ) == $true )
{
print "\"$string\" is a palindrome\n";
}
else { print "\"$string\" is NOT a palindrome\n" }

sub palindrome_string_test
{
$string =~ s/^\s+//g; #Strip leading / trailing whitespace if any
$string =~ s/\s+$//g;
$teststring = reverse( $string );

if ( $ignore_case == 1 )
{
print "Testing case insensitive:";
if ( lc $teststring eq lc $string ) { return $true; }
}
else
{
print "Testing case sensitive:";

if ( $teststring eq $string ) { return $true; }
}

}