[22687] in Perl-Users-Digest
Perl-Users Digest, Issue: 4908 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 29 00:07:21 2003
Date: Mon, 28 Apr 2003 21:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 28 Apr 2003 Volume: 10 Number: 4908
Today's topics:
Re: Authentication with Unix username and password (David Efflandt)
Re: crypt function on Win32 Perl ? <noreply@gunnar.cc>
Re: crypt function on Win32 Perl ? (Malcolm Dew-Jones)
Re: Curses and perl5.8 <goldbb2@earthlink.net>
DBD-Pg issue (IKNIR)
Re: Distribute a perl script <huuhaa@kastema.to>
Re: Get PID from process started by "system" - how? <anthony@movielink.net.au>
Re: Get PID from process started by "system" - how? <goldbb2@earthlink.net>
Re: How can I hide a specific Window (Thomas B)
Re: How can I hide a specific Window (Malcolm Dew-Jones)
Re: How can I hide a specific Window <goldbb2@earthlink.net>
Re: How to compress and uncompress the files using the (Vinod. K)
Re: Newb Question: Telling perl when to stop and go wh ctcgag@hotmail.com
Re: Newbie cannot compile :( (Tad McClellan)
Re: perl, grep and multidimensional array - help needed (Tad McClellan)
Re: Problem with Getopt::Std and getopts().... (Joe Smith)
Re: setting a variable from a line in a file (Tad McClellan)
Re: Test::Harness annoyance <jkeen@concentric.net>
Re: Test::Harness annoyance <jkeen@concentric.net>
Re: Unnecessary Calls to the Server? <spamsucks@noemail.com>
Re: Unnecessary Calls to the Server? (amit_pc)
what is $@ ? (Thomas)
Re: what is $@ ? <mbudash@sonic.net>
Re: what is $@ ? <uri@stemsystems.com>
Re: what is $@ ? <ethan@draupnir.gso.saic.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 29 Apr 2003 01:18:22 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Authentication with Unix username and password
Message-Id: <slrnbarkmu.2rh.efflandt@typhoon.xnet.com>
On 26 Apr 2003 15:18:45 -0700, SlimClity <slimclity@hotmail.com> wrote:
> Is it possible to use the BSD username and password as authentication
> method?
>
> I've tried to use the encrypt command and verify this with
> /etc/master.passwd but the encrypted string changes while using the
> same password.
If you can access the crypted password (if not using shadow passwords) you
should be able to tell if a user supplied plain text password matches by
using the crypt() function to crypt plain text password using (whole)
crypted password as salt, and see if result matches the crypted password.
That has always worked for me with DES or MD5 passwords. If you try to
use just the first 2 characters of the crypted password as salt, that will
fail for MD5 passwords, but the whole crypted password as salt works for
either.
--
David Efflandt - All spam ignored http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: Tue, 29 Apr 2003 00:49:24 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: crypt function on Win32 Perl ?
Message-Id: <b8kb5u$b0ep3$1@ID-184292.news.dfncis.de>
Kenjis Kaan wrote:
> How secure is the crypt function of Perl in win32? (activeperl).
>
> Is is implemented in the same way as that of unix crypt? is it MD5
> algorithm?
I have used the Perl crypt function on Win32 to create passwords for
.htpassword files on Unix, so it's apparently the same algorithm.
> Should one use it to secure a website access??
I pass that one. ;-) Have heard the view that there are weaknesses
compared to .htaccess protection, but am not able to explain how/why.
/ Gunnar
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 28 Apr 2003 17:41:17 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: crypt function on Win32 Perl ?
Message-Id: <3eadca2d@news.victoria.tc.ca>
Gunnar Hjalmarsson (noreply@gunnar.cc) wrote:
: Kenjis Kaan wrote:
: > How secure is the crypt function of Perl in win32? (activeperl).
: >
: > Is is implemented in the same way as that of unix crypt? is it MD5
: > algorithm?
: I have used the Perl crypt function on Win32 to create passwords for
: .htpassword files on Unix, so it's apparently the same algorithm.
: > Should one use it to secure a website access??
: I pass that one. ;-) Have heard the view that there are weaknesses
: compared to .htaccess protection, but am not able to explain how/why.
I think some other algorithms are inherently better than crypt, but having
said that, I don't think the choice of crypt vs some other algorithm will
be your security concern. The real security weaknesses are in how you put
it all together. Also, with crypt, the quality of the passwords will be a
bigger issue that crypt itself, but even assuming good passwords I don't
think you'll find any banks using .htaccess files and http: to control
access to your bank account.
Roll-your-own security is easy to get wrong, but assuming you do it right
and also used crypt, it should be similar in security to .htaccess
protection. However the latter is built in to web servers so why reinvent
the wheel? Perhaps more importanly, if you use the server's security than
it leaves your application free to use better security whenever it's
available on a server.
In summary, on most member sites that do not involve money, the security
of basic authentication using .htaccess, or a handed rolled equivalent,
is probably fine.
But if you start involving money, or accessing truely personal data (e.g.
medical records), then you need to find someone who can make a situation
specific recommendation on how to properly protect the data.
------------------------------
Date: Mon, 28 Apr 2003 23:53:58 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Curses and perl5.8
Message-Id: <3EADF756.90F852C7@earthlink.net>
"Eric J. Roode" wrote:
>
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> Benjamin Goldberg <goldbb2@earthlink.net> wrote in
> news:3EAD5259.BFBFEFED@earthlink.net:
>
> > Actually, since there is a line in one of the headers:
> >
> > #define sv_isa(a,b) Perl_sv_isa(aTHX_ a,b)
> >
> > They are equivilant. So you could use either. However, a bare
> > sv_isa is clearer (and it's more consistant with the other code in
> > Curses).
>
> Then why the compiler error? :-/
sv_isa(a,b) is equivilant to Perl_sv_isa(aTHX_ a,b).
sv_isa(a,b) is NOT equivilant to Perl_sv_isa(a,b).
Perl_sv_isa(aTHX_ a,b) is NOT equivilant to Perl_sv_isa(a,b).
Note the presence/absence of "aTHX_".
--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
------------------------------
Date: 28 Apr 2003 19:54:02 -0700
From: as400tips@lycos.com (IKNIR)
Subject: DBD-Pg issue
Message-Id: <204f0ba7.0304281854.5a7e9153@posting.google.com>
am struggling with the DBD-Pg installation almost 3 weeks. Please
somebody out there could help me. Thank you in advance.
I have installed the following on WINDOWS XP:
CYGWIN
POSTGRESQL 7.3.1
APACHE 2.0.43
ACTIVESTATE PERL 5.8
DBI 1.35 (Installed using cygwin)
DBD-Pg 1.22 (Installed using cygwin perl makefile.pl, make, make test,
and make install)
I have no problem in running the following script in CYGWIN:
#!/perl/bin/perl -w
BEGIN {
push(@INC, 'C:/cygwin/lib/perl5/site_perl/5.6.1/cygwin-multi');
}
use DBI;
use DBD::Pg;
print "Content-type: text/html\n\n";
print "hi";
However, I cannot run this using the browser. I get the following
error.
Can't load 'C:/cygwin/lib/perl5/site_perl/5.6.1/cygwin-multi/auto/DBD/Pg/Pg.dll'
for module DBD::Pg:load_file:The specified module could not be found
at C:/Perl/lib/DynaLoader.pm line 229.
What am I doing wrong? Why this works in CYGWIN but not in browser?
------------------------------
Date: Tue, 29 Apr 2003 00:37:40 +0300
From: "Arde" <huuhaa@kastema.to>
Subject: Re: Distribute a perl script
Message-Id: <3ead9f25$1@news.dnainternet.net>
How about Perl2exe (http://www.indigostar.com/perl2exe.htm) ?
-arde
"Patrice" <google@ppatrice.ovh.org> wrote in message
news:da445f9c.0304231821.700700c1@posting.google.com...
> I have done a perl script as a project for univeristy. I am now
> looking for a way to distribute it to my examiners so they can easily
> test it. By easly I mean without having anything to install. There's a
> high probability they have a windows machine, but I'd like to provide
> something for Linux as well.
> My script is using two modules : XML::LibXML and XML::LibXSLT
>
> I tried perlcc and pp to build linux executables. I succeed but a
> friend of mine tried both on his machine, and they didn't run because
> of an incompatible glibc. Anyway, for Linux I can assume there is a
> perl interpreter installed and just provide the source. But what about
> the modules ? Will it work if I also put the *.pm files along with my
> script ?
>
> I also tried perl2exe to make both linux and win32 executables. Worked
> for Linux but crashed when I launch it. And it didn't compile for
> win32 (there is a file missing : p2x56exe.lib).
>
> Any experience or advice to share ?
> Thanks in advance.
------------------------------
Date: Tue, 29 Apr 2003 09:39:24 +1000
From: "Tony" <anthony@movielink.net.au>
Subject: Re: Get PID from process started by "system" - how?
Message-Id: <pan.2003.04.28.23.39.22.645273@movielink.net.au>
On Mon, 28 Apr 2003 12:18:01 -0400, Benjamin Goldberg wrote:
> Tony wrote:
>> Rudolf Polzer wrote:
> [snip]
>> > You use the same 'play' program I know? Then my ForkAndExec
> By using exec(), instead of system(), a second fork is avoided.
Ieeee...there are so many things to think of...:-((
I must admit that the connection there was not considered,
need to read up on EXCEC a bit more.
>> Where do the %pids come from? (Only the forked process ID
>> as far as I can see).
>
> The %pids hash is filled in by the StartFile subroutine. It's keys are
> devices (possibly always "/dev/output" ... in which case there would be
> at most one key, and at most one stored pid), and it's values are
> process ids.
>
>> Killing the forked perl process will not kill the play process...
>
> Because of the exec(), the forked process is no longer a perl process,
> but is a play process directly. Thus, you are killing the play process,
> not a perl process.
Now I just need to re-jig things so that I can play a list of files...
I am not sure how to acomplish that as each event trigers playing
a list of files but the above will replace the perl process with
the play process and then the perl process is gone.
As far as I can see Rudolf's suggestion also checks to see
if the device is free. Just need to see how I can pass the files
to play, one by one, until there are no more to play.
I guess like this:
Read in config file (Solved)
Process it to my correct format (Solved)
Get week day and time (Solved)
Run a main perl process to check against DAY,TIME match
where the formated schedule file is continuesly read to
the end and started over. On match store the list of
files to play in @list, fork a process, store its PID,
and send the files, one by one to the "play_file" script
with the fork. (Not solved yet)
When next play event is found, kill the perl forked process
and the play process (If still running) and wait for kill
to complete. Then fork a new process and repeat... (Not solved yet)
Thanks to Rudolf, Benjamin and Bryan. I have got something to
work with now - just need to tie it all together.
Tony
--
--------------------------------------------------------------
To reply directly send to: anthony AT movielink DOT net DOT au
Replace AT and DOT with @ and . and mail will get through.
Any spammers will be persued until they get booted off the net
------------------------------
Date: Mon, 28 Apr 2003 23:49:33 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Get PID from process started by "system" - how?
Message-Id: <3EADF64D.19BA7EB9@earthlink.net>
Tony wrote:
[snip]
> Now I just need to re-jig things so that I can play a list of files...
Assuming you've got a data structure of the form:
my @cronjobs = (
# the times here are seconds since the epoch,
# similar to what the time() function returns.
[ $time_to_play_sounds, @list_of_files ],
[ $time_to_play_sounds, @list_of_files ],
[ $time_to_play_sounds, @list_of_files ],
...
); # sorted by $time_to_play_sounds
You might be able to write code like:
# first, discard sounds which should have played
# before those which should currently be playing.
while( @cronjobs > 1 ) {
shift @cronjobs, next if time() > $cronjobs[1][0];
}
# needed to make the logic below easier.
unshift @cronjobs, [];
# perl process which is doing the timeout.
my $timeoutpid;
OUTER: while( 1 ) {
# is the list of sounds to play "now" empty?
until( @{ $cronjobs[0] } ) {
# ok, kill the timeout process, if there is one.
if( defined $timeoutpid ) {
kill "INTR", $timeoutpid;
waitpid($timeoutpid, 0) or die horribly;
undef $timeoutpid;
}
# go to the next list of sounds.
shift(@cronjobs);
# if there's no more, then we're done.
last OUTER unless @cronjobs;
# sleep until this group of sounds needs to be playing.
my ($now, $expire) = ( time, shift @{ $cronjobs[0] } );
sleep( $expire - $now ) if $expire > $now;
# When should the next group of sounds play?
$expire = $cronjobs[1][0];
if( defined $expire ) {
$now = time;
if( $now >= $expire ) {
# uh oh, they should already be playing!
@{ $cronjobs[0] } = ();
next;
}
# They play sometime in the future, so we
# start a timeout process which will exit
# when the next group needs to start playing.
unless( $timeoutpid = fork ) { sleep($expire-$now); exit }
}
}
# ok, @{ $cronjobs[0] } contains the list of sounds
# which should be playing "right now".
# get and remove the first from this list.
my $sound = shift @{ $cronjobs[0] };
unless( my $playpid = fork ) {
exec "play", $sound;
die "exec failed: $!";
}
# wait for *either* $playpid, *or* $timeoutpid.
my $apid = wait;
# If "play" is what finished, go to the next
# sound in the list, assuming there is one.
next if $apid == $playpid;
# Otherwise, it should be the timeout process.
die horribly unless $apid == $timeoutpid;
undef $timeoutpid;
# Kill the currently playing sound.
kill "INTR", $playpid;
# And clean up the zombie.
waitpid( $playpid, 0 ) or die horribly;
# And remove anything else which
# was supposed to play "now".
@{ $cronjobs[0] } = ();
}
[untested]
--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
------------------------------
Date: 28 Apr 2003 16:34:47 -0700
From: thomas@shurflo.com (Thomas B)
Subject: Re: How can I hide a specific Window
Message-Id: <866f534e.0304281534.de93519@posting.google.com>
For whatever reason, the "Create_no_Window" option doesn't work and
I'm not trying to hide the Perl window - I'm trying to hide another
application that was launched from Perl (an executable).
------------------------------
Date: 28 Apr 2003 17:00:52 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: How can I hide a specific Window
Message-Id: <3eadc0b4@news.victoria.tc.ca>
Thomas B (thomas@shurflo.com) wrote:
: I'm almost there - but not quite. I don't see any reference to the
: Window handle in the the Process object. I need it to pass to the
: command that hides the window.
: The following code will hide the current window. But I need to get
: the Window Handle of the process I launch, not the process that is
: executing the Perl script.
: BEGIN
: {
: ( $hWnd, $hInstance ) = GUI::GetPerlWindow();
: GUI::Hide( $hWnd );
: }
: This is the entire program, and as you can see (hopefully), the HIDE
: method at the bottom does not hide the Window.
: Anyone know how to get the Windows Handle of a specific process.
I don't see an os or platform mentioned - the below is likely applicable
if you're using M$ Windows.
A process may or may not have one or more windows, so what you want is not
always quite what you describe.
However, a typical way to do something like this is to enumerate the open
windows, looking for one that either has the window title you expect, or
the window class you expect.
You can then use that handle in the various windows routines that use
window handles.
I don't know the function names in perl, so you'll have to look them up,
but in C there are functions such as FindWindow and EnumWindows.
------------------------------
Date: Tue, 29 Apr 2003 00:00:50 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: How can I hide a specific Window
Message-Id: <3EADF8F2.15681EC3@earthlink.net>
Thomas B wrote:
>
> For whatever reason, the "Create_no_Window" option doesn't work and
> I'm not trying to hide the Perl window - I'm trying to hide another
> application that was launched from Perl (an executable).
The CREATE_NO_WINDOW option prevents windows from creating a dos box/
console window for an application which otherwise would have one. I
would be quite surprised if it didn't accomplish it's intended purpose.
If I understand correctly, you're starting a normal windows app, which
creates it's own gui, and you want to prevent that gui window from being
created. As far as I can tell, this isn't possible.
The closest you can come is to tell the app to start out minimized (and
even this, it can choose to ignore). I'm sure that you can read the
docs of Win32::Process just as well as I can, and can figure out how to
do that yourself.
The next closest thing would be to start the app, then using Win32::API
and the FindWindow and EnumWindows functions of <something>.dll, or
whatever, find the window that was created, and close or minimize it.
--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
------------------------------
Date: 28 Apr 2003 20:49:11 -0700
From: pkvinu@indiatimes.com (Vinod. K)
Subject: Re: How to compress and uncompress the files using the perl program
Message-Id: <bde4ceed.0304281949.7e3b3590@posting.google.com>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<b8ir0k$bl2$2@mamenchi.zrz.TU-Berlin.DE>...
> Vinod. K <pkvinu@indiatimes.com> wrote in comp.lang.perl.misc:
> > Hello All,
> >
> >
> > I am having a bunch of compressed files(database files, i.e .dbf files
> > whose size is more than 1GB) in one area. All these files need to be
> > uncompressed one after the other and put them in other location using
> > perl script. presently I used - system "uncompress" - statement in my
> > perl script which is consuming considerably more time. Just I want
> > know is there any module or any other command in perl which will
> > perform the above said activity in lesser time???
>
> There may be such modules, but they won't run significantly faster.
> All you can save is the call time for an external program. The time-
> consuming expansion will be the same in both cases.
>
> Anno
Hi Anno,
Thanks for ur immediate response. Do you have any idea about those modules ???
Thanks,
- Vinod.
------------------------------
Date: 28 Apr 2003 23:52:11 GMT
From: ctcgag@hotmail.com
Subject: Re: Newb Question: Telling perl when to stop and go while reading a file..
Message-Id: <20030428195211.353$Gr@newsreader.com>
email_entropy123@yahoo.com (entropy123) wrote:
>
> The first 4 lines of oldfile are filler and I'll never use them (Maybe
> someday I'd use them but not right now).
>
> The juicy stuff starts on line 5 which starts out with two spaces and
> a series of numbers like:
> ssssnnnnnnnssnnnnnnssnnnnnnsscssssnsssnsssn
> s= space
> n= number
> c = character
That looks curiously like an sd file for description of chemical
structures. Actually, like a poor generalization of such, as the
many of s's can turn to n's if the numbers wish to have more digits
than give by the n's. Anyway, to answer what you asked I not what I
think you should have asked, I'd set it up something like this:
<FILE> foreach 0..3 # skip the first 4 lines
while (<FILE>) {
last unless / /;
my $char=substr($_,30,1);
# do something with $char;
};
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
Date: Mon, 28 Apr 2003 19:17:11 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Newbie cannot compile :(
Message-Id: <slrnbarh47.inp.tadmc@magna.augustmail.com>
ibits <one2katwo@yahoo.com> wrote:
> I can't compile/run the program
> because of some errors.
Are they secret error messages?
Don't we get to see these error messages?
Error messages are meant to help solve whatever went wrong,
help the helpers help you by helpfully providing the exact
text of the messages you are getting (as suggested in
the Posting Guidelines).
> and direct me to make the appropriate corrections.
> #use strict;
^
^
There is an extra character before that "use". :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 28 Apr 2003 19:10:10 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: perl, grep and multidimensional array - help needed
Message-Id: <slrnbargn2.inp.tadmc@magna.augustmail.com>
Rainer Scherg <Rainer.Scherg@t-online.de> wrote:
> Perhaps I have to post "more" code,
Provide enough information
If you do the things in this item, you will have an Extremely Good
chance of getting people to try and help you with your problem!
These features are a really big bonus toward your question winning
out over all of the other posts that you are competing with.
First make a short (less than 20-30 lines) and *complete* program
that illustrates the problem you are having. People should be able
to run your program by copy/pasting the code from your article. (You
will find that doing this step very often reveals your problem
directly. Leading to an answer much more quickly and reliably than
posting to Usenet.)
Describe *precisely* the input to your program. Also provide example
input data for your program. If you need to show file input, use the
__DATA__ token (perldata.pod) to provide the file contents inside of
your Perl program.
Show the output (including the verbatim text of any messages) of
your program.
Describe how you want the output to be different from what you are
getting.
If you have no idea at all of how to code up your situation, be sure
to at least describe the 2 things that you *do* know: input and
desired output.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 29 Apr 2003 02:55:34 GMT
From: inwap@inwap.com (Joe Smith)
Subject: Re: Problem with Getopt::Std and getopts()....
Message-Id: <GQlra.10847$io.313850@iad-read.news.verio.net>
In article <yTEfa.4252$rw.882@nwrddc01.gnilink.net>,
Jürgen Exner <jurgenex@hotmail.com> wrote:
>Michele Dondi wrote:
>I'm not sure if a plain 16-bit DOS version of perl even exists...
http://www.perl.com/CPAN/ports/msdos/LMOLNAR/
>So for all practical purposes we are talking about the 32-bit Windows-based
>cmd.exe command line interpreter, not the 16-bit command.com original DOS
>shell.
Windows 98SE still uses command.com, not cmd.exe for the command line.
Hint for people using Win95, Win98, or WinMe: Most of the unix-style
perl on-liners can be executed as is under the bash shell.
I installed Cygwin (www.cygwin.com) for this very purpose.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Mon, 28 Apr 2003 19:28:46 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: setting a variable from a line in a file
Message-Id: <slrnbarhpu.inp.tadmc@magna.augustmail.com>
Peter Wilson <peter_wilson@mail.com> wrote:
> open(filelist,$list_of_files_filename)
There are three things wrong with that line of code.
Do you know what they are?
> open(htmlfile,$_);
Only two things on that one.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 29 Apr 2003 00:14:10 GMT
From: "James E Keenan" <jkeen@concentric.net>
Subject: Re: Test::Harness annoyance
Message-Id: <b8kg4i$b4a@dispatch.concentric.net>
"Sisyphus" <kalinabears@hdc.com.au> wrote in message
news:3ead46a3$0$21278@echo-01.iinet.net.au...
>
>
> Ha !! Really not a perl problem - at least the solution has nothing to do
> with perl.
>
> Turns out that the (cmd.exe) console on my laptop is 80 characters wide,
and
> on my desktop it's only 75 characters wide.
>
> Test::Harness defines a variable:
> $blank = ' ' x 77;
>
> So, on the laptop 'print "$blank\r";' returns the cursor to its original
> starting position, but on the desktop the same command advances the cursor
> down the screen by one line.
>
> Setting the desktop console to 80 chars wide fixes the problem.
>
This sounds like a cousin to the problem I reported a couple of months back:
That when I installed ActivePerl 8.0 (Perl 5.8.0) on Win95, I got screwy
results in the console when I called 'perldoc'. The solution (short of
installing arcane patches) was to wait till I was upgraded to Win2K before
installing 5.8.
------------------------------
Date: 29 Apr 2003 00:14:11 GMT
From: "James E Keenan" <jkeen@concentric.net>
Subject: Re: Test::Harness annoyance
Message-Id: <b8kg4j$8ff@dispatch.concentric.net>
"Sisyphus" <kalinabears@hdc.com.au> wrote in message
news:3ead46a3$0$21278@echo-01.iinet.net.au...
>
>
> Ha !! Really not a perl problem - at least the solution has nothing to do
> with perl.
>
> Turns out that the (cmd.exe) console on my laptop is 80 characters wide,
and
> on my desktop it's only 75 characters wide.
>
> Test::Harness defines a variable:
> $blank = ' ' x 77;
>
> So, on the laptop 'print "$blank\r";' returns the cursor to its original
> starting position, but on the desktop the same command advances the cursor
> down the screen by one line.
>
> Setting the desktop console to 80 chars wide fixes the problem.
>
This sounds like a cousin to the problem I reported a couple of months back:
That when I installed ActivePerl 8.0 (Perl 5.8.0) on Win95, I got screwy
results in the console when I called 'perldoc'. The solution (short of
installing arcane patches) was to wait till I was upgraded to Win2K before
installing 5.8.
------------------------------
Date: Tue, 29 Apr 2003 03:20:55 GMT
From: "Topspin" <spamsucks@noemail.com>
Subject: Re: Unnecessary Calls to the Server?
Message-Id: <rcmra.122362$Si4.107497@rwcrnsc51.ops.asp.att.net>
"Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
news:3EAD6914.134F1A19@earthlink.net...
> Marko Vallius wrote:
> >
> > On Mon, 28 Apr 2003 14:54:19 GMT, Topspin wrote:
> > > Inside the script, I log to a text file each time the script is
> > > executed and completed. When users call the scripts that return
> > > other file types, the script correctly logs a "hit". When users
> > > request a PDF (via the PDF script), the script often logs 2 or 3
> > > hits.
> >
> > That's IE for you (or rather some versions of IE with Acrobat Reader
> > plugin). Microsoft calls it a feature:
> >
> > http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792
>
> So for those versions of IE which generate 3 requests in a row, you can
> solve the problem by detecting when the userAgent is "contype", and
> remove the prior entry from that client from the log, and to treat that
> particular request as a HEAD instead of as a GET, *and* don't log that
> particular request.
>
> That would reduce 3 requests down to one request, and decrease the cost
> of the middle request.
>
> --
> $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
> );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
> ]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
Thank you to both of you!!!
------------------------------
Date: 28 Apr 2003 20:28:09 -0700
From: aprachitnis@yahoo.com (amit_pc)
Subject: Re: Unnecessary Calls to the Server?
Message-Id: <816b397d.0304281928.1d356aa2@posting.google.com>
I have the same issue and I am using ASP. Does any one know how to
check for userAgent=contype in ASP?
Thanks
"Topspin" <spamsucks@noemail.com> wrote in message news:<wgbra.4893$26.2699@news.randori.com>...
> I originally posted this on a Perl list, but I thought this might be a more
> appropriate place for it if the solution is something more generic.
> ----
> I have a Perl script that when called from the web, returns a PDF to the
> user.
>
> I have the exact same script that I have used for other file types without
> any problems.
>
> Inside the script, I log to a text file each time the script is executed and
> completed. When users call the scripts that return other file types, the
> script correctly logs a "hit". When users request a PDF (via the PDF
> script), the script often logs 2 or 3 hits. The code is the same other than
> the output. It appears that on another one of our servers that doesn't use
> Perl, hits to PDFs produce multiple hits also. Does anyone know if this is
> a Adobe issue? Can I do anything about it in my script?
>
> Currently we are just having to check the logs for hits to the same url from
> the same user within a couple of seconds of each other and filter the extra
> ones out, but it's not an exact science, so it's not a perfect solution.
>
> Any advice is appreciated.
------------------------------
Date: 28 Apr 2003 15:45:02 -0700
From: cfang@telamon-corp.com (Thomas)
Subject: what is $@ ?
Message-Id: <844eec0d.0304281445.63164e56@posting.google.com>
I met an internal variable $@. Could not find out what it does. Anybody can help?
Thanks
------------------------------
Date: Mon, 28 Apr 2003 22:49:43 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: what is $@ ?
Message-Id: <mbudash-3865E9.15494228042003@typhoon.sonic.net>
In article <844eec0d.0304281445.63164e56@posting.google.com>,
cfang@telamon-corp.com (Thomas) wrote:
> I met an internal variable $@. Could not find out what it does. Anybody can
> help?
>
> Thanks
tsk, tsk... use the docs, luke
per 'perldoc perlvar':
$@ The Perl syntax error message from the last eval()
operator. If $@ is the null string, the last
eval() parsed and executed correctly (although the
operations you invoked may have failed in the nor-
mal fashion). (Mnemonic: Where was the syntax
error "at"?)
Warning messages are not collected in this vari-
able. You can, however, set up a routine to pro-
cess warnings by setting $SIG{__WARN__} as
described below.
Also see "Error Indicators".
hth-
--
Michael Budash
------------------------------
Date: Mon, 28 Apr 2003 22:53:37 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: what is $@ ?
Message-Id: <x7sms28c9a.fsf@mail.sysarch.com>
>>>>> "T" == Thomas <cfang@telamon-corp.com> writes:
T> I met an internal variable $@. Could not find out what it
T> does. Anybody can help?
where did you meet it? at a bar or in a chat channel?
you can meet it and many others in perldoc perlvar.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: 28 Apr 2003 16:15:07 -0700
From: Ethan Brown <ethan@draupnir.gso.saic.com>
Subject: Re: what is $@ ?
Message-Id: <vr65oy9ptw.fsf@draupnir.gso.saic.com>
>>>>> "Thomas" == Thomas <cfang@telamon-corp.com> writes:
Thomas> I met an internal variable $@. Could not find out what it does. Anybody can help?
Thomas> Thanks
I didn't know that either, but I found the answer at:
http://www.perldoc.com/perl5.6/pod/perlvar.html
--Ethan Brown
--In a band? Use http://www.WheresTheGig.com for free.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 4908
***************************************