Perl: Difference between revisions

From DWIKI
No edit summary
mNo edit summary
 
(17 intermediate revisions by 2 users not shown)
Line 6: Line 6:
<br /><br />
<br /><br />
Structurally, Perl is based on the brace-delimited block style of AWK and C, and was widely adopted for its strengths in string processing, and lack of the arbitrary limitations of many scripting languages at the time.</blockquote>
Structurally, Perl is based on the brace-delimited block style of AWK and C, and was widely adopted for its strengths in string processing, and lack of the arbitrary limitations of many scripting languages at the time.</blockquote>
----
{| style="width:600px;" border="0"
| colspan="2" | '''Useful links'''
|-
| [http://search.cpan.org/ http://search.cpan.org/] || Search the '''Comprehensive Perl Archive Network'''
|}
=Documentation=
*http://perldoc.perl.org/
*[http://wiki.debian.org/PerlFAQ Debian Perl FAQ]
==cpan==
===reconfigure cpan===
o conf init
= command line tips =
Check the validity of your scripts:
  perl -c <scriptname>
With additional library paths:
  perl -I ../somelib -c <scriptname>
Alter a file by changing all '''FOO''''s by '''BAR''''s:
  perl -pi -e 's!FOO!BAR!' <filename>
= useful modules =
Some modules I find handy
== [http://search.cpan.org/perldoc/Data::Dumper Data::Dumper] ==
lets you dump data structions in a readable format.
== [http://www.template-toolkit.org/ Template] ==
Andy Wardley's very workable templating engine.
== [http://www.masonhq.com/ Mason] ==
== [http://search.cpan.org/perldoc/Storable Storable] ==
Persistence for Perl data structures. Save's a lot of nitpicking with reading and writting files that's don't need to be accessed by anything else then a perlscript e.g. temporary data for CGI's and daemons.
== [http://search.cpan.org/perldoc/Net::LDAP Net::LDAP] ==
A very comprehensive way to work with [[LDAP|Lightweight Directory Access Protocol]]
== [http://search.cpan.org/perldoc/Sys::Syslog Sys::Syslog] ==
Perl interface to the UNIX syslog(3) calls. Why bother writting and maintaining logfiles when someones else can do it?
== [http://search.cpan.org/perldoc/Spreadsheet::WriteExcel Spreadsheet::WriteExcel] ==
Very easy way to generate excelsheets for e.g. reporting.
== Snippets ==
[[perl nslookup]]
=FAQ=
==Profiling perl=
perl -d NYTProf mine.pl
nytprofhtml
[[Category:Scripting]]
[[Category:Programming]]

Latest revision as of 13:36, 15 June 2017

Practical Extraction and Report Language

-or- Pathologically Eclectic Rubbish Lister

From the Wikipedia:

Perl is a dynamic programming language created by Larry Wall and first released in 1987. Perl borrows features from a variety of other languages including C, shell scripting (sh), AWK, sed and Lisp.



Structurally, Perl is based on the brace-delimited block style of AWK and C, and was widely adopted for its strengths in string processing, and lack of the arbitrary limitations of many scripting languages at the time.


Useful links
http://search.cpan.org/ Search the Comprehensive Perl Archive Network

Documentation

cpan

reconfigure cpan

o conf init

command line tips

Check the validity of your scripts:

 perl -c <scriptname>

With additional library paths:

 perl -I ../somelib -c <scriptname>

Alter a file by changing all FOO's by BAR's:

 perl -pi -e 's!FOO!BAR!' <filename>

useful modules

Some modules I find handy

Data::Dumper

lets you dump data structions in a readable format.

Template

Andy Wardley's very workable templating engine.

Mason

Storable

Persistence for Perl data structures. Save's a lot of nitpicking with reading and writting files that's don't need to be accessed by anything else then a perlscript e.g. temporary data for CGI's and daemons.

Net::LDAP

A very comprehensive way to work with Lightweight Directory Access Protocol

Sys::Syslog

Perl interface to the UNIX syslog(3) calls. Why bother writting and maintaining logfiles when someones else can do it?

Spreadsheet::WriteExcel

Very easy way to generate excelsheets for e.g. reporting.

Snippets

perl nslookup

FAQ

=Profiling perl

perl -d NYTProf mine.pl
nytprofhtml