Ticket #187: testrel2abs.pl

File testrel2abs.pl, 1.4 KB (added by Shmuel (Seymour J.) Metz, 6 years ago)

Perl program to demonstrate errors

Line 
1#! perl
2use Cwd 'abs_path';
3use Data::Dumper;
4use File::Spec;
5my $inter;
6$inter = "Cwd->abs_path(F:testpl.cmd)";
7print "\ninter=",$inter,"\n";
8print "\ninter=",Dumper($inter),"\n";
9my @inter;
10@inter=("\nCwd->abs_path(F:testpl.cmd)        = ", Cwd->abs_path('F:testpl.cmd'),"\n");
11print "\n\inter=",Dumper(@inter),"\n";
12print "\nCwd->abs_path(F:testpl.cmd)        = ", Cwd->abs_path('F:testpl.cmd'),"\n";
13print "\nCwd->abs_path(G:testpl.cmd)        = ", Cwd->abs_path('G:testpl.cmd'),"\n";
14print "\nCwd->abs_path(H:testpl.cmd)        = ", Cwd->abs_path('H:testpl.cmd'),"\n";
15print "\nCwd->abs_path(testpl.cmd)          = ", Cwd->abs_path('testpl.cmd'),"\n";
16print "\nCwd->abs_path(\\testpl.cmd)         = ", Cwd->abs_path('\testpl.cmd'),"\n";
17print "\nCwd->abs_path(\\\\server\\testpl.cmd) = ", Cwd->abs_path('\\server\testpl.cmd');
18print "\n";
19
20print "\nFile::Spec->rel2abs(F:testpl.cmd)         = ", File::Spec->rel2abs('F:testpl.cmd');
21print "\nFile::Spec->rel2abs(G:testpl.cmd)         = ", File::Spec->rel2abs('G:testpl.cmd');
22print "\nFile::Spec->rel2abs(H:testpl.cmd)         = ", File::Spec->rel2abs('H:testpl.cmd');
23print "\nFile::Spec->rel2abs(testpl.cmd)           = ", File::Spec->rel2abs('testpl.cmd');
24print "\nFile::Spec->rel2abs(\\testpl.cmd)          = ", File::Spec->rel2abs('\testpl.cmd');
25print "\nFile::Spec->rel2abs(\\\\server\\testpl.cmd)  = ", File::Spec->rel2abs('\\server\testpl.cmd');