While going through the below perl code, there is a line
which contains
$sheet -> {MaxRow} ||= $sheet -> {MinRow};
Could anyone please explain the meaning of ||= and where it is used
complete code
---------------
foreach my $sheet (@{$excel -> {Worksheet}}) {
printf("Sheet: %s\n", $sheet->{Name});
$sheet -> {MaxRow} ||= $sheet -> {MinRow};
foreach my $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) {
$sheet -> {MaxCol} ||= $sheet -> {MinCol};
foreach my $col ($sheet -> {MinCol} .. $sheet -> {MaxCol}) {
my $cell = $sheet -> {Cells} [$row] [$col];
if ($cell) {
printf("( %s , %s ) => %s\n", $row, $col, $cell -> {Val});
}
}
}
---------- Post updated at 08:17 AM ---------- Previous update was at 07:16 AM ----------
Could anyone please explain the above code( ||= )