Skip Menu |

This queue is for tickets about the Shell-EnvImporter CPAN distribution.

Report information
The Basics
Id: 34820
Status: resolved
Priority: 0/
Queue: Shell-EnvImporter

People
Owner: dfaraldo [...] cpan.org
Requestors: gwenaelle.leclair [...] atosorigin.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.04
Fixed in: (no value)



Hello Dave, I noticed that Shell::EnvImporter->new(shell => "zsh", command => "my_command", debuglevel => 9); does not work fine when my command writes some empty lines ("\n") on its stdout. As an example, let's suppose that my command writes the 5 following lines on its stdout: *Warning* Cycle.log files could not be used Setting variables for main cycle /farequote/IntegrationK/OTFGenData/setPSCacheLinux was sourced succesfully for FqA database In this situation, the while loop on line 274 of file Shell/EnvImporter/Shell.pm exits on the first blank line of my command's stdout, therefore the end of the command's stdout is not parsed and its status not captured. The next while loop (line 291 of file Shell/EnvImporter/Shell.pm) behaves the same, and the new environment variable values are not imported. I guess it would be better to replace the following instruction: while (my $line = shift(@lines)) { on lines 257, 274 and 291 of file Shell/EnvImporter/Shell.pm with some instructions like: while (@lines) { my $line = shift(@lines); Have a nice day, Best Regards, Gwenaelle
Subject: Fixed: blank lines break import
Doh! Total newbie error -- thanks for the catch! Fixed in version 1.05.