Re: Absoulte path in Perl
am 05.06.2007 11:16:14 von Mothi Mehta
--===============0679160307==
Content-Type: multipart/alternative;
boundary="----=_Part_6989_32133560.1181034974607"
------=_Part_6989_32133560.1181034974607
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Thanks,
I have tried the same , but after creating exe using pdk its shows
CGI Error The specified CGI application misbehaved by not returning a
complete set of HTTP headers
--LM
On 6/5/07, Kenneth Ölwing wrote:
>
>
> > Cannot find current script
> '\\?\c:\inetpub\wwwroot\mydemos\examples\testscript\path.exe ' at
> /PerlApp/FindBin.pm line 201
> > BEGIN failed--compilation aborted at /PerlApp/FindBin.pm line 201.
> > BEGIN failed--compilation aborted at path.pl line 9.
> >
> For some reason IIS (?) is using the unicode form of the path (i.e.
> prefixing with \\?) and this causes FindBin to fail. Actually, just
> putting the following in c:\tmp\foo.pl:
>
> use FindBin;
>
> and then trying to run with 'perl \\?\c:\tmp\foo.pl' causes the same
> error (note that the script *does* run however - giving a path this way
> is thus legal).
>
> Tracing it shows that it is a 'file exist' check that fails, and indeed,
> trying it specifically shows this. Assuming c:\tmp\foo.pl exists as a
> file:
>
> perl -e "print -f $ARGV[0]" c:\tmp\foo.pl
>
> will print '1', while
>
> perl -e "print -f $ARGV[0]" \\?\c:\tmp\x.pl
>
> will print '' (i.e. a blank value, indicating false). Still, it's
> generally ok to use the \\? form (since the example above, running 'perl
> \\?\c:\tmp\foo.pl' nicely runs the script).
>
> Thus, I'd file this as a bug with the '-f' operator...?
>
> For your particular problem - whether you can get IIS to avoid that form
> I have no idea. A workaround might be this...
>
> ...
> BEGIN { $0 =3D~ s#^\\\\\?\\## };
> use FindBin;
> ...
>
> Ugh...not very nice and I don't know if it might cause problems
> elsewhere, or if it'll work when perlapped...
>
> ken1
>
>
------=_Part_6989_32133560.1181034974607
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Thanks,
I have tried the same , but after creating exe using pdk its shows
iv>
CGI Error
The specified CGI application misbehaved by not returning a complete s=
et of HTTP headers
--LM
On 6/5/07, K=
enneth Ölwing <kenneth@olwing=
..se> wrote:
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
> Cannot find current scr=
ipt '\\?\c:\inetpub\wwwroot\mydemos\examples\testscript\path.exe ' a=
t /PerlApp/FindBin.pm line 201
> BEGIN failed--compilation aborted at /PerlApp/FindBin.pm line 201.=
> BEGIN failed--compilation aborted at path.pl line 9.
>
Fo=
r some reason IIS (?) is using the unicode form of the path (i.e.
prefix=
ing with \\?) and this causes FindBin to fail. Actually, just
putting the following in c:\tmp\foo.pl:
use FindBin;
and =
then trying to run with 'perl \\?\c:\tmp\foo.pl' causes the same
>error (note that the script *does* run however - giving a path this way
is thus legal).
Tracing it shows that it is a 'file exist=
9; check that fails, and indeed,
trying it specifically shows this. Assu=
ming c:\tmp\foo.pl exists as a file:
perl -e "prin=
t -f $ARGV[0]" c:\tmp\foo.pl
will print '1', while
perl -e "pri=
nt -f $ARGV[0]" \\?\c:\tmp\x.pl
will print '' (i.e. a b=
lank value, indicating false). Still, it's
generally ok to use the \=
\? form (since the example above, running 'perl
\\?\c:\tmp\foo.pl' nicely runs the script).
Thus, I'd fi=
le this as a bug with the '-f' operator...?
For your particu=
lar problem - whether you can get IIS to avoid that form
I have no idea.=
A workaround might be this...
...
BEGIN { $0 =3D~ s#^\\\\\?\\## };
use FindBin;
...
<=
br>Ugh...not very nice and I don't know if it might cause problems
e=
lsewhere, or if it'll work when perlapped...
ken1
quote>
------=_Part_6989_32133560.1181034974607--
--===============0679160307==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0679160307==--
Re: Absoulte path in Perl
am 05.06.2007 11:17:34 von Mothi Mehta
--===============1354752981==
Content-Type: multipart/alternative;
boundary="----=_Part_6997_12747268.1181035054445"
------=_Part_6997_12747268.1181035054445
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
also I am ship jre6 with my application, so I don't wants to use existing..
On 6/5/07, Mothi Mehta wrote:
>
> Thanks,
> I have tried the same , but after creating exe using pdk its shows
>
> CGI Error The specified CGI application misbehaved by not returning a
> complete set of HTTP headers
>
> --LM
>
>
> On 6/5/07, Kenneth Ölwing wrote:
> >
> >
> > > Cannot find current script
> > '\\?\c:\inetpub\wwwroot\mydemos\examples\testscript\path.exe ' at
> > /PerlApp/FindBin.pm line 201
> > > BEGIN failed--compilation aborted at /PerlApp/FindBin.pm line 201.
> > > BEGIN failed--compilation aborted at path.pl line 9.
> > >
> > For some reason IIS (?) is using the unicode form of the path (i.e.
> > prefixing with \\?) and this causes FindBin to fail. Actually, just
> > putting the following in c:\tmp\foo.pl:
> >
> > use FindBin;
> >
> > and then trying to run with 'perl \\?\c:\tmp\foo.pl' causes the same
> > error (note that the script *does* run however - giving a path this way
> > is thus legal).
> >
> > Tracing it shows that it is a 'file exist' check that fails, and indeed=
,
> > trying it specifically shows this. Assuming c:\tmp\foo.pl exists as a
> > file:
> >
> > perl -e "print -f $ARGV[0]" c:\tmp\foo.pl
> >
> > will print '1', while
> >
> > perl -e "print -f $ARGV[0]" \\?\c:\tmp\x.pl
> >
> > will print '' (i.e. a blank value, indicating false). Still, it's
> > generally ok to use the \\? form (since the example above, running 'per=
l
> >
> > \\?\c:\tmp\foo.pl' nicely runs the script).
> >
> > Thus, I'd file this as a bug with the '-f' operator...?
> >
> > For your particular problem - whether you can get IIS to avoid that for=
m
> > I have no idea. A workaround might be this...
> >
> > ...
> > BEGIN { $0 =3D~ s#^\\\\\?\\## };
> > use FindBin;
> > ...
> >
> > Ugh...not very nice and I don't know if it might cause problems
> > elsewhere, or if it'll work when perlapped...
> >
> > ken1
> >
> >
>
------=_Part_6997_12747268.1181035054445
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
also I am ship jre6 with my application, so I don't wants to use existi=
ng..
On 6/5/07, M=
othi Mehta <evergreenu=
daipur@gmail.com> wrote:
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
Thanks,
I have tried the same , but after creating exe using pdk its shows
iv>
CGI Error
The specified CGI application misbehaved by not returning a complete s=
et of HTTP headers
--LM
On 6/5/07, K=
enneth Ölwing <
t,this)" href=3D"mailto:kenneth@olwing.se" target=3D"_blank">kenneth@olwing=
..se
> wrote:=20
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
> Cannot find current scr=
ipt '\\?\c:\inetpub\wwwroot\mydemos\examples\testscript\path.exe ' a=
t /PerlApp/FindBin.pm line 201=20
> BEGIN failed--compilation aborted at /PerlApp/FindBin.pm line 201.=
> BEGIN failed--compilation aborted at path.pl line 9.
>
Fo=
r some reason IIS (?) is using the unicode form of the path (i.e.
prefix=
ing with \\?) and this causes FindBin to fail. Actually, just=20
putting the following in c:\tmp\foo.pl:
use FindBin;
and =
then trying to run with 'perl \\?\c:\tmp\foo.pl' causes the same
>error (note that the script *does* run however - giving a path this way=20
is thus legal).
Tracing it shows that it is a 'file exist=
9; check that fails, and indeed,
trying it specifically shows this. Assu=
ming c:\tmp\foo.pl exists as a file:
perl -e "prin=
t -f $ARGV[0]" c:\tmp\foo.pl=20
will print '1', while
perl -e "pri=
nt -f $ARGV[0]" \\?\c:\tmp\x.pl
will print '' (i.e. a b=
lank value, indicating false). Still, it's
generally ok to use the \=
\? form (since the example above, running 'perl=20
\\?\c:\tmp\foo.pl' nicely runs the script).
Thus, I'd fi=
le this as a bug with the '-f' operator...?
For your particu=
lar problem - whether you can get IIS to avoid that form
I have no idea.=
A workaround might be this...=20
...
BEGIN { $0 =3D~ s#^\\\\\?\\## };
use FindBin;
...
<=
br>Ugh...not very nice and I don't know if it might cause problems
e=
lsewhere, or if it'll work when perlapped...
ken1
quote>
------=_Part_6997_12747268.1181035054445--
--===============1354752981==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1354752981==--
Re: Absoulte path in Perl
am 05.06.2007 11:30:10 von ken1
This is a multi-part message in MIME format.
--===============1012080602==
Content-Type: multipart/alternative;
boundary="------------030603090005080200080201"
This is a multi-part message in MIME format.
--------------030603090005080200080201
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
> I have tried the same , but after creating exe using pdk its shows
>
>
>
> CGI Error
>
> The specified CGI application misbehaved by not returning a complete
> set of HTTP headers
Umm, what exactly do you mean to have tried??? Again, I'm not skilled in
CGI, but this seems unrelated to the FindBin problem? My suggested
workaround, e.g. the BEGIN is just a snippet of course, insert it into
your original code. Perhaps I misunderstand you completely...
ken1
--------------030603090005080200080201
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
cite="mid:68ab69220706050216q6fc413e7h1f1434189a403af2@mail. gmail.com"
type="cite">
I have tried the same , but after creating exe using pdk its
shows
CGI Error
The specified CGI application misbehaved by not returning a
complete set of HTTP headers
Umm, what exactly do you mean to have tried??? Again, I'm not skilled
in CGI, but this seems unrelated to the FindBin problem? My suggested
workaround, e.g. the BEGIN is just a snippet of course, insert it into
your original code. Perhaps I misunderstand you completely...
ken1
--------------030603090005080200080201--
--===============1012080602==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1012080602==--
Re: Absoulte path in Perl
am 05.06.2007 11:48:40 von Mothi Mehta
--===============1796209139==
Content-Type: multipart/alternative;
boundary="----=_Part_7175_32039121.1181036920985"
------=_Part_7175_32039121.1181036920985
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi,
I have tried that :
#!perl --
use strict;
use warnings;
use CGI;
BEGIN { $0 =3D~ s#^\\\\\?\\## };
use FindBin;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
my $cgi =3D CGI->new;
print $cgi->header;
my $jver =3D 'unknown or jre6 not found';
my $spath =3D "$ENV{SystemRoot}\\SYSTEM32";
$ENV{PATH} .=3D ";$spath";
my $osname =3D lc $^O;
if ($osname eq 'linux') {
$jver =3D `./version.sh`;
}
else
{
my $jrepath =3D "$FindBin::Bin/jre6/bin/java.exe";
if (-e $jrepath)
{
$jver =3D `$jrepath -version 2>&1`;
}
}
print <
Absolute Path Sample Script Showing How To Get Absolute Path In PERL
And JavaVersion
The Absolute Path to this script is:
#0066FF;">$FindBin::Bin
The script I'm executing is:
#0066FF;">$0
The output of 'java -version' is:
$jver
The Perl binary I'm executing is at:
#0066FF;">$^X
END_HTML
exit;
it works while running with
http://localhost/mydemos/examples/perlscript/foo.pl'
but when I have created exe and tried the same
http://localhost/mydemos/examples/perlscript/foo.exe then its show CGI erro=
r
On 6/5/07, Kenneth Ölwing wrote:
>
>
> I have tried the same , but after creating exe using pdk its shows
>
> CGI Error The specified CGI application misbehaved by not returning a
> complete set of HTTP headers
>
> Umm, what exactly do you mean to have tried??? Again, I'm not skilled in
> CGI, but this seems unrelated to the FindBin problem? My suggested
> workaround, e.g. the BEGIN is just a snippet of course, insert it into
> your original code. Perhaps I misunderstand you completely...
>
> ken1
>
>
------=_Part_7175_32039121.1181036920985
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi,
I have tried that :
#!perl --
use strict;
use warnings;
use CGI;
BEGIN { $0 =3D~ s#^\\\\\?\\#=
# };
use FindBin;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser)=
;
my $cgi =3D CGI->new;
print $cgi->header;
my $jver =3D '=
unknown or jre6 not found';
my $spath =3D "$ENV{SystemRoot}\\SYSTEM32";
$ENV{PATH} .=3D=
";$spath";
my $osname =3D lc $^O;
if ($osname eq 'linux') {
&nb=
sp; $jver =3D `./version.sh`;
}
else
{
r> my $jrepath =3D "$FindBin::Bin/=
jre6/bin/java.exe";
if (-e $jrepath)
&nb=
sp; {
=
$jver =3D `$jrepath -version 2>&=
;1`;
}
}
print <<END_HTML;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HT=
ML 4.01 Transitional//EN">
<HTML>
<HEAD>
<T=
ITLE>Absolute Path Sample Script Showing How To Get Absolute Path In PER=
L And JavaVersion</TITLE>
</HEAD>
<BODY>
<h3>The Absolute Path to this script is: <span style=3D"co=
lor: #0066FF;">$FindBin::Bin</span></h3>
<h3>T=
he script I'm executing is: <span style=3D"color: #0066FF;"=
;>$0</span></h3>
<h3>The output of 'java -version' is: </h3>
<=
span style=3D"color: #0066FF;">
<PRE>
$jver
<=
;/PRE>
</span>
<h3>The Perl binary I'm executing i=
s at: <span style=3D"color: #0066FF;">$^X</span></=
h3>
</BODY>
</HTML>
END_HTML
exit;
it works while running with
es/perlscript/foo.pl'">http://localhost/mydemos/examples/perlscript/foo=
..pl'
but when I have created exe and tried the same
/localhost/mydemos/examples/perlscript/foo.exe">http://local host/mydemos/ex=
amples/perlscript/foo.exe then its show CGI error
On 6/5/07, K=
enneth Ölwing <kenneth@olwing=
..se> wrote:
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
I have tried the same , but after creating exe using pdk its shows
iv>
CGI Error
The specified CGI application misbehaved by not returning a complete s=
et of HTTP headers
Umm, what exactly do you mean t=
o have tried??? Again, I'm not skilled in CGI, but this seems unrelated=
to the FindBin problem? My suggested workaround,=20
e.g. the BEGIN is just a snippet of course, insert it into your original co=
de. Perhaps I misunderstand you completely...
ken1
=
blockquote>
------=_Part_7175_32039121.1181036920985--
--===============1796209139==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1796209139==--
Re: Absoulte path in Perl
am 05.06.2007 11:50:36 von Mothi Mehta
--===============1170227680==
Content-Type: multipart/alternative;
boundary="----=_Part_7191_27333936.1181037036259"
------=_Part_7191_27333936.1181037036259
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
and When I have tried on other machine, that havn't perl installed, this
shows
CGI ErrorThe specified CGI application misbehaved by not returning a
complete set of HTTP headers. The headers it did return are:
Cannot find current script '\\?\c:\inetpub\wwwroot\lmtest\foo.exe' at
/PerlApp/FindBin.pm line 201
BEGIN failed--compilation aborted at /PerlApp/FindBin.pm line 201.
BEGIN failed--compilation aborted at foo.pl line 7.
On 6/5/07, Mothi Mehta wrote:
>
> Hi,
>
> I have tried that :
>
>
> #!perl --
>
> use strict;
> use warnings;
> use CGI;
> BEGIN { $0 =3D~ s#^\\\\\?\\## };
> use FindBin;
> use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
>
> my $cgi =3D CGI->new;
> print $cgi->header;
> my $jver =3D 'unknown or jre6 not found';
>
> my $spath =3D "$ENV{SystemRoot}\\SYSTEM32";
> $ENV{PATH} .=3D ";$spath";
>
> my $osname =3D lc $^O;
> if ($osname eq 'linux') {
> $jver =3D `./version.sh`;
> }
> else
> {
> my $jrepath =3D "$FindBin::Bin/jre6/bin/java.exe";
>
> if (-e $jrepath)
> {
> $jver =3D `$jrepath -version 2>&1`;
> }
> }
>
> print <
>
>
>
> Absolute Path Sample Script Showing How To Get Absolute Path In
> PERL And JavaVersion
>
>
>
> The Absolute Path to this script is:
> #0066FF;">$FindBin::Bin
> The script I'm executing is:
> #0066FF;">$0
> The output of 'java -version' is:
>
>
> $jver
>
>
> The Perl binary I'm executing is at:
> #0066FF;">$^X
>
>
>
> END_HTML
>
> exit;
>
>
> it works while running with
> http://localhost/mydemos/examples/perlscript/foo.pl'
> but when I have created exe and tried the same
> http://localhost/mydemos/examples/perlscript/foo.exe then its show CGI
> error
>
>
>
>
>
> On 6/5/07, Kenneth Ölwing wrote:
> >
> >
> > I have tried the same , but after creating exe using pdk its shows
> >
> > CGI Error The specified CGI application misbehaved by not returning a
> > complete set of HTTP headers
> >
> > Umm, what exactly do you mean to have tried??? Again, I'm not skilled i=
n
> > CGI, but this seems unrelated to the FindBin problem? My suggested
> > workaround, e.g. the BEGIN is just a snippet of course, insert it into
> > your original code. Perhaps I misunderstand you completely...
> >
> > ken1
> >
> >
>
>
------=_Part_7191_27333936.1181037036259
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
and When I have tried on other machine, that havn't perl installed=
, this shows
CGI Error
The specified CGI application misbehaved by not returning=
a complete set of HTTP headers. The headers it did return are:=20
Cannot find current script '\\?\c:\inetpub\wwwroot\lmtest\foo.e=
xe' at /PerlApp/FindBin.pm line 201
BEGIN failed--compilation aborted at /PerlApp/FindBin.pm line 201.
BEGIN failed--compilation aborted at foo.pl line 7.
On 6/5/07, M=
othi Mehta <evergreenu=
daipur@gmail.com> wrote:
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
Hi,
I have tried that :
#!perl --
use strict;
use warnings;
use CGI;
an class=3D"q">BEGIN { $0 =3D~ s#^\\\\\?\\## };
use FindBin;
<=
span class=3D"q">use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
>
my $cgi =3D CGI->new;
print $cgi->header;
my $jver =3D '=
unknown or jre6 not found';
my $spath =3D "$ENV{SystemRoot}\\SYSTEM32";
$ENV{PATH} .=3D=
";$spath";
my $osname =3D lc $^O;
if ($osname eq 'linux') {
&nb=
sp; $jver =3D `./version.sh`;
=
}
else
{
my $jrepath =3D &q=
uot;$FindBin::Bin/jre6/bin/java.exe";
if (-e $jrepath)
&nb=
sp; {
=
$jver =3D `$jrepath -version 2>&=
;1`;
}
}
print <<END_HTML;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HT=
ML 4.01 Transitional//EN">
<HTML>
<HEAD>
<T=
ITLE>Absolute Path Sample Script Showing How To Get Absolute Path In PER=
L And JavaVersion</TITLE>=20
</HEAD>
<BODY>
<h3>The Absolute Path to this script is: <spa=
n style=3D"color: #0066FF;">$FindBin::Bin</span></h3&=
gt;
<h3>The script I'm executing is: <span style=3D"co=
lor: #0066FF;">$0</span></h3>=20
<h3>The output of 'java -version' is: </h3>
<=
span style=3D"color: #0066FF;">
<PRE>
$jver
<=
;/PRE>
</span>
<h3>The Perl binary I'm exec=
uting is at: <span style=3D"color: #0066FF;">$^X</span&g=
t;</h3>=20
</BODY>
</HTML>
END_HTML
exit;
it works while running with
ndow,event,this)" href=3D"http://localhost/mydemos/examples/perlscript/foo.=
pl'" target=3D"_blank">http://localhost/mydemos/examples/perlscri pt/foo=
..pl'
but when I have created exe and tried the same
urn top.js.OpenExtLink(window,event,this)" href=3D"http://localhost/mydemos=
/examples/perlscript/foo.exe" target=3D"_blank">http://localhost/mydemos/ex=
amples/perlscript/foo.exe
then its show CGI error
On 6/5/07,
mail_sendername">Kenneth Ölwing <
xtLink(window,event,this)" href=3D"mailto:kenneth@olwing.se" target=3D"_bla=
nk">kenneth@olwing.se
> wrote:
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
I have tried the same , but after creating exe using pdk its shows
iv>
CGI Error
The specified CGI application misbehaved by not returning a complete s=
et of HTTP headers
Umm, what exactly do you mean t=
o have tried??? Again, I'm not skilled in CGI, but this seems unrelated=
to the FindBin problem? My suggested workaround,=20
e.g. the BEGIN is just a snippet of course, insert it into your original co=
de. Perhaps I misunderstand you completely...
ken1
=
blockquote>
------=_Part_7191_27333936.1181037036259--
--===============1170227680==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1170227680==--
Re: Absoulte path in Perl
am 05.06.2007 15:19:55 von ken1
This is a multi-part message in MIME format.
--===============2074852544==
Content-Type: multipart/alternative;
boundary="------------010005050207080007010700"
This is a multi-part message in MIME format.
--------------010005050207080007010700
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
> CGI Error
>
> The specified CGI application misbehaved by not returning a complete
> set of HTTP headers. The headers it did return are:
>
> Cannot find current script '\\?\c:\inetpub\wwwroot\lmtest\foo.exe' at /PerlApp/FindBin.pm line 201
> BEGIN failed--compilation aborted at /PerlApp/FindBin.pm line 201.
> BEGIN failed--compilation aborted at foo.pl line 7.
>
Well, how to make the CGI stuff behave I have no idea. The error above
suggest that the BEGIN never ran (you did recompile?), or, that it isn't
possible to assign to $0 in that manner in a perlapp. Or something else
is broken...sorry, can't help much beyond here.
ken1
--------------010005050207080007010700
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
cite="mid:68ab69220706050250k340f428h13cddbc51df9c479@mail.g mail.com"
type="cite">
CGI Error
The specified CGI application misbehaved by not returning a complete
set of HTTP headers. The headers it did return are:
Cannot find current script '\\?\c:\inetpub\wwwroot\lmtest\foo.exe' at /PerlApp/FindBin.pm line 201
BEGIN failed--compilation aborted at /PerlApp/FindBin.pm line 201.
BEGIN failed--compilation aborted at foo.pl line 7.
Well, how to make the CGI stuff behave I have no idea. The error above
suggest that the BEGIN never ran (you did recompile?), or, that it
isn't possible to assign to $0 in that manner in a perlapp. Or
something else is broken...sorry, can't help much beyond here.
ken1
--------------010005050207080007010700--
--===============2074852544==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============2074852544==--
RE: Absoulte path in Perl
am 05.06.2007 17:14:43 von Jan Dubois
This is a multipart message in MIME format.
--===============1392853872==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0333_01C7A749.929F8ED0"
Content-Language: en-ca
This is a multipart message in MIME format.
------=_NextPart_000_0333_01C7A749.929F8ED0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
PerlApp needs to do some magic behind the scenes to keep FindBin =
working, so modifying $0 doesn=92t have any effect.
=20
Please add the following BEGIN block to the top of your script to work =
around this issue.
=20
BEGIN {
return unless defined &PerlApp::exe;
my $exe =3D PerlApp::exe();
$exe =3D~ s#^\\\\\?\\##;
no warnings "redefine";
*PerlApp::exe =3D sub { $exe };
}
=20
I=92ll fix PerlApp for PDK 7.1 to automatically strip the \\?\ prefix =
from $0 and PerlApp::exe() to make this workaround unnecessary.
=20
Cheers,
-Jan
=20
PS: Please send PerlApp and other PDK related questions/problems to the =
PDK mailing list (once it becomes clear that it is a PDK
related issue and not a general Perl problem).
=20
From: activeperl-bounces@listserv.ActiveState.com =
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Mothi =
Mehta
Sent: June 5, 2007 2:51 AM
To: Kenneth Ölwing
Cc: activeperl@listserv.activestate.com
Subject: Re: Absoulte path in Perl
=20
and When I have tried on other machine, that havn't perl installed, this =
shows
=20
CGI Error
The specified CGI application misbehaved by not returning a complete set =
of HTTP headers. The headers it did return are:=20
Cannot find current script '\\?\c:\inetpub\wwwroot\lmtest\foo.exe' at =
/PerlApp/FindBin.pm line 201
BEGIN failed--compilation aborted at /PerlApp/FindBin.pm line 201.
BEGIN failed--compilation aborted at foo.pl line 7.
=20
On 6/5/07, Mothi Mehta wrote:=20
Hi,=20
=20
I have tried that :
=20
#!perl --
use strict;
use warnings;
use CGI;
BEGIN { $0 =3D~ s#^\\\\\?\\## };
use FindBin;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
my $cgi =3D CGI->new;
print $cgi->header;
my $jver =3D 'unknown or jre6 not found';
my $spath =3D "$ENV{SystemRoot}\\SYSTEM32";
$ENV{PATH} .=3D ";$spath";
my $osname =3D lc $^O;
if ($osname eq 'linux') {
$jver =3D `./version.sh`;
}=20
else=20
{
my $jrepath =3D "$FindBin::Bin/jre6/bin/java.exe";
if (-e $jrepath)
{
$jver =3D `$jrepath -version 2>&1`;
}=20
}
print <
Absolute Path Sample Script Showing How To Get Absolute Path In =
PERL And JavaVersion=20
The Absolute Path to this script is:
#0066FF;">$FindBin::Bin
The script I'm executing is:
#0066FF;">$0
=20
The output of 'java -version' is:
$jver
The Perl binary I'm executing is at:
#0066FF;">$^X
=20
END_HTML
exit;
=20
it works while running with =
http://localhost/mydemos/examples/perlscript/foo.pl'=20
but when I have created exe and tried the same =
http://localhost/mydemos/examples/perlscript/foo.exe then its show CGI =
error
=20
=20
=20
On 6/5/07, Kenneth Ölwing
> wrote:=20
I have tried the same , but after creating exe using pdk its shows=20
=20
CGI Error
The specified CGI application misbehaved by not returning a complete set =
of HTTP headers
Umm, what exactly do you mean to have tried??? Again, I'm not skilled in =
CGI, but this seems unrelated to the FindBin problem? My
suggested workaround, e.g. the BEGIN is just a snippet of course, insert =
it into your original code. Perhaps I misunderstand you
completely...
ken1
=20
=20
=20
------=_NextPart_000_0333_01C7A749.929F8ED0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
charset=3Diso-8859-1">
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>PerlApp needs to do some magic behind the scenes to keep =
FindBin
working, so modifying $0 doesn’t have any =
effect.
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Please add the following BEGIN block to the top of your =
script
to work around this issue.
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>
style=3D'font-size:11.0pt;
font-family:"Courier New";color:black'>BEGIN {
style=3D'font-size:11.0pt;
font-family:"Courier New";color:black'> =A0 return unless defined
&PerlApp::exe;
style=3D'font-size:11.0pt;
font-family:"Courier New";color:black'> =A0 my $exe =3D =
PerlApp::exe();
style=3D'font-size:11.0pt;
font-family:"Courier New";color:black'> =A0 $exe =3D~ =
s#^\\\\\?\\##;
style=3D'font-size:11.0pt;
font-family:"Courier New";color:black'> =A0 no warnings =
"redefine";
style=3D'font-size:11.0pt;
font-family:"Courier New";color:black'> =A0 *PerlApp::exe =3D sub { =
$exe };
style=3D'font-size:11.0pt;
font-family:"Courier New";color:black'>}
style=3D'font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>
>
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>I’ll fix PerlApp for PDK 7.1 to automatically strip =
the \\?\
prefix from $0 and PerlApp::exe() to make this workaround =
unnecessary.
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Cheers,
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>-Jan
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>PS: Please send PerlApp and other PDK related =
questions/problems
to the PDK mailing list (once it becomes clear that it is a PDK related =
issue
and not a general Perl problem).
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>
0cm 4.0pt'>
0cm 0cm 0cm'>
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >From:=
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >
activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of =
Mothi
Mehta
Sent: June 5, 2007 2:51 AM
To: Kenneth Ölwing
Cc: activeperl@listserv.activestate.com
Subject: Re: Absoulte path in Perl
and When I have tried on other machine, that havn't =
perl
installed, this shows
CGI Error
The specified CGI application misbehaved by not =
returning a
complete set of HTTP headers. The headers it did return are: =
Cannot find current script '\\?\c:\inetpub\wwwroot\lmtest\foo.exe' =
at /PerlApp/FindBin.pm line 201
BEGIN =
failed--compilation aborted at /PerlApp/FindBin.pm line =
201.
BEGIN failed--compilation aborted at foo.pl =
line 7.
On 6/5/07, Mothi =
Mehta <
href=3D"mailto:evergreenudaipur@gmail.com">evergreenudaipur@ gmail.com=
>
wrote:
#!perl --
use strict;
use warnings;
use CGI;
BEGIN { $0 =3D~ s#^\\\\\?\\## };
use FindBin;
use CGI::Carp qw(warningsToBrowser =
fatalsToBrowser);
my $cgi =3D CGI->new;
print $cgi->header;
my $jver =3D 'unknown or jre6 not found';
my $spath =3D "$ENV{SystemRoot}\\SYSTEM32";
$ENV{PATH} .=3D ";$spath";
my $osname =3D lc $^O;
if ($osname eq 'linux') {
$jver =3D `./version.sh`;
}
else
{
my $jrepath =3D
"$FindBin::Bin/jre6/bin/java.exe";
if (-e $jrepath)
{
&=
nbsp;
$jver =3D `$jrepath -version 2>&1`;
}
}
print <<END_HTML;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 =
Transitional//EN">
<HTML>
<HEAD>
<TITLE>Absolute Path Sample Script Showing How To Get Absolute =
Path In
PERL And JavaVersion</TITLE>
</HEAD>
<BODY>
<h3>The Absolute Path to this script is: =
<span
style=3D"color: =
#0066FF;">$FindBin::Bin</span></h3>
<h3>The script I'm executing is: <span
style=3D"color: #0066FF;">$0</span></h3> =
<h3>The output of 'java -version' is: =
</h3>
<span style=3D"color: =
#0066FF;">
<PRE>
$jver
</PRE>
</span>
<h3>The Perl binary I'm executing is at: <span =
style=3D"color:
#0066FF;">$^X</span></h3>
</BODY>
</HTML>
END_HTML
exit;
it works while running with
href=3D"http://localhost/mydemos/examples/perlscript/foo.pl' " =
target=3D"_blank">http://localhost/mydemos/examples/perlscri pt/foo.pl'
but when I have created exe and tried the =
same
href=3D"http://localhost/mydemos/examples/perlscript/foo.exe " =
target=3D"_blank">http://localhost/mydemos/examples/perlscri pt/foo.exe
then its show CGI error
On 6/5/07, Kenneth =
Ölwing <
href=3D"mailto:kenneth@olwing.se" target=3D"_blank">kenneth@olwing.se =
>
wrote:
1.0pt;padding:0cm 0cm 0cm 6.0pt;
margin-left:4.8pt;margin-right:0cm'>
I have tried the same , but after creating exe =
using pdk its
shows
CGI Error
The specified CGI application misbehaved by not =
returning a
complete set of HTTP headers
Umm, what exactly do you mean to have tried??? =
Again, I'm
not skilled in CGI, but this seems unrelated to the FindBin problem? My
suggested workaround, e.g. the BEGIN is just a snippet of course, insert =
it
into your original code. Perhaps I misunderstand you completely...
ken1
------=_NextPart_000_0333_01C7A749.929F8ED0--
--===============1392853872==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1392853872==--
Re: Absoulte path in Perl
am 05.06.2007 21:52:38 von ken1
This is a multi-part message in MIME format.
--===============1103815627==
Content-Type: multipart/alternative;
boundary="------------030103000109060408090309"
This is a multi-part message in MIME format.
--------------030103000109060408090309
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Jan Dubois wrote:
>
> I'll fix PerlApp for PDK 7.1 to automatically strip the \\?\ prefix
> from $0 and PerlApp::exe() to make this workaround unnecessary.
>
Thanks Jan - what do you think about the issue at the heart of the
problem? I.e. the reason to mangle $0 in the first place is that '-f'
won't work with a \\?\ path - but shouldn't that be considered a bug? If
you agree can you file that as a bug (merely asking nicely since I
gather you might be knowledgeable about the actual code involved...) or
should the OP do that?
Thanks again for great work on ActivePerl, PDK et al!
ken1
--------------030103000109060408090309
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Jan Dubois wrote:
style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125);">I’ll
fix PerlApp for PDK 7.1 to automatically strip the \\?\
prefix from $0 and PerlApp::exe() to make this workaround unnecessary.
Thanks Jan - what do you think about the issue at the heart of the
problem? I.e. the reason to mangle $0 in the first place is that '-f'
won't work with a \\?\ path - but shouldn't that be considered a bug?
If you agree can you file that as a bug (merely asking nicely since I
gather you might be knowledgeable about the actual code involved...) or
should the OP do that?
Thanks again for great work on ActivePerl, PDK et al!
ken1
--------------030103000109060408090309--
--===============1103815627==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1103815627==--
RE: Absoulte path in Perl
am 05.06.2007 22:25:12 von Jan Dubois
Kenneth Ölwing wrote:
> Jan Dubois wrote:
>> I=92ll fix PerlApp for PDK 7.1 to automatically strip the \\?\ prefix
>> from $0 and PerlApp::exe() to make this workaround >>unnecessary.
>
> Thanks Jan - what do you think about the issue at the heart of the
> problem? I.e. the reason to mangle $0 in the first place is that '-f'
> won't work with a \\?\ path - but shouldn't that be considered a bug?
> If you agree can you file that as a bug (merely asking nicely since I
> gather you might be knowledgeable about the actual code involved...)
> or should the OP do that?
No, Perl cannot support the \\?\ prefix right now. This prefix works
only with the "wide character" APIs, whereas Perl uses the ANSI APIs for
almost all file operations [*]. Perl also uses fixed width buffers
throughout the code that could not accommodate longer filenames. This
_may_ all be improved eventually, but not until Perl
5.12 at the earliest.
You'll see that I "fixed" this problem in core Perl almost 2 years ago:
http://groups.google.com/group/perl.perl5.porters/msg/d194a6 d4be42143f
I believe that change was also prompted by IIS6 using the prefix to load
additional libraries, which created a problem for Perl-ISAPI and PerlEx.
Cheers,
-Jan
[*] I've added some support to Perl and the Win32 module to allow
processing of files whose names cannot be represented in the system
codepage. I'll write something about it when it is being released
in ActivePerl 821 (it will be core Perl in 5.8.9 and 5.10 too).
The idea is essentially to automatically turn Unicode names into 8.3
short filenames whenever they cannot be encoded in the system codepage.
This will work for glob(), readdir(), etc.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Absoulte path in Perl
am 06.06.2007 14:30:34 von Mothi Mehta
--===============0448963005==
Content-Type: multipart/alternative;
boundary="----=_Part_14880_33113810.1181133034702"
------=_Part_14880_33113810.1181133034702
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Now its works..thanks a lot....
--Mohit
On 6/6/07, Jan Dubois wrote:
>
> Kenneth Ölwing wrote:
> > Jan Dubois wrote:
> >> I'll fix PerlApp for PDK 7.1 to automatically strip the \\?\ prefix
> >> from $0 and PerlApp::exe() to make this workaround >>unnecessary.
> >
> > Thanks Jan - what do you think about the issue at the heart of the
> > problem? I.e. the reason to mangle $0 in the first place is that '-f'
> > won't work with a \\?\ path - but shouldn't that be considered a bug?
> > If you agree can you file that as a bug (merely asking nicely since I
> > gather you might be knowledgeable about the actual code involved...)
> > or should the OP do that?
>
> No, Perl cannot support the \\?\ prefix right now. This prefix works
> only with the "wide character" APIs, whereas Perl uses the ANSI APIs for
> almost all file operations [*]. Perl also uses fixed width buffers
> throughout the code that could not accommodate longer filenames. This
> _may_ all be improved eventually, but not until Perl
> 5.12 at the earliest.
>
> You'll see that I "fixed" this problem in core Perl almost 2 years ago:
>
> http://groups.google.com/group/perl.perl5.porters/msg/d194a6 d4be42143f
>
> I believe that change was also prompted by IIS6 using the prefix to load
> additional libraries, which created a problem for Perl-ISAPI and PerlEx.
>
> Cheers,
> -Jan
>
> [*] I've added some support to Perl and the Win32 module to allow
> processing of files whose names cannot be represented in the system
> codepage. I'll write something about it when it is being released
> in ActivePerl 821 (it will be core Perl in 5.8.9 and 5.10 too).
>
> The idea is essentially to automatically turn Unicode names into 8.3
> short filenames whenever they cannot be encoded in the system codepage.
> This will work for glob(), readdir(), etc.
>
>
------=_Part_14880_33113810.1181133034702
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Now its works..thanks a lot....
--Mohit
On 6/6/07, J=
an Dubois <jand@activestate.=
com> wrote:
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Kenneth Ölwing wrote:
> =
Jan Dubois wrote:
>> I'll fix PerlApp for PDK 7.1 to automatically=
strip the \\?\ prefix
>> from $0 and PerlApp::exe() to make this workaround >>unn=
ecessary.
>
> Thanks Jan - what do you think about the issue at=
the heart of the
> problem? I.e. the reason to mangle $0 in the firs=
t place is that '-f'
> won't work with a \\?\ path - but shouldn't that be consid=
ered a bug?
> If you agree can you file that as a bug (merely asking =
nicely since I
> gather you might be knowledgeable about the actual c=
ode involved...)
> or should the OP do that?
No, Perl cannot support the \\?\ =
prefix right now. This prefix works
only with the "wide character&q=
uot; APIs, whereas Perl uses the ANSI APIs for
almost all file operation=
s [*]. Perl also uses fixed width buffers
throughout the code that could not accommodate longer filenames. This
r>_may_ all be improved eventually, but not until Perl
5.12 at the earli=
est.
You'll see that I "fixed" this problem in core Pe=
rl almost 2 years ago:
94a6d4be42143f">http://groups.google.com/group/perl.perl5.po rters/msg/d194a=
6d4be42143f
I believe that change was also prompted by IIS6 usin=
g the prefix to load
additional libraries, which created a problem for Perl-ISAPI and PerlEx=
..
Cheers,
-Jan
[*] I've added some support to Perl and=
the Win32 module to allow
processing of files whose names cannot be rep=
resented in the system
codepage. I'll write something about it when it is being=
released
in ActivePerl 821 (it will be core Perl in 5.8.9 and 5.10 too)=
..
The idea is essentially to automatically turn Unicode names into 8=
..3
short filenames whenever they cannot be encoded in the system codepage.
=
This will work for glob(), readdir(), etc.
------=_Part_14880_33113810.1181133034702--
--===============0448963005==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0448963005==--