Mailing List Archive

Strange whitespace
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!

DB
_______________________________________________
interchange-users mailing list
interchange-users@interchangecommerce.org
https://www.interchangecommerce.org/mailman/listinfo/interchange-users
Re: Strange whitespace [ In reply to ]
DB via interchange-users <interchange-users@interchangecommerce.org> writes:

> 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]|

--
Marco
_______________________________________________
interchange-users mailing list
interchange-users@interchangecommerce.org
https://www.interchangecommerce.org/mailman/listinfo/interchange-users
Strange whitespace [ In reply to ]
>> 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]|
>
> --
> 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@interchangecommerce.org
https://www.interchangecommerce.org/mailman/listinfo/interchange-users
Re: Strange whitespace [ In reply to ]
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@interchangecommerce.org
> https://www.interchangecommerce.org/mailman/listinfo/interchange-users
>

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


_______________________________________________
interchange-users mailing list
interchange-users@interchangecommerce.org
https://www.interchangecommerce.org/mailman/listinfo/interchange-users