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

syntax error near unexpected token

P: 1
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
Share this Question
Share on Google+
4 Replies


Motoma
Expert 2.5K+
P: 3,235
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
Expert 2.5K+
P: 4,059
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

P: 46
If you comment out that line do you still get an error?
Oct 6 '07 #4

KevinADC
Expert 2.5K+
P: 4,059
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.