Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Re: "unique" filename?

by 2501 (Pilgrim)
on Dec 04, 2000 at 03:33 UTC ( [id://44721]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: "unique" filename?
in thread "unique" filename?

When you log into a site, you have two options.
You can start running a script from a new connection or you can use an existing connection.
Since only one person can be using a PID at a time, the combination of time and PID is fine.

Replies are listed 'Best First'.
Re: Re: Re: Re: "unique" filename?
by quidity (Pilgrim) on Dec 04, 2000 at 05:12 UTC

    That might be so, but if you need the file to remain on the server for a while (as part of session management perhaps), then your method breaks.

    With some operating systems, for instance OpenBSD, there is a chance that the same PID will occur twice within one second, especially on a heavily loaded site. You are also at risk of exposing your machines current position in the PID list, which could be of use to someone hoping to exploit the way someone has used the PID and time to seed a random number generator.

    Use the modules, and you insulate yourself from these problems. CPAN is your friend.

      If you used Time::Hires then it is far less likely you would get the same value from time(). But then since you are already using a modules from CPAN it would be better to use one meant for what you are doing.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2025-02-07 05:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (94 votes). Check out past polls.