Loading ...
Sorry, an error occurred while loading the content.

Re: why error?

Expand Messages
  • daymobrew@yahoo.com
    Can you run the script from the command line to see what the real error is (or look in the error log)? Does the script compile okay? (run: perl -w -c
    Message 1 of 7 , Feb 1, 2001
    • 0 Attachment
      Can you run the script from the command line to see what the real
      error is (or look in the error log)?
      Does the script compile okay? (run: perl -w -c script.pl)
      What error report/message is pointing you to this line?

      --- In perl-beginner@y..., "Franki" <frankieh@v...> wrote:
      > $sc_scart_index_of_quantity = $scart{"quantity"};
      >
      > The line above is in a script I am working on...
      >
      >
      > Now this is simple I think
      >
      > Does it now state that this: $sc_scart_index_of_quantity
      > Is set to be equal to: $scart{"quantity"};
      >
      > I didn't think that setting a variable could possibly responsible
      for a
      > server 500 error..
      >
      > And yet in this script, ANYTHING that is set to $scart{"quantity"};
      >
      > Like so, $some_variable = $scart{"quantity"};
      >
      > Will cause a server 500 error....
      >
      > Can anyone tell me why this could be?
      >
      > How could setting a variable be responsible for a 500 error if that
      variable
      > doesn't exist anywhere else?
      >
      > Many thanks
      >
      > Frank Hauptle
      > http://www.gshop.com.au/
      > franki@g...
      >
      > -----Original Message-----
      > From: Foster, Russell J. [mailto:RFoster@S...]
      > Sent: Thursday, 1 February 2001 11:48 PM
      > To: perl-beginner@y...
      > Subject: RE: [PBML] ignore white space and text
      >
      > Tham,
      >
      > When I read in a text file to be parsed, I usually do it like this:
      >
      > @x = split (/\t+/,$line);
      >
      > This splits the items on the line by anything seperated by one or
      more tabs.
      > This allows me to use 1 or more tabs in the text file so that I can
      line
      > things up to make them easier to read.
      >
      > If you want to ignore the space it front, just throw away the first
      item of
      > the split.
      >
      > -rjf
      >
      >
      > > From: Tham Huei Hwan [mailto:hhtham@a...]
      > > Subject: [PBML] ignore white space and text
      > >
      > >
      > > Hi all,
      > >
      > > How do ignore white space and also text (row and column) of the
      data
      > > file ?
      > >
      > > I am using "split" function by space on building my hash array
      form
      > > this data file.
      > >
      > > -- sample --
      > >
      > >
      > > dbnum chksize freesize <--- would like to
      > > ignore this
      > > text, how ?
      > >
      > > 1 100 10
      > > 2 400 50
      > > 3 300 20
      > > |
      > > ignore white space in front, how ?
      > >
      > >
      > > Regards,
      > >
      > > Tham
      >
      >
      >
      >
      >
      ----------------------------------------------------------------------
      ------
      > --------------------------------
      >
      > This e-mail is sent by a law firm and may contain information that
      is
      > privileged or confidential. If you are not the intended recipient,
      please
      > delete the e-mail and any attachments and notify us immediately.
    • Charles K. Clarkson
      ... To ignore that specific line place this in your processing loop: while { next if /^d/i; # skip if line starts with d or D . . . . } HTH,
      Message 2 of 7 , Feb 1, 2001
      • 0 Attachment
        > From: "Foster, Russell J." <RFoster@...>
        > > Tham,
        > >
        > > When I read in a text file to be parsed, I usually do it like this:
        > >
        > > @x = split (/\t+/,$line);
        > >
        > > This splits the items on the line by anything seperated by one or more
        > tabs.
        > > This allows me to use 1 or more tabs in the text file so that I can line
        > > things up to make them easier to read.
        > >
        > > If you want to ignore the space it front, just throw away the first item
        > of
        > > the split.
        > >
        > > -rjf
        > >
        > >
        > > > From: Tham Huei Hwan [mailto:hhtham@...]
        > > > Subject: [PBML] ignore white space and text
        > > >
        > > >
        > > > Hi all,
        > > >
        > > > How do ignore white space and also text (row and column) of the data
        > > > file ?
        > > >
        > > > I am using "split" function by space on building my hash array form
        > > > this data file.
        > > >
        > > > -- sample --
        > > >
        > > >
        > > > dbnum chksize freesize <--- would like to
        > > > ignore this
        > > > text, how ?
        > > >
        > > > 1 100 10
        > > > 2 400 50
        > > > 3 300 20
        > > > |
        > > > ignore white space in front, how ?
        > > >
        > > >

        To ignore that specific line place this in your
        processing loop:

        while <DATA> {
        next if /^d/i; # skip if line starts with 'd' or 'D'.
        . . .
        }

        HTH,
        Charles K. Clarkson
      Your message has been successfully submitted and would be delivered to recipients shortly.