[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
What's the correct syntax to test/access variables from a Gl0balSub?
****** message to minivend-users from "Gerard Olszowiec" <gerard@entitysoftware.com> ******
Hi all:
I'm having trouble accessing variables set in a Gl0balSub. (And I'm
purposely spelling Gl0balSub wrong here to keep this message from bouncing
again.) The following
Gl0balSub sets $member_auth_results to an authorization string that I want
to test in the checkout_profile.
Gl0balSub <<EOF
sub member_auth {
open(AUTH, "goodstanding |");
my $member_auth_results = <AUTH>;
close(AUTH);
return $member_auth_results;
}
EOF
I know that $member_auth_results gets the correct response from <AUTH>
because I have been able to display the results with [perl
sub]member_auth[/perl] in the body of checkout.html. However, I want to
test the value of $member_auth_results (and eventually strip other info from
the string) from within [set checkout_profile]. My problem is that I can't
seem to properly position the [perl sub] call and get the syntax of the test
right. Here's what my [set checkout_profile] looks like:
[set checkout_profile]
...
[perl sub]member_auth[/perl]
[perl values config]
...
$member_auth_ok = ($member_auth_results =~ /^APPROVED/);
/* I've also tried $member_auth_ok = ($Safe{'values'}->{member_auth_results}
=~ /^APPROVED/);
$out = <<EOF;
&set = mv_member_auth_declined $member_auth_ok
EOF
return $out;
[/perl]
&fatal=yes
...
&final=yes
[/set]
What am I doing wrong here? Your help is greatly appreciated?
Cheers,
Gerard
------------------------------
Gerard Olszowiec
Entity Software
gerard@entitysoftware.com
www.entitysoftware.com
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list