For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > January 2006 > running a short perl script in a windows XP arena









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author running a short perl script in a windows XP arena
DBSMITH@OhioHealth.com

2006-01-10, 4:01 am

All,

Here is my script and it is outputting "file is not present" when it should
be outputting "temp file is good and $MHfile is there\n";
Am I missing something since I am running this is a Windows env?
thank you,
derek


#!/usr/bin/perl

use strict;
use warnings;
require 5.8.0;
$ENV{"PATH"} = qq(C:\\Documents*\\mh-hl7:C:\\Perl\\bin);

my $p= qq(--passphrase-fd 0);
my $de= qw(--decrypt);
my $outp= qw(--output);
my $MHfile= qq(C:\\Documents*\\mh-hl7\\MHFM.*);
my $pass= qq(C:\\temp\\pass.txt);

# unlink qq(C:\\Documents*\\mh-hl7\\MHFM.*);

if ( -s $MHfile ) {
print "temp file is good and $MHfile is there\n";
open (PASS, "C:\\temp\\pass.txt");
for (;<PASS>;) {
print $_;
}
}
else {
print "file not present\n";
#system ("C:\\WINDOWS\\notepad.exe C:\\temp\\pass.txt");
}

close (PASS);

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams


Charles K. Clarkson

2006-01-10, 4:01 am

DBSMITH@OhioHealth.com <mailto:DBSMITH@OhioHealth.com> wrote:

: my $MHfile= qq(C:\\Documents*\\mh-hl7\\MHFM.*);

Windows XP does not allow the asterisk in paths or filenames.
This is not a valid filename. If the asterisks are supposed to be
wildcards, perl will not expand them automatically.

HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328


Timothy Johnson

2006-01-10, 4:01 am


For starters, you aren't formatting your PATH variable correctly. That
should be a semicolon before "C:\\Perl".

-----Original Message-----
From: DBSMITH@OhioHealth.com [mailto:DBSMITH@OhioHealth.com]=20
Sent: Wednesday, December 28, 2005 2:01 PM
To: beginners@perl.org
Subject: running a short perl script in a Windows XP arena

All,

Here is my script and it is outputting "file is not present" when it
should
be outputting "temp file is good and $MHfile is there\n";
Am I missing something since I am running this is a Windows env?
thank you,
derek


#!/usr/bin/perl

use strict;
use warnings;
require 5.8.0;
$ENV{"PATH"} =3D qq(C:\\Documents*\\mh-hl7:C:\\Perl\\bin);

my $p=3D qq(--passphrase-fd 0);
my $de=3D qw(--decrypt);
my $outp=3D qw(--output);
my $MHfile=3D qq(C:\\Documents*\\mh-hl7\\MHFM.*);
my $pass=3D qq(C:\\temp\\pass.txt);

# unlink qq(C:\\Documents*\\mh-hl7\\MHFM.*);

if ( -s $MHfile ) {
print "temp file is good and $MHfile is there\n";
open (PASS, "C:\\temp\\pass.txt");
for (;<PASS>;) {
print $_;
}
}
else {
print "file not present\n";
#system ("C:\\WINDOWS\\notepad.exe C:\\temp\\pass.txt");
}

close (PASS);

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams



--=20
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>



DBSMITH@OhioHealth.com

2006-01-10, 4:01 am

ok I will take that out .... I reran it and still get the same error. This
is not the problem.
Note: this is the correct way to do it within Unix.

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams





"Timothy Johnson"
<tjohnson@zone.ch
eckpoint.com> To
<DBSMITH@OhioHealth.com>,
12/28/2005 05:06 <beginners@perl.org>
PM cc

Subject
RE: running a short perl script in
a Windows XP arena











For starters, you aren't formatting your PATH variable correctly. That
should be a semicolon before "C:\\Perl".

-----Original Message-----
From: DBSMITH@OhioHealth.com [mailto:DBSMITH@OhioHealth.com]
Sent: Wednesday, December 28, 2005 2:01 PM
To: beginners@perl.org
Subject: running a short perl script in a Windows XP arena

All,

Here is my script and it is outputting "file is not present" when it
should
be outputting "temp file is good and $MHfile is there\n";
Am I missing something since I am running this is a Windows env?
thank you,
derek


#!/usr/bin/perl

use strict;
use warnings;
require 5.8.0;
$ENV{"PATH"} = qq(C:\\Documents*\\mh-hl7:C:\\Perl\\bin);

my $p= qq(--passphrase-fd 0);
my $de= qw(--decrypt);
my $outp= qw(--output);
my $MHfile= qq(C:\\Documents*\\mh-hl7\\MHFM.*);
my $pass= qq(C:\\temp\\pass.txt);

# unlink qq(C:\\Documents*\\mh-hl7\\MHFM.*);

if ( -s $MHfile ) {
print "temp file is good and $MHfile is there\n";
open (PASS, "C:\\temp\\pass.txt");
for (;<PASS>;) {
print $_;
}
}
else {
print "file not present\n";
#system ("C:\\WINDOWS\\notepad.exe C:\\temp\\pass.txt");
}

close (PASS);

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams



--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>




--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Timothy Johnson

2006-01-10, 4:01 am


Try printing out the result of the variables you are creating. Maybe
I'm just not getting what you're trying to do, but I don't think it's
doing what you think it's doing.


-----Original Message-----
From: DBSMITH@ohiohealth.com [mailto:DBSMITH@ohiohealth.com]=20
Sent: Wednesday, December 28, 2005 3:48 PM
To: Timothy Johnson
Cc: beginners@perl.org
Subject: RE: running a short perl script in a Windows XP arena

ok I will take that out .... I reran it and still get the same error.
This
is not the problem.
Note: this is the correct way to do it within Unix.

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams




=20

"Timothy Johnson"

<tjohnson@zone.ch

eckpoint.com>
To=20
<DBSMITH@OhioHealth.com>,

12/28/2005 05:06 <beginners@perl.org>

PM
cc=20
=20

=20
Subject=20
RE: running a short perl script
in =20
a Windows XP arena

=20

=20

=20

=20

=20

=20






For starters, you aren't formatting your PATH variable correctly. That
should be a semicolon before "C:\\Perl".

-----Original Message-----
From: DBSMITH@OhioHealth.com [mailto:DBSMITH@OhioHealth.com]
Sent: Wednesday, December 28, 2005 2:01 PM
To: beginners@perl.org
Subject: running a short perl script in a Windows XP arena

All,

Here is my script and it is outputting "file is not present" when it
should
be outputting "temp file is good and $MHfile is there\n";
Am I missing something since I am running this is a Windows env?
thank you,
derek


#!/usr/bin/perl

use strict;
use warnings;
require 5.8.0;
$ENV{"PATH"} =3D qq(C:\\Documents*\\mh-hl7:C:\\Perl\\bin);

my $p=3D qq(--passphrase-fd 0);
my $de=3D qw(--decrypt);
my $outp=3D qw(--output);
my $MHfile=3D qq(C:\\Documents*\\mh-hl7\\MHFM.*);
my $pass=3D qq(C:\\temp\\pass.txt);

# unlink qq(C:\\Documents*\\mh-hl7\\MHFM.*);

if ( -s $MHfile ) {
print "temp file is good and $MHfile is there\n";
open (PASS, "C:\\temp\\pass.txt");
for (;<PASS>;) {
print $_;
}
}
else {
print "file not present\n";
#system ("C:\\WINDOWS\\notepad.exe C:\\temp\\pass.txt");
}

close (PASS);

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams



--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>




--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>





Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com