On 03.08.2007 22:58, "Michael Havlicek" <[EMAIL PROTECTED]> wrote:
> Hello Marek,
>
> I still don't understand what are you trying to do.
>
> $1 and S2 and so on are reserved words. hm
> I still don't understand why you are using anonymous arrays and
> references.
> Perhaps I am wrong but I am very tired and I have drunk some wine.
>
>
> If I want to add a list of numbers I do this:
> --------START--------------------
> #!/usr/bin/perl
>
> my @A = (2, 4.98, 6.45, 8);
> foreach $element (@A) {
> $result += $element;
> }
> print join (" + ",@A)." = ";
> $result = sprintf "%.2f\n", $result;
> print $result;
> ---------END----------------------
>
> This script prints this:
> 2 + 4.98 + 6.45 + 8 = 21.43
>
> Please tell my what are do you want to do exactly.
> I need more information.
> Thanks.
> Best regards,
> --
> Michael Havlicek
Hi Michael,
a simple task. I write in my perl-script my $1 ... But I need this up to $4
or more. I select my $1, and my filter makes out of it:
my ($1, $2, $3, $4);
But you are right: this are reserved scalars (blushing) ...
so I change my task to:
my $scalar1,
with filter becomes:
my ($scalar1, $scalar2, $scalar3, $scalar4);
Was this clearer?
best greetings and sorry for the confusion
marek
--
------------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_script.shtml>
List archives: <http://www.listsearch.com/bbeditscripting.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>