Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FOREACH statement

Status
Not open for further replies.

lucknowm

MIS
Jun 4, 1999
19
US
what is error in following code :

@dir = ( $d1, $d2, $d3 );

foreach ( $dir )
{
chk_dir_exists ( $dir )
};


Keeps complaining "Global symbol dir requires explicit package name "

 
Do you have a:
Code:
use strict;
line in your code? If so you will need something like this:
Code:
my @dir = ( $d1, $d2, $d3 );
foreach my $dir (@dir) {
    chk_dir_exists ( $dir )
};

or something like that ;-)

Will. will@hellacool.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top