Daily Archives: August 28, 2009

Hotel Room Problem

Three men decided to split the cost of a hotel room. The hotel manager gave them a price of $30. The men split the bill evenly, each paying $10, and went to their room. However, the hotel manager realized that … Continue reading

Posted in Problems | 1 Comment

How To Redirect STDERR to STDOUT in Perl

Redirecting STDERR to STDOUT in Perl: open STDERR, ‘>&STDOUT’; Reassign raw file handles: *STDERR = *STDOUT; Redirect all output to a logfile: open(LOG,”>/tmp/foo.log”); *STDERR = *LOG; *STDOUT = *LOG; Example: #!/usr/bin/perl use strict; use warnings; warn “regular error”; open STDERR, … Continue reading

1 Comment