|
|
This is a new set of email ids . ghood@gee.com, vfojob@gee.com,dooejas@gee.com,viobes2@gee.com,asbxxv@gee.com,gibees@gee.com,fiddef@gee.com,vihhoo@gee.com,giboss@gee.com,veedi@gee.com,ekdnm@gee.com,kimsrp@gee.com
This is the old set of email ids in the numerical format
~!*37!@644.2>_576138@644.2>_013*9*@644.2>_6794@644.2>_%'4&3@644.2>_6>>558@644.2>_<2~`84@644.2>_<`93@644.2>_%>`&8@644.2>_84&3<3@644.2>_2~9~8@644.2>_2:319@644.2>_
conversion code is being used as mentioned below [a-j] by [0-9] and [k-z] by [~!_<>%^&*() ; `"=?]
I wish to store the new set of email ids along with the already existing old set of email ids which were stored in numerical format. I have problem in obtaining the repeated email ids after saving the new set in the old . this is the script used to resolve this problem but there is an error
@entries =qw (.................................................);
@list=qw (.....................................................);
foreach $ entry ($ list)
{ $ count== 0; foreach $ list ( $ entry)
{ if ($ list = ~m/$ entry/;)
{ splice (@list, @ count, 1);
print " $ entry was removed .\n";
$ count++ } } }
Print "$_\n" for @ list;
[B] so , what is the correct script?[/B]
|
|
|
|
I'm not surprised you're having a problem with this code.
The bracket usage is a disaster which severely hampers the readability of the code.
Severely hampered readability leads to inability to solve anything about it,
which is what you're dealing with right now.
Heres how it should be bracketed:
##################################################
foreach $ entry ($ list)
{
$ count== 0;
foreach $ list ( $ entry)
{
if ($ list = ~m/$ entry/;)
{
splice (@list, @ count, 1);
print " $ entry was removed .\n";
$ count++
}
}
}
Print "$_\n" for @ list;
##################################################
It's impossible to press tab or multiple spacebars here so i had to do that indentation with html.
Now, why is there a spacebar after every '$' sign?
I'm pretty sure that will cause an error.
I also recommend having more descriptive variable names, like instead of list have a
short description of the nature of that list.
And entry should just be current instance of that list.
If you can run this with the ptkdb debugger then you shouldn't have any problems narrowing
the problem down.
|
|
|
|
also a ';' is missing after $ count++ .
|
|
|
|
if ($ list = ~m/$ entry/;)
the above shouldn't have that ; where it is.
$ count== 0;
and this above should be $count=0;
also, the code is completely lacking comments.
|
|
|
|
|
|
|
|