Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Re: The Y2.001775K Bug

by Masem (Monsignor)
on Apr 19, 2001 at 07:04 UTC ( [id://73734]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: The Y2.001775K Bug
in thread The Y2.001775K Bug

Here's a possible way that you can run into this blunder, a good possible 'newbish' problem.
# Generate files... my $time = time(); open FILE ">$time.txt" or die $!; print FILE $stuff; close FILE; # this is repeated often, as from CGI... # # Retrieval now... my @files = get_list_of_files(); @files = sort { $a cmb $b } @files; foreach my $file ( @files ) { do_something_with_file ( $file ); }
If the files are created across the 9/9/01 boundary, you are going to missort these later.

Oddly enough, I use this exact technique in my recent code snippet, notepad.pl; however, I do protect from this by sprintf'ing the time into a much much longer string that should be ok until 64-bit systems...without that sprintf, that code suffers from the same problem.

}


Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found