ARGV-OrDATA
    
    
  
  
  
view release on metacpan or search on metacpan
t/02-stdin.t
t/03-package.t
t/04-unimport.t
t/05-is_funcs.t
t/input.txt
t/My.pm
t/pipe.pl
t/script.pl
t/is_using.pl
t/is_using_package.pl
xt/changes.t
xt/manifest.t
xt/pod-coverage.t
xt/pod.t
META.yml                                 Module YAML meta-data (added by MakeMaker)
META.json                                Module JSON meta-data (added by MakeMaker)
t/04-unimport.t view on Meta::CPAN
SKIP: {
    skip "Can't run the test when stdin is not the terminal", 4
        unless -t;
    my $file = "$FindBin::Bin/input.txt";
    is scalar <>, "data 1\n", 'read line 1 from data';
    @ARGV = $file;
    is scalar <>, "data 2\n", 'changes to @ARGV ignored';
    'ARGV::OrDATA'->unimport;
    @ARGV = $file;
    is scalar <>, "file 1\n", 'unimport works';
    'ARGV::OrDATA'->import;
    is scalar <>, "data 3\n", 'switching back to data';
}
__DATA__
xt/changes.t view on Meta::CPAN
use strict;
use Test::More tests => 1;
use ARGV::OrDATA;
use FindBin;
my $module_version = $ARGV::OrDATA::VERSION;
my $dir = $FindBin::Bin . '/..';
open my $changes, '<', "$dir/Changes" or die 'Changes not found';
my $found;
while (<$changes>) {
    $found = 1, last if /\Q$module_version\E\s/;
}
ok $found, "$module_version found in Changes";
( run in 0.779 second using v1.01-cache-2.11-cpan-c333fce770f )