diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/Perl-Scripting.iml b/.idea/Perl-Scripting.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/Perl-Scripting.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..4444b22 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6573e98 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Perl-Scripting/sub_routine_prob.pl b/Perl-Scripting/sub_routine_prob.pl new file mode 100644 index 0000000..da32531 --- /dev/null +++ b/Perl-Scripting/sub_routine_prob.pl @@ -0,0 +1,17 @@ +#!/usr/bin/perl +use strict; +use warnings; + +# Subroutine to check even or odd +sub check_even_odd { + my ($num) = @_; # Get the number from arguments + return $num % 2 == 0 ? "$num is Even\n" : "$num is Odd\n"; +} + +# Taking user input +print "Enter a number: "; +my $num = ; +chomp($num); + +# Calling the subroutine and printing result +print check_even_odd($num);