April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Perl Tips

Useful One-Line Scripts for Perl Dec 03 2013 | version 1.10 ——————————– ———– ———— Compiled by Peteris Krumins (peter@catonmat.net, @pkrumins on Twitter) http://www.catonmat.net — good coders code, great reuse Latest version of this file is always at: http://www.catonmat.net/download/perl1line.txt This file is also available in other languages: Chinese: https://github.com/vinian/perl1line.txt Please email me peter@catonmat.net if you wish […]

Get the java info perl

#!/usr/bin/perl # Fast script to grab jstack / jinfo and jmap of processes running on server. # ### Update paths here for java_base. $java_base=’/usr/java/bin’; $jstack=’jstack’; $jinfo=’jinfo’; $jmap=’jmap’; $script=$0; $runuser=`/usr/xpg4/bin/id -nu`; chomp($runuser); #$outdir=’/tmp’; ($min, $hour, $day, $month, $year) = (localtime)[1,2,3,4,5]; $year=$year+1900; if ( $month < 10 ) { $month=”0$month”; } if ( $day < 10 ) […]

Perl Programming ( perl 5 )

Basics

Scripts

Perl is a script language, which is compiled each time before running. That unix knows that it is a perl script there must be the following header at the topline of every perl script: #!/usr/bin/perl where the path to perl has to be correct and the line must not exeed 32 charachters. Comments […]