What exactly are you trying to achieve?
This is what I'm trying to do - and feel free to tell me I'm wasting my
time if there's a better solution.
Essentially what I'm trying to do is to create some kind of ftp
auto-reconnect feature. I have a few machines that will drop the ftp
connectio
On 3/9/07, Matt <[EMAIL PROTECTED]> wrote:
snip
You're right, but does it slowdown the script much if if there are two?
I only ask because I didn't think about combining them into one line -
not questioning your perl know-how.
snip
It depends on where in the code you do it. In your case you ha
Jeff Pang wrote:
} else {
my $whileloop = 99;
}
Hello,
There is a scope mistaken above.You declare $whileloop at the outside of the loop,while here you
re-declare another $whileloop with "my".This $whileloop is different from the former
one.So "my $whileloop = 99" s
I don't understand why you are using the $whileloop variable. Perl
has perfectly good loop control mechanisms. A quick rewrite would be
I think I used it because at first I tried while ($sock) - and that
didn't work. So I just used something I 'knew' would always hold true.
while (1) {
I don't understand why you are using the $whileloop variable. Perl
has perfectly good loop control mechanisms. A quick rewrite would be
while (1) {
if ($sock) {
printf "Socket connected\n";
printf "$counter\n";
$counter++;
sleep
>} else {
>my $whileloop = 99;
>}
Hello,
There is a scope mistaken above.You declare $whileloop at the outside of the
loop,while here you re-declare another $whileloop with "my".This $whileloop is
different from the former one.So "my $whileloop = 99" shouldn't change th
On 3/8/07, mlist <[EMAIL PROTECTED]> wrote:
I have a script which will create a socket connection to a host. It
should loop through while the socket connection is active. The problem
is that it still continues to loop even if I take down the interface on
the host machine. What am I missing (no
You need to remove the 'my' for $whileloop within the while() statement:
while ($whileloop < 1) {
if ($sock) {
printf "Socket connected\n";
printf "$counter\n";
$counter++;
sleep 2;
} else {
my $whileloop = 99;