codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Problem 1 - Email ids conversion code  patelg at 21:51 on Saturday, November 29, 2008
 

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]


  Re: Problem 1 - Email ids conversion code  hermanningjaldsson at 08:53 on Sunday, November 30, 2008
 

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.



  Re: Problem 1 - Email ids conversion code  hermanningjaldsson at 09:47 on Sunday, November 30, 2008
 

also a ';' is missing after $ count++ .

  Re: Problem 1 - Email ids conversion code  hermanningjaldsson at 11:52 on Monday, December 01, 2008
 

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.










CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
• Regular Expression Query Replace -- Twice Wrongly
• Processing MS Office documents with Java
• Re: help!
• Re: Can javascript preload swf files?
• ADODB.Recordset error (0x800A0CB3)
• Need Your Inputs About Level Editor Interface
• `section` is an unexpected token. Expecting white space. Line 1, position 137.
• Javascript rollover toggle help please!
• help monitoting cpu load on windows machine


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009