Guys,
I need some real help here. I'm stuck big time. This is what i have so far. I cannot figure out why its not running. It makes perfect sence to me, looks correct, but something is wrong.
sub calculate {
$scon = Net::SSH::Perl->new ("com123.user123.mydomain.com",(protocol=>'2',port=>'22'));
$scon->login("user123","pass123");
print "connected ...\n";
$data_file="test4.o";
open(DAT, "$data_file") || die("Could not open file!");
@raw_data=<DAT>;
foreach $num (@raw_data)
{
chomp($num);
($num1,$num2,$num3)=split(' ',$num);
print "Number 1 is $num1, Number2 is $num2, Number3 is $num3\n";
}
close(DAT);
}
I am recieving this error alot of the time..
Could not open file! at hello.pl line 43.
Could not open file! at hello.pl line 43.
while executing
"::perl::CODE(0x55eb4cc)"
invoked from within
".c.calc invoke "
invoked from within
".c.calc instate {pressed !disabled} { .c.calc state !pressed; .c.calc invoke } "
(command bound to event)
Line 43 is :
open(DAT, "$data_file") || die("Could not open file!");
if i change it to this to it
open(DAT, "+>" . $data_file) || die("Could not open file!");
Then it only creates file in my c: drive.
I'm calling this code from a tcl button which is set up as follows:
Tkx::ttk__button(".c.calc", -text => "Connect to server", -command => sub {calculate();});
I've used a mkdir command after the initall connection, but it creates the directory on my c: drive and not the server, this leads me to think its not connecting right.
Can someone please give me some direction to go with this!!!
Thanks,
Philip.