where am my()?

  • Thread starter Ben Dover - Mental Patient 0057
  • Start date
B

Ben Dover - Mental Patient 0057

where am my()?

@db=some db file;
sub test {
foreach $list ($file1,$file2,$file3){
foreach (@db){
my($var); <--if my defined here
if ($countTD > $linesPerColumn){
if ($countTR > $columnsPerPage){
$var=1234; <---and used here
}
print "<td valign=\"top\"><u><b>$var</b></u>\n"; <--why won't it show
up here?
}
if ($_ =~ m/category:/){
}
if ($_ =~ m/;;/){
}

}
}
}

isn't my defined at a broad enough location?
 
G

Glenn Jackman

Ben Dover - Mental Patient 0057 said:
my($var); <--if my defined here
if ($countTD > $linesPerColumn){
if ($countTR > $columnsPerPage){
$var=1234; <---and used here
}
print "<td valign=\"top\"><u><b>$var</b></u>\n"; <--why won't it show
up here?

$countTR is not greater than $columnsPerPage
 
T

Tad McClellan

Ben Dover - Mental Patient 0057 said:
where am my()?

@db=some db file;
sub test {
foreach $list ($file1,$file2,$file3){
foreach (@db){
my($var); <--if my defined here
if ($countTD > $linesPerColumn){
if ($countTR > $columnsPerPage){
$var=1234; <---and used here
}
print "<td valign=\"top\"><u><b>$var</b></u>\n"; <--why won't it show
up here?


Maybe because $countTR <= $columnsPerPage ?

Do you have warnings enabled?

isn't my defined at a broad enough location?


$var will be in scope for the print().

Maybe you are printing undef or the empty string though...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top