Showing posts with label Perl. Show all posts
Showing posts with label Perl. Show all posts

2009-01-14

CPAN Reinitialization

cpan> o conf init

2008-03-20

Perl Sites

Perl.org
Perl.com
PM.org - Perl Mongers
CPAN.org
MacPerl.com
ActiveState.com
TPJ.com - The Perl Journal
PerlArchive.com
PerlMonks.com (or PerlMonks.net)
YAPC.org - Yet Another Perl Conference

2008-03-12

2008-02-15

Perl 5.10.0 released

Perl 5.10.0 Released

Today (December 18th, 2007) the Perl Foundation announces the release of Perl 5.10, the first major upgrade to the wildly popular dynamic programming language in over five years. This latest version builds on the successful 5.8.x series by adding powerful new language features and improving the Perl interpreter itself. The Perl development team, called the Perl Porters, has taken features and inspiration from the ambitious Perl 6 project, as well as from chiefly academic languages and blended them with Perl's pragmatic view to practicality and usefulness.

Significant new language features

The most exciting change is the new smart match operator. It implements a new kind of comparison, the specifics of which are contextual based on the inputs to the operator. For example, to find if scalar $needle is in array @haystack, simply use the new ~~ operator:

  if ( $needle ~~ @haystack ) ...

The result is that all comparisons now just Do The Right Thing, a hallmark of Perl programming. Building on the smart-match operator, Perl finally gets a switch statement, and it goes far beyond the kind of traditional switch statement found in languages like C, C++ and Java.

Regular expressions are now far more powerful. Programmers can now use named captures in regular expressions, rather than counting parentheses for positional captures. Perl 5.10 also supports recursive patterns, making many useful constructs, especially in parsing, now possible. Even with these new features, the regular expression engine has been tweaked, tuned and sped up in many cases.

Other improvements include state variables that allow variables to persist between calls to subroutines; user defined pragmata that allow users to write modules to influence the way Perl behaves; a defined-or operator; field hashes for inside-out objects and better error messages.

Interpreter improvements

It's not just language changes. The Perl interpreter itself is faster with a smaller memory footprint, and has several UTF-8 and threading improvements. The Perl installation is now relocatable, a blessing for systems administrators and operating system packagers. The source code is more portable, and of course many small bugs have been fixed along the way. It all adds up to the best Perl yet.

For a list of all changes in Perl 5.10, see Perl 5.10's perldelta document included with the source distribution. For a gentler introduction of just the high points, the slides for Ricardo Signes' Perl 5.10 For People Who Aren't Totally Insane talk are well worth reading.

Don't think that the Perl Porters are resting on their laurels. As Rafael Garcia-Suarez, the release manager for Perl 5.10, said: "I would like to thank every one of the Perl Porters for their efforts. I hope we'll all be proud of what Perl is becoming, and ready to get back to the keyboard for 5.12."

2007-11-06

How to Add Support for a New Language to Exuberant Ctags

Add Support for New Languages to Ctags

Exuberant Ctags has been designed to make it very easy to add your own custom language parser. As an exercise, let us assume that I want to add support for my new language, Swine, the successor to Perl (i.e. Perl before Swine ). This language consists of simple definitions of labels in the form "def my_label". Let us now examine the various ways to do this.

Operational background

As ctags considers each file name, it tries to determine the language of the file by applying the following three tests in order: if the file extension has been mapped to a language, if the file name matches a shell pattern mapped to a language, and finally if the file is executable and its first line specifies an interpreter using the Unix-style "#!" specification (if supported on the platform). If a language was identified, the file is opened and then the appropriate language parser is called to operate on the currently open file. The parser parses through the file and whenever it finds some interesting token, calls a function to define a tag entry.

2007-10-30

[Perl] Manipulate Windows Registry

Win32::TieRegistry - Powerful and easy ways to manipulate a registry [on Win32 for now]

2007-10-13

ActivePerl on Windows

[keywords: perl windows]

ActivePerl: PPM

ASPN: ActiveState Programmer Network
PPM: Perl Package Management

2007-09-21

CPAN mirror

Perl CPAN: cpan.linuxforum.net, very fast! (Dead?)

http://cpan.modperl.cn/

2007-09-13

Using Perl as Grep or Sed

  • perl -ne '/pattern/ and print' ...
  • perl -lne '/pattern/ and print' ...
  • perl -pe 's/foo/bar/' ...
  • perl -pe 's/^foo.*//' ...
  • perl -lpe 's/^foo.*//' ...
  • perl -pi -e 's/foo/bar/' ...
  • perl -pli -e 's/foo/bar/' ...

2007-08-21

SWIG: Simplified Wrapper and Interface Generator

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of languages including common scripting languages such as Perl, PHP, Python, Tcl, Ruby and PHP. The list of supported languages also includes non-scripting languages such as C#, Common Lisp (CLISP, Allegro CL, CFFI, UFFI), Java, Modula-3 and OCAML. Also several interpreted and compiled Scheme implementations (Guile, MzScheme, Chicken) are supported. SWIG is most commonly used to create high-level interpreted or compiled programming environments, user interfaces, and as a tool for testing and prototyping C/C++ software. SWIG can also export its parse tree in the form of XML and Lisp s-expressions. SWIG may be freely used, distributed, and modified for commercial and non-commercial use.

2007-07-26

Perl Misc

近两年没怎么用 perl, 忘得差不多了:

2007-07-01

MacPorts: The port command

  • port selfupdate
  • port search subversion
  • port install bash
  • port variants vim
  • port install vim +perl +cscope subversion +no_bdb
  • port cat vim
  • port deactivate vim @7.1.002_0
  • port upgrade vim
  • port upgrade installed
  • port info bash
  • port deps subversion
  • port dependents readline
  • port outdated
  • ... ...