I wrote this code
$rc=system("pwd");
open(OUT, ">/usr/local/lawson/temp.txt");
foreach (<$rc>) {
chomp;
my @fields = split ///;
$lawdir = "/" . $field[0] . "/" . $field[1] . "/" . $field[2] . "/";
$sys = $fields[3];
print OUT ("LAWDIR is " . $lawdir), "\n";
print OUT ("sys is " . $sys), "\n";
}
close (OUT);
I am trying to get the value returned from the system command "pwd", and then parsing it. The reply should be: /usr/lawson/lawson/ocft/javasrc
I want to put /usr/lawson/lawson/ into the varaible $lawdir and ocft into the variable $sys.
I am getting an error on the split with the ///.
How do I get around this?
$rc=system("pwd");
open(OUT, ">/usr/local/lawson/temp.txt");
foreach (<$rc>) {
chomp;
my @fields = split ///;
$lawdir = "/" . $field[0] . "/" . $field[1] . "/" . $field[2] . "/";
$sys = $fields[3];
print OUT ("LAWDIR is " . $lawdir), "\n";
print OUT ("sys is " . $sys), "\n";
}
close (OUT);
I am trying to get the value returned from the system command "pwd", and then parsing it. The reply should be: /usr/lawson/lawson/ocft/javasrc
I want to put /usr/lawson/lawson/ into the varaible $lawdir and ocft into the variable $sys.
I am getting an error on the split with the ///.
How do I get around this?