Lines Matching refs:what

20     my $what  = shift;
27 if not defined $what;
36 my ($type, $proper_what) = $class->_guess_what($what);
63 my $what = shift;
65 if (!blessed($what)) { } # not blessed, do nothing
66 elsif ($what->isa('Path::Class::File')) { $what = $what->stringify }
67 elsif (any { $what->isa($_) } qw(IO::File IO::AtomicFile IO::Uncompress::Bunzip2)) {
69 if not $what->opened;
70 return ('iofile', $what);
72 elsif ($what->isa('IO::String')) { return ('iostring', $what) }
73 else { confess 'no support for '.blessed($what) };
75 my $ref_what = ref($what);
76 if ($ref_what eq 'ARRAY') { return ('file', File::Spec->catfile(@{$what})) }
77 elsif ($ref_what eq 'SCALAR') { return ('string', $what) }
79 else { confess 'no support for ref '.(ref $what) }
82 if ((ref \$what eq 'GLOB') and (my $fh = *{$what}{IO})) {
86 if ($what =~ m{^file://(.+)$}) { return ('file', $1) } # local file
87 if ($what =~ m{^https?://}) { return ('http', $what) } # http link
88 if ($what =~ m{^<}) { return ('string', $what) } # xml string
89 if ($what =~ m(^{)) { return ('string', $what) } # json string
90 if ($what =~ m{^\[}) { return ('string', $what) } # json string
91 if ($what =~ m{\n[\s\w]}) { return ('string', $what) } # multi-line string
92 if ($what eq '') { return ('string', '') } # empty string
93 { return ('file', $what) } # default is filename
98 my $what = shift;
103 return $class->new($what, '<', $opt);
108 my $what = shift;
113 return $class->new($what, '>', $opt);
118 my $what = shift;
123 my $fh = $class->read($what, $opt);
160 my $what = shift;
167 my $fh = $class->new($what, '+>>', $opt);