Dan

> I think that's exactly whatI'm doing wrong.
>
> I think what's Jenda has been trying to get across to my little brain all
along.
>
> Thw way I'm doing it is this
>
> $string = "$row[2] $row[4] $row[5] $row[3]";
> If ($string ....
>  But $string is already interpolated!
>
> What Jenda has been saying is
>
> Foreach $item(@row) {
> if( $item ....
>
> The regex isn't the problem it's the interpolation by adding those
elements to a variable and checking it.
>
> I'll just rewrite it to do it that way.
>

I still doubt if that'll get you anywhere I'm afraid. You see, Perl will
interpolate only one level at a time, and as far as I know the only way to
interpolate further is to use an eval. Look at this:

    my ( $user, $password ) = qw ( Rob SECRET );
    my @row = ( 'print $user;', 'print $password;' );

    my $string = "$row[0] $row[1]";

    print "$string\n";
    print eval qq["$string"]."\n";

output

    print $user; print $password;
    print Rob; print SECRET;

See what I mean? And I doubt if you've been doing anything like that. That's
why I think you should print your @row array as early as possible to see
what you actually have. I believe the code you have is correct and the
problem is earlier on.

I'll leave you alone now! Good luck!

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to