[ic] Strange whitespace

Stefan Hornburg (Racke) racke at linuxia.de
Sat Mar 4 16:55:38 UTC 2023


On 04/03/2023 16:14, DB via interchange-users wrote:
>>> I think this mysterious whitespace is why my query is failing. The below code displays
>>>
>>> | BS | instead of the expected |BS|
>>>
>>> I can't tell where these spaces are coming from and I can't get rid of them. I use the pipe characters to make spaces easier to spot.
>>>
>>> [tmp ol_sku_test]BS-12345[/tmp]
>>>
>>> [tmp sku_prefix2]
>>> [perl]
>>> my $ol_sku_test = "[scratch ol_sku_test]";
>>> my @sku_array = split('-', $ol_sku_test);
>>> return "@sku_array[0]";
>>> [/perl]
>>> [/tmp]
>>>
>>> |[scratch sku_prefix2]|
>>>
>>> Any thoughts are welcome!
>>
>> That's because [tmp sku_prefix2]...[tmp] includes the new lines around
>> the [perl]
>>
>> Try this:
>>
>>
>> [tmp sku_prefix2][perl]
>> my $ol_sku_test = "[scratch ol_sku_test]";
>> my @sku_array = split('-', $ol_sku_test);
>> return "@sku_array[0]";
>> [/perl][/tmp]
>>
>> |[scratch sku_prefix2]|

I would unleash the whole [perl] power instead of brewing a ITL/[perl] concoction :-)

[perl]
my @sku_array = split('-', $Scratch->{ol_sku_test});
$Tag->tmp(sku_prefix2 => $sku_array[0]);
return;
[/perl]

Regards
   Racke

>>
>> -- 
>> Marco
> 
> 
> Thanks that was indeed the issue. I guess I did not expect newlines to magically become spaces, and for some reason I could not filter them out. Also thanks to Racke - his quoting advise was of course correct.
> 
> DB
> _______________________________________________
> interchange-users mailing list
> interchange-users at interchangecommerce.org
> https://www.interchangecommerce.org/mailman/listinfo/interchange-users
> 

-- 
Automation expert - Ansible and friends
Linux administrator & Debian maintainer
Perl Dancer & conference hopper




More information about the interchange-users mailing list