in reply to Re^2: Heredoc with system call
in thread Heredoc with system call
a quick hack is to remove the single quotes from the heredoc marker. In this way the heredoc contents will be processed by perl and any variables within it will be interpolated (and if you do not have use strict; use warnings; all perl-looking variables - declared in your program or not - will be replaced). However, better than a heredoc is to construct a string with your specifications under your full control, using for example, sprintf(), escaping sigils and single quotes. For example, my $var1 = ...; my $str = "echo '$var1' | awk '{print \$1}'";
See also, Re^2: Ubuntu File Names with spaces and special characters
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Heredoc with system call
by Anonymous Monk on Apr 22, 2019 at 16:37 UTC | |
by bliako (Abbot) on Apr 22, 2019 at 18:03 UTC |