disable auto-instantiation or warn about it

asmith9983@gmail.com asmith9983 at gmail.com
Fri Jul 13 17:56:39 BST 2007


Hi Frank

In line with many gnu commands  the use of "--" in general, says that the list 
of options 
has ended, so to remove a file try "rm -- <file>"
In perl you can use the following command
perl -e 'unlink "<file>";'. Obviously, in both instances you substitute the 
<file> with the filename you want to delete.
I tried both in a temporary directory. Another good tip, as you can us the 
command "rm -rv <directory" if  you have trouble making the command work.
I tried out the about with a file I created with ":> -tre", so make sure I 
wasn't giving you any duff info,

-- 
Andrew in Edinburgh

On Fri, 13 Jul 2007, Frank v Waveren wrote:

> Lectori Salutem (or, if you prefer, "Hello"),
>
> I'm going to veer dangerously on-topic here and ask a perl question
> that's been bothering me for some time:
>
> Is there any way to turn off auto-instantiation, or at least to make
> perl emit a warning when it happens?
>
> The auto-instantiation I mean here is the kind that makes evaluating
> "$foo->{bar}" turn $foo into a hashref if it's undef. It's a nice
> feature in some cases, but especially in larger projects it's a huge
> source of bugs, in my experience.
>
> Alternatively, for a partial credit, you can tell me how to delete a
> file starting with -.
>
> Frank


More information about the london.pm mailing list