Re: Finally a better script!



On Fri, 29 Apr 2005 22:07:54 +0300, Nikos <hackeras@xxxxxxxxx> wrote:

>You understand very quickly what i wanted to do and you helped me write
>the correct way.
>After all of the guys suggestions here is how the script transformed:

Well, you missed one of mine.

>=========================================================
>my $script = param('select') || "Welcome Page!";
>my ($data, @data);
>
>
>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.

>{
> open(FILE, "<../data/text/$script.txt") or die $!;

Where did $script come from? Not this program, evidently.

<snip>

> $data = join('', @data);

$data never seems to get used. All the occurrences of it from here on
are on the left hand side of an assignment. I can't the point of
slurping the contents of $script.txt in and jamming it all together.

<snipped rest of the code>

>I wish i can test ti but iam currently having a mysql problem but thing
>it will work :-)

What? You're posting all this stuff and you haven't tested it? I'm
wasting my time then. Sheesh.

>If we still can make it shorter please let me know!

Shorter != better.

Now get this: Unless you post code that RUNS and doesn't contain
unnecessary material unrelated to your question, and show YOUR output
from it, and explain accurately why it's not doing what you thought it
should do, then I'm not going to write another word to try to help
you. Most other people have bailed out already.
.



Relevant Pages

  • Re: dont get too excited
    ... > The bookies odds have actually got shorter for an Oz win from when they were ... I can only imagine that they have been looking at a weather forecast. ... Prev by Date: ...
    (uk.sport.cricket)
  • Re: OT: Ford 1.8 TDCi Lynx engine
    ... but I imagine the ratios will be a bit shorter down low. ... I wonder myself what difference - gear change wise - this would make to ...
    (uk.rec.cars.maintenance)
  • Re: OT: Ford 1.8 TDCi Lynx engine
    ... but I imagine the ratios will be a bit shorter down low. ... I wonder myself what difference - gear change wise - this would make to ...
    (uk.rec.cars.maintenance)
  • Re: 3D Graph Default Data and equal scale? Another 3D graph question...
    ... Your "reverting back issue" is not clear and I have never seen that behaviour. ... I could imagine an issue with your code doing that but I would only be speculating. ... Please post code that demonstrates this issue and we may be of more hlep. ...
    (comp.lang.labview)