Tags » Perl

perl getters/setters

Saves creating subroutines with long argument lists. Embed inside the main perl file.


package Config;
 sub new { bless {} };
 sub conf { return( getset(@_, 'conf') ); }
 sub project { return( getset(@_, 'project') ); }
 sub base { return( getset(@_, 'base') ); }
 sub path { return( getset(@_, 'repo_path') ); }
 sub url { return( getset(@_, 'repo_url') ); }

  sub getset {
    if ( !@_ || (@_ < 2) ) {
      return(undef);
    }

    if ( @_ == 2 ) {
      # getter 0=self, 1=key
      return($_[0]->{$_[1]});
     }

     # setter 0=self, 1=val, 2=key
     $_[0]->{$_[2]} = $_[1];
  }

Perl

perl switch statement


SWITCH: {
  ( $op eq 'checkount' ) && do {
    $checkout++;
    last(SWITCH);
  };
  ( $op eq 'commit' ) && do {
    $commit++;
    last(SWITCH);
  };

  // default
  print " Unsupported operation $op\n";
}
Perl

“Sr. Software Test Engineer (SSTE)” for Full-Time position in Lake Forest, CA.

Job Title: “Senior Software Test Engineer (SSTE)”

Job Location: Lake Forest, CA.

Job Duration: Permanent

Job Nature: Full-Time Equivalent (FTE), Full-Time Hire (FTH)

Client Domain: … 583 more words

Jobs

hash

while (($key, $value)= each %reads){
print “$key=$value\n”;
}

Perl

Adventures of a Programmer: Parser Writing Peril XXIII

Types and Modifiers

ECMAScript does not know much about types and modifiers, but Little should. There are not many, but enough to justify the small hassle the implementation costs. 1,157 more words

Computing

Senior Linux Systems Administrator for Cloud Start-up in Bristol

Senior Linux Engineer / Linux Systems Administrator – RedHat Linux (RHEL), Chef, MySQL 
Brilliant Established Tech Start-Up 
Amazon AWS | Cloud Infrastructure | SaaS Product  363 more words

Jobs