hi,
Because of network problem,my script can't create Mysql dbh sometime
when running,then it died.I have written code like this:
my
$mysql_dbh=DBI->connect("dbi:mysql:$mysql_db:$mysql_host",$mysql_user,$mysql_passwd,
{PrintError => 1,RaiseError => 0});
I want to
HI,
I want to know what's the difference when I call a subroutine with '&'
or without '&'.
such as:
&subroutine();
sub subroutine{
..
}
or
subroutine();
sub subroutine{
..
}
Can anyone tell me?thanks a lot.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
Your code logic says that you want to find lines in '2.txt' that are NOT in
'1.txt'.
thanks for all answerers.
yeah,I have put less attention on that code,and have made a fatal logic error.
but the way mentioned by John, putting file's all contents to a hash,
maybe somewhat less efficiency when
hi,
Is there a best way to find some lines which exists in both two files?
Someone has show me a method but it seems a little low efficiency.
The code is as below:
open (T1,"1.txt") or die "$!";
open (T2,"2.txt") or die "$!";
while(my $line=){
chomp $line;
print $line,"\n" unless diff($line)
hi,
maybe u should redefined the __DIE__ handle for the reason of safety.
such as:
$SIG{__DIE__}=\&log_die;
sub log_die
{
open (HDW,">>",$err_log);
select HDW;$|=1;select STDOUT;
print HDW @_;
close HDW;
die @_;
}
2005/10/8, Timothy Johnson <[EMAIL PROTECTED]>:
> It partly de
hi,everyone,
I want to move my web applications which written by traditional CGI to
mod_perl.Is there any risk or difficulty here?
The applications are something about webmail.Which module under mod_perl
is suited for me?
Any advise or reference to me should be appreciated.TKS.
--
Jeff Pan
$total{$mbox_id}{$type}+=$size;
}
close HD;
`cat /dev/null > $log`;
&disable(\%total);
}
}
----------
--
Jeff Pan
[EMAIL PROTECTED]
--
http://www.fastmail.fm - Choose from over 50 domains or
ari Tent' => 'LuxTnt'
>},
>
> I basically want just:
>
> Luxury, Thatched Chalet', Luxury Safari Tent etc.
>
> If anyone would could assist me, I would be most grateful.
>
> Kind Regards
> Brent Clark
>
> --
me some advises? thanks.
--
Jeff Pan
[EMAIL PROTECTED]
--
http://www.fastmail.fm - A no graphics, no pop-ups email service
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
/$host/;
$_=~/\((\w+)\,\s*(\d+)\)\s+\((\w+)\,\s*(\d+)\)/;
#my @array=("$1","$2","$3","$4");
my @array=qw/$1 $2 $3 $4/;
print join (":",@array),"\n";
}
executing the script:
$ perl t10.pl tt2.txt
$1:$2:$3:$4
why this happen?
Sorry,it should be:
$_=~/\((\w+)\,\s*(\d+)\)\s+\((\w+)\,\s*(\d+)\)/;
Didn't consider the blank space before.
On Mon, 12 Sep 2005 14:54:56 +0800, "Jeff Pan" <[EMAIL PROTECTED]>
said:
> Is this feasible?
>
> while(<>)
> {
> next unless /$host/;
Root = "/gjkeenan/G7";
> my $fileG7 = "$dirRoot/G7";
> my $filePW = "$dirRoot/PW";
>
> open(PWFILE, "$filePW")
> || die "Can't open $filePW: $!";
> while () {
> if (/$host/) {
> my @c = /(\D,\d\d)\s(\D,\d\d)/;
> }
er,
> ping returns a success regardless of whether or not
> packets are received.
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
-
Sure,this code is more brief:
$hash{$i++}=[split] while (<>);
thank u.
On Thu, 08 Sep 2005 19:54:11 -0700, "John W. Krahn" <[EMAIL PROTECTED]>
said:
> Jeff Pan wrote:
> > #/usr/bin/perl
>
> use warnings;
> use strict;
>
> > my $i=0;
>
ta1 = $line[1];
> @line = $lines[2];
> $coordData2 = $line[3];
> ...do something with $coordData1 & $coordData2
>
> I'm hoping for a better way and I'm looking for suggestions.
>
> Thanks for your time.
>
> Greg Keenan
> Lucent Technologies *
>
>
> Which perl module can I use to help me to do this task
>
>
>
> Thanks
>
>
>
>
>
> José Pinto
>
--
Jeff Pan
[EMAIL PROTECTED]
--
http://www.fastmail.fm - mmm... Fastmail...
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comm
gt;
> Cheers,
>
> Graeme :)
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
--
Jeff Pan
[EMAIL PROTECTED]
gt; For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
--
Jeff Pan
[EMAIL PROTECTED]
--
http://www.fastmail.fm - Or how I learned to stop worrying and
love email again
--
my @[EMAIL PROTECTED];
>
> This isn't needed actually and it only makes unnecessary overhead as
> keys/values are copied, so you immediately lost benefit by passing by
> reference.
>
> It's better to access them directly like,
> $hash_ref->{key}
> $array
more safer.
for example,such below code is right:
my (%hash,@array);
&sub_test(\%hash,[EMAIL PROTECTED]);
sub sub_test{
my ($hash_ref,$array_ref)[EMAIL PROTECTED];
my %hash=%$hash_ref;
my @[EMAIL PROTECTED];
do something...
}
--
Jeff Pan
[EMAIL PROTECTED]
--
http://www.fastmail.fm - IMA
> this
> code before. something's happened to a configuration, or something, and i
> can't figure out why. i'm now tearing my hair out over this.
> has anyone ever come across this before? if so, how did you fix it?
>
> many thanks
> dan
>
>
>
> --
&g
; e-mail message and/or attachments to it are strictly prohibited. If you
> have received this communication in error, please notify us by reply
> e-mail or telephone and immediately and permanently delete the message
> and any attachments. Thank you
--
Jeff Pan
[EMAIL PROTECTED]
-
e /g would stop that
> behaviour..
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
--
Jeff Pan
[EMAIL PROTECTED]
--
http://www.fas
et->accept;
die "can't fork:$!" unless defined (my $child = fork());
if ($child==0)
{
$listen_socket->close;
&writelog($connection);
exit 0;
}
$connection->close;
}
thanks.
--
Jeff Pan
[EMAIL PROTECTED]
--
http://www.fa
"this, is a, space"
>
> Hope someone can help,
>
> Bernard
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
&g
25 matches
Mail list logo