[17225] in Perl-Users-Digest
Perl-Users Digest, Issue: 4647 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 18 00:05:33 2000
Date: Tue, 17 Oct 2000 21:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <971841908-v9-i4647@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 17 Oct 2000 Volume: 9 Number: 4647
Today's topics:
Administering IIS with Perl <dans@radiant.net>
Re: Disk Quotas <jdb@wcoil.com>
Re: getting close, but not there yet! <bwalton@rochester.rr.com>
Getting value of a variable in different file <deward@purdue.edu>
Help Needed (Noghri)
Re: Help Needed (Martien Verbruggen)
Re: IO::File or FileHandle - which? <ren.maddox@tivoli.com>
Re: IO::File or FileHandle - which? <uri@sysarch.com>
Re: Is there a better way? <ren.maddox@tivoli.com>
Re: Is there a better way? (Colin Watson)
Newbie - Advise on getting a lock on a file <rjyoung@chat.carleton.ca>
Re: Newbie - Advise on getting a lock on a file <mikecook@cigarpool.com>
Re: Packing multiple strings into one string (Martien Verbruggen)
Re: perl objects and methods <rick.delaney@home.com>
Re: PGP Module Question <elephant@squirrelgroup.com>
Re: problems with open2 use in cgi <tina@streetmail.com>
Re: Save As... Popup box <jdb@wcoil.com>
Re: Taking credit cards though perl <elephant@squirrelgroup.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 17 Oct 2000 20:42:22 -0700
From: "Dan Morris" <dans@radiant.net>
Subject: Administering IIS with Perl
Message-Id: <suq6tv4i62tld0@corp.supernews.com>
Does anyone know how to access the IIS 5 ADSI objects? Currently I am stuck
using a VBS script to create virtual www sites on IIS. Any help would be
appreciated!
Dan
------------------------------
Date: 18 Oct 2000 03:54:31 GMT
From: "Josiah" <jdb@wcoil.com>
Subject: Re: Disk Quotas
Message-Id: <8sj6tn$p0j$0@206.230.71.67>
> I know about the 'quota' command but this just displays the info, I need
it
> to be passed back to perl (say the total amount available or used).
I'm sorry, as I don't know anything about the "quota" command.
However, I do know that when I type this in my perl script:
$raw_listing = `ls`;
$raw_listing now contains the output of "ls", the same as I would see
if I typed 'ls' on the command line.
The key is the backticks: ` , not the normal single quotes, '
, but
backticks. When given:
perldoc -q backtick
It provides some FAQ that may/may not be helpful, but at least its a start.
To answer your question, you might try:
$quota = `quota`;
Then, assuming fate smiles, $quota now holds the output of quota, the same
as you would see on the command line. Cheers!
hth,
--
$from = <$josiah>;
------------------------------
Date: Wed, 18 Oct 2000 03:29:16 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: getting close, but not there yet!
Message-Id: <39ED1908.DCCD7A8C@rochester.rr.com>
Paul Spitalny wrote:
>
> I have almost got this to work. It appears though that the data I have
> uses a UNIX endian-"ness" that is not the same as the endian-ness of my
> NT machine. Yipes, now what??
>
> in the left column is what the number should be, in the right column is
> the output from my program:
>
> 2.743588915081886e-006 2.74358891508189e-006
> -2.249997454558070e-004 -0.000224999745455807
> 0.000000000000000e+000 0
> -4.027310559692743e-010 -4.02731055969274e-010
> 0.000000000000000e+000 0
> 7.557832283439269e-004 0.000755783228343927
> -7.585263855829361e-004 -0.000758526385582936
> -4.345490800893958e-010 -4.34549080089396e-010
> 0.000000000000000e+000 0
> 0.000000000000000e+000 0
> 2.249997454558070e+000 2.24999745455807
> 2.250000000000000e+000 2.25
> 2.249998727279035e+000 2.24999872727903
> 3.264767994870773e+000 2.95908505230826e-260
>
> See how the last number on the right column is screwed-up, but
> everything before that looks fine?? What gives?? Here's how I did it,
> perhaps you folks can find the error in my ways (I know, I know, i
> didn't check if the file exists before opening it)
>
> open(NEW,'<bin_only.dat');
> open(OUT,'>thebin.dat');
> binmode NEW;
> $index = 0;
> while (read(NEW,$in,8))
> {
> $index++;
> $foo = unpack("d",$in);
> print OUT "$foo\n";
> }
> close(NEW);
> close(OUT);
...
> Paul
...
Paul, I think you will need to review the tiny details of the double
floating format of both of your machines. Your NT machine (if it is a
PC -- I don't know about Alpha's) will use the IEEE standard floating
point representation. I have no idea what format your Unix machine uses
-- that depends upon the platform, and could be almost anything. Some
platforms support more than one floating point format. Your format is
probably very close to IEEE, but not exactly the same. Generally, you
can't depend on binary floating point representations to be the same,
even with endianness fixed. If you don't go from the documentation, you
will never know if there is another problem with the transfer you just
didn't encounter yet. HTH.
--
Bob Walton
------------------------------
Date: Tue, 17 Oct 2000 22:57:58 -0500
From: "Andrew Watts" <deward@purdue.edu>
Subject: Getting value of a variable in different file
Message-Id: <8sj745$eoh$1@mozo.cc.purdue.edu>
I am writing a script that parses the input from an HTML form. I am using
cgi-lib to parse. So I can access the values of the fields like so after
calling &ReadParse from my perl script:
$input{'fieldValue1'};
$input{'fieldValue2'};
Now I want to re-write these values to the client with some other HTML.
I want to use another file for my HTML because of length and the complexity
of the code. (It will just make the code a lot nicer to read.) Then read the
file and output its contents to the client. But I need to be able to insert
these values in the middle of the output stream to the client. My thought
was to put keys in the HTML file and then parse the input stream, look for
the key, and switch the key with the value. Assuming the key is of the
following form: $input{'fieldValue1'}. The code may look something like
this:
open(FILE, "<file.html");
while(<FILE>){
$currentLine = $_;
if($currentLine =~ /$input{'\S'}/) {
@matches =~ /$input{'\S'}/gi;
for each $match (@matches) {
$currentLine =~ s/$match/?????????/;
# I don't know what to put for the second parameter of
s///
}
}
print $currentLine;
}
close FILE;
So the value of $match could be:
$input{'field1'}
or
$input{'field2'}
I need to turn the value of $match into a variable in my perl script.
I thought I saw somewhere this could be done but I can't figure it out. If
you have any suggestions related this idea or another idea to accomplish the
same thing I would appreciate some input. Thanks.
------------------------------
Date: Wed, 18 Oct 2000 00:57:27 GMT
From: noghri@nospam.com (Noghri)
Subject: Help Needed
Message-Id: <39ecf514.38069420@enews.newsguy.com>
I need help with a perl program. How do I make a program that will
look at the secure log and make a list of the different machines that
have connected with ssh and count how many times they have connected.
I'm not 100% certain where the secure log is located. I'm also a perl
newbie so any help I can get will be greatly appreciated
-Noghri
------------------------------
Date: Wed, 18 Oct 2000 13:24:32 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Help Needed
Message-Id: <slrn8uq2f0.294.mgjv@martien.heliotrope.home>
[Please, next time, pick a subject line that describes your problem
better than this.]
On Wed, 18 Oct 2000 00:57:27 GMT,
Noghri <noghri@nospam.com> wrote:
> I need help with a perl program. How do I make a program that will
> look at the secure log and make a list of the different machines that
> have connected with ssh and count how many times they have connected.
> I'm not 100% certain where the secure log is located. I'm also a perl
> newbie so any help I can get will be greatly appreciated
The format of your log file, or whether it even provides the information
you need has nothing to do with Perl. You could try comp.security.ssh to
find out more about that, and maybe even about already existing tools.
If you want to do it with Perl, you'll have to get yourself a copy of
the log file, find out what the format is (we'll assume that it is some
textual format), and read up on some of Perl's operators and functions
to read files and process their lines. You should probably get yourself
a good book to teach you Perl. (Do a search on www.deja.com for this
group. Recommendations are made almost every week).
You want to read about the open and close functions
# perldoc -f open
# perldoc -f close
Maybe the perl open tutorial
# perldoc perlopentut
Depending on the data format, you probably want to read up on split,
and/or regular expressions:
# perldoc perlre
# perldoc -f split
There may be other things you need, but that's hard to tell.
Martien
--
Martien Verbruggen |
Interactive Media Division | Failure is not an option. It comes
Commercial Dynamics Pty. Ltd. | bundled with your Microsoft product.
NSW, Australia |
------------------------------
Date: 17 Oct 2000 19:24:39 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: IO::File or FileHandle - which?
Message-Id: <m3u2abm1x4.fsf@dhcp11-177.support.tivoli.com>
starfire <starfire@zipcon.net> writes:
> I need to manipulate a filehandle, and either the IO::File or the FileHandle
> modules will do what I want. Which one should I use? I'm developing on Perl
> version 5.005_03, but want maximum backwards and forwards compatibility.
> Optimizing portability would be good, too.
>
> perldoc IO::File says "Derived from FileHandle.pm by Graham Barr", whereas
> perldoc FileHandle says "... since FileHandle is descended from IO::File".
> Fess up, guys!
I believe that FileHandle.pm has since been rewritten to be derived
from IO::File. See the Note at the beginning of the description:
NOTE: This class is now a front-end to the IO::* classes.
I believe you can infer from the word "now" that this was changed at
some point. I deduce that it is a former version from with Graham
derived IO::File.
As to which you should use... I'm not certain. My take would be that
FileHandle is trying to be the interface to IO::File.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Wed, 18 Oct 2000 03:48:53 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: IO::File or FileHandle - which?
Message-Id: <x7pukystb7.fsf@home.sysarch.com>
>>>>> "RM" == Ren Maddox <ren.maddox@tivoli.com> writes:
RM> starfire <starfire@zipcon.net> writes:
>> I need to manipulate a filehandle, and either the IO::File or the FileHandle
>> modules will do what I want. Which one should I use? I'm developing on Perl
>> version 5.005_03, but want maximum backwards and forwards compatibility.
>> Optimizing portability would be good, too.
>>
>> perldoc IO::File says "Derived from FileHandle.pm by Graham Barr", whereas
>> perldoc FileHandle says "... since FileHandle is descended from IO::File".
>> Fess up, guys!
RM> I believe that FileHandle.pm has since been rewritten to be derived
RM> from IO::File. See the Note at the beginning of the description:
RM> NOTE: This class is now a front-end to the IO::* classes.
RM> I believe you can infer from the word "now" that this was changed at
RM> some point. I deduce that it is a former version from with Graham
RM> derived IO::File.
RM> As to which you should use... I'm not certain. My take would be that
RM> FileHandle is trying to be the interface to IO::File.
it is much simpler than that. FileHandle was the original
module. IO::Handle was a major rewrite so it was derived from
FileHandle. then FileHandle was rewritten to be just a wrapper around
IO::Handle.
so FileHandle now loads IO::Handle and not vice versa. and the code is
IO::Handle is a rewrite (derived) from the original FileHandle.
is that clear?
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 17 Oct 2000 19:27:31 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Is there a better way?
Message-Id: <m3pukzm1sc.fsf@dhcp11-177.support.tivoli.com>
whish_was_a_newbie@db-networks.com writes:
> I have some text file in descending order. I need to extract the top
> 25 lines as unique.
>
> I have tried a hash with:
> ...
> %seen = ();
> @toprint = grep { ! $seen{$_} ++ } @asked;
>
> but it sometimes looses the descending order.
Could you elaborate on this? It shouldn't loose the order. Perhaps
@asked isn't in the order you think it is....
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: 18 Oct 2000 01:27:07 GMT
From: cjw44@flatline.org.uk (Colin Watson)
Subject: Re: Is there a better way?
Message-Id: <8siu9b$auq$1@riva.ucam.org>
whish_was_a_newbie@db-networks.com wrote:
>I have some text file in descending order. I need to extract the top
>25 lines as unique.
I take it from your code that you want to extract the first 25 lines and
then uniquify, rather than uniquifying and then extracting the top 25
lines.
>I have tried a hash with:
>...
>%seen = ();
You don't need that initialization, since perl will automatically create
the hash for you as required. You'll need a 'my %seen;' if you're
running under strict vars, though.
>@toprint = grep { ! $seen{$_} ++ } @asked;
I can't see how this would obviously fit into your code below, but you
should indeed be doing that general kind of thing - just with the right
arguments.
>$i = 0;
>while(<INFILE>) {
> $i++;
> if ($i > 25)) {
> last;
> }
You're reading an extra line there, if that's important to you.
IMHO all this loop control stuff could be more clearly written (noting
that I've shifted $i by one, but you're not using it as anything more
than a loop counter anyway) as a single for statement:
for (my $i = 0; $i < 25 && defined($_ = <INFILE>); $i++) {
... although it does have the disadvantage that you have to do the
explicit tests on the filehandle.
If you don't like the for, then for slightly neater code try:
my $i = 0;
while (<INFILE>) {
last if $i++ >= 25;
> @data = split(",",$_);
> $data[1] =~ s/\W+$//g;
Unnecessary $_ in the first line, and unnecessary /g in the second (that
pattern can only match once in the absence of /m). If you're only ever
using $data[1], you might consider 'my $data = (split /,/)[1];', or
combine the two lines into one regex.
> $data[1] =~ s/\"//g;
The backslash is unnecessary (although I suppose you may need it to
un-confuse your editor), and tr///d is faster.
> ## this is where the make it unique starts
> $duplicate = 0;
> foreach $item(@asked) {
> if (uc($data[1]) eq uc($item)) {
> $duplicate = 1;
> }
> }
> if ($duplicate == 0) {
> push(@asked, $data[1]);
> }
>}
>....
>Then I print....
Eww. Apart from generally not being very idiomatic, this runs in
quadratic time. Try rewriting the whole loop as something like:
my %seen;
for (my $i = 0; $i < 25 && defined($_ = <INFILE>); $i++) {
my $data = (split /,/)[1];
$data =~ s/\W+$//;
$data =~ tr/"//d;
print "$data\n" unless $seen{uc $data}++;
}
That works fine for me.
--
Colin Watson [cjw44@flatline.org.uk]
"Lisp programs also have the advantage that very few programmers know
Lisp, so your employer will have to keep you on staff to maintain it."
- Joel Ray Holveck in Vigor, http://www.red-bean.com/~joelh/vigor/
------------------------------
Date: 18 Oct 2000 01:12:33 GMT
From: "Robert Young" <rjyoung@chat.carleton.ca>
Subject: Newbie - Advise on getting a lock on a file
Message-Id: <8site1$2vu$1@bertrand.ccs.carleton.ca>
I've just created my first guest book script in perl (yea!) and have a
question about "locking" the file I use to store the guestbook entries.
Currently I have a script to update this file based on information from a
HTML form. I figured that since multiple instances or threads of this
script could be running at once (ie multiple people hitting submit at once,)
that I should get the script to create a temporary lock file, and deletes it
when it finishes writing to the main file. When ever this script runs, it
wait until this lock file disappears (if it already exists,) thus ensuring
that only one thread of the script is modifying it at once. Is this the
best way to do this? My script is stable, but is there any way that it
could fail to complete its execution, and thus leave this lock file lying
around, keeping more entries from being added? (I don't mean my script
crashing because of bad programming, but are there any typical cases where a
server will screw up, and halt the scripts execution half way through?) My
programming expertise is more in desktop programming, so I don't have quite
the breath of knowledge on this sort of thing that I'd you guys do. :^)
Thanks a ton,
Bob Young :^)
PS: Here's the script address, if any of you want to see it (it's pretty
basic, I wanted it that way.) :^)
http://thebobbo.hypermart.net/MainBook.cgi
--
==============================================
Bob Young :^)
ICQ # 91239971
My page: http://www3.sympatico.ca/john.young4/
==============================================
------------------------------
Date: Tue, 17 Oct 2000 18:28:17 -0700
From: "Michael Cook" <mikecook@cigarpool.com>
Subject: Re: Newbie - Advise on getting a lock on a file
Message-Id: <Z07H5.1483$Tj6.363131@news.uswest.net>
Good luck getting that one answered here...if I can help, drop me an email,
but my locking method is not quite complete.
Michael
--
== CigarPool ==
http://www.cigarpool.com
"Robert Young" <rjyoung@chat.carleton.ca> wrote in message
news:8site1$2vu$1@bertrand.ccs.carleton.ca...
> I've just created my first guest book script in perl (yea!) and have a
> question about "locking" the file I use to store the guestbook entries.
> Currently I have a script to update this file based on information from a
> HTML form. I figured that since multiple instances or threads of this
> script could be running at once (ie multiple people hitting submit at
once,)
> that I should get the script to create a temporary lock file, and deletes
it
> when it finishes writing to the main file. When ever this script runs, it
> wait until this lock file disappears (if it already exists,) thus ensuring
> that only one thread of the script is modifying it at once. Is this the
> best way to do this? My script is stable, but is there any way that it
> could fail to complete its execution, and thus leave this lock file lying
> around, keeping more entries from being added? (I don't mean my script
> crashing because of bad programming, but are there any typical cases where
a
> server will screw up, and halt the scripts execution half way through?)
My
> programming expertise is more in desktop programming, so I don't have
quite
> the breath of knowledge on this sort of thing that I'd you guys do. :^)
>
> Thanks a ton,
>
> Bob Young :^)
>
> PS: Here's the script address, if any of you want to see it (it's pretty
> basic, I wanted it that way.) :^)
> http://thebobbo.hypermart.net/MainBook.cgi
> --
> ==============================================
> Bob Young :^)
> ICQ # 91239971
> My page: http://www3.sympatico.ca/john.young4/
> ==============================================
>
>
------------------------------
Date: Wed, 18 Oct 2000 12:20:37 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Packing multiple strings into one string
Message-Id: <slrn8upun5.294.mgjv@martien.heliotrope.home>
On 16 Oct 2000 19:47:39 -0700,
Paul Rubin <phr-n2000@nightsong.com> wrote:
> mjd@plover.com (Mark-Jason Dominus) writes:
> >
> > That's a good proposal, and guess what? It's already been adopted.
> > Except that we write 'w/A*' instead of 'D'. See the Perl 5.6 'pack'
> > documentation. (w/A* is a special case of a more general facility for
> > packing counted strings.)
>
[snip]
>
> Yes, of course it works fine, it's just clumsy to implement in Perl,
> since you either have to do the BER-decoding in perl or else use
> unpack to pick off the BER number, then compute the length of the BER
> number either by repacking or by arithmetic, then skip over that many
> bytes.
Maybe you missed the '/' template character in the documentation for
5.6.0?
# perldoc -f pack
[snip]
o The `/' template character allows packing
and unpacking of strings where the packed
structure contains a byte count followed
by the string itself. You write length-
item`/'string-item.
[snip]
Martien
--
Martien Verbruggen |
Interactive Media Division | You can't have everything, where
Commercial Dynamics Pty. Ltd. | would you put it?
NSW, Australia |
------------------------------
Date: Wed, 18 Oct 2000 03:13:14 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: perl objects and methods
Message-Id: <39ED182D.BEE6249@home.com>
Logan Shaw wrote:
>
> In article <Pine.GSO.4.21.0010160924080.25707-100000@crusoe.crusoe.net>,
> Jeff Pinyan <japhy@pobox.com> wrote:
> >As of Perl 5.6, you can make subroutines lvalues -- which means they can
> >be assigned to.
> >
> > package Foo;
> > sub id :lvalue {
> > return $_[0]{id};
> > }
> >
> > package main;
> > bless $obj, 'Foo';
> > $obj->id = 100;
> > print $obj->id; # 100
>
> This doesn't seem to actually work for me. For one, thing, if I run
> the code as posted, I get a "Can't bless non-reference value" error,
> but I fix that by adding "$obj = {};" immediately before the bless.
> Still, it doesn't seem to actually modify the object.
That's because of the explicit "return". If it is coded as
sub id :lvalue {
$_[0]{id};
}
then it works fine. That is, provided the key id already exists. If it
doesn't then you get the error,
Can't return a readonly value from lvalue subroutine
That should probably be fixed.
I don't know if the use of "return" in lvalue subs will always "fail" in
future versions of Perl. It's kind of like saying
(return $foo) = 'bar';
except it doesn't produce an error. It should at least produce a
warning.
> However, even that doesn't seem to work. It seems like this would
> print "13", but it prints "0":
[snip]
> sub id : lvalue
> {
> my $self = shift;
> my ($newvalue) = @_;
>
> if (defined $newvalue)
> {
> ${$self->{id}} = $newvalue;
> }
> else
> {
> return ${$self->{id}};
> }
> }
[snip]
Removing the "return" in this example won't fix it. It seems like the
if-else is interfering. If you try it you'll get
Can't return a temporary from lvalue subroutine
It looks like the safest way to play with lvalue subs is to put your
lvalue variable as the last thing in the sub block.
> (Maybe the lvalue variables have to be lexicals rather than
> globals or something.)
No. This is easily verified by modifying the little example in perlsub.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Wed, 18 Oct 2000 12:43:17 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: PGP Module Question
Message-Id: <MPG.1457b954a441be08989827@localhost>
t0873 wrote ..
>I want to use PGP module on windows NT. I tried to use this but it is
>giving me error while declaring the object. it says "PGP configuration
>file not found.". it looking for config file in
>
>
> if (! -e "$pgppath/config.txt" &&
> ! -e "/usr/local/lib/pgp/config.txt" )
above are file tests .. type the following at a command prompt for more
information
perldoc -f -X
> {
> carp "PGP configuration file not found.";
> return (0);
> };
>
>
>
>what to do in case of Windows NT???
change the file tests to ones that are relevant to WinNT and how PGP is
setup on it
>I am using PGP6.0 desktop
interesting
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 18 Oct 2000 01:22:04 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: problems with open2 use in cgi
Message-Id: <8sitvs$kbgi9$2@ID-24002.news.cis.dfn.de>
hi,
In comp.lang.perl.misc mrbigsecret@my-deja.com wrote:
> I've got a cgi script using open2 and it works
> fine on the command line, but when used via a
> browser seems to call itself and start over once
> it hits the open2 call. I'll get any printed
> statements down to the open2 call, then the same
> statements again, followed by the rest of the
> script's output. I've duplicated all of the
> environment variables in my shell and still get
> the same results. Below is a simple example that
> doesn't work. Anyone know what's up? I've looked
> around, but not seen a lot of info about this.
> Thanks for any ideas.
> #!/usr/bin/perl
> use IPC::Open2;
> print "Content-type: text/html\n\n";
> print "BEGINNING OF HTML DOCUMENT<br>\n";
> my $pid = open2(\*PWR, \*PWW, 'cat') || die "Can't
> open $pwprog: $!\n";
> print PWW "Hello, world.\n";
> print PWW "How are you?\n";
> print PWW "I am fine.\n";
> close(PWW);
> while (<PWR>){
> chop;
better use chomp(), chop() is from perl 4.
> print "D: ", $_, "<br>\n";
> }
> close(PWR);
> print "-> waitpid<br>\n";
> waitpid($pid, 0);
> print "waitpid -><br>\n";
it works if you add $|=1; at the beginning of your
script. but i don't know why. the doc says that
open2 sets autoflush on the write handle, but i
don't know why that makes the script print
out the lines twice.
anyone else?
tina
--
http://tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \__,_\___/\___/_| /__/ perception
please don't email unless offtopic or followup is set. thanx
------------------------------
Date: 18 Oct 2000 03:47:30 GMT
From: "Josiah" <jdb@wcoil.com>
Subject: Re: Save As... Popup box
Message-Id: <8sj6gi$o7d$0@206.230.71.67>
> Thanks for the people who actually said something worth reading, I now
have
> the answer.
Ahh...and at what a cost... by my count, you have been the lucky new
addition to several prominent killfiles, including my own. Awww, a touching
moment.
> To the other people who just seem to bitch...
Hmm... what were you doing with this post that I am quoting? Lecturing on
relaxation techniques? Nope, sounded a bit more like bitching by my meter
stick... I like what one of the replies said, in pointing out that any and
all
advice, tips, and lectures received here is "gratis". You accuse the Perl
God's
of bitching at you .... they are telling you off for taking up their time
and the
time and space of this newsgroup to ask an off-topic question, while
pointing
you to the correct place for such a question, and doing so in a personable
manner (here I have in mind Martin Verbruggen's posts). You should
be /THANKING/ them for their replies, instead of wineing about somebody
talking to you in a perceived tone of bitchyness and hurting your tender
feelings.
> I'm so sorry for posting the question in 'maybe' the wrong group.
MAYBE? Hmm...let me read your original post again, just to clarifty my
memory.
Word count by my eyes: "download", 2 times, browser-related ("HTML",
"content-type", "save as box"), 1 each word, "browser", 3 times, "perl", 1
word!
Sooo...as far as totals go, download and browser-related topics, as well as
"browser"
could apply to almost any newsgroup, yet they specifically do NOT apply to
comp.lang.perl.misc, as "browser" has nothing to do with "server." Let me
clarrify...
Granted, there is much more to Perl than the web. For me, about 10% of the
Perl that
I write is for the web. But...about _100%_ of the Perl out there is SERVER
based,
(excluding ActiveStates PerlScript, of course...I have no idea how much that
is used,
but since client machine requires Perl, that isn't going to be very useful
for the
general internet.) Since we have looked at this, we see that Perl has
almost NOTHING
to do with direct control of the browser. The areas that the two do
intereact, it is through
CGI, which, incase you didn't know, means Common Gateway Interface. E.g. not
specific
to a single language. CGI allows you to interact with the browser virtually
the EXACT
same way from Perl as you would from C or Python, or any other language.
Back to my point, it seems that your post had almost NOTHING to do with Perl
that
couldn't be accomplished with any other language. Perl and CGI, are NOT the
same,
nor is Perl and "Browser-control" the same.
> because I did not understand that it was not perl and actually the browser
> should not be a problem.
Let's see...to quote you, "make the _BROWSER_" (my emphasis) ....to quote
you,
"I have a perl script that..." . Now, you could have put in "...a C program
that...",
or "...a Java program that...", and posted it in a java newsgroup or a C
newsgroup,
and I am sure you would have gotten lectured in almost the exact same
manner.
You must understand, and you should have understood, that the Browser is in
NO way directly controlled by the server (i know, certain cases, etc.).
Therefore,
posting such a question in a NG related to a language that, when used for
the web,
is mainly SERVER side, is completly off-topic, rude, and dissrespectful
(again,
see Martin's post to which you replied that he was bitching at you in...he
was explaining
how you deserved a good kick in the pants for being such an "arsehole", to
quote
Martin in a seperate post.)
> Isn't this the place to learn things?????
Learn this word:
killfile
It will be a frequent word in your vocabulary should you continue with rude,
dissrespectful,
and offtopic posts, and then you complain for bitching when all the help
here is gratis?
Repeat after me, "killfile"..."killfile"....
> It certainly is not very friendly!!!!
Awwww..... so sorry.... not really, actually. You deserved it. Hark! Do I
here you wine,
"but why?"... to avoid more quoting, refer to Martin's post in message
news:slrn8un5d5.a0g.mgjv@verbruggen.comdyn.com.au
Specifically, his point #2 and following paragraphs.
> Life an't that long, relax guys.
:-) Thanks, will do! But without your annoying OT posts...relax buddy,
you'll learn...one of
these days!
<snipped upside-down quoting...shame shame, robby! tsk tsk... >
--
$from = <$josiah>;
------------------------------
Date: Wed, 18 Oct 2000 12:35:56 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: Taking credit cards though perl
Message-Id: <MPG.1457b793886a1849989826@localhost>
jon_uk@my-deja.com wrote ..
>My company has asked me to design a "simple" online shopping site for
>them. I have done everything so far and its looking quite good. Now I
>am at the stage where you ask the person for these credit card details.
>
>We need to store the credit card details in a file for a member of
>staff to read at a later date. The perl script which writes it to the
>file is based on a secure server of course.
>
>What is the best way of storing the information on the server? How
>would you do it?
start reading about encryption .. there are a number of possibilities
out there - one of the most common is to use PGP
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4647
**************************************