Jan 21, 2008, 9:58 PM
Post #1 of 2
unable to access variable declared inside if loop
i have written a script where i need to split the file name into 4 parts and save in 4 variables, but the problem is i want to access the variable outside the if loop, when i use the variable outside the lf loop it gives the error.
Global symbol "$x" requires explicit package name at test3.pl line 38.
Execution of test3.pl aborted due to compilation errors.
My script is:
system "ls *.log >> list.out" ;
for my $check_file (@check_files)
if ( -f "$check_file" )
open(LOG_FILE,"$check_file") || die "Cannot open $check_file";
while( my $line = <LOG_FILE> )
if ( $thread_line =~/_/)
if ( $y =~/_/)
if ( $b=~/_/)
#my $from = "'$thread_line'";
#my $to = " ../WIP/'$thread_line'";
#my $action= " mv $from $to ";