Hi,
When I get a database handler with DBI,
my $dbh = DBI->connect(...);
Then I fork in the script:
my $pid = fork;
if ($pid ) { # parent
do something;
} else { # child
do something another;
$dbh->disconnect;
}
What I want to know is, when $dbh get disconnected in child, will it
in
> "reader" == reader writes:
reader> When using cgi to run scripts over html, what is the right addressing
reader> scheme when the script needs to open or alter files on the server.
*Most* CGI execution engines "cd" to the path of the script when
executing that script. Hence opening ">foo"
> "Erez" == Erez Schatz writes:
Erez> One problem I have with Merlyn, is when he starts talking about
Erez> something, you're willing to throw everything away and go where he
Erez> points. He's such a passionate, compelling speaker.
Erez> My other problem is that he's mostly right.
[blush]
On Sunday 20 Dec 2009 21:15:53 Parag Kalra wrote:
> Hello All,
>
> Just started learning OOPs in Perl from the book 'Intermediate Perl'
> written by Randal.
As well as brian d foy and Tom Phoenix I may add.
>
> I have written a small program given below. Its working at most places
> except whi
Hi Sajad!
On Sunday 20 Dec 2009 20:02:53 sajad sadeghi wrote:
> hello
> i am new member ,i want to know can i post my question to this or i must
> post it another where?
All Perl-related questions are acceptable here. With some more advanced and
specialised questions, you may have better luck w
This may belong somewhere else... but I'm pretty sure someone here can
tell me about this.
When using cgi to run scripts over html, what is the right addressing
scheme when the script needs to open or alter files on the server.
For example... a cgi writes a page for viewing.
the cgi needs to ope
Hello All,
Just started learning OOPs in Perl from the book 'Intermediate Perl' written
by Randal.
I have written a small program given below. Its working at most places
except while printing color of unnamed creatures. Just execute the script
and you will figure out the bug. Could someone explai
On Sat, Dec 19, 2009 at 9:13 PM, sftriman wrote:
> I use this series of regexp all over the place to clean up lines of
> text:
>
> $x=~s/^\s+//g;
> $x=~s/\s+$//g;
> $x=~s/\s+/ /g;
>
> in that order, and note the final one replace \s+ with a single space.
>
> Basically, it's (1) remove all leading
As long as your query is related to Perl, you are free to shoot the question
here.
Cheers,
Parag
On Sun, Dec 20, 2009 at 11:32 PM, sajad sadeghi wrote:
> hello
> i am new member ,i want to know can i post my question to this or i must
> post it another where? ,my questions is about some progr
hello
i am new member ,i want to know can i post my question to this or i must
post it another where? ,my questions is about some program of perl and how
to program...
--
والحمدلله
John W. Krahn wrote:
> That can be reduced to:
>
> $text =~ tr/ \t\n\r\f/ /s;
>
> But that still doesn't remove leading and trailing whitespace so add two
> more lines:
>
> $text =~ tr/ \t\n\r\f/ /s;
> $text =~ s/\A //;
> $text =~ s/ \z//;
That was left as an exercise to the reader. Come now,
sftriman wrote:
I've been wondering for a long time... is there a slick (and hopefully
fast!) way to do this?
foreach (keys %fixhash) {
$x=~s/\b$_\b/$fixhash{$_}/gi;
}
So if
$x="this could be so cool"
and
$fixhash{"could"}="would";
$fixhash{"COOL"}="awesome";
$fixhash{"beso"}="nope";
$fi
Shawn H Corey wrote:
sftriman wrote:
I use this series of regexp all over the place to clean up lines of
text:
$x=~s/^\s+//g;
$x=~s/\s+$//g;
$x=~s/\s+/ /g;
in that order, and note the final one replace \s+ with a single space.
Basically, it's (1) remove all leading space, (2) remove all trail
2009/12/20 sftriman :
> I've been wondering for a long time... is there a slick (and hopefully
> fast!) way
> to do this?
>
> foreach (keys %fixhash) {
> $x=~s/\b$_\b/$fixhash{$_}/gi;
> }
You can do a global substitute of the sentence and see if they match
any key in the hash. i.e.:
$x =~ s/\b
sftriman wrote:
> I use this series of regexp all over the place to clean up lines of
> text:
>
> $x=~s/^\s+//g;
> $x=~s/\s+$//g;
> $x=~s/\s+/ /g;
>
> in that order, and note the final one replace \s+ with a single space.
>
> Basically, it's (1) remove all leading space, (2) remove all trailing
sftriman wrote:
> I've been wondering for a long time... is there a slick (and hopefully
> fast!) way
> to do this?
>
> foreach (keys %fixhash) {
> $x=~s/\b$_\b/$fixhash{$_}/gi;
> }
>
> So if
>
> $x="this could be so cool"
>
> and
>
> $fixhash{"could"}="would";
> $fixhash{"COOL"}="awesome"
2009/12/20 sftriman :
> I use this series of regexp all over the place to clean up lines of
> text:
>
> $x=~s/^\s+//g;
> $x=~s/\s+$//g;
> $x=~s/\s+/ /g;
>
You can probably use $x=~s/^(\s+)|(\s+)$//g;
But I don't think it will use any less CPU than the 3 regex option,
the nature of Perl's regex en
I use this series of regexp all over the place to clean up lines of
text:
$x=~s/^\s+//g;
$x=~s/\s+$//g;
$x=~s/\s+/ /g;
in that order, and note the final one replace \s+ with a single space.
Basically, it's (1) remove all leading space, (2) remove all trailing
space,
and (3) replace all multi-spa
I've been wondering for a long time... is there a slick (and hopefully
fast!) way
to do this?
foreach (keys %fixhash) {
$x=~s/\b$_\b/$fixhash{$_}/gi;
}
So if
$x="this could be so cool"
and
$fixhash{"could"}="would";
$fixhash{"COOL"}="awesome";
$fixhash{"beso"}="nope";
$fixhash{"his"}="impo
19 matches
Mail list logo