문제

I absolutely don't speak any perl or perl Template!

I have a perl file with use Template; and a call to ->process to process a .tt2 file. Within the .tt2 file, a variable is printed, like so: [% path | html %].

How do I apply an s/,-.*// (remove ,- and what follows) to [% path | html %]?

도움이 되었습니까?

해결책

Scalars have a .remove vmethod.

[% path.remove(',-.*') | html %]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top