469,319 Members | 2,287 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,319 developers. It's quick & easy.

syntax error near unexpected token

hey ,
i m getting error listed below plz help me

/virtualHosts/beta.myiris.com/htdocs/commodities/commd_admin/CRONJOB/new_cronjob/new_mcx.pl: line 14: syntax error near unexpected token `"/usr/bin/wget -O /tmp/mcx.dat http://www.mcxindia.com/xmlurl/GetTouchLine.aspx?userid=IRIS&pwd=CZ33M3KZ53"'

Expand|Select|Wrap|Line Numbers
  1.  #!/usr/bin/perl
  2. #Purpose : To create MCX DAT file from mcx feed coming from mcxindia.com
  3. #Author : Yatin Patil
  4.  
  5. # url for mcx feed
  6. #$SOURCE="http://www.mcxindia.com/xmlurl/GetTouchLine.aspx?userid=IRIS\\&pwd=CZ33M3KZ53";
  7. #$TARGET="/virtualHosts/beta.myiris.com/htdocs/commodities/commd_admin/CRONJOB/new_cronjob/mcx.dat";
  8. #$cmd="/usr/bin/wget -O /tmp/mcx.dat $SOURCE";
  9. #$cmd1="/bin/cp  /tmp/mcx.dat -d $TARGET";
  10. #$cmd="/usr/bin/wget -O /tmp/mcx.dat http://www.mcxindia.com/xmlurl/GetTouchLine.aspx?userid=IRIS&pwd=CZ33M3KZ53";
  11. #system($cmd);
  12. #system($cmd1);
  13.  
  14. system("/usr/bin/wget -O /tmp/mcx.dat http://www.mcxindia.com/xmlurl/GetTouchLine.aspx?userid=IRIS&pwd=CZ33M3KZ53");
  15. system("/bin/cp /tmp/mcx.dat -d /virtualHosts/beta.myiris.com/htdocs/commodities/commd_admin/CRONJOB/new_cronjob/mcx.dat");
  16. open FILE, "/virtualHosts/beta.myiris.com/htdocs/commodities/commd_admin/CRONJOB/new_cronjob/mcx.dat" or die $!;
  17. $fname="mcx1.dat";
  18.  
  19. #delete DAT file if exist
  20.     if(-e $fname)
  21.         {
  22.                 unlink $fname;
  23.         }
  24.  
  25. #Reading file for parsing mcx data
  26. while(defined ($val=<FILE>))
  27. {
  28.     @result=split(/\|/,$val);
  29.     open FO, ">>mcx1.dat" or die $!;
  30.     chmod(0777,"mcx1.dat");
  31.     $count=scalar(@result);
  32.     #print FO $count;
  33.  
Oct 5 '07 #1
4 6440
Motoma
3,237 Expert 2GB
I have moved this thread over the the PERL forum, as I think the experts there are most qualified to answer your question.
Oct 5 '07 #2
KevinADC
4,059 Expert 2GB
where do you see that error? Is it in an error log? I don't see anything wrong with that line as far as syntax goes.
Oct 5 '07 #3
If you comment out that line do you still get an error?
Oct 6 '07 #4
KevinADC
4,059 Expert 2GB
I wonder if the "-" is being interpreted as an operator? Try escaping it:

Expand|Select|Wrap|Line Numbers
  1. system("/usr/bin/wget \-O /tmp/mcx.dat http://www.mcxindia.com/xmlurl/GetTouchLine.aspx?userid=IRIS&pwd=CZ33M3KZ53");
Oct 6 '07 #5

Post your reply

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

Similar topics

4 posts views Thread by Bob Stearns | last post: by
3 posts views Thread by Manuel | last post: by
4 posts views Thread by lisa | last post: by
12 posts views Thread by Yusuf | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.