diff --git a/README.md b/README.md new file mode 100644 index 0000000..32cfc96 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Perl Examples diff --git a/launch b/launch new file mode 100755 index 0000000..5612965 --- /dev/null +++ b/launch @@ -0,0 +1,33 @@ +#!/usr/bin/perl + +use strict; +use lib "/media/elex/UltraFit/Scripts/my-scripts/perl/modules"; +use MyTime; + +my $doc = < + * git - add, commit, push + * mod - chmod a+x *.pl +DOC + +sub git { + my $now = &MyTime::ymdhms; + system("git add -A"); + system("git commit -m '$now'"); + system("git push -u origin"); +} + +sub chmod{ + system("chmod a+x *src/*.pl"); +} + +my $argc = $#ARGV + 1; +my $argv1 = @ARGV[0]; + +if ($argv1 eq "git"){ + &git; +} elsif ($argv1 eq "mod") { + &chmod; +} else { + print $doc; +} \ No newline at end of file diff --git a/src/glob.pl b/src/glob.pl new file mode 100755 index 0000000..2842192 --- /dev/null +++ b/src/glob.pl @@ -0,0 +1,8 @@ +#!/usr/bin/perl +use strict; + +chdir("/home/elex/") or die("$!"); +my @files = glob("*"); +for (@files){ + print "$_\n"; +} \ No newline at end of file diff --git a/gui-tk.pl b/src/gui-tk.pl similarity index 100% rename from gui-tk.pl rename to src/gui-tk.pl diff --git a/hello.pl b/src/hello.pl similarity index 100% rename from hello.pl rename to src/hello.pl