How is this wrong? Please Help.

Discussion in 'Perl' started by Big Dix, Dec 30, 2003.

  1. Big Dix

    Big Dix Guest

    I am dealing with three different database files. If the user (me) chooses
    to edit File 1 it opens File1.csv and so onfor File 3
    But File three needs to written in a different format then File 1 and File
    2.
    My question is about line 4
    I am getting an error. Why and what am I doing wrong that I am missing?
    any ideas?
    Thank you


    1 $NextEntry = $perp_year;
    2 if ($perp_mon < 10) { $NextEntry .= "0"; }
    3 $NextEntry .= "$perp_mon";
    4 if (($perp_day < 10) && ($editfiles = "File 3")) { $NextEntry .= "0"; }
    5 $NextEntry .= "$perp_day\n";
    6 elsif ($perp_day < 10) { $NewEntry .= "0"; }
    7 $NewEntry .=
    "$perp_day|$INPUT{'Add'}|$URL|$INPUT{'address'}|$INPUT{'city'}|$INPUT{'state
    '}|$INPUT{'zip'}|$INPUT{'phone'}|$INPUT{'time'}|$INPUT{'FullText'}\n";
     
    Big Dix, Dec 30, 2003
    #1
    1. Advertising

  2. Big Dix

    Rusty Guest

    Seeing that you provided no error message all I can go by is what is in
    your post. Carefully look at line 4:

    if (($perp_day < 10) && ($editfiles = "File 3")) { $NextEntry .= "0"; }

    The second part of your conditional says to assign the string 'File 3'
    to the variable $editfiles. I don't think you want to do this but want
    to do a comparison.

    Rusty


    Big Dix wrote:
    > I am dealing with three different database files. If the user (me) chooses
    > to edit File 1 it opens File1.csv and so onfor File 3
    > But File three needs to written in a different format then File 1 and File
    > 2.
    > My question is about line 4
    > I am getting an error. Why and what am I doing wrong that I am missing?
    > any ideas?
    > Thank you
    >
    >
    > 1 $NextEntry = $perp_year;
    > 2 if ($perp_mon < 10) { $NextEntry .= "0"; }
    > 3 $NextEntry .= "$perp_mon";
    > 4 if (($perp_day < 10) && ($editfiles = "File 3")) { $NextEntry .= "0"; }
    > 5 $NextEntry .= "$perp_day\n";
    > 6 elsif ($perp_day < 10) { $NewEntry .= "0"; }
    > 7 $NewEntry .=
    > "$perp_day|$INPUT{'Add'}|$URL|$INPUT{'address'}|$INPUT{'city'}|$INPUT{'state
    > '}|$INPUT{'zip'}|$INPUT{'phone'}|$INPUT{'time'}|$INPUT{'FullText'}\n";
    >
    >
    >
     
    Rusty, Dec 30, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. intrader
    Replies:
    1
    Views:
    476
    intrader
    Feb 6, 2006
  2. Replies:
    4
    Views:
    525
    Chris Uppal
    May 5, 2005
  3. KK
    Replies:
    2
    Views:
    598
    Big Brian
    Oct 14, 2003
  4. MuZZy
    Replies:
    7
    Views:
    1,770
    Mike Hewson
    Jan 7, 2005
  5. mera
    Replies:
    7
    Views:
    1,114
Loading...

Share This Page