[11672] in Perl-Users-Digest
Perl-Users Digest, Issue: 5272 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 31 20:17:26 1999
Date: Wed, 31 Mar 99 17:00:19 -0800
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, 31 Mar 1999 Volume: 8 Number: 5272
Today's topics:
Re: <STDIN> (Bob Trieger)
Re: <STDIN> ryanpc@my-dejanews.com
Re: ActivePerl - "require" and "@INC" and "." (Earl Hood)
apache, mysql, perl - giving users access <arranp@datamail.co.nz>
Converting from local character encoding to UTF-8 <richm@netscape.com>
Re: hashes <jglascoe@giss.nasa.gov>
Re: Hello World <jglascoe@giss.nasa.gov>
Help...me about array... <jearanai@science.gmu.edu>
Help...me about array... <jearanai@my-dejanews.com>
How do you round numbers in variables? <spam@should.die>
Re: How do you round numbers in variables? <paladin@uvic.ca>
Re: How do you round numbers in variables? (Abigail)
Re: How do you round numbers in variables? <jglascoe@giss.nasa.gov>
Re: how to dereference a package variable <jglascoe@giss.nasa.gov>
Re: including perl scripts in Server Side Includes (SHT <larsplessmann@gmx.de>
Re: my random doesn't return number!! (Abigail)
Re: Perl book illustrator needed (Bob Trieger)
Perl offline browser <computertech@clara.net>
Re: Problem... <jglascoe@giss.nasa.gov>
Re: problems with 'require'. (Earl Hood)
Re: problems with 'require'. <jglascoe@giss.nasa.gov>
Re: problems with 'require'. <APTavistock@lbl.gov>
Re: program interaction using <<HERE docs <rick.delaney@home.com>
Send Mail <greg2@surfaid.org>
Re: Some more newbie questions... <jglascoe@giss.nasa.gov>
Re: two questions need help (Bob Trieger)
Validating Email addresses <greg2@surfaid.org>
Re: Validating Email addresses <flavell@mail.cern.ch>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 31 Mar 1999 23:31:22 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: <STDIN>
Message-Id: <7dub5f$ild$2@ash.prod.itd.earthlink.net>
"Elliot Slater" <eslater@frinc.com> wrote:
<>Am I able to assign a value to <STDIN> as I would any other variable?
Any other variable? <STDIN> in a filehandle, not a variable. BIG difference.
Bob Trieger
sowmaster@juicepigs.com
------------------------------
Date: Thu, 01 Apr 1999 00:28:22 GMT
From: ryanpc@my-dejanews.com
Subject: Re: <STDIN>
Message-Id: <7dueit$s9k$1@nnrp1.dejanews.com>
In article <7du37a$fpt$1@nntp3.uunet.ca>,
"Elliot Slater" <eslater@frinc.com> wrote:
> Am I able to assign a value to <STDIN> as I would any other variable?
<STDIN> is not a variable - it is a file handle. you can read and write to
it, redirect it and pipe things into it but you can't "assign" anything to
it. maybe what you really looking to do is pipe something through it.
- ryan
>
> Thanks,
> Elliot
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 31 Mar 1999 23:33:44 GMT
From: ehood@geneva.acs.uci.edu (Earl Hood)
Subject: Re: ActivePerl - "require" and "@INC" and "."
Message-Id: <7dubco$aea@news.service.uci.edu>
In article <3701FE8E.21E08E4A@ms1.hinet.net>,
Richard Ireland <dragnet@ms1.hinet.net> wrote:
>I've just installed ActivePerl build 509 on NT and IIS4.0
BTW, there is a port of Apache for Win32. You may also want to look at
Xitami. Unless you know the trick of getting IIS4.0 to allow standard
I/O redirection in CGI programs, the other servers are more friendly
to non-MS languages.
>My scripts have a problem seeing other files in their own diectory when
>using the "require" command.
>
>The message I get is:
>
>Can't locate cgi-lib.pl in @INC (@INC contains: C:\Perl\lib
>C:\Perl\site\lib .) at C:\InetPub\wwwroot\tmdia\members\envtest.pl line
>5.
Check what the current working directory. It may not be what you
suspect. There are modules for dealing with pathnames.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Thu, 01 Apr 1999 11:58:09 +1200
From: Arran Price <arranp@datamail.co.nz>
Subject: apache, mysql, perl - giving users access
Message-Id: <3702B691.4F04@datamail.co.nz>
Hi all,
Sorry if this is perhaps not in the correct groups (please let me know
if theres a better forum).
Ive searched Dejanews, the apache Faqs, the perl docs and the mysql
docos.
Any my question goes like this,
I have apache running on a linux box, I have perl (using cgi and dbi)
cgi scripts providing a web interface to some mysql databases+tables.
These forms are to provide a method of documentating changes ie user
inputs name and changes made, documentation,rollback etc etc,
What I would like to do is ensure that the user has to stick in a
username, password in order to:
1) get access to the page (to fill in the forms)
2) get access to the database (in order to searching etc)
3) get certain permissions on the database (to allow manipulation of
some tables and not others)
Now I can do
1) thru .htaccess for users defined in my htpasswd generated file
2) thru users set up in the mysql user table
3) thru users set up in the database/table permission tables
But, what I would really like to do, is integrate the 3 of them (if
possible).
This would mean I have one table of users/permissions etc - where they
dont require a unix account.
I could do this by creating some dodgy form where you enter in a
username/password - but then I have to figure out encryption/security on
this table.
So in a nutshell, Is there anyway(s) of doing the above?
If so
what is the best way?
how do I go about it (is there some documentation I have missed)?
thanks in advance
Arran
arranp@datamail.co.nz
My opinions are my own and do not necessarily reflect those of my
employer.
------------------------------
Date: Tue, 30 Mar 1999 15:11:28 -0800
From: Rich Megginson <richm@netscape.com>
Subject: Converting from local character encoding to UTF-8
Message-Id: <37015A20.AE503CB9@netscape.com>
This is a multi-part message in MIME format.
--------------111A1AB11B827E37DDE83B6A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I need to be able to read files written by the user in the user's local character set encoding
format e.g. ascii, latin1, shift JIS, etc. any 7 bit, 8 bit, or multi byte local character set
encoding format. I then need to be able to convert these strings to UTF-8 and back to the local
encoding.
What I have found so far:
use POSIX;
use locale;
$charset = setlocale(LC_CTYPE);
This will return me the local character set encoding. Problem: The string returned is highly
platform dependent. So I need a way to get a standardized or normalized charset name e.g.
$normalizedCharSet = ?func?($charset);
Then, I believe I can use the Unicode::Map or Map8 combined with the Unicode::String to create a UC2
string
$unicodeString = Unicode::Map($origString, $normalizedCharSet, "UC2");
Then to a utf8 string
$utf8 = $unicodeString->utf8;
Is there a better way to do this? I have to be able to work with all european and asian locales,
and on NT and most unixen.
--------------111A1AB11B827E37DDE83B6A
Content-Type: text/x-vcard; charset=us-ascii;
name="richm.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Rich Megginson
Content-Disposition: attachment;
filename="richm.vcf"
begin:vcard
n:Megginson;Richard
x-mozilla-html:TRUE
adr;dom;quoted-printable:;;Bldg. 15=0D=0A501 Ellis;Mountain View;;;
org:Netscape Communications
version:2.1
email;internet:richm@netscape.com
title:Engineer
x-mozilla-cpt:;0
tel;work:5714
fn:Richard Megginson
end:vcard
--------------111A1AB11B827E37DDE83B6A--
------------------------------
Date: Wed, 31 Mar 1999 18:44:59 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Ketil Heggtveit <Ketil@dnb-data.dnb.no>
Subject: Re: hashes
Message-Id: <3702B37B.268D3F7B@giss.nasa.gov>
[courtesy copy of post sent to cited author]
Ketil Heggtveit wrote:
>
> Hi,
>
> foreach $i (sort keys %hist_pros){
> for $j (sort keys %{$hist_pros{$i}}){
> print "$i $hist_pros{$j}\n";
print $hist_pros{$i}{$j}, "\n";
> }
> }
> Can anyone tell me HOW to store a two-dimentional
> array in a dbm file ?
use Data::Dumper qw(DumperX);
$Data::Dumper::Terse = 1;
# put a ref to your array in the dbm
my $array_ref = \@array;
$dbm{"foo"} = DumperX($array_ref);
# retrieve the value
$array_ref = eval $dbm{"foo"};
@array = @$array_ref;
# OR, more simply, and with hashes:
$dbm{"bar"} = DumperX(\%hash);
%hash = %{ eval dbm{"bar"} };
Jay Glascoe
------------------------------
Date: Wed, 31 Mar 1999 18:57:09 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Jim Main <jim@stv-mcr.freeserve.co.uk>
Subject: Re: Hello World
Message-Id: <3702B655.35B260F0@giss.nasa.gov>
[courtesy copy of post sent to cited author]
Jim Main wrote:
>
<snip>
> all it does however is print,
>
> "What is your name? Hello !"
>
> is it me or the Perl Builder environment.
it must be Perl Builder -- I don't see any problems with your code.
> ps. this is cut and pasted code so if the is a typo here it's probably the
> cause.
No, I lazily pasted it into my perl, and it ran as it should.
Jay Glascoe
------------------------------
Date: Thu, 01 Apr 1999 00:17:03 GMT
From: apple <jearanai@science.gmu.edu>
Subject: Help...me about array...
Message-Id: <7dudtn$rgu$1@nnrp1.dejanews.com>
I am really new for perl. When I read the data from a catalog file. How can I
get the name of my catagory in the array format like : name(1)=apple,
name(2)=cheery,name(3)=orange...( I ever use in C )
Now I can only read it in the string format which have $name.
-------perl----------------
sub catagory
{
open (WORDSLIST,"catalog")||
die "catn't open catalog: $!";
while (defined ($name=<WORDSLIST>))
{
chomp($name);
print "$name\n";
}
close (WORDSLIST) ||
die "couldn't close catalog: $!";
}
-------catalog-------------
apple
cherry
orange
Thank you,
jearanai
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 01 Apr 1999 00:15:52 GMT
From: apple <jearanai@my-dejanews.com>
Subject: Help...me about array...
Message-Id: <7dudrg$rgg$1@nnrp1.dejanews.com>
I am really new for perl. When I read the data from a catalog file. How can I
get the name of my catagory in the array format like : name(1)=apple,
name(2)=cheery,name(3)=orange...( I ever use in C )
Now I can only read it in the string format which have $name.
-------perl----------------
sub catagory
{
open (WORDSLIST,"catalog")||
die "catn't open catalog: $!";
while (defined ($name=<WORDSLIST>))
{
chomp($name);
print "$name\n";
}
close (WORDSLIST) ||
die "couldn't close catalog: $!";
}
-------catalog-------------
apple
cherry
orange
Thank you,
jearanai
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 31 Mar 1999 16:15:21 -0700
From: Brandon Smith <spam@should.die>
Subject: How do you round numbers in variables?
Message-Id: <3702AC89.10CD27A0@should.die>
Ok, this is probably a really stupid question, but I'm wondering what
methods anyone uses to round numbers. Right now if I want to get a
number to no more than three places beyond the decimal I'm using a
regular expression to truncate it as so:
$variable =~ s/((\d)*\.\d\d\d)((\d)*)/$1/;
I've also used printf like:
printf("%.3f\n", $variable);
since the printf command actually does rounding, but printf only prints;
it doesn't allow me to store that back in a variable, as far as I know.
How does anyone else get numbers rounded to a certain number of digits?
Regards,
Brandon
p.s. If you're going to email me something, the address is o10246 with a
domain of email.mot.com.
------------------------------
Date: Wed, 31 Mar 1999 15:54:57 -0800
From: Draco Paladin <paladin@uvic.ca>
To: Brandon Smith <o10246@email.mot.com>
Subject: Re: How do you round numbers in variables?
Message-Id: <Pine.A41.4.05.9903311554080.162452-100000@unix3.UVic.CA>
On Wed, 31 Mar 1999, Brandon Smith wrote:
> printf("%.3f\n", $variable);
>
> since the printf command actually does rounding, but printf only prints;
perldoc -f sprintf
--
Mother is the name for GOD on the lips and
hearts of all children. - Eric Draven
------------------------------
Date: 1 Apr 1999 00:00:16 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How do you round numbers in variables?
Message-Id: <7ducug$kp2$1@client2.news.psi.net>
Brandon Smith (spam@should.die) wrote on MMXXXVIII September MCMXCIII in
<URL:news:3702AC89.10CD27A0@should.die>:
'' Ok, this is probably a really stupid question, but I'm wondering what
'' methods anyone uses to round numbers. Right now if I want to get a
'' number to no more than three places beyond the decimal I'm using a
'' regular expression to truncate it as so:
I usually do $variable *= 10; to get a nice round number. If I want
an even rounder number, I would do $variable *= 100;
If I want to do something really neat, I read the FAQ.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Wed, 31 Mar 1999 19:00:40 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
Subject: Re: How do you round numbers in variables?
Message-Id: <3702B728.75502E2@giss.nasa.gov>
Brandon Smith wrote:
>
> $variable =~ s/((\d)*\.\d\d\d)((\d)*)/$1/;
oh, ick. That's a weird application for regexes ;^)
> I've also used printf like:
>
> printf("%.3f\n", $variable);
>
> since the printf command actually does rounding, but printf only prints;
yes, but sprintf sprints:
my $string = sprintf "%.3f\n", $variable;
Jay Glascoe
------------------------------
Date: Wed, 31 Mar 1999 18:13:15 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: evrim@my-dejanews.com
Subject: Re: how to dereference a package variable
Message-Id: <3702AC0B.E61DA102@giss.nasa.gov>
[courtesy copy of post sent to cited author]
evrim@my-dejanews.com wrote:
>
> Hi. I am using somehitng liek:
>
> $z="A";
> $x=$$z::i;
There's probably a better way to accomplish
what you want. But, this should work:
$x = eval "\$${z}::i";
Jay Glascoe
------------------------------
Date: 1 Apr 1999 00:55:02 GMT
From: Lars Plessmann <larsplessmann@gmx.de>
Subject: Re: including perl scripts in Server Side Includes (SHTML)
Message-Id: <3702C4C6.6B745284@gmx.de>
Yes, it runs in the bash
on the server, the following messege appears in the error.log
[Thu Apr 1 02:46:41 1999] [error] [client 195.20.200.67] malformed header
from script. Bad header=16: /server/our_domain/cgi-bin/counter.pl
David Efflandt schrieb:
> On 30 Mar 1999 21:50:16 GMT, Lars Plessmann <larsplessmann@gmx.de> wrote:
> >How can I include perlscripts with the #include tag to a shtml file?
> >That is right, isn't it?
> >
> > <!--include file="file.pl"-->
> >
> >When I include it in windows ist works. But in Linux there happens
> >nothing. Even on a webserver in the internet it doesn't work (there even
> >is an error message)!
> >What have I done wrong?
> >Please help me, it's very important!
> >Thx,
> >
> > Lars
>
> Unless the CGI script is in a ScriptAlias directory (like cgi-bin set up
> by your ISP) the scriptname usually needs to end with '.cgi' as in
> 'file.cgi' whether it is used standalone or as SSI. Or course there could
> be any number of other problems. Make sure the script runs in the shell
> (./file.cgi) without errors before trying it on the web. You will get
> more detailed error messages.
>
> --
> David Efflandt efflandt@xnet.com
> http://www.xnet.com/~efflandt/
------------------------------
Date: 1 Apr 1999 00:07:04 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: my random doesn't return number!!
Message-Id: <7dudb8$kp2$2@client2.news.psi.net>
David Delikat (ddelikat@protix.com) wrote on MMXXXVIII September MCMXCIII
in <URL:news:37028C89.7566@protix.com>:
// Larry Rosler wrote:
// >
// > [Posted and a courtesy copy mailed.]
// >
// > In article <37027790.4487@protix.com> on Wed, 31 Mar 1999 13:29:20 -
// > 0600, David Delikat <ddelikat@protix.com> says...
// > > Yannick Girard wrote:
// > ...
// > > > $rand_key = $keys[int rand @keys];
// > ...
// > >
// > > try this:
// > >
// > > $rand_key = $keys[int rand $#keys];
// >
// > Sorry, dav. That never gets to the last element in the array. Ever.
// > `perldoc -f rand`:
//
// neither will '@keys' in a scalar context it evaluates to
// <trumpet fanfare> '$#keys'
No it doesn't. Go read the documentation.
// why on earth would I want the last element in the array?
Why not? If you want a random element, the last element should have a
chance to be picked as well.
// the code is generating a valid index, if my memory serves me
// in any way, the last element in the array ( #4 or 5 ) is a 3 digit
// number. this would not give me acceptable results.
What the last element of the array will be depends on the current contents
of the hash. Unless it's fixed, you won't know what it will be.
// Larry, I do not know what it is that you do. but I'm a programmer.
You don't sound like one, and you certainly don't act like one.
// please don't tell me my business.
//
// I'd appretiate it if you would take your own advice.
// also, learn to read code.
I'm sure Larry know how to code. I've doubts about you though.
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: Wed, 31 Mar 1999 23:56:18 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Perl book illustrator needed
Message-Id: <7duck7$ild$3@ash.prod.itd.earthlink.net>
In article <370253DA.D0841C3E@manning.com>, tedken@manning.com wrote:
/>We are looking for someone with Perl programming knowledge and a
/>graphics sense to work with the author of a new Perl book to develop
/>illustrations to amplify selected portions of the text. If interested,
/>please send a brief description of your credentials to me at
/><tedken@manning.com> and I will send you more information.
That's what sucks about "Programming Perl", "Learning Perl" and the bible. Not
enough illustrations.
Bob Trieger
sowmaster@juicepigs.com
------------------------------
Date: Wed, 31 Mar 1999 23:01:21 GMT
From: Matthew Tillett <computertech@clara.net>
Subject: Perl offline browser
Message-Id: <370157D9.69EC5BF3@clara.net>
Hi,
Does anyone know of any application that will run as a fake server from
a single command line and does not write back to ANY config files /
history, etc.
The problem I am having is that a client of ours wants their entire
website put on CD for distribution to their customers. The problem is
that their site that we developed requires heavy use of perl for the
databases and if we put this to CD, we need some way of running the perl
scripts and sending the output to the browser without installing ANY
files on the customers system. Got any ideas??
If possible please could you email me direct.
Thank you.
Mat
computertech@clara.net
------------------------------
Date: Wed, 31 Mar 1999 17:58:46 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Frank de Bot <debot@xs4all.nl>
Subject: Re: Problem...
Message-Id: <3702A8A6.33A83E8E@giss.nasa.gov>
[courtesy copy of post sent to cited author]
Frank de Bot wrote:
>
> Perl exist 2 times in that string. How can I make the script that it
> count the number of "Perl" (in this case). This should be 2. How can I
> do that automatic?
>
my $string = "Free Perl scripts, Get your Perl Scripts here";
my $count = 0;
++$count while $s =~ /perl/gi;
Jay Glascoe
--
ping.
------------------------------
Date: 31 Mar 1999 23:43:38 GMT
From: ehood@geneva.acs.uci.edu (Earl Hood)
Subject: Re: problems with 'require'.
Message-Id: <7dubva$an0@news.service.uci.edu>
In article <37029C96.E242F42F@lbl.gov>,
Aaron Tavistock <APTavistock@lbl.gov> wrote:
>_test.conf_
>
>$value = "test string";
>_test.pl_
>
>use strict;
>
>my ($value);
-^^
>require 'test.conf';
>print "$value\n";
The my causes $value to only be visible within the test.pl. Therefore,
the $value in test.conf is a separate variable.
Solutions:
o Utilize the 'use vars' pragma. Example:
use vars qw/ $value /;
This predeclares variables for you so strict will not complain.
o Set 'no strict' before the require and 'use strict' afterwords.
Therefore, you will not get errors from using non-predeclared
variables.
o Have your conf file use a hash instead.
o Do not use 'use strict'. Of course many may not like this
solution.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Wed, 31 Mar 1999 18:52:48 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Aaron Tavistock <APTavistock@lbl.gov>
Subject: Re: problems with 'require'.
Message-Id: <3702B550.D6D0106B@giss.nasa.gov>
[courtesy copy sent to cited author]
Aaron Tavistock wrote:
>
> I have a wierd issue that someone might be able to answer.
<snip>
> I'm having a hard time explaining this in non-perl. So, Heres a code
> example of the problem
>
> _test.conf_
>
> $value = "test string";
>
> _test.pl_
>
> use strict;
>
> my ($value);
>
> require 'test.conf';
>
> print "$value\n";
>
> The results of this will be nothing.
<snip>
> Any good insite into this?
"$value" is a global variable in _test.conf_, whereas
it's a lexical variable in _test.pl_.
try this, in _test.pl_:
use vars qw($value); # instead of "my"
Jay Glascoe
------------------------------
Date: Wed, 31 Mar 1999 16:12:12 -0800
From: Aaron Tavistock <APTavistock@lbl.gov>
Subject: Re: problems with 'require'.
Message-Id: <3702B9DC.CC54008F@lbl.gov>
I improperly assumed that require was essentially a stream based eval.
:) Which is how I came to a brute force solution that works as well.
e.g. -
open (CONF, './test.conf);
eval (join ("\n", <CONF>));
close (CONF);
Earl Hood wrote:
>
> >_test.conf_
> >
> >$value = "test string";
>
> >_test.pl_
> >
> >use strict;
> >
> >my ($value);
> -^^
> >require 'test.conf';
> >print "$value\n";
>
> The my causes $value to only be visible within the test.pl. Therefore,
> the $value in test.conf is a separate variable.
>
------------------------------
Date: Thu, 01 Apr 1999 00:35:54 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: program interaction using <<HERE docs
Message-Id: <3702C163.E92DA711@home.com>
Christian M. Aranda wrote:
>
> On Wed, 31 Mar 1999 02:53:41 GMT, Rick Delaney <rick.delaney@home.com>
> wrote:
>
> >You *really* aught to look into installing the module yourself.
> >Please don't ignore people's helpful suggestions.
> >
> FYI - I wasn't ignoring his help. I stated a couple of times that the
> sysadmin WILL NOT let a module be on his machine. Period. End of
> story. It doesn't matter where I put it. Period.
Okay, I didn't realize your sysadmin was so strange. All you really
ever said was that you couldn't install modules because of sysadmin
reasons. I figured those reasons were that he wouldn't install the
module for you. Sorry, I guess I shouldn't have assumed.
> >man ftp
> perhaps you should do the same.
You're absolutely right.
> I don't mean to sound hostile, I'm not. I just don't like getting
> responses to messages that don't take in to account what my original
> post said.
And why should you? I totally passed over your actual ftp commands.
Sorry about that.
In addition to Darren Greer's solution, you could also try:
open(FTP, '|/usr/bin/ftp -ni aix7') or die "Can't fork: $!\n";
print FTP <<FTP;
user john password
cd catest
put myfile.txt
quit
FTP
> (I'm sure I'll get flamed for this.)
Nah, that should only happen to me.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Thu, 01 Apr 1999 00:53:03 +0100
From: Greg Griffiths <greg2@surfaid.org>
Subject: Send Mail
Message-Id: <3702B55F.847D7FB9@surfaid.org>
Dear All,
everytime I try and use the sendmail prog that is listed in the PERL
faq's :
$mailprog = '/usr/lib/sendmail -oi -t -odq';
open (MAIL, "|$mailprog") || die "Can't open $mailprog!\n";
print MAIL "To: $To ($ToEmail)\n";
print MAIL "Reply-to: CILP Staff Member ($FromEmail)\n";
print MAIL "Subject: $Subject\n\n";
print MAIL "$From on behalf of The Christian Internet Links Project
sends you this Message \n";
print MAIL "$Message \n";
print MAIL "Christian Internet Links Project \n";
print MAIL "http://www.aber.ac.uk/~scty12/links/";
close (MAIL);
I get the message
Bad Command or File Name
Any idea why, I assume that it is because the command is a Unix command
and I'm using the Win32 PERL, is there an alternative without using any
fancy Perl modules as my server won't llow any extras ?
------------------------------
Date: Wed, 31 Mar 1999 18:07:08 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Ben Janssen <btm.janssen@mailbox.kun.nl>
Subject: Re: Some more newbie questions...
Message-Id: <3702AA9C.2B8A5A50@giss.nasa.gov>
[courtesy copy of post sent to cited author]
Ben Janssen wrote:
>
> Hiya all!
>
> I have some questions:
>
> 1. How should I use file handles to add text from a certain
> variable (EG $text = "foo")to a standard text file?? I know how
> to open a file handle [ open (BAR, ">>foo.txt"); ] But after
> that??
print BAR $text;
>
> 2. Can different perl programs (EG foo.perl bar.perl &
> blaat.perl) work together and/or share variables??
yes.
perldoc -f do
perldoc -f use
perldoc -f require
$ cat foo.pl
package main;
use strict;
use bar;
main();
sub main {
print $hello;
}
__END__
$cat bar.pl
package main;
use strict;
use vars qw($hello);
$hello = "Hello, Foo!\n";
__END__
> 3. Which ways are there to get html-form-input from a url
> (http://bar.bar.bar/cgi-bin/foo.cgi?name=xxx)??
GET and POST
>
> Thanxx for answering...
>
> THundur--
___
|
\/ Jay Glascoe
------------------------------
Date: Thu, 01 Apr 1999 00:18:31 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: two questions need help
Message-Id: <7dudtt$ild$4@ash.prod.itd.earthlink.net>
fanxin@my-dejanews.com wrote:
/>Hi all experts: there has two questions: 1. i have downloaded almost all
/>mailing list cgi script on the net. all of them are almost same. a loop
/>invokes sendmail once by once. the mail is send by openning a pipe from the
/>script to sendmail. BUT! this doesn't work when the list is very long.
/>eg.5000 the loop will only go about 25-30 times when it needs to go 5000
/>times. if the list is reduced to 100. the program works fine. is there
/>anything wrong with the system? there has no process at all when the loop
/>hasn't finished. so how to write a mailing list cgi program for huge list,
/>like 10000 emails.
I hope you never figure it out. There is no legitimate reason in the world to
send over 5000 e-mails.
Bob Trieger
sowmaster@juicepigs.com
------------------------------
Date: Thu, 01 Apr 1999 00:50:50 +0100
From: Greg Griffiths <greg2@surfaid.org>
Subject: Validating Email addresses
Message-Id: <3702B4DA.F3A83B33@surfaid.org>
Dear All,
I have been stuggling to develop a method of checking for valid email
address coming out of a database and through my script, so as to remove
them before they hit the mailserver. However I am not allowed (due to
server restrictions) to use any other modules apart form the basic ones.
I thus started to build an RE along the lines of
if ($ToEmail=~/\@/)
{
$To=$Data{'ContactName'};
$ToEmail=$Data{'Email'};
print "$To, $ToEmail";
}
else
{
print "failed";
}
but I keep getting the fail line every time, even for valid emails, even
though I have escaped the @, any ideas why ?
------------------------------
Date: Thu, 1 Apr 1999 02:16:00 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Validating Email addresses
Message-Id: <Pine.HPP.3.95a.990401021059.9211A-100000@hpplus01.cern.ch>
On Thu, 1 Apr 1999, Greg Griffiths wrote:
| Subject : Validating Email addresses
What was your reaction to the FAQ?
> I have been stuggling to develop a method of checking for valid email
> address
It's impossible. The FAQ says it's impossible. The FAQ is correct.
You might be able to detect _some_ invalid addresses. Nothing more.
> However I am not allowed (due to
> server restrictions) to use any other modules apart form the basic ones.
So, not content with trying to solve a problem that you've already been
told is impossible, you're now setting out to solve it with one hand
tied behind your back? Does this seem reasonable? How much sympathy is
one entitled to expect from the worldwide usenet community?
--
"y'know the Internet, that great electronic anorak?
- Billy Connolly
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". 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". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5272
**************************************