Logo
  • Home
  • About
  • Services
  • Career
  • Blogs
  • Contact
Logo

The UK's #1 Software Development Company. PodTech IO builds custom software solutions for businesses. Call today for a free consultation

  • Address

    4th Floor, 4 Tabernacle Street London EC2A 4LU
  • Email

    info@podtech.com
  • Contact

    +44 (0) 20 8720 6583

Tag Archives: Perl

  • Home
  • Tag Archives

Perl – Fork and Kill a System Process on Timeout

  • By podtech
  • In Perl

Perl – Fork and Kill a System Process on Timeout [perl] $pid = open(PIPE, “$command |”) or die $!; eval { local $SIG{ALRM} = sub { die “TIMEOUT” }; alarm($timeout); while (<PIPE>) { $data = $_; }; close(PIPE); alarm(0); }; if ($@) { die $@ unless $@ =~ /TIMEOUT/; kill 15, $pid; close(PIPE); $? ||= […]

Read More

Amazon – Ubuntu CPAN Perl Install

  • By podtech
  • In UNIX

Amazon – Ubuntu CPAN Perl Install If you experiencing any issues with installing, upgrading or managing CPAN perl libraries on a refreshley deployed Amazon EC2 instance make sure you have your build essentials!! Run: sudo  apt-get install build-essential    

Read More

Get Parent PID

  • By podtech
  • In Perl

Get Parent PID [perl] my $parent_id = getppid(); print “$parent_id\n”; [/perl] NAME getppid – get parent process ID SYNOPSIS getppid DESCRIPTION Returns the process id of the parent process. DISCLAIMER We are painfully aware that these documents may contain incorrect links and misformatted HTML. Such bugs lie in the automatic translation process that automatically created […]

Read More

Get PID (process id) from Perl Script

  • By podtech
  • In Perl

Get PID (process id) from Perl Script $$ or $PID

Read More

Perl – Lock Files (flock)

  • By podtech
  • In Perl

Perl – Lock Files (flock) The following script is an example of using lock files in Perl. This prevents more than one user or process accessing a file at a time. [perl] use Fcntl qw(:DEFAULT :flock); use Fcntl ‘:flock’;¬†¬†¬†¬† #LOCK_* constants my($lockneedsremoving)=0; my($lockfilename)=”/var/.pwd.lock”; unless (createlock()) { print “Lock has been created”; print “This is only […]

Read More

Perl Substr

  • By podtech
  • In Perl

Perl Substr substr This function supports three sets of passed values as follows: [perl] substr (STRING,OFFSET,LEN,REPLACEMENT) substr (STRING,OFFSET,LEN) substr (STRING,OFFSET) [/perl] The function: substr (STRING,OFFSET) returns all characters in the string after the designated offset from the start of the passed string. The function: substr (STRING,OFFSET,LEN) returns all characters in the string after the designated […]

Read More

Perl Lower/Upper Case First Character

  • By podtech
  • In Perl

Perl Lower/Upper Case First Character ucfirst Takes a string and retruns it with the first character in upper case. [perl] ucfirst Str1 [/perl] lcfirst Takes a string and retruns it with the first character in lower case. [perl] lcfirst Str1 [/perl]

Read More

Perl Upper Case

  • By podtech
  • In Perl

Perl Upper Case uc Converts all characters in the string to upper case. [perl] uc Str [/perl]

Read More

Perl Index

  • By podtech
  • In Perl

Perl Index index This function returns the position of the first occurance of the specified SEARCH string. If POSITION is specified, the occurance at or after the position is returned. The value -1 is returned if the SEARCH string is not found. [perl] rindex STRING,SEARCH,POSITION rindex STRING,SEARCH [/perl]

Read More

Perl Lower Case

  • By podtech
  • In Perl

Perl Lower Case lc Converts all characters in the string to lower case. [perl] lc Str [/perl]

Read More
  • 1
  • 2
  • 3
  • 4

Recent Posts

  • What is Software Piracy?
  • Microsoft and SITA Launch New Innovation Center in South Africa
  • Ericsson, Qualcomm and Thales to Launch 5G into Space
  • Schneider Electric Launches Free Data Center Professional Education Platform
  • UK and South Korea Reach Data Sharing Agreement

PodTech IO

The UK's #1 Software Development Company. PodTech IO builds custom software solutions for businesses. Call today for a free consultation

Company

  • About
  • Services
  • Contact
  • Blogs
  • Career

Terms

  • Terms & Conditions
  • Privacy Policy

Contact Us

  • ADDRESS

    Headquarter: Tabernacle Street London India: Vi john Tower, Gurgaon, Haryana
  • EMAIL

    info@podtech.com
  • CONTACT

    +44 (0) 20 8720 6583

Copyright ©2022 PodTech IO. All Rights Reserved

Logo