Questions tagged [autodie]

Replace functions with ones that succeed or die with lexical scope

autodie
Filter by
Sorted by
Tagged with
4 votes
1 answer
137 views

After scoped `no autodie` the program dies at `*STDOUT`

This program use warnings; use strict; use feature qw(say); { #use autodie; # all good when this is uncommented no autodie; } open my $OLDSTD, '>&', *STDOUT; #--> line 10 (...
zdim's user avatar
  • 66.2k
3 votes
2 answers
1k views

Perl : Name "main::IN" used only once, but it is actually used

I writing a short perl script that reads in a file. See tmp.txt: 1 gene_id "XLOC_000001"; gene_name "DDX11L1"; oId 1 gene_id "XLOC_000001"; gene_name "DDX11L1"; oId 1 gene_id "...
irritable_phd_syndrome's user avatar
3 votes
1 answer
498 views

PERL Net::SFTP::Foreign autodie=>0 then 1

I'm writing a script that retrieves some files automatically once a day on some sftp server. The problem is this sftp server is not very reliable and sometimes the client have to retry a couple of ...
Guillaume W.'s user avatar
7 votes
1 answer
213 views

Getting exceptions from IO::File?

The IO::File, IO::Socket::INET modules have some advantages over directly using perl's built-in IO functions, such as having explicit syntax to flush a handle. However, they seem to have some ...
John Dough's user avatar
2 votes
2 answers
323 views

die like autodie

I use autodie to handle exceptions from built-ins. Unfortunately its scope is lexical, autodie does not work with methods. Is it possible to throw exceptions from my class methods so that they are ...
Gurunandan Bhat's user avatar
7 votes
3 answers
614 views

How to use autodie with non-builtins?

The autodie documentation hints that it is possible to use it for other functions than those built-ins which it can handle by default, but there are no clear examples how to do that in it. ...
Rörd's user avatar
  • 6,606
16 votes
1 answer
335 views

Does the autodie-pragma have influence on the encoding?

Why do I get after the "autodie" a different output? #!/usr/bin/env perl use warnings; use 5.012; use utf8; use open ':encoding(utf-8)'; use open ':std'; open my $fh, '>', 'test.txt' or die $!; ...
sid_com's user avatar
  • 24.6k
16 votes
4 answers
3k views

Are there disadvantages to autodie?

Every now and again I see people on StackOverflow promote the use of autodie. But in the code here and elsewhere in the net I don't see autodie very often. Are there some disadvantages? Do I lose ...
sid_com's user avatar
  • 24.6k
6 votes
3 answers
950 views

What is the difference between Perl modules autodie and Fatal?

The Perl modules autodie and Fatal seem to be doing similar things. What are the reasons for using one in preference to the other?
justintime's user avatar
  • 3,611