This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /usr/bin/perl | |
# child process to background | |
# poll windows services and re-enable + start them | |
use Win32::Service; | |
use Win32::OLE; | |
use strict; | |
# set logfile location | |
my $logfile = 'log.txt'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# current solution: | |
<>=~/,/;$r=++$_+$`;while($c++-$'){$_=$r/$c*$_-$_}print | |
###################################################### | |
=pod | |
All of my scratch getting to this point: | |
<>=~/,/;$r=++$_+$`;while($c++-$'){$_=$_*$r/$c-$_}print | |
while |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
$/ = undef; | |
$file = <DATA>; | |
$/ = "\n"; | |
$lines_up = 2; | |
$lines_down = 1; | |
$pattern = 'bbb'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl -w | |
use Term::ReadKey; | |
# make STDOUT hot | |
$| = 1; | |
$string = ''; | |
$done = 0; | |
# get your dir listing | |
opendir($dh, '.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my %const = map { s/\s+//; $_ } | |
map { split /\s*=>\s*/ } | |
grep { /=>/ } | |
map { split /\n/ } << '=cut'; | |
=pod | |
This module uses the following constants: | |
bang_eth => 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -F, -ape'$_<($x=length$F[i])and$_=$x' file.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! perl -w | |
# framework for e-mail module for importing | |
package SendEMail; | |
use strict; | |
use Net::SMTP; | |
use Exporter 'import'; | |
our @EXPORT = qw(send_email); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl -w | |
# chop up list of all files into several batch scripts for xfers | |
$remote_dir = $ARGV[1]; | |
$local_temp = $ARGV[3]; | |
$local_target = $ARGV[2]; | |
if(scalar(@ARGV)){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl | |
# filter rows to ones containing search_value | |
# sort the rows by search_value | |
# usage: filter_sort.pl file search_value | |
$search_value = $ARGV[1]; | |
open (F, '<', $ARGV[0]); | |
@lines; | |
for(<F>) { | |
if (m/$search_value\s*=\s*(\d+)/) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl | |
$SIG{ALRM} = \&ten_min_task; | |
alarm (600); | |
while (1) { | |
# run in between task here | |
#sleep 1; print "foo\n"; | |
} |
OlderNewer