By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,178 Members | 971 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,178 IT Pros & Developers. It's quick & easy.

Problem 1 Email ids Conversion code

P: 1
Problem 1

This is a new set of email ids
Expand|Select|Wrap|Line Numbers
  1. 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

Expand|Select|Wrap|Line Numbers
  1. ~!*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

Expand|Select|Wrap|Line Numbers
  1. @entries =qw (.................................................);
  2.  
  3.    @list=qw (.....................................................);
  4.  
  5.  foreach $ entry ($ list)
  6.  
  7.   { $ count== 0; foreach $ list ( $ entry)
  8.   { if ($ list = ~m/$ entry/;)
  9.   { splice (@list, @ count, 1);
  10.  
  11.   print " $ entry was removed .\n";
  12.  $ count++ } } }
  13.  
  14.  Print "$_\n" for @ list;
so , what is the correct script?
Nov 29 '08 #1
Share this Question
Share on Google+
3 Replies


eWish
Expert 100+
P: 971
Did you write this code? You should learn the basics first. Your script should not even complie correctly.

Add these two lines to your script and fix your syntax errors.
Expand|Select|Wrap|Line Numbers
  1. use strict;
  2. use warnings;
I don't understand your conversion chart. Do you have more details?

--Kevin
Nov 29 '08 #2

KevinADC
Expert 2.5K+
P: 4,059
I understand the conversion but the perl code is just a total mess and I have no idea what the output should be.
Nov 30 '08 #3

Icecrack
Expert 100+
P: 174
I agree with Kevin its a mess, i cant see how you would get that to work, second Fix your code formating

Expand|Select|Wrap|Line Numbers
  1. use strict;
  2. use warnings;
  3.  
  4. @entries =qw(.................................................);
  5. @list=qw(.....................................................);
  6.  
  7.  foreach $entry ($list)
  8.    { 
  9.      $count=0; 
  10.      foreach $list ($entry)
  11.       {
  12.         if ($list = ~m/$entry/)
  13.           { 
  14.             splice (@list, @count, 1);
  15.             print "$entry was removed .\n";
  16.             $count++;
  17.   } 
  18.  }
  19. }
  20.  
  21.  print "$_\n" for @list;
  22.  
Dec 2 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.