|
|
Up |
|
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Feb 10, 2008 18:03
This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
3.11: Where can I get Perl macros for vi?
For a complete version of Tom Christiansen's vi configuration file, see
http://www.cpan.org/authors/Tom_Christiansen/scripts/toms.exrc.gz , the
standard benchmark file for vi emulators. The file runs best with nvi,
the current version of vi out of Berkeley, which incidentally can be
built with an embedded Perl interpreter--see
http://www.cpan.org/src/misc/ .
--------------------------------------------------------------------
|
| Show full article (1.40Kb) |
|
| |
no comments
|
|
  |
Author: Petr ViletaPetr Vileta
Date: Feb 10, 2008 17:21
I have Perl 5.6.1 installed and I use Komodo 3.5 which internaly use Perl 5.8
( I don't know subversion). In Komodo IDE is Regexp Toolkit to test regular
expressions.
When I test this
$x = 'a b c d e f 123';
$x =~s/(\b)\s(\S)/$1$2/g;
print $x;
in Komodo Regexp Tool then I get
abcdef 123
But when I test the same in Perl 5.6.1 then I get
ab cd ef 123
I found a workaround for Perl 5.6.1
1 while($x =~s/(\b)\s(\S)/$1$2/g);
but ... :-) Please can anybody explain me what is wrong?
P.S. Please, don't tell me "Upgrade to perl 5.8/5.10" - I can't.
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail from
another non-spammer site please.)
|
| Show full article (0.76Kb) |
|
| |
9 Comments |
|
  |
Author: xahleexahlee
Date: Feb 10, 2008 16:27
while doing my website's traffic report, i did some research on major
computer lang or tech website ranking. Here's the result ranked by
alexa.com (some non-lang tech sites are given just for comparison):
|
| Show full article (1.74Kb) |
|
1 Comment |
|
  |
Author: ahmadahmad
Date: Feb 10, 2008 13:28
1) If you are looking for the truth to soothe and please your self,
just click on this link.
2) If you are looking for the secrt of the family happiness, just
click on this link
3) If you are looking for solving any social problem you face, just
click on this link.
free books
http://www.lecalame.org/english/html/index.htm
|
| |
|
no comments
|
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Feb 10, 2008 12:03
This is an excerpt from the latest version perlfaq2.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
2.17: What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org?
Perl.com at http://www.perl.com/ is part of the O'Reilly Network, a
subsidiary of O'Reilly Media.
The Perl Foundation is an advocacy organization for the Perl language
which maintains the web site http://www.perl.org/ as a general advocacy
site for the Perl language. It uses the domain to provide general
support services to the Perl community, including the hosting of mailing
lists, web sites, and other services. There are also many other
sub-domains for special topics like learning Perl, Perl news, jobs in
Perl, such as:
|
| Show full article (2.22Kb) |
|
no comments
|
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Feb 10, 2008 06:03
This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
3.2: How can I use Perl interactively?
The typical approach uses the Perl debugger, described in the
perldebug(1) manpage, on an "empty" program, like this:
perl -de 42
Now just type in any legal Perl code, and it will be immediately
evaluated. You can also examine the symbol table, get stack backtraces,
check variable values, set breakpoints, and other operations typically
found in symbolic debuggers.
--------------------------------------------------------------------
|
| Show full article (1.41Kb) |
|
no comments
|
|
  |
Author: January WeinerJanuary Weiner
Date: Feb 10, 2008 03:24
Hello,
I have the following problem. I had a script that contained only one
global variable which was called $DEBUG. I just used it to print out
various think or do some checks in debugging mode
print "number of objects $n_obj\n" if $DEBUG ;
check_sanity if $DEBUG ;
The program grew and now I splitted it up into several modules.
Question: what to do with the debug variable?
* I could make it local to all of the functions, but I would really hate
passing it through to each of the functions separately. Firstly, IMO this
is one of the few cases where global variables are justified, and second,
this would require me to make hundreds of modifications in the code.
* I could make it a global variable in each of the modules, and create a
function that switches on the debugging for one module only. This would
have the advantage that I could specify which module to debug.
Disadvantage is that I need to remember to switch it on in every module
if I want to switch it on globally.
|
| Show full article (1.44Kb) |
|
20 Comments |
|
  |
Author: January WeinerJanuary Weiner
Date: Feb 10, 2008 00:57
Hello,
in my program, I am using a matrix which has usually a size of 2000x2000 or
similar. It contains short integers. The matrix is filled in one by one in
a loop over rows and columns.
The only calculation that I am doing with this matrix is averaging
over a window sliding along the diagonals. Finally, I need to access each
matrix element one after another in a loop to calculate something.
At first, I used a regular Perl matrix, constructed as [ [ .... ], [ ... ],
.... ]. This was quite slow and took a lot of memory (the memory footprint
of my program grews up by roughly 50MB), so I googled and found PDL -- Perl
Data Language.
PDL is supposed to be much faster and to have a smaller memory footprint.
While I can see the latter (the footprint is now negligible compared to the
whole program), it is roughly three to four times slower than the regular
perlish way. I am creating the matrix as follows [please bear with me -- I
am not posting actual code, because it is rather complex, and you will see
that answering my question doesn't require finding out whether my code is
correct]:
$matrix = short(zeroes($l1, $l2)) ;
|
| Show full article (1.68Kb) |
|
2 Comments |
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Feb 10, 2008 00:03
This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
3.1: How do I do (anything)?
Have you looked at CPAN (see perlfaq2)? The chances are that someone has
already written a module that can solve your problem. Have you read the
appropriate manpages? Here's a brief index:
|
| Show full article (2.01Kb) |
|
no comments
|
|
  |
|
|
  |
Author: MoshiachNowMoshiachNow
Date: Feb 9, 2008 21:53
HI,
The following sub extracts data nicely from all tables,just one table
comes up empty.
Will appreciate ideas on possible issues in the code.
thanks
=======================
sub exportMDB {
my $database = shift;
my $driver = "Microsoft Access Driver (*.mdb)";
print "$database\n";
print "---------------------------------\n\n";
my $dsn = "dbi:ODBC:driver=$driver;dbq=$database";
my $dbh = DBI->connect("$dsn") or warn "Couldn't open database:
$DBI::errstr; stopped";
my $sth = $dbh->table_info( "", "", "", "TABLE" );
|
| Show full article (1.34Kb) |
|
7 Comments |
|
|
|
|
|
|