in reply to Multiline Hash - how to get rid of formatting?
What do you mean with "formatted text"? That you get a lot of spaces? That's because you have those spaces in your string values for 'body'. If you want a newline you must use \n as in your second example, Perl doesn't care about newlines you used to format the script in which you defined the data structure.
But there are some other issues here:
In short, I think this is what you should have:
Print a workflow to the command line:my %workflows = ( 'workflow1' => [ "first step", "second step", "third step" ], 'workflow2' => [ "first step", "second step", "third step" ], );
I hope that helps to get you started - welcome to Perl!print "Workflow1 is:\n" . join("\n", @%{$workflows{'workflow1'}})."\n" +;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multiline Hash - how to get rid of formatting?
by Anonymous Monk on Apr 30, 2012 at 08:37 UTC | |
by tospo (Hermit) on Apr 30, 2012 at 09:26 UTC |