Skip to content

Using indented HEREDOC with Rex tasks #1533

Answered by ferki
rwp0 asked this question in Q&A
Discussion options

You must be logged in to vote

HEREDOCs should work in general. Rex code is just Perl code, there's no distinction.

The Compile time errors message suggests that Rex receives invalid Perl code somehow. When loading the Rexfile upon rex execution, it is treated as a perl module named __Rexfile__. This helps avoiding to execute invalid code, by detecting them early (and offloads the whole check to standard perl).

The problem here is that the ending delimiter LOADER is indented with 8 spaces, while the previous lines are indented with single tabs. I could reproduce the initial error, but when I made the HEREDOC indentation correct, it worked for me as expected.


That being said, in general I would not recommend using the a…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@rwp0
Comment options

Answer selected by rwp0
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants