Request for program test on different operating sytsems

From: edgrsprj (edgrsprj_at_ix.netcom.com)
Date: 04/19/04


Date: Mon, 19 Apr 2004 19:31:26 GMT


# April 19, 2004 - This is the first line of Perltest.txt - A comment
# This is the second line of the print test - Also a comment
#
# This is a Perl test program which is intended to see what has to be
# done to get this program to run on computers with different operating
# systems.
#
# I am trying to learn how to have it correctly read text from a text file
# and then have different operating systems automatically open that
# same file with a text editor. That information will then be used to
# prepare the next version of a scientific program I am circulating
# to researchers around the world.
#
# A copy of this test program has been temporarily stored at:
#
# http://www.freewebz.com/eq-forecasting/Perltest.zip
#
# It is requested that people download that file, unzip it, and
# try running the file inside it instead of using this present file.
# That would show if the text file displayed properly on different
# computers.
#
# Then please state if it ran Ok in a note posted to this Newsgroup.
#
# However, tests involving doing the same with this copy of the file
# would also provide helpful information.
#
# To use that downloaded zip file:
# Choose or create a directory to run this program.
# Download that zip file, unzip the two files in it.
# Store them in the directory you selected.
# Open the Perltest.pl file with a text editor.
# Substitute the name of the directory you want to use in the following
# line.

$directoryname = 'C:\ETDPROG';
$directoryname = $directoryname.chr(92);
# the above line adds a \ to the directory name

# Store the file again in that directory.
#
# Or,
#
# To use this present file:
# Change that directory name (several lines up) in this copy of the program.
# Store this entire file as Perltest.txt in that directory.
# Store this entire file as Perltest.pl in that directory.
#
# Tell the Perltest.pl program to run.
#
# It should print the following 2 lines on your computer screen.

# April 19, 2004 - This is the first line of Perltest.txt - A comment
# This is the second line of the print test - Also a comment

# Then it will pause for 25 seconds.
# Then it will try to get a text editor to open and display Perltest.txt.
#
# Did it print those lines Ok?
# If it did not, then what commands need to be added to it to get it to run?
#
# It should create a Perltest.bat file which the program then tells to run.
# With Windows XP that program will cause a text editor to open the
# Perltest.txt file and display it.
#
# Did it do that for people running Windows XP?
#
# If the command lines for storing information in the Perltest.bat file
# are changed to the one for Windows 98 then that program should cause a
# text editor to open and display the Perltest.txt file.
#
# Did it do that for people using Windows 98?
#
# What option commands need to be added to the program so that uses can
# get it to run on other operating systems?
#
# What option commands need to be added to it so that they can get it
# to automatically open and display the Perltest.txt file?
#
# Please post any information and comments to the:
# comp.lang.perl.misc Newsgroup Thanks.
#

open testfile, '< '.$directoryname.'Perltest.txt';
@testarray = <testfile>;
close testfile;

print substr($testarray[0], 0, length($testarray[0]) -3), "\n";
print substr($testarray[1], 0, length($testarray[1]) -3), "\n";
print "\n";
print "\n";
print 'This program should have read the Perltest.txt file and', "\n";
print 'then at the top, printed the following lines (preceded by number
signs)', "\n";
print 'There should not be any blank lines between those two lines', "\n";
print "\n";
print 'April 19, 2004 - This is the first line of Perltest.txt - A
comment', "\n";
print 'This is the second line of the print test - Also a comment', "\n";
print "\n";
print 'This program should now halt for 25 seconds.', "\n";
print 'Then it will try to have a text editor open and display', "\n";
print 'the file named Perltest.txt', "\n";
print "\n";
for $delaytime(1..25){;
print 26 - $delaytime, "\n";
sleep 1};

# For use with Windows XP
#
# If you are using Windows 98 or some other operating system:
# Add # at the start of the first print line below.
# Then if you are using Windows 98 remove the # at the start of
# the second print line below.
# If are not using either version of Windows then add # at the
# start of the exec line below.
open batfile, '> '.$directoryname.'Perltest.bat';
print batfile 'c:\windows\start.exe '.$directoryname.'Perltest.txt';
# print batfile 'c:\windows\start.exe '.$directoryname.'Perltest.txt';
close batfile;

# What optional commands need to added here to get other operating systems
# to have a text editor automatically open Perltest.txt file
# and display it?

# The following statement will tell Windows XP or 98 to run that bat file
# Add a # at the start of this line if you are using some other
# operating system.
exec $directoryname.'Perltest.bat';

__END__

The last line before that __END__ is the end of this program.

any text can be entered below the __END__ statement without the need
for the number signs which are at the beginning of comment lines etc.



Relevant Pages

  • Re: starting Solver with VBA
    ... Sub Solver_Show ... Windows XP & Office 2007 ... code just to display the dialog box - which is all I want it to do. ... The code will be in the VB Editor. ...
    (microsoft.public.excel.programming)
  • Re: Error: No printer found.
    ... Is the printer set as default in Windows? ... Stefan Blom ... Microsoft Word MVP ... Lexmark Z82 - and I can print test page; ...
    (microsoft.public.word.application.errors)
  • Best way to print photos
    ... Let us suppose that I have a HP DeskJet 5850 that I can talk to via ... I can print test pages w/o any problem. ... expect relative to Windows? ...
    (freebsd-questions)