[16458] in Perl-Users-Digest
Perl-Users Digest, Issue: 3870 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 1 11:07:19 2000
Date: Tue, 1 Aug 2000 08:05:13 -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: <965142312-v9-i3870@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 1 Aug 2000 Volume: 9 Number: 3870
Today's topics:
Re: APACHE Login name (Colin Keith)
Bulk Emailing <john@nomailplease>
Re: Bulk Emailing <mstyne@bownemgmt.com>
check if $sth->fetch is empty vnguyen_1999@my-deja.com
Dec->Hex, how to? aqutiv@softhome.net
Re: Dec->Hex, how to? <red_orc@my-deja.com>
Re: Dec->Hex, how to? (Colin Keith)
Documentation? WIN32 ODBC: Access97 - ActiveState Perl <joj@invalid.doms.dk>
Re: Documentation? WIN32 ODBC: Access97 - ActiveState P (Colin Keith)
Re: downloading a file from a remote machine (Colin Keith)
Re: execute a Perl script in another Perlscript <tschilbach@aodinc.com>
Re: Help with LWP <Timothy.Clemmer@lexis-nexis.com>
On upgrading Perl... <mstyne@bownemgmt.com>
Re: On upgrading Perl... (Greg Bacon)
Re: Perl and MySQL <thunderbear@bigfoot.com>
Re: Regular expression president@whitehouse.gov
Re: Regular expression (Greg Bacon)
Rotating Images oderus54@my-deja.com
Re: Rotating Images oderus54@my-deja.com
Re: Rotating Images <martin@fez.dk>
Re: size in bytes of a scalar (Keith Calvert Ivey)
Re: spliting on caps (newbie) (Keith Calvert Ivey)
Re: splitting on spaces <red_orc@my-deja.com>
Re: Substituting a string?! <aqumsieh@hyperchip.com>
Re: Syntax Question <mjcarman@home.com>
Re: Syntax Question (Greg Bacon)
Re: Syntax Question (Marcel Grunauer)
system($commandline) fails <ldj@cistron.nl>
Re: text file to HTML page (Keith Calvert Ivey)
Re: Tutorial suggestions for a new programmer rinkjustice@rocketmail.com
Re: Variable Interpolation Woes (Keith Calvert Ivey)
Re: Win2000 ActivePerl EXE association grief <tschilbach@aodinc.com>
Win32::ODBC & SQL Anywhere <heinej@jaguar.rockvillemd.ncr.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 01 Aug 2000 13:32:02 GMT
From: ckeith@clara.net (Colin Keith)
Subject: Re: APACHE Login name
Message-Id: <mjAh5.64$DT4.2182693@nnrp2.clara.net>
In article <39869A3B.5BDB@yahoo.com>, Mouse <glodalec@yahoo.com> wrote:
>I am using CGI module on Unix/Apache server.
>
>both of commands (remote_user(),user_name()) returns empty
"remote_user ()
Return the authorization/verification name used for user verification,
if this script is protected."
Presumably this is just returning the contents of $ENV{'REMOTE_USER'}.
If its not returning anything then the script you're calling didn't have a
username sent to it. It might be that your script is in a directory that
isn't .htaccess protected (That is what you mean by apache authorization I
assume) itself and isn't in a subdirectory of a password protected
directory.
user_name() is almost certainly going to be empty.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Tue, 1 Aug 2000 14:35:27 +0100
From: "John" <john@nomailplease>
Subject: Bulk Emailing
Message-Id: <3986d2eb@news.telinco.net>
Hi, I've written a script for a weekly mailshot to my subscribers (see
below). As it works now the message is written again for every recipient. Is
there a way of avoiding this without including every recipients address in
the message header eg as in $smtp->to(@users);
JohnShep
while (my $ref = $sth->fetchrow_arrayref)
{
$smtp = Net::SMTP->new('localhost') or die;
$smtp->mail(mailto:'boxrec@uklinux.net);
$smtp->to($$ref[0]);
$smtp->data();
$smtp->datasend('From: boxrec@uklinux.net'."\n");
$smtp->datasend("To: ".$$ref[0]."\n");
$smtp->datasend("Subject: Boxing Results\n");
$smtp->datasend("\n");
$smtp->datasend("www.boxrec.com weekly reuslts .............
");
foreach $line (@line)
{
$smtp->datasend($line);
}
$smtp->datasend();
$smtp->quit;
}
------------------------------
Date: Tue, 01 Aug 2000 09:57:56 -0400
From: Mike Styne <mstyne@bownemgmt.com>
Subject: Re: Bulk Emailing
Message-Id: <3986D764.8AF5206B@bownemgmt.com>
John,
Is it possible to use Blind Carbon Copy (Bcc)?
Regards,
Mike
John wrote:
>
> Hi, I've written a script for a weekly mailshot to my subscribers (see
> below). As it works now the message is written again for every recipient. Is
> there a way of avoiding this without including every recipients address in
> the message header eg as in $smtp->to(@users);
>
> JohnShep
>
> while (my $ref = $sth->fetchrow_arrayref)
> {
> $smtp = Net::SMTP->new('localhost') or die;
>
> $smtp->mail(mailto:'boxrec@uklinux.net);
>
> $smtp->to($$ref[0]);
>
> $smtp->data();
> $smtp->datasend('From: boxrec@uklinux.net'."\n");
> $smtp->datasend("To: ".$$ref[0]."\n");
> $smtp->datasend("Subject: Boxing Results\n");
> $smtp->datasend("\n");
> $smtp->datasend("www.boxrec.com weekly reuslts .............
> ");
> foreach $line (@line)
> {
> $smtp->datasend($line);
> }
> $smtp->datasend();
>
> $smtp->quit;
> }
--
miracle: an extremely outstanding or unusual event, thing, or
accomplishment.
-- Webster's Dictionary
------------------------------
Date: Tue, 01 Aug 2000 14:45:44 GMT
From: vnguyen_1999@my-deja.com
Subject: check if $sth->fetch is empty
Message-Id: <8m6nqm$st7$1@nnrp1.deja.com>
Hello !!!
How can I check if $sth->fetch is empty?
Thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 01 Aug 2000 13:11:22 GMT
From: aqutiv@softhome.net
Subject: Dec->Hex, how to?
Message-Id: <8m6i9m$o9s$1@nnrp1.deja.com>
Hrrm, I can't seem to find a way to turn a decimal number into an hex
string with perl... Is it possible? I couldn't find a built-in function
of sort.. What I need is the reversal operation of hex(xx), and it is
needed for a query string link.
Thanks.
Idan Robbins,
aqutiv@softhome.net.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 01 Aug 2000 13:22:58 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: Dec->Hex, how to?
Message-Id: <8m6ivc$p12$1@nnrp1.deja.com>
In article <8m6i9m$o9s$1@nnrp1.deja.com>,
aqutiv@softhome.net wrote:
> Hrrm, I can't seem to find a way to turn a decimal number into an hex
> string with perl... Is it possible? I couldn't find a built-in
> function of sort.. What I need is the reversal operation of hex(xx),
> and it is needed for a query string link.
>
have you looked into pack and unpack?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 01 Aug 2000 13:41:35 GMT
From: ckeith@clara.net (Colin Keith)
Subject: Re: Dec->Hex, how to?
Message-Id: <jsAh5.65$DT4.2182905@nnrp2.clara.net>
In article <8m6i9m$o9s$1@nnrp1.deja.com>, aqutiv@softhome.net wrote:
>Hrrm, I can't seem to find a way to turn a decimal number into an hex
>string with perl... Is it possible? I couldn't find a built-in function
printf "%x", $num;
>of sort.. What I need is the reversal operation of hex(xx), and it is
>needed for a query string link.
Ahh, in that case,
printf("%02X", $num);
better yet, use CGI.pm and it'll do it for you
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Tue, 01 Aug 2000 15:18:29 +0200
From: John =?iso-8859-1?Q?=D8llg=E5rd?= Jensen <joj@invalid.doms.dk>
Subject: Documentation? WIN32 ODBC: Access97 - ActiveState Perl script
Message-Id: <3986CE25.8C71E980@invalid.doms.dk>
HI,
Using Access97 + ActivePerl vers 5 build 522:
Where do I find some documentation about ODBC naming rules?
Especially:
Which characters are allowed in table names and table field names?
Max length of table names and table field names?
Other restrictions?
Ex.
This is working:
$sql = "SELECT * FROM MyTableName;";
$sql = "SELECT * FROM My_Table_Name;";
This is NOT working:
$sql = "SELECT * FROM My Table Name;";
$sql = "SELECT * FROM 'My Table Name';";
$sql = "SELECT * FROM My-Table-Name;";
Are those restrictions to be found on the ACCESS97 side or the Perl
script side?
thanks,
John
------------------------------
Date: Tue, 01 Aug 2000 13:47:34 GMT
From: ckeith@clara.net (Colin Keith)
Subject: Re: Documentation? WIN32 ODBC: Access97 - ActiveState Perl script
Message-Id: <WxAh5.66$DT4.2183049@nnrp2.clara.net>
In article <3986CE25.8C71E980@invalid.doms.dk>, John =?iso-8859-1?Q?=D8llg=E5rd?= Jensen <joj@invalid.doms.dk> wrote:
>This is NOT working:
> $sql = "SELECT * FROM My Table Name;";
> $sql = "SELECT * FROM 'My Table Name';";
> $sql = "SELECT * FROM My-Table-Name;";
>Are those restrictions to be found on the ACCESS97 side or the Perl
>script side?
I would strongly suspect that its on the access side. The above naming
conventions certainly aren't allowed by MySQL, and I would suspect it
applies to most databases.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Tue, 01 Aug 2000 14:19:45 GMT
From: ckeith@clara.net (Colin Keith)
Subject: Re: downloading a file from a remote machine
Message-Id: <50Bh5.67$DT4.2184904@nnrp2.clara.net>
In article <x6uh5.16649$Cm.573836@news1.gvcl1.bc.home.com>, "whitetigercat" <whitetigercat@home.com> wrote:
>host has this module installed. I've written a lot of PERL code and never used
At the cmd prompt: perl -MLWP::Simple
If it errors you don't have it installed (or its not in a place where perl
could find it). If you can't get a prompt as a CGI script:
#!/usr/bin/perl -w
use strict;
print "Content-Type: text/plain\n\n";
eval { require LWP::Simple; };
if($@){
print "Ick something failed: $@\n";
} else {
print "Found it and loaded it okay.\n";
}
Note that require is used instead of 'use' as use is acted on before
runtime.
>an external module before (ok, I probably did, but they were simple ones
> like CGI::Carp qw(fatalsToBrowser); Can you or anyone give me a snippet of
>code showing the actual downloading of a file from the web?
Tut tut ;)
But if you look at perldoc LWP::Simple you'll see all you need to straight
off in the synopsis section:
use LWP::Simple;
$content = get("http://www.sn.no/")
Try it. Add "print $content;" to the end of it and see what you get .. yup,
$content is a copy of what the server returned for that query. Better
still, look further down through the docs and you'll see:
getstore($url, $file)
Gets a document identified by a URL and stores it in
the file. The return value is the HTTP response code.
You can plonk it on disk and process it from there..
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Tue, 1 Aug 2000 08:18:23 -0500
From: "Timothy H. Schilbach" <tschilbach@aodinc.com>
Subject: Re: execute a Perl script in another Perlscript
Message-Id: <8m6iqc$ofd$1@news.chatlink.com>
This is an excellent question. If you find out please clue me in :-)
--
Timothy H. Schilbach
Alpha Omega Design Inc.
tschilbach@aodinc.com
1-877-263-7094
Visit our website at www.aodinc.com
Web server hosting and dialup access for the future.
<johands@hotmail.com> wrote in message news:8m4uiq$kc0$1@nnrp1.deja.com...
> hello everybody
>
> how do i execute an cgi-script(written in Perl) within another cgi-
> script (written in Perl).
>
> So i have a cgi-script and then somewhere in this cgi-script i want
> another cgi-script to be executed.
>
> nice greetings and thank you
>
> johan
>
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Tue, 1 Aug 2000 10:00:22 -0400
From: "Timothy Clemmer" <Timothy.Clemmer@lexis-nexis.com>
Subject: Re: Help with LWP
Message-Id: <8m6l77$6dg$1@mailgate2.lexis-nexis.com>
Jeff,
I have not personally run into this problem, so I apologize in advance
if my advice is misleading, but here goes...
I have recently used the LWP, and see nothing suspicious in your code
snippet, though I admit, I am working on a PC (activestate distribution).
Here's my suggestion... since you say it works on one box but not another,
I'll assume that the two boxes are on different networks (one is home, the
other is at work?) and that your problem may be related to proxies. I
noticed two functions on UserAgent called proxy() and env_proxy() which
might be helpful.
Good luck! Let us know what you find out.
Tim
Jeffrey <seesej@uswest.net> wrote in message
news:B5AC1473.81AF%seesej@uswest.net...
> Hi:
> I am trying to use the LWP:UserAgent module and I am having the following
> problem.
>
> I am getting a code 500 back from any url that I try, but this script will
> run correctly from my desktop computer.
>
> When I try to get message (ok,server error,etc) I get an execution error
> from the "message" object
>
> "Can't locate auto/URI/URL/http/path_query.al in @INC............."
>
> Problem is I can't find path_query.al anywhere.
>
> My first question is. Why am I getting the code 500 in the first place?
> Secondly, what is the path_query.al and if I need it where can I get it.
>
> Thank you in advance for any help
> Jeff
>
> I am using Perl5 on Red Hat Linux release 6.2 with Apache.
>
> Here is an excerpt of the code I am attempting to use.
>
> ######################################################
> # Create a user agent object
> use LWP::UserAgent;
>
> $ua = new LWP::UserAgent();
> $request = new HTTP::Request('GET','http://www.excite.com/');
> $result = $ua->request($request);
>
> $content = "\ncode .....: ".$result->code;
> $content .= "\nmessage ..: ".$result->message;
> $content .= "\ncontent ..: \n".$result->content;
>
> print $content;
> ######################################################
>
------------------------------
Date: Tue, 01 Aug 2000 09:48:01 -0400
From: Mike Styne <mstyne@bownemgmt.com>
Subject: On upgrading Perl...
Message-Id: <3986D511.85E40E77@bownemgmt.com>
I've checked online, and in the FAQ's -- but I can't seem to find the
surefire way to upgrade a system from Perl 5.005_03 to 5.6.0. It seems
that previous versions of Perl installed to /usr/bin and 5.6.0 installs
to /usr/local/bin. Annoying, to say the least.
Any enlightenment or magic spells would be appreciated.
Mike
--
miracle: an extremely outstanding or unusual event, thing, or
accomplishment.
-- Webster's Dictionary
------------------------------
Date: Tue, 01 Aug 2000 14:55:52 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: On upgrading Perl...
Message-Id: <sodp7o1odbm78@corp.supernews.com>
In article <3986D511.85E40E77@bownemgmt.com>,
Mike Styne <mstyne@bownemgmt.com> wrote:
: I've checked online, and in the FAQ's -- but I can't seem to find the
: surefire way to upgrade a system from Perl 5.005_03 to 5.6.0. It seems
: that previous versions of Perl installed to /usr/bin and 5.6.0 installs
: to /usr/local/bin. Annoying, to say the least.
Set the prefix, e.g., `Configure -Dprefix=/usr -des`. Changing the
default to /usr/local on Linux (possibly other platforms too) wasn't
an accident. Many Linux distributions put their specially configured
perls in /usr/bin. Installing over the distribution perl could cause
problems if you aren't careful.
Greg
--
Cop: I can put you in Queens on the night of the hijacking.
Hockney: Really? I live in Queens. Did you put that together yourself?
------------------------------
Date: Tue, 01 Aug 2000 15:52:35 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: Perl and MySQL
Message-Id: <3986D623.BC60BCBB@bigfoot.com>
Jonathan Stowe wrote:
> >> Also, can anyone recommend any good tutorial sites, or books,
> >> that can help me learn this strange new language?
> >
> > I've been reading MySQL and mSQL by Yarger, Reese & King. I know
> > nothing about MySQL, and so far it's been a pretty good tutorial.
> >
>
> It ought to borne in mind that one of the authors has a demonstrable
> loathing and complete lack of understanding of Perl.
I read the book to learn about SQL, not as much MySQL. In my opinion
the book is a rather large installation and maintainance manual instead
of a SQL programmers tool.
--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear
------------------------------
Date: Tue, 01 Aug 2000 14:04:17 +0100
From: president@whitehouse.gov
Subject: Re: Regular expression
Message-Id: <3986CAD1.CA318F42@whitehouse.gov>
Chrys wrote:
> how to extract for instance:
> the # 61242194 from the line:
> /usr/data/testing/sid61242194/dt.out
(\d+) matches one-or-more digits
------------------------------
Date: Tue, 01 Aug 2000 14:41:00 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Regular expression
Message-Id: <sodobs63dbm41@corp.supernews.com>
In article <15f5621a.c9f340d9@usw-ex0108-061.remarq.com>,
Chrys <isc80460NOisSPAM@nus.edu.sg.invalid> wrote:
: how to extract for instance:
: the # 61242194 from the line:
: /usr/data/testing/sid61242194/dt.out
:
: the pattern of the line is always the same.
It helps to give several examples to make the pattern clearer. How
does the following work for you?
if ($file =~ m!/usr/data/testing/sid(\d+)!) {
print "Got '$1'\n";
}
Greg
--
Aren't you glad you're not getting all the government you pay for now?
------------------------------
Date: Tue, 01 Aug 2000 13:16:37 GMT
From: oderus54@my-deja.com
Subject: Rotating Images
Message-Id: <8m6ijg$ola$1@nnrp1.deja.com>
I am trying to rotate images for a script im making for my job for our
webcams. I would like to be able to rotate the images on the page
without having to reload it, and have the images some up as fast as
possible, how would i rotate the images without reloading
Thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 01 Aug 2000 13:21:37 GMT
From: oderus54@my-deja.com
Subject: Re: Rotating Images
Message-Id: <8m6iss$ope$1@nnrp1.deja.com>
P.S. ... This is a cgi script for a webpage.
In article <8m6ijg$ola$1@nnrp1.deja.com>,
oderus54@my-deja.com wrote:
> I am trying to rotate images for a script im making for my job for our
> webcams. I would like to be able to rotate the images on the page
> without having to reload it, and have the images some up as fast as
> possible, how would i rotate the images without reloading
>
> Thanks
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 01 Aug 2000 15:43:28 +0200
From: Martin Mouritzen <martin@fez.dk>
Subject: Re: Rotating Images
Message-Id: <pukdos4cbnfor268i36k4joolsbjtie557@4ax.com>
On Tue, 01 Aug 2000 13:16:37 GMT, oderus54@my-deja.com sneezed and
this is what came out:
>I am trying to rotate images for a script im making for my job for our
>webcams. I would like to be able to rotate the images on the page
>without having to reload it, and have the images some up as fast as
>possible, how would i rotate the images without reloading
Use a Java applet.
You can't do this job with Perl/CGI.
--
Martin Mouritzen
- If you have any questions,
please direct them to a nearby wall.
------------------------------
Date: Tue, 01 Aug 2000 12:59:51 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: size in bytes of a scalar
Message-Id: <3988c94d.47344874@news.newsguy.com>
logan@cs.utexas.edu (Logan Shaw) wrote:
> $length = 0;
> foreach (@my_array) { $length += length; }
$length = length join '', @my_array;
>The simple way for a hash is this:
>
> $length = 0;
> foreach (keys %my_hash, values %my_hash) { $length += length; }
$length = length join '', %my_hash;
I don't know if that's really what the original poster wanted,
though. It seems less than useful.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Tue, 01 Aug 2000 13:12:14 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: spliting on caps (newbie)
Message-Id: <3989cad2.47733859@news.newsguy.com>
goodrow@panix.com (Jason Goodrow) wrote:
>Hey - I'm trying to split words on caps
>
>@a = split '([A-Z])', $ARGV[0];
>
>foreach $spl (@a) {
>print "$spl\n";}
>
>This returns
>
>> ./w2 SplitAllTheseWords
>
>S
>plit
>A
>ll
>T
>hese
>W
>ords
>
>Not what I want
But it is the behavior you'd expect from the documentation.
If there are capturing parentheses in the split regex, the
captured string are returned between the split elements in the
array, and that's what's happening. Now, if you got rid of
them, like this
@a = split /[A-Z]/, $ARGV[0];
(I prefer to use // rather than '' around the split regex to
remind myself and others that it's a regex), then the capital
letters would be discarded:
plit
ll
hese
words
which is obviously not what you want either. So you need to
have a separator that doesn't include any characters, like a
look-ahead:
@a = split /(?=[A-Z])/, $ARGV[0];
That does what you want.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Tue, 01 Aug 2000 13:18:34 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: splitting on spaces
Message-Id: <8m6in4$omi$1@nnrp1.deja.com>
In article <MPG.13efadab13fa1c8698ac14@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
> That certainly is the long way around. Either (as others have said)
> split on /\s+/ (which preserves a leading null field) or on " ", which
> doesn't.
>
> perldoc -f split.
>
when I tried splitting on " ", I typoed and checked the wrong array for
the results. thanks for the redirect to a more appropriate sollution.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 01 Aug 2000 13:42:33 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Substituting a string?!
Message-Id: <7almyhf67o.fsf@merlin.hyperchip.com>
<acfernandes@netc.pt> writes:
> Hello everybody!
> I am getting started with programming in perl.
> I am trying to do a task that I think is very
> simple but i am having some problems. I need
> to find a substring inside a string in a file
> and remove it, eg:
>
> old:
> p=12,as=43,w=8;
> p=2,as=1344,y=9;
>
> new:
> p=12,w=8;
> p=2,y=9;
>
> I need to remove the mentioning of as=... in
> all lines and save to a new file. But i am
> getting problems with the variable length of
> as.
> Can someone help me please?
Sure, but first tell us what have you tried. It'll be a better
experience for you if someone points out your errors for you.
--Ala
------------------------------
Date: Tue, 01 Aug 2000 07:51:09 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Syntax Question
Message-Id: <3986C7BD.7AE298DF@home.com>
bardicstorm@my-deja.com wrote:
>
> Again, thanks, though having looked through the Perldoc and seeing
> entries on everything in perl with very little to tell me where to look
> for my particular question (I was looking for some Perldoc related to
> files, not figuring the answer would be in the variables)
Did you notice the flags you can pass to perldoc? Namely
perldoc -f <function> -- search for help on <function>
perldoc -q <keyword> -- search the FAQ for help on <keyword>
Trying 'perldoc -q read' pulls up a number of entries, including "How
can I read in a file by paragraph?" which is similar to what you're
trying to do and points you toward $/.
-mjc
------------------------------
Date: Tue, 01 Aug 2000 14:35:17 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Syntax Question
Message-Id: <sodo15h1dbm45@corp.supernews.com>
In article <MPG.13efaf50426d2dcd98ac15@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
: In article <sobr33jt55142@corp.supernews.com> on Mon, 31 Jul 2000
: 21:15:15 GMT, Greg Bacon <gbacon@HiWAAY.net> says...
:
: > open FILE, $file or die "$0: open $file: $!";
: > my $contents = do { local $/; <FILE> };
: > close FILE;
:
: Several recent threads have shown that -- despite its elegance -- this
: solution is slower than either doing the localization in a separate
: statement (as others have posted)
I don't care. I don't use Perl for speed critical applications. When
I use Perl, I'm as far away from the bare metal, cycle counting mindset
of assembly language programmers. Besides, the above code is about as
idiomatic as it could be. Idiomatic code should execute quickly.
: or (faster yet), using read().
:
: read FILE, $contents, -s FILE or die ...
It may be fast, but it's incorrect. What happens when the read is
incomplete, i.e., when the return value (ignored in this case) is
less than -s FILE? Slow and steady wins the race, Mr. Hare.
Greg
--
Extraordinary men are tempted by the most ordinary things.
-- Cigarette Smoking Man
------------------------------
Date: Tue, 01 Aug 2000 14:47:00 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: Syntax Question
Message-Id: <slrn8odp28.839.marcel@gandalf.local>
On Tue, 01 Aug 2000 14:35:17 GMT, Greg Bacon <gbacon@HiWAAY.net> wrote:
>In article <MPG.13efaf50426d2dcd98ac15@nntp.hpl.hp.com>,
> Larry Rosler <lr@hpl.hp.com> wrote:
>
>: In article <sobr33jt55142@corp.supernews.com> on Mon, 31 Jul 2000
>: 21:15:15 GMT, Greg Bacon <gbacon@HiWAAY.net> says...
>:
>: > open FILE, $file or die "$0: open $file: $!";
>: > my $contents = do { local $/; <FILE> };
>: > close FILE;
>:
>: Several recent threads have shown that -- despite its elegance -- this
>: solution is slower than either doing the localization in a separate
>: statement (as others have posted)
>
>I don't care. I don't use Perl for speed critical applications. When
>I use Perl, I'm as far away from the bare metal, cycle counting mindset
>of assembly language programmers. Besides, the above code is about as
>idiomatic as it could be. Idiomatic code should execute quickly.
Not as idiomatic as it could be.
my $c = do { local (@ARGV, $/) = $file; <> };
--
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: Tue, 1 Aug 2000 16:18:54 +0200
From: "DeeJay" <ldj@cistron.nl>
Subject: system($commandline) fails
Message-Id: <8m6mbg$9fh$1@enterprise.cistron.net>
I try to execute a mapisend.exe from pearl. I redirect the output to a
html-file and get the following response:
---------------------------------------------------
$commandline = c:\mailsend\mapisend.exe -u Mail -p xxxxxx -r
"Administrator" -s "Testing 123" -m "This is a testmessage."
ERROR: MAPI Logon Failed: 3
Mapisend has been executed.
---------------------------------------------------
When I cut & paste the same line from the DOS-promt, no problem.
It looks like the system($commandline) has a problem with the -u and -p
options, 'though DOS hasn't.
Background Info: I'm trying to send a HTML-form on Intranet through mail
from IIS4 to Exchange 5.5, without using SMTP. The Intranet-server has an
Exchange 5.0 client (MAPI). I've seen this script working with BLAT, made by
Greg Elin and try to adapt it to MAPISEND.
Does anyone has a clue what the problem is? If not, is there an alternative
to send HTML-forms to Exchange Server without SMTP?
Thanks in advance!
Greetings,
Léon de Jong.
------------------------------
Date: Tue, 01 Aug 2000 12:47:40 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: text file to HTML page
Message-Id: <3986c69b.46655105@news.newsguy.com>
Tyler Larson <Tyler_L@techie.com> wrote:
> print "<pre>\n";
> print <FILE>;
> print "</pre>";
[snip]
>And possibly the most important detail to keep in mind is that ALL whitespace is
>treated the same, and no matter how many spaces and blank lines you insert, all
>consecutive whitespaces will be reduced to one single space when it is
>displayed. If you want to go to the next line, you have to specifically say so
>with the <br> tag (or with any block-level tag, but that's beside the point).
Not when you're using <PRE>, as you are. <PRE> preserves the
whitespace.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Tue, 01 Aug 2000 13:00:11 GMT
From: rinkjustice@rocketmail.com
Subject: Re: Tutorial suggestions for a new programmer
Message-Id: <8m6hkp$nqn$1@nnrp1.deja.com>
Try http://www.hardcorelinux.com/perl-tutorial-intro.htm
> As part of my job I have to program in perl but I have not used the
> language before. I've used other programming languages and I'm
looking
> for suggestions for a tutorial/reference that would help me get
started.
> Online tutorials and books are welcomed.
>
> Thanks,
> Sara
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 01 Aug 2000 12:51:50 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Variable Interpolation Woes
Message-Id: <3987c74d.46832586@news.newsguy.com>
abliss@mindspring.com wrote:
>My first instinct was to use a variable-interpolated string, a la
>
>print "The error $dbh->errmsg() occured.";
>
>but this prints the $dbh reference and then the literal '-
>>errmsg()'.
That's right, because $dbh->errmsg() isn't a variable. It's a
method call: a variable, an operator, and a function. It's not
interpolated, any more than "$interval+time()" would be.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Tue, 1 Aug 2000 08:16:17 -0500
From: "Timothy H. Schilbach" <tschilbach@aodinc.com>
Subject: Re: Win2000 ActivePerl EXE association grief
Message-Id: <8m6ime$oeq$1@news.chatlink.com>
Andy,
I am a big NT webserver/ISP myself. I use windows NT 4.0 or Linux for
webserving with PERL. The reason your having trouble is a simple windows
2000 built in routine. Windows 2000 does not allow applications that run in
16bit mode. Or I should say that it doesn't work with applications that do
not work in 16bit protected mode. This is why so many wonderful dos games,
windows 95 applications, and some unix emulated features do not work on
NT2k.
Active PERL runs in the command prompt in a 16bit emulated environment. I do
not think it runs in protected mode (you may want to check with active PERL
or in the file properties itself). Because of this Active PERL will not work
on NT2k very well in the command prompt mode. Try forcing it to protective
mode and see if that helps any.
You may want to check the latest documentation at the activestate site to
see if there will be any updates or changes for NT2k.
Let me know if this helps.
--
Timothy H. Schilbach
Alpha Omega Design Inc.
tschilbach@aodinc.com
1-877-263-7094
Visit our website at www.aodinc.com
Web server hosting and dialup access for the future.
<c741535@my-deja.com> wrote in message news:8m5rj2$8as$1@nnrp1.deja.com...
> Howdy,
>
> I used to run ActivePerl on a WinNT box, no problems. I've just installed
the
> lastest build (616?) onto a Win2000 Pro server and have found that the IIS
> associations for the ISAPI and EXE's for Perl have not been put in by the
> install (eg. associate '.pl' files with 'bin\perl.exe') even though the
boxes
> in the install were ticked (double checked).
>
> I've manually put the ISAPI DLL into the list and that works fine. Only
> problem is when I use a '.plx' file and I've got errors they don't go to
the
> browser so I can't debug 'em. Generally in the past I've always used the
> '.pl' (associated with Perl.exe) when building/debuging code cos it gives
me
> the error text to the browser. Then I move to '.plx' for production to
speed
> it up.
>
> My problem is that I thought the association for the EXE would be a simple
> 'bin\Perl.exe' but this isn't working even on a simple 'hello world'
script
> (the script works fine if I change the extension to '.plx' and run it
through
> the ISAPI DLL). If I set up the association for Perl.exe the browser just
> sits there forever and I can't even kill the Perl process as I get a
> 'Permission denied' message (reboot is required to kill it). I can run the
> perl script from the command line.
>
> So two questions - 1. Is there a way to display the perl debug output if I
> use the ISAPI DLL as the interpreter? or 2. Can anyone tell me the correct
> IIS association for using the EXE?
>
> One answer to either question would put me in the clear.
>
> Thanks alot for reading this, appreciated!
>
> Regards,
> Andy.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Tue, 1 Aug 2000 09:56:36 -0400
From: "Jeff Heine" <heinej@jaguar.rockvillemd.ncr.com>
Subject: Win32::ODBC & SQL Anywhere
Message-Id: <3986d67c$1@rpc1284.daytonoh.ncr.com>
Hi,
I'm trying to add a new DSN for a SQL Anywhere database dynamically at
runtime, and I need to use the Start=... option setting as follows:
Win32::ODBC::ConfigDSN(ODBC_ADD_DSN, 'Sybase SQL Anywhere 5.0'
, ("DSN=USPS_AJ",
...
, 'Start = C:\sqlany50\win32\dbclient.exe -x tcpip{host=153.84.100.5}
USPS_AJ'
))
it gives me the following error because of the 'Start = ' line:
---------- Error Report: ----------
Errors for the package:
Connection Number:
Error number: 911
Error message: "Illegal use of reserved characters []{}(),?*!@;"
-----------------------------------
Who's giving this error? Perl, ODBC, SQL Anywhere?
How can I specify a TCPIP host address within my startline without usng the
squirley brackets?
Anyone out there doing anything like this?
Any assistance would be greatly appreciated
Thanks
J
------------------------------
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 3870
**************************************