[13283] in Perl-Users-Digest
Perl-Users Digest, Issue: 693 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 1 06:08:15 1999
Date: Wed, 1 Sep 1999 03:05:10 -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 Wed, 1 Sep 1999 Volume: 9 Number: 693
Today's topics:
Re: *HTTP_REFERER IN STUPID NETSCAPE!!??!?!?!?!? (Henry Penninkilampi)
Re: <DATA> in a module(package) (Lack Mr G M)
Re: Can I have a subroutine return a hash? (Ct60)
Re: Can't use telnet with telnetd server <lars@thegler.dk>
Re: Comparing lists <Mark@Mark.Com>
Creating runtime variables. <e109775@orca.cc.metu.edu.tr>
Re: Desperately searching for perl lint (Ed Blackman)
Re: example,beginner,if,elsif,else (Larry Rosler)
RE: Help: How to put perl with HTTP libs on one floppy <webmaster@compre-ya.com>
Re: How to read webpages and post HTML forms with PERL (Eric Bohlman)
Re: How to rewind DATA filehandle? (Lack Mr G M)
RE: I am new to perl <webmaster@compre-ya.com>
RE: I am new to perl (Larry Rosler)
matching <Font size=+1> problem (TSOI_WING_SHING)
matching <Font size=+1> problem (TSOI_WING_SHING)
Re: matching <Font size=+1> problem (Larry Rosler)
Re: matching <Font size=+1> problem <hove@ido.phys.ntnu.no>
Re: Maybe too academic: How to build a (binary) tree (s <garethr@cre.canon.co.uk>
RE: newbie : POST <webmaster@compre-ya.com>
Re: perl equivalent of a Unix command line sort? (Larry Rosler)
Re: perl equivalent of a Unix command line sort? <uri@sysarch.com>
Printing problems NT and PERL <tox911@hotmail.com>
Re: R: Dos Perl and System command (Larry Rosler)
Re: Redirecting STDERR to STDOUT (on NT) (hoz)
Running a cgi from ssi <ughridk@abchotmail.com>
Re: Simulating Carriage Returns <roman.stawski@synersoft.fr>
SOCKS module... (GEMINI)
split defect? <markd@cup.hp.com>
Re: subtraction error (Larry Rosler)
using ppm with proxy servers <me@my.com>
Where a subroutine gets called from? <kdl@softhome.net>
Re: Where a subroutine gets called from? <uri@sysarch.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 01 Sep 1999 15:19:03 +0930
From: spamfree@metropolis.net.au (Henry Penninkilampi)
Subject: Re: *HTTP_REFERER IN STUPID NETSCAPE!!??!?!?!?!?
Message-Id: <spamfree-0109991519040001@d4.metropolis.net.au>
In article <37C9A695.A7A868E7@cyberthrill.com>, admin@cyberthrill.com wrote:
>of course it does!!!! im writing a script in perl, although it's
>largly dependent on the browser, i use $EVN{'HTTP_REFERER'}; to
>retreive it... and i though perl people would know...
Errr... Of course you mean $ENV{} not $EVN{}, don't you?
Henry.
------------------------------
Date: Wed, 01 Sep 1999 09:26:13 BST
From: gml4410@ggr.co.uk (Lack Mr G M)
Subject: Re: <DATA> in a module(package)
Message-Id: <1999Sep1.092613@ukwit01>
In article <37cc774b@cs.colorado.edu>, Tom Christiansen <tchrist@mox.perl.com> writes:
|> [courtesy cc of this posting mailed to cited author]
|>
|> In comp.lang.perl.misc,
|> gml4410@ggr.co.uk (Lack Mr G M) writes:
|> : I've been trying to use the <DATA> file handle to read a text stream
|> :from the end of the module code, but this doesn;t seem to work in a
|> :package, or when the module coded is sucked in by a "use". Am I missign
|> :something, or is this not allowed? (I'm using v 5.004p4).
|>
|> You use __DATA__ in a module.
Thanks. That works fine.
Knowing the answer I've also found that it is documented (in
perldata). I had tried the FAQ....obviously not very F :-)
--
--------- Gordon Lack --------------- gml4410@ggr.co.uk ------------
This message *may* reflect my personal opinion. It is *not* intended
to reflect those of my employer, or anyone else.
------------------------------
Date: 01 Sep 1999 06:08:43 GMT
From: ct60@aol.com (Ct60)
Subject: Re: Can I have a subroutine return a hash?
Message-Id: <19990901020843.20982.00002432@ng-fw1.aol.com>
From: gremlin gremlin_NO_SPAM_@ix.netcom.com
Date: Tue, 31 August 1999 11:55 PM
>
>Hi;
>
>I would like to call a subroutine and have that routine open up a file,
>add data to a hash, and return the new hash to the calling routine.
There is nothing to this. Simply return the hash a-la
sub hashIt
{
my %ini_hash;
open(FH, "<config.ini")||die "Can not open file.\n";
while(<FH>)
{
my ($name, $value) = split(/=/, $_);
#Last implies file of form name = value
$ini_hash{$name} = $value;
}
close(FH);
return(%ini_hash);
}
I have done production code like this and it works fine, but if the hash is
very large, you should consider returning a hash reference. By returning the
hash, you are onrolling the list of hash elements and rerolling it when result
returns to caller. This is less efficient than returning the "pointer" to the
hash and then dereferencing it.
Hope that helps.
Chris Tauss (ct60@AOL.com)
------------------------------
Date: Wed, 01 Sep 1999 11:08:41 +0200
From: Lars Thegler <lars@thegler.dk>
Subject: Re: Can't use telnet with telnetd server
Message-Id: <37CCED19.ACF41F2E@thegler.dk>
Sune Carlzon wrote:
>
> I am trying to setup a script that via telnet issues a couple of commands
> and stores the result for evaluation.
>
> Anyone that has any idea what's going wrong ?
>
> use Net::Telnet ();
For debugging Net::Telnet scripts, use dump_log:
[From perldoc Net::Telnet]
dump_log - log all I/O in dump format
$fh = $obj->dump_log;
$fh = $obj->dump_log($fh);
$fh = $obj->dump_log($filename);
This method starts or stops dump format logging of all
the object's input and output. The dump format shows
the blocks read and written in a hexadecimal and
printable character format. This method is useful
when debugging, however you might want to first try
input_log() as it's more readable.
[end of quote]
/Lars
------------------------------
Date: Wed, 01 Sep 1999 10:11:11 +0100
From: Mark <Mark@Mark.Com>
Subject: Re: Comparing lists
Message-Id: <37CCEDAF.7E9C7585@Mark.Com>
Delarock wrote:
> Okay folks.. It's me, the lousy Perl programmer..
>
> I think last time, I got mixed up about my version.. Doesn't really matter..
>
> I need more help now. I have two lists of things.. Two columns each.. First
> list is a standard list, second list is changing. I wanna compare them to see
> which ones in the second list are different and print out a list of them, and
> possibly email the list to someone. Anyone wanna give me help? Please send
> responses via email.
You may be a lousy programmer but what's your reading like?
Try:
perldoc perlfaq4
and look for 'How do I compute the difference of two arrays'.
In fact, read the whole thing
BDB
Mark
------------------------------
Date: 31 Aug 1999 14:09:05 GMT
From: baris sertkaya <e109775@orca.cc.metu.edu.tr>
Subject: Creating runtime variables.
Message-Id: <7qgnm1$88u$1@kemer.cc.metu.edu.tr>
Hi folks..
I am trying to create runtime variables like that:
-----------------------------------
for $n (0..2) {
$a="var$n";
$$a=$n;
print "\$$a:$$a\n";
}
-----------------------------------
that works...
My question is : Is it possible to do the same operation without
using that $a variable as a helper..
I want to do this assignments(below) at one expression...
$a="var$n";
$$a=$n;
Kiss..
------------------------------
Date: Tue, 31 Aug 1999 01:27:08 -0400
From: edgewood+news@pobox.com (Ed Blackman)
Subject: Re: Desperately searching for perl lint
Message-Id: <se2y3AJ7KppV092yn@pobox.com>
Look in Belly::Button.
Ed
------------------------------
Date: Tue, 31 Aug 1999 22:58:30 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: example,beginner,if,elsif,else
Message-Id: <MPG.123660594c8313d3989efc@nntp.hpl.hp.com>
In article <7qi4h3$45n$1@autumn.news.rcn.net> on Tue, 31 Aug 1999
22:51:14 -0400, Ben Horowitz <bzhaainc@erols.com> says...
...
> print"that will be \8.50 please.\n";}
^ Is there a '$' missing from there?
> elsif(answer eq 'no'){print "okay but your missing a great movie\n";}
> else{print"i"m sorry,i didn't understand that\n";}
^ That should be a single-quote.
In addition to what the others have pointed out, there is a syntax error
on that line, so the code couldn't have compiled as posted. In the
future, use copy-and-paste from real compiled code rather than typing
things in (which can introduce new errors or inadvertantly fix the
actual errors).
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 31 Aug 1999 17:36:38 -0300
From: "Webmaster" <webmaster@compre-ya.com>
Subject: RE: Help: How to put perl with HTTP libs on one floppy (windows)?
Message-Id: <7qgpc6$al5$1@vnews.prima.com.ar>
You may compile you script to exe. So, you´ll not the perl in a floppy, but
at least you´ll may run the script everywere.
--
Gastón Gorosterrazú
webmaster@compre-ya.com
http://www.compre-ya.com
Mike5 <mike5@eunet.si> escribió en el mensaje de noticias
i4Ly3.512$8g3.90010@news.siol.net...
> Does anyone know if there a version of perl for Win32 with HTTP support
that
> is compact enough to fit on one floppy?
>
> Tnx, Mike5
>
>
------------------------------
Date: 1 Sep 1999 05:32:14 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: How to read webpages and post HTML forms with PERL
Message-Id: <7qidou$grj@dfw-ixnews16.ix.netcom.com>
Leonid A. Elbert (larc@writeme.com) wrote:
: Can anybody give me an advice how to make a script that
: 1) connects to a webserver and read through the contents of a html page
: 2) posts a HTML form to a webserver
: (All this without using a browser, of course.)
LWP will do this for you. It comes with the LWP Cookbook, as well as
documentation on the individual modules.
------------------------------
Date: Wed, 01 Sep 1999 09:21:31 BST
From: gml4410@ggr.co.uk (Lack Mr G M)
Subject: Re: How to rewind DATA filehandle?
Message-Id: <1999Sep1.092131@ukwit01>
In article <37CC15BF.64AF05B@email.sps.mot.com>, Steve Schwartz <rhgv90@email.sps.mot.com> writes:
|>
|> I've tried to read the text from DATA more than once and have only been
|> successful with an ugly hack. Here's a simple example of what I want to do:
What about just reading it once, but processing the result multiple
times?
@inline_data = <DATA>;
...
foreach (@inline_data) {
<code set 1>
}
...
foreach (@inline_data) {
<code set 2>
}
etc.
--
--------- Gordon Lack --------------- gml4410@ggr.co.uk ------------
This message *may* reflect my personal opinion. It is *not* intended
to reflect those of my employer, or anyone else.
------------------------------
Date: Tue, 31 Aug 1999 17:41:13 -0300
From: "Webmaster" <webmaster@compre-ya.com>
Subject: RE: I am new to perl
Message-Id: <7qgpkp$alg$1@vnews.prima.com.ar>
Easy, the first line must be:
!#c:/perl/bin/perl.exe or whatever the perl.exe file is.
<jim_p_stew@my-deja.com> escribió en el mensaje de noticias
7qff78$osm$1@nnrp1.deja.com...
> I am new to perl programming. I purchased a book
> and starting reading the 1st few chapters. It all
> makes perfect sense, but I don't know how to do
> this:
>
> I will build the scripts using wordpad. Next, I
> want to test them. I don't have an account with
> telnet access, So I downloaded perl32 for windows
> 95, and think I installed it correctly (In the
> root dir (C:)).
>
> Next, I want to run the script. I assume my 1st
> line would be #/perl5/perl. Now, if I put my
> scripts in the bin directory, how do I run
> them?? Do I need to create an html page to
> execute the script, or is there a way I can run
> it directly??
>
> Thanks
>
> Jim
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: Tue, 31 Aug 1999 23:05:55 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: RE: I am new to perl
Message-Id: <MPG.12366221a58729b2989efd@nntp.hpl.hp.com>
In article <7qgpkp$alg$1@vnews.prima.com.ar> on Tue, 31 Aug 1999
17:41:13 -0300, Webmaster <webmaster@compre-ya.com> says...
WHY do you quote the entire post after your one-line response???
> Easy, the first line must be:
>
> !#c:/perl/bin/perl.exe or whatever the perl.exe file is.
That is most unlikely. First of all, it should start with '#!', not
'!#'. Secondly, except for some software (particularly Apache, so far
as I know), that line is not used on Windows systems to find the perl
executable -- only to verify that it contains the word 'perl', in which
case succeeding flags are processed.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 1 Sep 1999 06:21:46 GMT
From: wstsoi@ee.cuhk.hk (TSOI_WING_SHING)
Subject: matching <Font size=+1> problem
Message-Id: <7qiglq$eu0$1@eng-ser1.erg.cuhk.edu.hk>
Hi all, I had a problem in my programme..
for the following codes
-----------------------------------
$_="anything here<font size=+1>";
if (m/<font size=+/1){
print "yes!\n"
}
else {
print "no";
}
-----------------------------------
it always print no, if I switch the matched pattern to /<font size=+/
it prints yes.
but why?
------------------------------
Date: 1 Sep 1999 06:22:42 GMT
From: wstsoi@ee.cuhk.hk (TSOI_WING_SHING)
Subject: matching <Font size=+1> problem
Message-Id: <7qigni$eu0$2@eng-ser1.erg.cuhk.edu.hk>
Hi all, I had a problem in my programme..
for the following codes
-----------------------------------
$_="anything here<font size=+1>";
if (m/<font size=+/1){
print "yes!\n"
}
else {
print "no";
}
-----------------------------------
it always print no, if I switch the matched pattern to /<font size=+/
it prints yes.
but why?
------------------------------
Date: Wed, 1 Sep 1999 00:22:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: matching <Font size=+1> problem
Message-Id: <MPG.123673f6129b5dd7989efe@nntp.hpl.hp.com>
In article <7qiglq$eu0$1@eng-ser1.erg.cuhk.edu.hk> on 1 Sep 1999
06:21:46 GMT, TSOI_WING_SHING <wstsoi@ee.cuhk.hk> says...
> Hi all, I had a problem in my programme..
> for the following codes
> -----------------------------------
> $_="anything here<font size=+1>";
> if (m/<font size=+/1){
This is a syntax error. It cannot be the actual code you are talking
about. Copy-and-paste it next time, instead of typingit in.
Presumably you meant
if (m/<font size=+1/){
> print "yes!\n"
> }
> else {
> print "no";
> }
> -----------------------------------
> it always print no, if I switch the matched pattern to /<font size=+/
> it prints yes.
> but why?
Unescaped '+' in a regex means 'one or more of the preceding'. As your
string indeed has that, it matches. When you add the '1', it would
match '<font size=1>'.
Here are three suggestions:
1. Escape the '+' by preceding it with a backslash.
2. Read a good tutorial on regular expressions, or perlre if you can
handle it.
3. Don't post the same submission twice.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 01 Sep 1999 09:53:55 +0200
From: Joakim Hove <hove@ido.phys.ntnu.no>
Subject: Re: matching <Font size=+1> problem
Message-Id: <k0nk8qbdq3w.fsf@ido.phys.ntnu.no>
wstsoi@ee.cuhk.hk (TSOI_WING_SHING) writes:
> $_="anything here<font size=+1>";
> if (m/<font size=+/1){
> print "yes!\n"
> }
> else {
> print "no";
> }
1. I'am sure you meant (m/<font size=+1/), as the code stands
now it will not even compile.
2. Check out how how a "+" works in a regular-expression in the
perlre manpage (hint : search for quantifiers). Then you can
also find what to do you when you really mean a literal "+".
3. You probably want to match fOnT SiZe written in arbitrary caps as
well, check out the "i" modifier for regular expressions.
Getting to know the extensive Perl documentation which is already on
your system will be far more useful than quick answers from USENET.
HTH - Joakim :)
--
=== Joakim Hove www.phys.ntnu.no/~hove/ ======================
# Institutt for fysikk (735) 93637 / 352 GF | Skøyensgate 10D #
# N - 7034 Trondheim hove@phys.ntnu.no | N - 7030 Trondheim #
=====================================================================
------------------------------
Date: Wed, 1 Sep 1999 09:46:04 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: "Ulf Rimkus" <ulf.rimkus@okay.net>
Subject: Re: Maybe too academic: How to build a (binary) tree (structure)
Message-Id: <si906rrmlf.fsf@cre.canon.co.uk>
Ulf Rimkus <ulf.rimkus@okay.net> wrote:
> When I was just looking through my computer language books like them
> for C and PASCAL everyone takes a huge amount of paper to explain all
> about trees, pre-order, in-order search and stuff like that. Now I was
> trying to find out how to do that in Perl, but don´t have even an idea
> how to implement such a data structure in Perl.
The `perldsc' manpage describes how to build data structures in Perl;
you probably also want to read `perlref' to understand the syntax.
Perl supports two data structures: arrays and hash tables. Other data
structures can be built using these. For example, you could represent a
node in a tree by (a reference to) an array of the value at that node
followed by the children of that node. So the binary tree
|
----1----
| |
--2-- --3--
| | | |
4 5 6 7
could be represented by the data structure
$tree = [1, [2, [4], [5]], [3, [6], [7]]];
And traversals might look like:
sub pre_order { my ($n,@c) = @{$_[0]}; ($n, map pre_order($_), @c) }
sub post_order { my ($n,@c) = @{$_[0]}; ((map post_order($_), @c), $n) }
--
Gareth Rees
------------------------------
Date: Tue, 31 Aug 1999 17:32:13 -0300
From: "Webmaster" <webmaster@compre-ya.com>
Subject: RE: newbie : POST
Message-Id: <7qgp3t$ae5$1@vnews.prima.com.ar>
The answer to your questions:
0 - Yes, it is possible
1 - Yes, it is possible too. May be difficult, but possible at least.
2 - Not worse that my English. :o)
Answer 0:
You must exec the script with the enviromment variables set. If u
want to, i may send you an script that does exactly that.
Answer 1:
The best way is to read the file, procces it and write it again. The
problem of doing that is tha the user will see the .cgi in the url. (But
there is a solution for that too)
Sebastian <sebastian@netgallery.net> escribió en el mensaje de noticias
7qgafu$16$1@serv1.iunet.it...
> Hello,
> I need a script that gets some data from an HTML page (via POST), proccess
> it and send this data to an ASP page (via POST) situated in another
server.
> The problem is that the script work must not be seen. I mean :
>
> the user clicks submit in the first page -
> (the script is executed - it gets the posted data - it proccess the
> data - it post the new data to the server where the ASP page exits)
> the user sees the ASP page -
> (the ASP proccess the data and calls an HTML page defined by me (it
send
> via GET some info telling me if it's all ok or not) - the ASP page can be
> viewed only if I pass to it (via post) the correct data)
>
> my questions:
>
> 0- Is it possible to POST data from one script to another ?
> 1- Is it possible to POST data to a page and load it in the browser
without
> user intervention ?
> 2- Am I a terrible english-speaker? YES.
>
> Grazie!
>
>
------------------------------
Date: Tue, 31 Aug 1999 22:21:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: perl equivalent of a Unix command line sort?
Message-Id: <MPG.123657c69d0daa2e989efa@nntp.hpl.hp.com>
In article <x7aer7uxlb.fsf@home.sysarch.com> on 31 Aug 1999 23:20:15 -
0400, Uri Guttman <uri@sysarch.com> says...
+ >>>>> "MV" == Martien Verbruggen <mgjv@comdyn.com.au> writes:
+
+ MV> In article <MPG.1234e12d95d5d449989ee8@nntp.hpl.hp.com>,
+ MV> lr@hpl.hp.com (Larry Rosler) writes:
+
+ MV> [Thanks to Uri and you for your article on sorting IP addresses,
+ MV> very useful for many things, not just IP addresses :)]
+
+ you're welcome.
And from me, too.
+ >> Benchmark: timing 1 iterations of Naive, Packed...
+ >> Naive: 35 wallclock secs (35.26 usr + 0.00 sys = 35.26 CPU)
+ >> Packed: 11 wallclock secs (10.88 usr + 0.00 sys = 10.88 CPU)
+
+ MV> That's a lot better than I expected as well. I often use the
+ MV> above approach for our local hosts databases (Hey! I just
+ MV> demonstrated a use for Perl that has _nothing_ to do with the
+ MV> web! [implicit grin]), but have never actually looked at speed
+ MV> comparisons.
+
+ i never saw the data set size for that benchmark.
100_000 lines * ~35 chars/line.
+ the difference should
+ get much better as the size grows since the inet_aton calls will be in
+ O(N*LogN) while the pack/unpack will be O(N). at small set sizes the
+ slowness of pack/unpack (compared to inet_aton) will show up. this is
+ a critical point in the paper. the larger overhead of our sort is only
+ saved with larger data sets.
Clearly, inet_aton must be implemented in C to be so efficient compared
to pack(). Otherwise the Benchmark difference would have been
enormously larger.
+ i am doing a sort on a very short (5-10
+ elements) set with a sort compare code containing a hash dereference
+ and numeric compare. that is the best choice for that problem.
Why? To me, it sounds like a rotten choice to demonstrate efficient
sorting techniques.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 01 Sep 1999 02:44:08 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: perl equivalent of a Unix command line sort?
Message-Id: <x77lmbuo5j.fsf@home.sysarch.com>
>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
LR> Clearly, inet_aton must be implemented in C to be so efficient compared
LR> to pack(). Otherwise the Benchmark difference would have been
LR> enormously larger.
it probably just calls the libc routine.
LR> + i am doing a sort on a very short (5-10
LR> + elements) set with a sort compare code containing a hash dereference
LR> + and numeric compare. that is the best choice for that problem.
LR> Why? To me, it sounds like a rotten choice to demonstrate efficient
LR> sorting techniques.
it is not a choice based on speed but simplicity. my point is that an
inefficient sort is ok when the data set size is so small that the
overhead of speedup methods is comparable to the overhead of the naive
compare code. my set in this problem is so small that the simplicity of
code wins over any speedup tricks. just choose the right tool for the
job.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Tue, 31 Aug 1999 22:43:41 -0400
From: "Mark" <tox911@hotmail.com>
Subject: Printing problems NT and PERL
Message-Id: <7qi7gb$1tfc$1@piglet.cc.uic.edu>
Anyone have any information about printing to NT printers? We are having a
problem.
print /d:\\server\printer test.txt works from the command line, and when
sent as a system command works from perl, but only AFTER the same command
has been sent from the command line. Log off, and it's back to not working
again. There has got to be a better way.
Please e-mail tox911@safeplace.net if you have an answer to this!
Mark
------------------------------
Date: Tue, 31 Aug 1999 22:09:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: R: Dos Perl and System command
Message-Id: <MPG.123654c9d1f197c3989ef9@nntp.hpl.hp.com>
In article <Nu_y3.8642$E4.15524@typhoon.libero.it> on Wed, 1 Sep 1999
01:59:05 +0200, Nando <nando@tetecma.com> says...
> Careful with "C:\" which must be "C:\\" ;-)
Well, "C:\" is probably a syntax error, unless there happens to be a
singleton double-quote soon thereafter. But I don't think it 'must' be
"C:\\". It might (better) be 'C:\\' or (best) 'C:/'.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 01 Sep 1999 15:45:45 GMT
From: hoz@rocketmail.com (hoz)
Subject: Re: Redirecting STDERR to STDOUT (on NT)
Message-Id: <37cd4a05.164028843@news.netvision.net.il>
>how can I redirect STDERR to STDOUT so die "string" would work
>correctly?
try using eval
-hoz
------------------------------
Date: Wed, 1 Sep 1999 05:41:46 -0400
From: "Stéphane Gauthier" <ughridk@abchotmail.com>
Subject: Running a cgi from ssi
Message-Id: <7qiscs$d04$1@news.quebectel.com>
Hi,
I would like know if somebody could help me. I want to run a Perl CGI from a
SSI (Server Side Includes) statement.
First, the SSI statement:
In my .SHTML page I wrote
<!--#exec cgi="test.pl">
I don't know if this statement is OK or if I must include the path in it
like cgi="cgi-bin/test.pl"
Second, the CGI:
Can I just use the print command to write something in my webpage or I must
use piping?
Thanks
Stéphane Gauthier
If you want to reply by e-mail, remove the abc from the address below:
ughridk@abchotmail.com
------------------------------
Date: Wed, 01 Sep 1999 10:06:22 +0200
From: Roman Stawski <roman.stawski@synersoft.fr>
Subject: Re: Simulating Carriage Returns
Message-Id: <37CCDE7E.D0FBDD19@synersoft.fr>
Stone Cold wrote:
>
> Is there a way to simulate a carriage return in perl when calling an
> external DOS command. For example, I'm pulling the system date from my
> machine by doing the following:
>
> $now=`date`;
> ($junk1,$junk2,$junk3,$junk4,$current) = split(/\s+/,$now);
> print $current;
> exit 0;
>
> This will run the date shell command and give me back the current
> date. Because it gives other info as well, I'm splitting on the other
> stuff to not see it.
>
> What happens is that when I run the script externally
> (C:/Perl/.../...test.pl), it just hangs there. I think it has
> something to do with there NOT being a carriage return after the `date`
> command because if I print $now, it doesn't even give me the date.
> --
Your script hangs when `Date` prompts you for a new date. Are you
obliged
to use the DOS date? or can you get away with just
print scalar localtime() ;
?
--
:-{)}
------------------------------
Date: 1 Sep 1999 08:17:33 GMT
From: dennis@info4.csie.nctu.edu.tw (GEMINI)
Subject: SOCKS module...
Message-Id: <7qinet$e7t$1@netnews.csie.NCTU.edu.tw>
hi all,
I got a SOCKS module to establish TCP/IP connections
that can go through our firewall.
However, I usually use some Net modules (FTP,NNTP,UserAgent...)
to make internet application. These modules have their
own fashion to establish the connection, and they don't
support SOCKS proxy. So is there any way to combine
these Net modules with SOCKS module? I.e., make these
modules to establish connection by SOCKS modules. Since
these modules are usually subclasses of IO::Socket,
and all use IO::Socket to establish connections, maybe
we can make some modification to IO::Socket without altering
the high level modules.
Thanks.
------------------------------
Date: Tue, 31 Aug 1999 22:16:36 -0700
From: Mark Donohoe <markd@cup.hp.com>
Subject: split defect?
Message-Id: <37CCB6B4.C8AC6F50@cup.hp.com>
Hi,
New to posting to this group. Sorta new to perl.
Someone in our group has posted a defect to the 'right' spot
so they say, but we have never heard back from anyone....
Problem:
We upgraded to perl 5.X and are now having problems in exsiting code
that worked just fine. We have tracked it down to a line that is doing
a split. It doesn't always happen, but when it does, perl appears to
never return from the split. Perl then runs till we kill it and while
it's running it eats the cpu.
The code is not mine and I am not that familiar with it, but we
really need a fix of some sort. The code where the problem
seems to be, has not been changed for quite some time. Only the
perl version has changed.
Particulars:
perl -v :
This is perl, version 5.004_04 built for PA-RISC1.1
Copyright 1987-1997, Larry Wall
We are running on HP-UX OS version 10.20. The OS has a lot of
HP-UX patches (I mean a lot) so I'm not going to list the patches
here, but can if need be. We are also running ClearCase on these
machines, if that is of any help.
Thanks in advance for any help you can give.
---
Mark Donohoe (markd@cup.hp.com)
------------------------------
Date: Tue, 31 Aug 1999 22:48:50 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: subtraction error
Message-Id: <MPG.12365e15bc9c4ff5989efb@nntp.hpl.hp.com>
In article <MPG.12363e472d4abeb9896e2@nntp1.ba.best.com> on Tue, 31 Aug
1999 20:33:03 -0700, Bill Moseley <moseley@best.com> says...
> hojo (i_tel@my-deja.com) seems to say...
> > Trans Amount $curbal
> > -59.75 -9.74
> > 9.74 -1.77635683940025e-15 (should be 0)
> >
> > I would call this a bug. Has anybody run into/fixed this problem?
>
> Does that amount get refunded by check or cash?
Several crooked programmers have gotten rich (until caught) by siphoning
off round-off errors into their personal accounts.
> Check out the first question in perlfaq4 and see if that helps.
The only way it can help is by papering over a fundamentally flawed
approach -- dealing with dollars and cents as floating-point numbers in
dollar units, instead of as integers in cent units.
It should be ingrained into all programmers not to do this in financial
calculations! This is a basic issue of professional competence.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 1 Sep 1999 09:42:09 +0100
From: "jon" <me@my.com>
Subject: using ppm with proxy servers
Message-Id: <7qip19$rjg$1@lure.pipex.net>
Hi
Does anyone know how to configure ppm to use a proxy server when accessing
websites with perl packages ?
Cheers
Jon
------------------------------
Date: Tue, 31 Aug 1999 16:33:34 +0900
From: "Denis Kotseba" <kdl@softhome.net>
Subject: Where a subroutine gets called from?
Message-Id: <7qikvp$fv9$1@usenet.kreonet.re.kr>
Hi,
In one of my programs there are "nested" subrouties, something like this:
sub a {
...
&c($x,$y);
...
}
sub b {
...
&c($x,$y);
...
}
sub c {
...
}
How can I find out which subrotine (a or b) called c without passing an
extra parameter?
Thanks in advance.
Denis Kotseba.
------------------------------
Date: 01 Sep 1999 04:02:40 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Where a subroutine gets called from?
Message-Id: <x7zoz7t5y7.fsf@home.sysarch.com>
>>>>> "DK" == Denis Kotseba <kdl@softhome.net> writes:
DK> How can I find out which subrotine (a or b) called c without passing an
DK> extra parameter?
perldoc -f caller
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. Due to their sizes, neither the Meta-FAQ nor
the FAQ are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq" from
almanac@ruby.oce.orst.edu.
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 693
*************************************