Re: Finally a better script!



* Henry Law schrieb:
> Nikos <hackeras@xxxxxxxxx> wrote:
>
> > if (param('select') and param('select') ne '..')
>
> And I'm sure in my own mind that this statement isn't going to do what
> you want. For a start you do realise that "ne" is higher priority
> than "and" so this is going to evaluate (param('select') ne '..')
> first (yielding a true/false value), and then take the result and
> logically "and" it with the _same_ param('select'). I may be
> completely wrong and it is exactly what you want (I'm not a skilled
> Perl-ist myself) but I can't imagine what value of param('select')
> will yield sense in that statement.

Try to read this condition as: if param is true and not equal "..". Due
to the very low precedence of »and« this construct makes sense, usually.

Consider the undefined value as param. Just comparing *undef* with the
string '..' throws a warning ("Use of uninitialized value in string ne
at ..."). Hence one is checking if param is not the undefined value (ok,
here the check tests for trueness instead of definedness).

regards,
fabian
.



Relevant Pages

  • Re: Graph traversieren wie ein Petri-Netz
    ... @param strValue zu prüfender String ... public static final boolean empty{ ... @param strBuffValue zu prüfender StringBuffer ...
    (de.comp.lang.java)
  • Re: Hashtable question
    ... * @param modelName is a filename less the .pim extension where the ... public void load() throws IOException { ... public void add(String keyString, Item item) ... * @param keyString the string to lookup by. ...
    (comp.lang.java.programmer)
  • Re: which JAR to use ?
    ... scan for a string that leads into the piece you want with indexOf. ... public static String getWantedCurrencies throws IOException ... * @param result Results to save, ... public static String get(String websiteURL, String relativeURL, ...
    (comp.lang.java.programmer)
  • Re: Time - BuffererdReader takes read in data - store in hash Map TAKING FOREVER
    ... then convert to string, then parse it yourself. ... @param prefix ... @exception IOException ... public static byterawReadEntireFile (File fromFile) throws ...
    (comp.lang.java.programmer)
  • Problems sending email javamail
    ... private String stmpServer; ... @param mm MailMessage ... // Part two is attachments ... The method GetBCCis undefined for the type MailMessage ...
    (comp.lang.java.programmer)