[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: need help with perl / scratch variable
****** message to minivend-users from "Hans-Joachim Leidinger" <hans-joachim.leidinger@home.gelsen-net.de> ******
Hello Mike,
without testing. Try this!
[perl scratch interpolate=1]
$_ = '[item-field image]';
s/.gif//;
s/.jpg//;
s/.any-other-ext//;
$name = $_;
$Safe{'scratch'}->{'small_image'} = $name;
[/perl]
You need $name only and you can cut all behind ´.´ !
s/anystring/otherstring/; will replace all anystring with otherstring.
s/anystring//; will replace all anystring with nothing.
I hope it helps you!
Joachim
| Hello,
| I'm running minivend 3.12 with perl 5.005
|
| I'm trying to run the following code that reads a field in my products
| database and then splits the value on the '.' and is supposed to
return the
| $name as a scratch variable for "small_image"
|
| $name is returning null or empty. I have no problem returning $image
though
| so i'm wondering if 'split' is not supported in "Safe perl." I'm new
to
| perl programing so i may be really far off the target on this one.
But any
| help would be appreciated.
|
| [perl scratch interpolate=1]
| $image = '[item-field image]';
| ($name, $ext) = split /./, $image;
| $Safe{'scratch'}{'small_image'} = $name;
| [/perl]
|
| thanks,
| mike k.
|
| -
| 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
|
-
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