Re: Finally a better script!
- From: Henry Law <lawshouse.public@xxxxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 22:15:41 +0100
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.
.
- Follow-Ups:
- Re: Finally a better script!
- From: Fabian Pilkowski
- Re: Finally a better script!
- From: David K. Wall
- Re: Finally a better script!
- References:
- Finally a better script!
- From: Nikos
- Finally a better script!
- Prev by Date: Re: Looking for Perl Grammar
- Next by Date: Re: Windows Clipboard
- Previous by thread: Finally a better script!
- Next by thread: Re: Finally a better script!
- Index(es):
Relevant Pages
|
|