Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: TIMTOWTDI Challenge: Create a filename

by fullermd (Priest)
on Jan 09, 2009 at 03:27 UTC ( [id://735066]=note: print w/replies, xml ) Need Help??


in reply to TIMTOWTDI Challenge: Create a filename

As in the previous challenge, the wording is deliberately vague. You can take this to mean anything you want, as long as the end result is the name of a file. The file may exist, or it may not exist, or its existence may be indeterminate. The choice is up to you.

In the spirit of stretching the bounds of the question...

The other entries all seem to assume the purpose is to get a file for temporary purposes. But that's never stated. So the simplest way to get a file would be:

$file = $0;

Of course, that doesn't guarantee you a file either:

% perl -e 'print "$0\n"' -e

So how do you guarantee that you get a file? Well... I don't think you can. It's at least theoretically possible that your filesystem has no files in it. Or even that you don't have a filesystem.

But then, it doesn't have to exist. The question even says its existence may be indeterminate, so it doesn't even have to be accessible at all.

$file = "/foo";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://735066]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2024-04-18 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found