perldoc usage

Posted by root Wed, 09 Jan 2008 10:59:00 GMT

function manual:
perldoc -f grep
search the text in perlfaq:
perldoc -q grep
module content:
perldoc -m IO::Socket
module absolute filename:
perldoc -l IO::Socket
and of course:
perldoc perl

Posted in  | Tags  | no comments

List Values and Arrays

Posted by root Fri, 30 Nov 2007 14:28:00 GMT

Perl

($a, $b) = (1, 2);
 @arr    = (1, 2);

Python
 a, b = 1, 2
 arr  = 1, 2;

Ruby
 a, b = 1, 2
 arr  = 1, 2
 arr  = 1,2, *[11,22] # the same as 
 arr  = [1,2, [11,22]].flatten
the ’*’ example was stolen from Ola Bini’s blog

Posted in , ,  | Tags  | no comments