Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Rex CPAN distribution.

Report information
The Basics
Id: 98871
Status: new
Priority: 0/
Queue: Rex

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.53.1
Fixed in: (no value)



Subject: Don't use local @ARGV=...; <> for slurping file contents
Rex::Config is using something like @ARGV = ...; <> to slurp file contents, and this may happen during compile time (e.g. read_ssh_config is called in import(), so a "use Rex::Config" would trigger this code). Unfortunately this means that a currently active <> loop would break. See https://github.com/cpan-testers/CPAN-Reporter/issues/20 for an issue where this actually happens. Probably it's safer to use instead do { open my $fh, $file or die $!; undef $/; <$fh> } even if it's slightly longer. Or alternatively use IO::File (); join '', IO::File->new($file)->getlines;