[16396] in Perl-Users-Digest
Perl-Users Digest, Issue: 3808 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 26 11:05:29 2000
Date: Wed, 26 Jul 2000 08:05:11 -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: <964623910-v9-i3808@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 26 Jul 2000 Volume: 9 Number: 3808
Today's topics:
Re: Advanced Perl Programming -- Dated? <lusol@Pandora.CC.Lehigh.EDU>
Re: autoresponder with customised message president@whitehouse.gov
Re: backtick with spaces on win32 <waltman@netaxs.com>
Re: Capturing info accross multiple pages in one form <wmonk@documentsolutions.com>
Re: CGI passing parameters melet@my-deja.com
Re: CGI->new(*FORM) Problem... <zampino@squidco.com>
Command Execution <glodalec@yahoo.com>
Re: exactly WHEN will PP-3rd be in bookstores, etc? An (SPAM)
Re: exactly WHEN will PP-3rd be in bookstores, etc? An <wmonk@documentsolutions.com>
Re: file location and access strategies hacktic@my-deja.com
find.pl & error_log <weberr2202@my-deja.com>
Re: Formatting text file <coy@coystoys.com>
Re: how do you ? question <aqumsieh@hyperchip.com>
Re: How do you find the full name of the user in NT? <thycotic@my-deja.com>
How to handle command application on unix jing111@my-deja.com
Loop for selecting text? <aage.vaksdal@ifi.uib.no>
Re: Loop for selecting text? <stephen.kloder@gtri.gatech.edu>
Re: No Data from Database melet@my-deja.com
Re: Perhaps a dumb question... nospam@our.site
Re: Perhaps a dumb question... <Peter.Dintelmann@dresdner-bank.com>
Perl Mail headers question <jason@mybowie.com>
Re: pos() bug? (matt venn)
Re: return value of `eval "use lib"' (Sweth Chandramouli)
RSH to os/2 does not work with backticks thomas.emde.te@bayer-ag.de
Urgent!! - Please help with Perl install aorrock@my-deja.com
Re: Urgent!! - Please help with Perl install <guenther.degenfelder@datev.de>
Re: Warnings and undefs (Keith Calvert Ivey)
Re: Was Why won't "use strict;" work? <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Jul 2000 13:06:33 GMT
From: "Stephen O. Lidie" <lusol@Pandora.CC.Lehigh.EDU>
Subject: Re: Advanced Perl Programming -- Dated?
Message-Id: <8lmnop$b0g@fidoii.CC.Lehigh.EDU>
Eric Bohlman <ebohlman@netcom.com> wrote:
> Hugh Lawson (hlawson@triad.rr.com) wrote:
> : What about Ch. 14, "User Interfaces with Tk", and Appendix A, "Tk Widget
> : Reference"?
> :
> : I wrote a beginner program that quizzes me on new French words I have to
> : look up while reading. I've never written any kind of graphic interface,
> : but I'd like to try setting up one for this program, mainly as a learning
> : exercise. Is this chapter satisfactory for a beginner's use, or should I
> : look elsewhere for an introduction?
> Go to O'Reilly's site and make note of the errata for Ch. 14 first.
> There are a number of typos that will prevent much of the code there from
> running unless they're corrected.
Is it even possible to get all the changes for Chapter 14, or must one go
through, page by page, for every printing/revision, looking for all the Tk
changes? The examples are (were?) full of errors where options were
specified w/o the leading dash. If these major errors still have not been
corrected, then I cannot recommend this book for its Tk content, which is
a shame ...
--
@_=map{eval"100${_}"}split/!/,'/5!*2!+$]!/10+$]';use Tk;$m=tkinit;$t='just an'.
'other perl hacker';$z='createText';$c=$m->Canvas(-wi,$_[1],-he,25)->grid;$c->$
z(@_[2,3],-te,$t,-fi,'gray50');$c->$z($_[2]-$],$_[3]-$],-te,$t);$m->bind('<En'.
'ter>',sub{$y=int(rand($m->screenheight));$m->geometry("+$y+$y")});MainLoop;
------------------------------
Date: Wed, 26 Jul 2000 14:26:57 +0100
From: president@whitehouse.gov
Subject: Re: autoresponder with customised message
Message-Id: <397EE721.EEFDF1D4@whitehouse.gov>
drdementor@my-deja.com wrote:
> I want to make an auto responder in perl.
>
> I know how to send mail but i dont know how to rexieve it.
>
> I know I will need a domain name. What kind of server support do i need?
> What is the code for this? will it just go into a bin and the perl code
> reads it like a file almost?
>
> I need somewhere to start.
>
> If someone sends an email to the autoresponding address i would like to
> do something like,,, take the info from the email sent then manipulate
> it and send it back to them..
>
> I am not familiar with mail proticals i know that there are 2 main ones
> and a total of maybe 4.
>
> I need suggestions of a webserver to use, what do i need?
> I know i need perl cgi capabilitiess but im talking mainly email wise...
>
> thanks in advance
>
> Jim
There are about a million ways to go about this, so give some idea what
you're resources and constraints are and we'll work from there. For example,
what kind of environment is this script going to run in? On your Win98 PC at
home, picking up your mail instead of Outlook? Or on a Solaris 8 SMTP
server, with Sendmail running it directly?
Oh, and there's only 1 main email protocol and that's SMTP. About 99.9% of
the world's email goes through SMTP at some point. The others are chicken
feed.
---
Nick
------------------------------
Date: 26 Jul 2000 10:39:44 -0400
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: backtick with spaces on win32
Message-Id: <m3r98h9cr3.fsf@netaxs.com>
undergronk@yahoo.com writes:
> > In article <m34s5dwqk2.fsf@netaxs.com>,
> > Walt Mankowski <waltman@netaxs.com> wrote:
> > > For backwards compatibility with old DOS programs, NT gives every
> file
> > > with more than 8 characters another filename that does have 8 chars.
> > > $TST='c:\PROGRA~1\Adobe\Reader\Acrord32.exe';
>
> In article <8lmdtl$9iu$1@nnrp1.deja.com>, undergronk@yahoo.com wrote:
> > The reason this doesn't work is that
> ^^^^^^^^^^^^^^^^^^^^^^^^^
>
> I've read this back, and it sounds like I am disagreeing with Walt.
> I'm not. His solution does work.
>
> I was trying to explain why mikelot's original command didn't work.
>
> Sorry if that wasn't clear.
No problem. I thought there must be a way to do it with qx. Your
solution is probably better anyway.
Walt
------------------------------
Date: Wed, 26 Jul 2000 07:40:31 -0700
From: "Monk" <wmonk@documentsolutions.com>
Subject: Re: Capturing info accross multiple pages in one form
Message-Id: <sntu13jr3j195@corp.supernews.com>
"Andy Barlow" <andybarlow70NOanSPAM@hotmail.com.invalid> wrote in message
news:00411366.71900778@usw-ex0104-025.remarq.com...
> I have 3 pages that follow each other that capture information.
> I want all the info to be captured on one form. Any ideas how
> to do this?
>
> The pages are http://www.justinsurancejobs.co.uk/cvsubmit1.htm
> thru cvsubmit3.htm
>
> Cheers
>
>
you can capture form input on the first form then dynamically create the
next form hiding the first forms input in hiddent input fields. You can do
this over and over again until you want to post all of the fields that you
have collected (hidden and straight off the last form).
wes
>
> -----------------------------------------------------------
>
> Got questions? Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
>
------------------------------
Date: Wed, 26 Jul 2000 13:30:10 GMT
From: melet@my-deja.com
Subject: Re: CGI passing parameters
Message-Id: <8lmp53$hh7$1@nnrp1.deja.com>
hello ,
Perhaps, I won't give a good response.But, i propose that you
keep your argument in main of MAIN. and after call a subroutine.
You could integrate the subroutine with key word require in MAIN.
Moreover, you ought to use
USE CGI;
$in=new CGI qw(:cgi);
and in main
$file=$in->param('...');
Bye.FRED
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Jul 2000 09:24:12 -0400
From: Phil Zampino <zampino@squidco.com>
Subject: Re: CGI->new(*FORM) Problem...
Message-Id: <zampino-1C531B.09241226072000@enews.newsguy.com>
In article <slrn8nsjf8.eb1.efflandt@efflandt.xnet.com>,
efflandt@xnet.com wrote:
> >I'm trying to write better Perl by switching a routine I have handled
> >manually to Perl/CGI.
> >
> >The routine stores off the current form passed to a CGI program then
> >calls an authorization routine, which eventually re-calls the original
> >CGI program. When the program is re-called it looks for the presence of
> >the stored form file, and if it exists and the user is now authorized it
> >reloads the form data.
> >The problem is that on returning to the CGI program, my restore doesn't
> >seem to bring back the form data, but instead some kind of HASH value- I
> >can't figure out how to properly read it back in using Perl/CGI
> >techniques. I've tried 23 permutations of loading the data back in
> >(FORMS, *FORMS, \*FORMS) and I've looked at umpteen sites on the web on
> >how to do this. While I've seen specific techniques for pulling back
> >the form data and manually parsing the stored data, I've seen no generic
> >method for restoring the stored data back into a CGI form available to
> >my program.
> >
> >Can anyone tell me what I'm doing wrong, or what the trick is to
> >restoring this data?
>
> Not quite, try:
>
> $q = new CGI(FORMS);
> print "Query Variables",$q->p;
> foreach ($q->param) { print "$_ = ",$q->param($_),$q->br; }
That works great, but introduces a new mystery to me... previously I
could refer to my form variables as param('myVar') in my calling
program. That still works if the user is authorized and the form is
restored by the same invocation of my local authorization routine.
However, if the real authorization program is called and my perl routine
is called again, then the calling program no longer can refer to
param("myVar") but must use $query->param("myVar"). The latter works in
both cases, so I suppose I should just use that syntax always, but I'm
curious why I can get away with param("myVar") when the authorization
program is not called.
To try to explain that better:
(1)
myProg->localAuth
localAuth->auth_check #user is authorized
myProg can use param("myVar")
BUT
(2)
myProg->localAuth
localAuth->auth_check # user is NOT authorized
auth_check->authenticate
authenticated->myProg # now go to (1)
myProg must use $query->param("myVar")
???
Thanks for any insight, and thanks a lot for the previous answer, this
gets my code going again...
philz
------------------------------
Date: Wed, 26 Jul 2000 16:16:07 +0200
From: Mouse <glodalec@yahoo.com>
Subject: Command Execution
Message-Id: <397EF2A7.607D@yahoo.com>
Hi !
I have one more question. I am using Solaris, and need to execute
command in two lines. I can do this in shell script.
#!/bin/sh
pmsmon<<!@!
stat -n
quit
!@!
The result is exactly the same, as if I would do it manually.
$ pmsmon
pmsmon> stat -n
....
...
...
pmsmon> quit
$
So I need output from this procedure.
In Perl I oftenly use an array for command output like:
@MYARRAY=`df -k` ;
foreach $MYVAR (@MYARRAY)
{
...
}
How can I integrate several command output lines into Perl variable ?
Thanks
Alex
------------------------------
Date: Wed, 26 Jul 2000 14:26:54 +0100
From: "Andy" <andy@andy(SPAM).co.uk>
Subject: Re: exactly WHEN will PP-3rd be in bookstores, etc? Anyone know?
Message-Id: <397ee793@news.jakinternet.co.uk>
I have a copy ordered at amazon, and it said they expect it on 7th August
Regards,
Andy
"Drew Simonis" <care227@attglobal.net> wrote in message
news:397E4D31.E39E7890@attglobal.net...
> Abigail wrote:
> >
> > David Combs (dkcombs@netcom.com) wrote on MMDXXI September MCMXCIII in
> > <URL:news:8llfrs$tkg$1@slb7.atl.mindspring.net>:
> > ~~ I saw something from Larry that the book was going to
> > ~~ be ready for TPC -- but that's over by now (true?) --
> > ~~ and O'Reilly's site is still saying "July".
> >
> > I got my courtesy copy on Monday.
>
> *grumble* I _paid_ for the darn thing and I still don't have it!
------------------------------
Date: Wed, 26 Jul 2000 07:34:31 -0700
From: "Monk" <wmonk@documentsolutions.com>
Subject: Re: exactly WHEN will PP-3rd be in bookstores, etc? Anyone know?
Message-Id: <snttlqs23j1144@corp.supernews.com>
"Andy" <andy@andy(SPAM).co.uk> wrote in message
news:397ee793@news.jakinternet.co.uk...
> I have a copy ordered at amazon, and it said they expect it on 7th August
>
> Regards,
>
> Andy
>
>
> "Drew Simonis" <care227@attglobal.net> wrote in message
> news:397E4D31.E39E7890@attglobal.net...
> > Abigail wrote:
> > >
> > > David Combs (dkcombs@netcom.com) wrote on MMDXXI September MCMXCIII in
> > > <URL:news:8llfrs$tkg$1@slb7.atl.mindspring.net>:
> > > ~~ I saw something from Larry that the book was going to
> > > ~~ be ready for TPC -- but that's over by now (true?) --
> > > ~~ and O'Reilly's site is still saying "July".
> > >
> > > I got my courtesy copy on Monday.
> >
> > *grumble* I _paid_ for the darn thing and I still don't have it!
don't know but you can get it from the oreilly web site.
>
>
------------------------------
Date: Wed, 26 Jul 2000 14:10:27 GMT
From: hacktic@my-deja.com
Subject: Re: file location and access strategies
Message-Id: <8lmrge$jeh$1@nnrp1.deja.com>
> I wasn't aware that deja.com didn't have
> news://comp.infosystems.www.authoring.cgi ..
> perhaps you should have looked more closely? :)
Deja has it. But it's a moderated forum. I posted first in that forum
but something went wrong when I had to confirm the post with a reply
mail or something, cause I wasn't able to track my post. It's a quiet
forum if u'd ask me. I guess due to this confirmation hasle.
> mostly it depends on where your script THINKS it is. it's ok to use
> relative paths provided that you make certain your script knows where
it
> is to start with.
>
> you might also consider looking into the File::Spec module if you
will
> be working on port-able code.
I never used modules before. I'm quite a beginner, so please bare with
me.
The File::Spec module u mentioned, I presume it's one of those CPAN
modules? I found File-Spec-0.82.tar.gz. Is this the module u mean? The
tar.gz indicates it's for UNIX, would I still be able to make it for
the Windows box I'm developing on?
Same goes for net::ftp to make an Perl FTP session in win32. The module
I guess I should use is Net-TFTP-0.10.tar.gz, but again for UNIX ...
right?
Regards;
-Mark-
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Jul 2000 14:03:48 GMT
From: Ralf Weber <weberr2202@my-deja.com>
Subject: find.pl & error_log
Message-Id: <8lmr41$j16$1@nnrp1.deja.com>
Hello,
in a perl file I use require find.pl the find-module and the sub wanted.
sub wanted {
(push (@AllFiles, $name)) && -f $_;
}
This works fine under windows, but under linux (SUSE 6.3) I get the
following error
in the error_log:
Fri Jul 14 19:01:51 2000] [error] Undefined subroutine
&Apache::ROOT::cgi_2dbin::cgiuebungen::searchindex::sicherhomepage::rfin
dex_2epl::find called at
/apache/cgi-bin/cgiuebungen/searchindex/sicherhomepage/rfindex.pl line
27.
I absolutely don't understand ;-)
Who can help me?
Ralf Weber
--
Ralf Weber
Klingenstr. 18
70186 Stuttgart
E-Mail: weberr@machno.hbi-stuttgart.de
Internet: http://machno.hbi-stuttgart.de/~weberr
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Jul 2000 14:43:18 GMT
From: "Coy" <coy@coystoys.com>
Subject: Re: Formatting text file
Message-Id: <aOCf5.9736$Mt.119914@nnrp1.ptd.net>
Well, because im a amature perl programer, im not sure of any easy
way of doing this..
but, if I had to take a guess, i would attempt to dynamically build an array for each row
after /^Run/, and push (@dynamic_array, $line); each row into the proper array.
Something like :
$file = 'file.dat';
open (FILE,"<file.dat");
foreach $line (<FILE>){
if ($line =~ /^Run.*/i) {
push (@row1, $line);
$num = 2;
else {
if (@row . $num) { # I have no idea if u can call a dynamic array like this
# e.g: @row . $num = @row2
push (@row . $num, $line);
else {
@row . $num = ();
push (@row . $num, $line);
}
++$num
if ($num > $totalrows) { $totalrows = $num }
}
}
for ($n=1, $n <= $totalrows, ++n) { print @row . $n . "\n"; }
Of course you will have to figure out how to declare dynamix array's
and fix the above, but, u get the general idea... (sorry, just woke up :)
Good luck
-Coy
"Bobby J. Allen II" <bobby.j.allen@intel.com> wrote in message news:8lldct$nao@news.or.intel.com...
: I need to reformat a text file so I can read it in Excel ( simple tab
: delimited text file ). The file I have in the beginning is composed of data
: from several runs of a program. Each run of the program spits out about 30
: lines of data, then about 3 news lines. Then , the next run is appended to
: the end of this file, and so on. By the end , my file looks like this:
:
: Run #1
: a
: b
: c
: .............
:
:
:
: Run #2
: a
: b
: c
: .............
:
:
:
: I have to sort and format the file so that the final text file looks like
: this:
:
: Run1 Run2 Run3
: a1 a2 a3
: b1 b2 b3
: c1 c2 c3
:
: I'd appreciate any suggestions. Thanks.
:
:
:
:
------------------------------
Date: Wed, 26 Jul 2000 14:10:16 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: how do you ? question
Message-Id: <7an1j5geye.fsf@merlin.hyperchip.com>
Chris <exit72@excite.com> writes:
> The answer to your question , I've been watching this group for a long
> long time and I'm disgusted with the garbage replies from people that
> have no intention of helping. Instead of someone posting a plain
> answer to a question or an example they would rather go off and
> explain in detail why they know the answer but aren't willing to share
> it , but oh here is a link to the manual that will explain. Morons
> like that miss the point , we've already been through the doc pages
> with no luck if you see a post here.
Then you haven't been watching the group close enough. Go ahead and
count the number of posts per day that are of the form:
how do I pad my numbers with zeros?
how do I delete/change something in a file?
how do I find today's/tomorrow's date?
how do I compare dates?
how do I check for a valid email address?
why doesn't my code work? (with a post of code
missing a semicolon)
etc ...
You'll find that most of the posts fall into this category, and all of
these can be avoided if the poster checks the FAQs and old posts first.
Now, some people actually do put some effort and try to locate the FAQs,
but can't do so alone (and I don't blame them). This is when referring
them to the way to access the FAQs becomes very important. But others
think that this is a free help desk, and that their time is much more
important that everybody else, and that they shouldn't bother with
reading the docs and FAQs because they are so important. Those people,
IMHO, don't deserve a straight answer because it will make them come
again at the next simple obstacle that they face.
--Ala
------------------------------
Date: Wed, 26 Jul 2000 13:31:47 GMT
From: Thycotic <thycotic@my-deja.com>
Subject: Re: How do you find the full name of the user in NT?
Message-Id: <8lmp84$hi4$1@nnrp1.deja.com>
> Thanks for all the answers. I was trying to use this in Perl.
However, the
> function Win32::Usergetattributes does not return the full name. Is
there an
> alternative I can use?
You can access COM components that support IDispatch from Perl using
Win32::OLE which should allow you to then use the ADSI components
(Active Directory Services Interface)? It has a fairly nice API
for accessing the winNT provider amongst other things (e.g. LDAP).
Just an idea ...
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Jul 2000 14:27:24 GMT
From: jing111@my-deja.com
Subject: How to handle command application on unix
Message-Id: <8lmsg6$ka5$1@nnrp1.deja.com>
I tried to automate sqlplus command on unix server. The code is as
follows:
open(HD, "| sqlplus userid/passwd") || die "$!";
print HD "spool filename";
print HD "select * from tablename"
print HD "/";
close HD;
open command works, but rest of the code do not work. why?
I know ther is module called IPC open2() for interactive programming.
In this simple situation, i don't want to make complicated.
Any hints or help, really appreciated.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Jul 2000 15:40:14 +0200
From: "Aage Vaksdal" <aage.vaksdal@ifi.uib.no>
Subject: Loop for selecting text?
Message-Id: <8lmpns$2uev$1@toralf.uib.no>
Hello!
I am writing a small script to rip off news headlines
from an online local paper.
The html-source is not very well structured, so I have to look for the
headings that has these attributes:
<font face="Verdana, Arial, Helvetica, sans-serif"><font
size="4"><b>«EXAMPLE HEADING»</b></font>
I have no trouble grabbing the first, like this:
s/^.*<font face="Verdana, Arial, Helvetica, sans-serif"><font size="4">//s;
#leaving out anything before
s/<\/b><\/font>.*$//s; #leaving out anything after.
Is there a friendly being out there with
any ideas how to make a loop that catches them all, parsing down the page?
Or maybe a completely different approach?
Friendly greetings from
Just Another Newcomer:
--
Aage Vaksdal
Bergen, Norway
------------------------------
Date: Wed, 26 Jul 2000 10:29:51 -0400
From: Stephen Kloder <stephen.kloder@gtri.gatech.edu>
Subject: Re: Loop for selecting text?
Message-Id: <397EF5DE.34189A49@gtri.gatech.edu>
Aage Vaksdal wrote:
> I am writing a small script to rip off news headlines
> from an online local paper.
>
> The html-source is not very well structured, so I have to look for the
> headings that has these attributes:
> <font face="Verdana, Arial, Helvetica, sans-serif"><font
> size="4"><b>«EXAMPLE HEADING»</b></font>
>
> I have no trouble grabbing the first, like this:
>
> s/^.*<font face="Verdana, Arial, Helvetica, sans-serif"><font size="4">//s;
> #leaving out anything before
> s/<\/b><\/font>.*$//s; #leaving out anything after.
>
> Is there a friendly being out there with
> any ideas how to make a loop that catches them all, parsing down the page?
> Or maybe a completely different approach?
>
Try a global match:
@headlines = m#<font face="Verdana, Arial, Helvetica, sans-serif"><font
size="4"><b>(.*?)</b></font>#g;
Details on global regex matching are in perlop.
------------------------------
Date: Wed, 26 Jul 2000 13:40:55 GMT
From: melet@my-deja.com
Subject: Re: No Data from Database
Message-Id: <8lmpp6$i0q$1@nnrp1.deja.com>
In article <8llaog$hs1$1@pinto.cobaltgroup.com>,
by Mark Watters" <mwatters@cobaltgroup.com>
Hello,
I only can give some advice.
-consult your web server log
- use CGI and write the header of html page with
use CGI;
$in=new CGI;
in main print $in->header('text/html');
Sometime, you forgive to \n\n befor print the header.
bye. FRED
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Jul 2000 14:20:06 +0100
From: nospam@our.site
Subject: Re: Perhaps a dumb question...
Message-Id: <8lmp2j$qto$1@icrf.news>
This message has been posted by: ewart@REMOVE-THIS-TO-SENDicrf.icnet.uk (Dave Ewart)
On Tue, 25 Jul 2000 20:36:42 -0700, bean
<beanNObeSPAM@agentkhaki.com.invalid> wrote:
> ...
> $use_file = 'listings.html';
> open (LISTINGS_FILE, '> $use_file');
How about if you change the single quotes to double quotes in the OPEN
statement?
Dave.
--
Dave Ewart
ewart@icrf.icnet.uk
Computing Manager
ICRF Cancer Epidemiology Unit, Oxford UK
------------------------------
Date: Wed, 26 Jul 2000 15:30:52 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: Perhaps a dumb question...
Message-Id: <8lmp5q$f852@intranews.dresdnerbank.de>
Hi,
bean schrieb in Nachricht <1431013e.0f08517b@usw-ex0105-034.remarq.com>...
--snip--
>I tried this:
>
> $use_file = 'listings.html';
> open (LISTINGS_FILE, '> $use_file');
variables are not interpolated in single quotes. Try " instead:
open( FILE, ">$userfile" ) || die $!;
Best regards,
Peter Dintelmann
------------------------------
Date: Wed, 26 Jul 2000 13:00:06 GMT
From: Jason Dixon <jason@mybowie.com>
Subject: Perl Mail headers question
Message-Id: <397EF174.596348AD@mybowie.com>
Ok, I posted this before but nobody replied. If this is not the right
place, someone please point me in the right direction... :-P
I've written a script to email a list of people with updates on my
site. The script works great, except I'm having difficulty customizing
the "From" section of the header (no problems at all with the
"Subject"). Instead of changing the From header to my variable, it uses
the "real" header (from a machine
that is NOT in my domain), then inserts the new header into the body of
the email (???).
As always, TIA!
-Jason
<snippet>
foreach $name (<INPUT>) {
chomp;
$from = "Jason <jason\@domain.com>";
$subject = "shtuff goes here";
$mailer = Mail::Mailer->new("sendmail");
$mailer->open({ From => $from,
To => $name,
Subject => $subject,
}) || die "can't open: $!";
print $mailer $body;
$mailer->close();
}
</snippet>
------------------------------
Date: Wed, 26 Jul 2000 13:23:44 GMT
From: matt@NOSPAMraas.screaming.net (matt venn)
Subject: Re: pos() bug?
Message-Id: <397ee5a7.15217050@news.ntlworld.com>
just an aside,
remember with perl you can change your regex delimiters if you are
getting 'backslashitis'
eg s#blah/ddfd/dfd\|#replace#g
the / are now not special, so dont have to be escaped
laters
matt
------------------------------
Date: Wed, 26 Jul 2000 14:31:46 GMT
From: sweth+perl@gwu.edu (Sweth Chandramouli)
Subject: Re: return value of `eval "use lib"'
Message-Id: <mDCf5.13883$eS6.237920@news1.rdc1.md.home.com>
In article <8lm51k$bpo$1@agate.berkeley.edu>,
Eric Kuritzky <kuritzky@math.berkeley.edu> wrote:
>In article <P3tf5.13404$eS6.234300@news1.rdc1.md.home.com>,
>Sweth Chandramouli <sweth+perl@gwu.edu> wrote:
>|.... I'm doing the @INC change with the following line:
>|
>|eval "use lib qw(@INC_DIRS)";
>|
>| , and everything works fine--except when I try to make sure
>|that the eval succeeded...
>
>use doesn't return a value, so eval doesn't, either.
Odd, since the Perl Cookbook has this example of how to
trap exceptions in use statements:
unless (eval "use $mod") {
warn "couldn't load $mod: $@";
}
.
> On the other
>hand, eval _does_ set $@ when something goes wrong with the
>evaluation, so you can have:
>
> eval "use lib qw(@INC_DIRS)";
> die "Couldn't use libs in \@INC_DIRS!" if $@;
>
>or (maybe better):
>
> eval "use lib qw(@INC_DIRS)";
> die $@ if $@;
>
>The documentation of $@ in perlvar is somewhat misleading: it says
>that $@ isn't set if the statement merely "[fails] in the normal
>fashion", but it appears to be set whenever there's a problem with a
>use statement.
Hmm... I've seen situations before where it isn't set
in an `eval "require foo"' that fails; maybe failure of a "use" statement
is never "in the normal fashion".
-- Sweth.
--
Sweth Chandramouli ; <sweth@sweth.net>
<a href="http://www.sweth.net/legal/disc.html">*</a>
------------------------------
Date: Wed, 26 Jul 2000 13:30:03 GMT
From: thomas.emde.te@bayer-ag.de
Subject: RSH to os/2 does not work with backticks
Message-Id: <8lmp4m$hfr$1@nnrp1.deja.com>
something like this: "@list = `rsh <host> <cmd>`;" does not work from a
linux system when the rshd runs under os/2. the rshd log says "remote
requester has closed the socket connection". Any ideas?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Jul 2000 13:23:41 GMT
From: aorrock@my-deja.com
Subject: Urgent!! - Please help with Perl install
Message-Id: <8lmooo$h3l$1@nnrp1.deja.com>
Hi,
I'm having a bit of trouble installing perl on an NT4 box.
I've copied across the perl folder from NT Resource Kit and tried to
run 'install.bat'
Unfortunately I'm getting an error saying:-
ntt\perl.exe exists, copying into current directory
1 file(s) copied.
1 file(s) copied.
Can't execute install.bat.
Can anyone help shed light on my problem
Mike Franklin
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Jul 2000 16:44:08 +0200
From: "Guenther Degenfelder" <guenther.degenfelder@datev.de>
Subject: Re: Urgent!! - Please help with Perl install
Message-Id: <397ef8e3$1@news.datev.de>
<aorrock@my-deja.com> schrieb in im Newsbeitrag:
8lmooo$h3l$1@nnrp1.deja.com...
> Hi,
> I'm having a bit of trouble installing perl on an NT4 box.
> I've copied across the perl folder from NT Resource Kit and tried to
> ...
The perl in the NT Resource Kit is VERY old.
Better try this
http://www.activestate.com/Products/ActivePerl/Download.html
This installation runs with Microsofts MSI and makes no troubles...
------------------------------
Date: Wed, 26 Jul 2000 13:17:26 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Warnings and undefs
Message-Id: <397fe3b1.42929367@news.newsguy.com>
jgamble@ripco.com (John M. Gamble) wrote:
>$ p56 -we '@x = (1, undef, 3); print join(":", @x), "\n";'
>Use of uninitialized value in join at -e line 1.
>1::3
I don't have an answer to the warnings question, but there's
always
print join(":", map {defined ? $_ : ''} @x), "\n";
You could even use
print join(":", map {$_ || ''} @x), "\n";
if 0 never occurs in @x.
Out of curiosity, if you're treating undef as '', why not just
use '' instead?
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Wed, 26 Jul 2000 13:16:49 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Was Why won't "use strict;" work?
Message-Id: <q2ptnskkv5udbdu4mgbs363je047a1qe6j@4ax.com>
What A Man ! wrote:
>Sorry, I changed the
>format settings in NS Composer, and hope this one goes thru as plain text.
It's a start.
And now for your quoting habits...
* You quoted the whole damn original post without any reason. Learn to
snip.
* You quoted in Jeopardy style (answer before question).
Two nono's!
--
Bart.
------------------------------
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 3808
**************************************