comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
March 2008
motuwethfrsasuw
     12 9
3456789 10
10111213141516 11
17181920212223 12
24252627282930 13
31       14
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.perl.misc Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  pattern match         


Author: Venkatesh can....can...
Date: Mar 19, 2008 22:29

$var="{' venkat'}->{'no'}->{'yes'}";
i want to get the "yes" token;
if i use
$var=~/\{'( .* )\}$/
i get venkat'}->{'no'}->{'yes
how to get the "yes" token...
5 Comments
  A-Z on programming languages C++, java and updates on SQL servers         


Author: Gokul
Date: Mar 19, 2008 18:55

The latest developments in SQL server 2008 and an complete
encyclopedia of microsoft softwares. Know the methodology to capture
customers requirements for new products. Get the latest development in
C++ and other IT related tools. A complete tutor for all your IT
needs. visit

http://www.sqlserversoftware.blogspot.com
no comments
  FAQ 7.6 What's an extension?         


Author: PerlFAQ Server
Date: Mar 19, 2008 18:03

This is an excerpt from the latest version perlfaq7.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 .

--------------------------------------------------------------------

7.6: What's an extension?

An extension is a way of calling compiled C code from Perl. Reading
perlxstut is a good place to learn more about extensions.

--------------------------------------------------------------------

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.

If you'd like to help maintain the perlfaq, see the details in
perlfaq.pod.
no comments
  very strange bug (in perl?)         


Author: dummy
Date: Mar 19, 2008 16:41

Please don't sneer and laugh, but I think I've found a bug in perl
itself.

I am trying to make, in my stumbling way, a database of homophones to
be the basis of a verifier similar to a spell checker, but for
homophones. I wrote this script as a crutch to help me with some logic.

It didn't work.

After many hours with and without the perl debugger I found the
proximate cause of my problem. But I'm at a loss to explain it.

Here is my source, showing the cure, followed by the output before and
after the fix.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ script before fix ~~~~~~~~~~

#!c:/strawberry/perl/bin/perl.exe
# perl 5.10.0 installed 3/3/2008
use strict; use warnings;
my %%ow = (
'a' => [qw/a b c/],
'b' => [qw/a b c/],
'c' => [qw/a b c/],
'r' => [qw/r s t u/...
Show full article (3.43Kb)
13 Comments
  FAQ 7.3 Do I always/never have to quote my strings or use semicolons and commas?         


Author: PerlFAQ Server
Date: Mar 19, 2008 12:03

This is an excerpt from the latest version perlfaq7.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 .

--------------------------------------------------------------------

7.3: Do I always/never have to quote my strings or use semicolons and commas?

Normally, a bareword doesn't need to be quoted, but in most cases
probably should be (and must be under "use strict"). But a hash key
consisting of a simple word (that isn't the name of a defined
subroutine) and the left-hand operand to the "=>" operator both count as
though they were quoted:

This is like this
------------ ---------------
$foo{line} $foo{'line'}
bar => stuff 'bar' => stuff

The final semicolon in a block is optional, as is the final comma in a
list. Good style (see perlstyle) says to put them in except for
one-liners:
Show full article (2.02Kb)
3 Comments
  segfault in perl         


Author: Mike
Date: Mar 19, 2008 08:26

I am testing a program that is not yet in production that after a
while the program will segfault. There is no core left behind when
the segfault happens. How can I get a core from the segfault or is
there another way to diagnose the situation?

Mike

Fedora Core 5
perl 5.8.8

--
Posted via a free Usenet account from http://www.teranews.com
4 Comments
  FAQ 6.14 How can I print out a word-frequency or line-frequency summary?         


Author: PerlFAQ Server
Date: Mar 19, 2008 06:03

This is an excerpt from the latest version perlfaq6.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 .

--------------------------------------------------------------------

6.14: How can I print out a word-frequency or line-frequency summary?

To do this, you have to parse out each word in the input stream. We'll
pretend that by word you mean chunk of alphabetics, hyphens, or
apostrophes, rather than the non-whitespace chunk idea of a word given
in the previous question:

while (<>) {
while ( /(\b[^\W_\d][\w'-]+\b)/g ) { # misses "`sheep'"
$seen{$1}++;
}
}

while ( ($word, $count) = each %%seen ) {
print "$count $word\n";
}
Show full article (2.01Kb)
no comments
  problem starting perl script from cron environment - ps: don't know which terminal to select         


Author: Micha
Date: Mar 19, 2008 05:24

I have perl program which works just fine on the console, but started
in cron environment it prints "ps: don't know which terminal to
select" to stderr - btw I don't call ps explicitly at any point in my
scripts.

Now lets have a look at the details :

My script is written in perl, inside that script there is a call in
backquotes to an other perl script which starts too.
By printf-debugging I could find out that the "ps: don't know which
terminal to select" output occurs both in the parent and child script
before by first line of code. Does perl call ps before starting?? why
does it need a terminal? my script do not process stdin and stdout +
stderr are redirected into files. And for some reason this problem
occurs only when calling a perl script from an other perl script.

In interactive mode the script works just fine - I ran it from a ksh.
To execute it via cron I write a small ksh script, which reads the
environment from the .kshrc an the executes the per script sending
stdout and stderr to log-files.

Let me try to deconfuse it ;)

Cron -> ksh-Script -> perlA -> perlB -> perlC
Show full article (1.37Kb)
3 Comments
  XML Parsing in Perl         


Author: Deepan Perl XML Parser
Date: Mar 19, 2008 05:04

Hi all,
This post is regarding XML parsing in perl.

I have written a handler for capturing Char named
characterData. when this handler is getting called up for parsing
""1667999478"" which is available in $data it should be able
to print "1667999478" replacing " with ", but it is only printing
".

Here is the code :

sub characterData {
my( $parseinst, $data ) = @_;
print "$data";
------------------>>> here i should get "1667999478" instead of "
}

Please help me.

Thanks,
Deepan
2 Comments
  Is substr only way of getting nth character of string?         


Author: Robbie Hatley
Date: Mar 19, 2008 03:53

I wrote the following, trying to get it to print a block of
20 rows of 20 random characters from a 96-member character
set. But it doesn't work; just just prints a series of
20 "\n" characters, and that's all:

#!/usr/bin/perl

sub rand_int;

srand;

my $i;
my $j;
my $Lower = "abcdefghijklmnopqrstuvwxyz"; # lower-case (26)
my $Upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; # upper-case (26)
my $Digits = "0123456789"; # digits (10)
my $Symbols = "`~!@#$%%^&*()-_=+[{]}\\|;:\'\",<.>/?"; # symbols (32)
my $White = "\11\40"; # tab, space ( 2)
my $Charset = $Lower.$Upper.$Digits.$Symbols.$White; # total: (96)

#print ("$Charset\n");
Show full article (2.04Kb)
21 Comments
1 2