Hello all, i have problem, and i don't know where is my mistake.
--- #!/usr/bin/perl
@myarra = ("test","error","block");
$file = 'sorted'; # File contain records xxx.xxx.xxx
# i need last symbols after last -> .
open(FILE, $file);
while ($data = <FILE>) {
$backupdata = $data;
$data =~ s/^(\S+)\.//g; # Remove xxx.xxx. get last 2 or 3 symbols after last -> .
$data = lc($data); # make $data to lowercast
for ($i = 0; $i < 3; ++$i)
{
if ($data eq $myarra[$i]) # no any outputs :(
# if ($data =~ /$myarra[$i]/) # this not work
# $data contain -> est
# $myarra[$i] -> test
# and script say equal but not.
{
print "------\n";
print "$data\n";
print "$i\n";
print "$myarra[ $i ]\n";
print "$backupdata\n"; # print $backupdata if
# $data equal to @myarra[$i], in this case test = test, error = error
# etc.
print "------\n";
}
}
}
close (FILE); -----
Any body can help me ? i read some documentation but unable to fix problem.
Regards, John
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>