syntax error near unexpected token

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bhunesh
    New Member
    • Oct 2007
    • 1

    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.co m/xmlurl/GetTouchLine.as px?userid=IRIS& pwd=CZ33M3KZ53" '

    [code=perl]
    #!/usr/bin/perl
    #Purpose : To create MCX DAT file from mcx feed coming from mcxindia.com
    #Author : Yatin Patil

    # url for mcx feed
    #$SOURCE="http://www.mcxindia.co m/xmlurl/GetTouchLine.as px?userid=IRIS\ \&pwd=CZ33M3KZ5 3";
    #$TARGET="/virtualHosts/beta.myiris.com/htdocs/commodities/commd_admin/CRONJOB/new_cronjob/mcx.dat";
    #$cmd="/usr/bin/wget -O /tmp/mcx.dat $SOURCE";
    #$cmd1="/bin/cp /tmp/mcx.dat -d $TARGET";
    #$cmd="/usr/bin/wget -O /tmp/mcx.dat http://www.mcxindia.co m/xmlurl/GetTouchLine.as px?userid=IRIS& pwd=CZ33M3KZ53" ;
    #system($cmd);
    #system($cmd1);

    system("/usr/bin/wget -O /tmp/mcx.dat http://www.mcxindia.co m/xmlurl/GetTouchLine.as px?userid=IRIS& pwd=CZ33M3KZ53" );
    system("/bin/cp /tmp/mcx.dat -d /virtualHosts/beta.myiris.com/htdocs/commodities/commd_admin/CRONJOB/new_cronjob/mcx.dat");
    open FILE, "/virtualHosts/beta.myiris.com/htdocs/commodities/commd_admin/CRONJOB/new_cronjob/mcx.dat" or die $!;
    $fname="mcx1.da t";

    #delete DAT file if exist
    if(-e $fname)
    {
    unlink $fname;
    }

    #Reading file for parsing mcx data
    while(defined ($val=<FILE>))
    {
    @result=split(/\|/,$val);
    open FO, ">>mcx1.dat " or die $!;
    chmod(0777,"mcx 1.dat");
    $count=scalar(@ result);
    #print FO $count;
    [/code]
    Last edited by numberwhun; Oct 5 '07, 05:05 PM. Reason: add code tags
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    I have moved this thread over the the PERL forum, as I think the experts there are most qualified to answer your question.

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      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.

      Comment

      • kaioshin00
        New Member
        • Nov 2006
        • 46

        #4
        If you comment out that line do you still get an error?

        Comment

        • KevinADC
          Recognized Expert Specialist
          • Jan 2007
          • 4092

          #5
          I wonder if the "-" is being interpreted as an operator? Try escaping it:

          Code:
          system("/usr/bin/wget \-O /tmp/mcx.dat http://www.mcxindia.com/xmlurl/GetTouchLine.aspx?userid=IRIS&pwd=CZ33M3KZ53");

          Comment

          Working...