Using sql server 2008 I am getting and invalid precision value error in the following perl script:
use DBI;
$idx = '12345';
$query = 'if exists (select * from tbl where idx = ?) select top 10 * from tbl';
my $h = $dbh->prepare($query) or die "Couldn't prepare query: " . $dbh->errstr;
$h->execute($idx) or die "Couldn't execute statement:...
For the sake of simplicity, let's say that we have input strings with this format:
*text1*|*text2*
so, I want to leave text1 alone, and remove all spaces in text2
This could be easy if we didn't have text1, a simple search and replace like this one would do:
%s/\s//g
but in this context I don't know what to do.
I tried with somet...
The generated library files from wsdl2perl.pl are not creating all the complex types I need to run requests through my wsdl. If I want to add a new type, say Price.pm to my type library, am I able to just add that module to the other library files? And if I do, what other files must I modify to incorporate it to my program (the element...
The first time you run cpan from the command line, you are prompted for answers to various questions. How do you automate cpan and install modules non-interactively from the beginning?
...
I'm successfully calling a perl script from a shell script. Now I want to pass a return value from the perl script indicating whether it was successful or not to the shell script. How would I go about doing this?
Thanks!
...
I'm not thinking too clearly right now and possibly overlooking something simple. I've been thinking about this for a while and been searching, but can't really think of any sensible search queries anymore that would lead me to what i seek.
In short, I'm wondering how to do module inheritance, in the way base.pm/parent.pm do it for obje...
I have a perl CGI that needs to report some information back to the browser before it goes into a really lengthy process that frequently takes several minutes.
Currently I print the message but it doesn't show up till the entire process exits.
So, my question is:
Is it possible to get the message back to browser mid stream and if not
...
I have a table T with columns A,B,C & D as below:
A,B,C,D
A1,B1,USD,LIBOR
A1,B2,JPY,FIXED
A2,B3,USD,LIBOR
A2,B4,EUR,FIXED
A3,B5,JPY,FIXED
A3,B6,USD,LIBOR
Table always has 2 rows per "A", with different values of "B".
"B" is unique
"A" - varchar(10), "B" - varchar(8), "C" - varchar(3), "D" - varchar(5)
Validation rules restrict th...
Hello,
I was wondering about the utility of storing metadata (Abbreviation Expansion, Brief Message, links to online resources) associated with messages, in /var/log/syslog, /var/log/kern.log etc.
For instance, for a message like ACPI: Processor [CPU1] (supports 8 throttling states) I would search online about CPU throttling, and sto...
I have a script in Perl that searches for an error that is in a config file, but it prints out any occurrence of the error. I need to match what is in the config file and print out only the last time the error occurred. Any ideas?
...
Hi everyone, I am running into a strange regex issue....
I have a document where I am doing a replace... as an example I want to replace
"DEXX" with "DEXX/AREX"
and then with the next substitution replace...
"AREX" with "AREX/CUBE"
DEXX and AREX are stored in a hash like so....
"DEXX" => "AREX",
"AREX" => "CUBE"
The regex I have is thi...
I am trying to write a socket server that forks for every connection. I have been successful except for one small caveat: my child processes use Net:OpenSSH->capture2() which requires that $SIG{CHLD} not be set to IGNORE or to a custom signal handler. How can I reap my children without setting the signal handler or slowing down the paren...
Two related questions
After I run a program how can I see what machine code got executed?
Moreover does perl execution convert the whole pl and its modules to machine code or just the part it executes?
...
Okay, I got a rather simple one (at least seems simple). I have a multi lined string and I am just playing around with replacing different words with something else. Let me show you...
#!/usr/bin/perl -w
use strict;
$_ = "That is my coat.\nCoats are very expensive.";
s/coat/Hat/igm;
print;
The output would be
That is my Hat
Hats are ...
I'm testing my project installation script on CentOS5.5.
My project need Date::Manip module which requires feature module...
When I try to install it (feature) through CPAN, CPAN wants to install Perl 5.9.5...
*** WHOA THERE!!! ***
This is an UNSTABLE DEVELOPMENT release.
The version of this perl5 distribution is 9, that is, o...
Hi all,
I have this web based project written in Perl and I have to migrate it to ASP.NET. I'm a complete noob at this. Is there a way to reduce the manual labor for it? What would be your approach? Can you also provide a short example of something that works, maybe how to port a small HelloWorld file?
Many thanks.
...
I seem to remember that there were certain conditions under which $ would match a newline (not "just before"), but I can't find anything in the docs that would confirm that. Did that use to be true in an earlier version of Perl or am I dreaming?
...
I sometimes want to match whitespace but not newline. So far I've been resorting to [ \t] . Is there a less awkward way?
...
I need change a value in a ini file like this val2 is the one being changed
Before
[section1]
var1=val1
var2=val2
var3=va3
After:
[section1]
var1=val1
var2=value
var3=va3
...
I have been hearing a lot about this "Modern Perl." Can anyone explain what it is?
One of the things I heard was the new open syntax:
open my $FH, '<', $filename
and not
open FH, "<$filename";
What else is in Modern Perl?
Thanks, Boda Cydo.
...