Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@krrrr38
Last active December 20, 2015 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krrrr38/6111387 to your computer and use it in GitHub Desktop.
Save krrrr38/6111387 to your computer and use it in GitHub Desktop.
glob分からん困った
#!/usr/bin/env perl
#
use strict;
use warnings;
use utf8;
use Data::Dumper;
my $file = "hoge.txt";
for(0..5){
print Dumper("hoge") if -e glob($file);
print Dumper glob($file);
print Dumper glob($file);
print Dumper glob($file);
print Dumper $file;
print "================================", "\n";
}
__END__
perl hoge.pl
$VAR1 = 'hoge';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
================================
Use of uninitialized value in -e at hoge.pl line 12.
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
================================
$VAR1 = 'hoge';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
================================
Use of uninitialized value in -e at hoge.pl line 12.
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
================================
$VAR1 = 'hoge';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
================================
Use of uninitialized value in -e at hoge.pl line 12.
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
$VAR1 = 'hoge.txt';
================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment