[10279] in Perl-Users-Digest
Perl-Users Digest, Issue: 3872 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 2 10:07:27 1998
Date: Fri, 2 Oct 98 07:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 2 Oct 1998 Volume: 8 Number: 3872
Today's topics:
Re: Attaching file to sendmail pipe <jdporter@min.net>
Re: Attaching file to sendmail pipe <e.christensen@netjob.dk>
Re: connecting to a Mysql via command line ok FAILs wit <burt.adsit@gte.net>
Re: Difference between =~ and =* operators? (Erik Huelsmann)
Re: Difference between =~ and =* operators? (Erik Huelsmann)
Hashes - defined or not? pds@datcon.co.uk
Re: Hashes - defined or not? <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: Hashes - defined or not? (Larry Rosler)
Help with socket programming <gvitus@jhbelec.co.za>
Re: Help with socket programming <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: I have installed Linux. Now what? tjevans@myhpbox.raleigh.ibm.com
Re: I have installed Linux. Now what? <richxard@infoxadv.com.au>
Re: I have installed Linux. Now what? (Koos Pol)
Re: Is there one different way to order data ? droby@copyright.com
Re: Need IP Address Sort Subroutine <erhmiru@erh.ericsson.se>
Re: Need IP Address Sort Subroutine <jdporter@min.net>
Passing Array and/or List to XSUB function <Arved_37@chebucto.ns.ca>
Perl Bug??? <cbandon_nospam@tiac.net>
Re: Premature end of script headers (Andreas Grueninger)
Re: Problem with readdir (Jeffrey R. Drumm)
Re: Problems Using a Compare Subroutine with Sort <jdporter@min.net>
Re: sendmail.pl <vwstranathan@home.net>
Re: string from array <merlyn@stonehenge.com>
Re: string from array (Larry Rosler)
Re: URL not working in Eudora via perl script droby@copyright.com
Re: What is HFB? <perlguy@inlink.com>
Win32::AdminMisc UserChangePassword Quesiton <perlguy@inlink.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 02 Oct 1998 08:59:16 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Attaching file to sendmail pipe
Message-Id: <3614CE24.DC115958@min.net>
David Bluestein II wrote:
>
> I now need to attach a text file to the email message (to preserve
> formatting) and cannot see how to do so.
>
> I've routinely sent email via perl using a pipe to sendmail and printing
> to it, or using the SMTP or MAIL modules. I've looked through
> documentation on all three but none mention attaching a file and I'm not
> familiar enough with sendmail to find out how it handles attachments.
>
> Can someone help with a point or two? Do I have to encode the file and
> print it to the sendmail pipe? If so, what is the format? If not, what
> should I do?
You have a friend called "Deja News". Ever heard of him?
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Fri, 02 Oct 1998 15:17:01 +0100
From: EC <e.christensen@netjob.dk>
To: David Bluestein II <dbii@mudpuddle.com>
Subject: Re: Attaching file to sendmail pipe
Message-Id: <3614E05C.3A6C5003@netjob.dk>
Hi
Take a look at
http://www.fmi.cz/private/Jenda/
the sender.pm does the job both text and other files.
mvh
Ernst
David Bluestein II wrote:
> I now need to attach a text file to the email message (to preserve
> formatting) and cannot see how to do so.
>
> I've routinely sent email via perl using a pipe to sendmail and printing
> to it, or using the SMTP or MAIL modules. I've looked through
> documentation on all three but none mention attaching a file and I'm not
> familiar enough with sendmail to find out how it handles attachments.
>
> Can someone help with a point or two? Do I have to encode the file and
> print it to the sendmail pipe? If so, what is the format? If not, what
> should I do?
>
> TIA-
>
> ii
>
> --
> David H. Bluestein II President & Lead Developer
> dbii@mudpuddle.com Interactive Internet
> http://www.interaction.net/
> - Specializing in Designing Interactive Websites -
> - and Searchable Internet Databases -
------------------------------
Date: Fri, 02 Oct 1998 09:57:14 -0400
From: Burt Adsit <burt.adsit@gte.net>
Subject: Re: connecting to a Mysql via command line ok FAILs with perl
Message-Id: <6v2lq6$aqn$1@news-2.news.gte.net>
Try using DBI/DBD instead of Mysql. It makes it alot easier and more
portable to other db systems.
http://www.hermetica.com/technologia/DBI/
Burt
randy.paries@avex.com wrote:
>
> Hello,
> Please help..
>
> I can connect to my database via command line
> /usr/local/mysql/bin/mysql --password=foo unitdb
>
> this works ok.
>
> I can not attatch via a very simple perl script(see error below code):
> #!/usr/local/bin/perl
>
> use Mysql;
>
> $dbh = Mysql->connect("node.com","unitdb","foo","username");
> if ( $dbh ){
> print "Connected to DB\n";
> }else{
> print "Connect Failed [$dbh]\n";
> }
>
> $sth = $dbh->Query("SELECT * FROM users" ) or die $Mysql::db_errstr;
>
> $ test.pl Connect Failed [] Can't call method "Query" without a package or
> object reference at test.pl line 12.
>
> Thanks for any help
> Randy Paries
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 2 Oct 1998 13:37:36 GMT
From: ErikH@Bitsmart.com (Erik Huelsmann)
Subject: Re: Difference between =~ and =* operators?
Message-Id: <wzgSQd1pdrdd-pn2-dwTHeft2CzsU@localhost>
On Thu, 1 Oct 1998 23:17:07, Ala Qumsieh <aqumsieh@tigre.matrox.com>
wrote:
>
> ErikH@Bitsmart.com (Erik Huelsmann) writes:
>
> >
> >
> > I am fairly new to perl, but I have extensively read the perlop pod
> > and have not come to a conclusion about most of the regex operators.
> > What are the differences?
>
> Read perldoc perlre .. it's a good start .. but you probably would
> like to start with a softer introduction. Check out Learning Perl, by
> R. Schwartz and T. Christiansen.
Well, I generally like to torture myself, so I read perlop (in HTML
format). That is where I found (under s///) that the behaviour of s///
can be modified by =3D* (I used =3D~ until then, but I figured that I was
doing something wrong..)
Thanks, I know now: if it works: don't touch it!
bye, Erik
--
Want to link your Psion to OS/2? Check out
http://www.bitsmart.com/erikh/PSI.html currently relayed to
http://www.oprit.rug.nl/hulsmann/PSI.html
[Don't mail posts, I will see them here just fine]
------------------------------
Date: 2 Oct 1998 13:37:45 GMT
From: ErikH@Bitsmart.com (Erik Huelsmann)
Subject: Re: Difference between =~ and =* operators?
Message-Id: <wzgSQd1pdrdd-pn2-KjHNkUrivPCc@localhost>
On Thu, 1 Oct 1998 20:05:29, ilya@math.ohio-state.edu (Ilya
Zakharevich) wrote:
> The difference is quite obvious: one exists, another does not.
>
> Hope this helps,
Actually, it did. Made my life a bit easier on myself :-)
bye, Erik
------------------------------
Date: Fri, 02 Oct 1998 09:50:58 GMT
From: pds@datcon.co.uk
Subject: Hashes - defined or not?
Message-Id: <6v27m1$m0v$1@nnrp1.dejanews.com>
Can anyone tell me what is wrong (or why) with the following:
{
my(%hash);
if (defined(%hash)) {
print("Hash is defined\n");
}
}
Run under Perl-Win32, this script indicates that %hash is defined despite no
values having been assigned to it.
Are there any Perl gugus who can explain this behaviour as it appears to be
different to the behaviour described in the Camel book.
Please copy me by e-mail as NEWS access is flakey to say the least.
Thanks,
Paul DS.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 02 Oct 1998 12:26:33 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
To: pds@datcon.co.uk
Subject: Re: Hashes - defined or not?
Message-Id: <83af3fb6p2.fsf@vcpc.univie.ac.at>
Re: Hashes - defined or not?, pds <pds@datcon.co.uk> said:
pds> my(%hash);
pds> Run under Perl-Win32, this script indicates that %hash
pds> is defined despite no values having been assigned to
pds> it.
The parens put %hash in a list context. The debugger would
say:
%hash = (
empty hash
)
Just
my %hash;
is probably what you want.
my %hash;
print "hash is defined\n" if defined %hash;
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Fri, 2 Oct 1998 06:32:49 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Hashes - defined or not?
Message-Id: <MPG.107e75dde06b4f74989895@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <83af3fb6p2.fsf@vcpc.univie.ac.at> on 02 Oct 1998 12:26:33
+0200, Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at> says...
!> Re: Hashes - defined or not?, pds <pds@datcon.co.uk> said:
!>
!> pds> my(%hash);
!>
!> pds> Run under Perl-Win32, this script indicates that %hash
!> pds> is defined despite no values having been assigned to
!> pds> it.
!>
!> The parens put %hash in a list context. The debugger would
!> say:
!>
!> %hash = (
!> empty hash
!> )
!>
!> Just
!>
!> my %hash;
!>
!> is probably what you want.
!>
!> my %hash;
!> print "hash is defined\n" if defined %hash;
So the unanswered question becomes, "Why does declaring a hash in list
context define it, while declaring it in scalar context does not define
it?"
To quote from the original submission,
> Are there any Perl gugus who can explain this behaviour as it appears to be
> different to the behaviour described in the Camel book.
How about it, gugus?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 02 Oct 1998 12:30:00 +0200
From: Gaby Vitus <gvitus@jhbelec.co.za>
Subject: Help with socket programming
Message-Id: <3614AB27.41C6@jhbelec.co.za>
I am new to Perl and I would like to write a little script to read a
socket and to write to a socket. Can anybody help. Which libraries I
must "include" in the script?
Thanks Gabriel
--
A lot of people are afraid of heights. Not me. I'm afraid of widths.
-- Steve Wright
These are my width coordinates: E-Mail gvitus@jhbelec.co.za
------------------------------
Date: 02 Oct 1998 12:36:34 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Help with socket programming
Message-Id: <837lyjb68d.fsf@vcpc.univie.ac.at>
Re: Help with socket programming, Gaby
<gvitus@jhbelec.co.za> said:
Gaby> I am new to Perl and I would like to write a little
Gaby> script to read a socket and to write to a socket. Can
Gaby> anybody help. Which libraries I must "include" in the
Gaby> script?
perldoc perlipc
perldoc IO::Socket
would be a good place to start.
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: 02 Oct 1998 06:58:01 -0400
From: tjevans@myhpbox.raleigh.ibm.com
Subject: Re: I have installed Linux. Now what?
Message-Id: <m3yaqzz0w6.fsf@myhpbox.raleigh.ibm.com>
Go to a bookstore, pick up "Learning GNU Emacs" published by O'Reilly
As a matter of fact, I recommend any of O'Reilly books. Better pick up
"Running Linux" also since you are an obvious newbie.
regards, Tom
------------------------------
Date: Fri, 2 Oct 1998 21:16:07 +1000
From: "Richard Ames" <richxard@infoxadv.com.au>
Subject: Re: I have installed Linux. Now what?
Message-Id: <sD2R1.28$ii1.78015@nsw.nnrp.telstra.net>
If your not logged in.... type root<cr> <cr> means hit enter, then type
the password you entered during the install and another <cr>.
Use the man program to look at the help pages, man man<cr> might be a good
start.
If you want to start editing, there are several editors.... The books
recommended are a good start. Try vi<cr>, then type :help<cr> and proceed to
read about the vim (iv improved) editor.
cheers,
Richard.
--
Richard Ames, Sydney, Australia
remove x's from e-mail address before using...
Dan Bialek wrote in message <36148F5B.7440D3CE@mindspring.com>...
>Dear Clever Linux People,
>
<cut>
no idea what I am doing. I apologize for my ignorance, but if
>anyone can shine flashlight of help this way, I would be ever thankful.
>Please respond via email.
>
>Thanks again,
>Dan
>
>--
>** Insert clever signature here **
>
>
------------------------------
Date: 2 Oct 1998 12:45:48 GMT
From: koos_pol@nl.compuware.com.NO_JUNK_MAIL (Koos Pol)
Subject: Re: I have installed Linux. Now what?
Message-Id: <6v2htt$q50@news.nl.compuware.com>
On Fri, 02 Oct 1998 01:31:23 -0700, Dan Bialek
<dan.bialek@mindspring.com> wrote:
| Dear Clever Linux People,
|
| I have installed Red Hat onto my PC, and now I am unable to get it do
| anything useful. How do I use
| the various editors, so that I can write basic Perl programs from my new
| example book and run them?
| I am at complete loss. I fired up the emacs in X windows, but I really
| have no idea what I am doing. I apologize for my ignorance, but if
| anyone can shine flashlight of help this way, I would be ever thankful.
| Please respond via email.
|
Finally a question which I can answer too :-) !
>From your message I gather that you are a beginner also with RH Linux.
If you installed the complete RedHat distribution, than Perl is
automatically installed too. So there is no need to worry about that.
In it's most basic form, this should work:
cd /tmp
vi test
<press: 'i' for insert mode>
print "Hello world!\n";
<press: ESC ':' 'wq'>
perl -w test
This should produce someting at least. Choosing the editor of your
liking is en entirely different subject.
Good luck!
Koos Pol
----------------------------------------------------------------------
S.C. Pol - Systems Administrator - Compuware Europe B.V. - Amsterdam
Check my email address when you hit "Reply".
------------------------------
Date: Fri, 02 Oct 1998 13:07:44 GMT
From: droby@copyright.com
Subject: Re: Is there one different way to order data ?
Message-Id: <6v2j6v$1ue$1@nnrp1.dejanews.com>
In article <3614677f.0@news.zeitung-online.net>,
"Manfred Henning" <edv@dragenopharm.de> wrote:
> Hello !
>
> i wanted to display one birthday list of our employes.
> The database field is one date field (like 31.12.1998)
> I split the date in day, month and year.
> i create after the spliting one query, to show me the people, that had
> birthday in the last 7 days.
>
> Now, i wanted to order the raws. I want to have as the 1st position, the
> person with the youngest day and month. (not year!)
> Just to order the string in the SQL query, is not enough - if i do it like
> this, i get the youngest people at the first line (because the order
> criterium in the database, reads also the year...)
>
Just to sort the dates by month and day, you could use something similar to
an algorithm recently discussed in a thread on sorting by IP address:
@birthdays_sorted = sort {
pack("C2",reverse split(/\./,$a)) cmp pack("C2",reverse split(/\./,$b))
} @birthdays;
Or using the ever-popular Schwartzian Transform to do those packs and unpacks
only once per birthday:
@birthdays_sorted =
map { $_->[0] }
sort { $a->[1] cmp $b->[1] }
map { [$_, pack("C2",reverse split(/\./,$_))] }
@birthdays;
But if you want to do date arithmetic (i.e., birthdays in the last seven
days), you really need a Julian date computation. I suspect the Date::Manip
module available on CPAN would be useful for this, and you might find there
something that will help you solve both problems.
Or you can roll your Julian date routine for use in the comparison and in the
sort, using the localtime function built into Perl and the timelocal function
in the Time::Local module that is bundled in the core set of things that come
with Perl.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 02 Oct 1998 12:02:01 +0200
From: Michal Rutka <erhmiru@erh.ericsson.se>
Subject: Re: Need IP Address Sort Subroutine
Message-Id: <lasoh7p9ie.fsf@erh.ericsson.se>
John Porter <jdporter@min.net> writes:
> Steffen Beyer wrote:
[...]
> > if ($item =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/))
> > {
> > $host = sprintf("%.2X%.2X%.2X%.2X", $1, $2, $3, $4);
> > $addr = sprintf("%d.%d.%d.%d", $1, $2, $3, $4); # removes leading 0
> > $addr{$host} = $addr;
> > # $name{$host} = $name; # wherever this comes from
> > }
> > }
> > foreach $host (sort keys(%hash))
> > {
> > printf("%-40.40s %s\n", $name{$host}, $addr{$host});
> > }
>
> I do not see a hash named %hash being created anywhere.
> I assume (i.e. I hope) you meant to say %addr.
>
> Anyway, this sorts the addresses as strings in their
> original form, not numerically, so that 127.0 is put
> before 2.0. I don't think that's what he was looking for.
John, please no bad feelings, you are wrong. Stings are not in their
original form. Those addresses will look like this: 7F.00 and 02.00 and
2.0 will be put before 127.0
Michal
------------------------------
Date: Fri, 02 Oct 1998 08:56:53 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Need IP Address Sort Subroutine
Message-Id: <3614CD95.1C5B4096@min.net>
Michal Rutka wrote:
> John Porter <jdporter@min.net> writes:
> > Anyway, this sorts the addresses as strings in their
> > original form, not numerically, so that 127.0 is put
> > before 2.0. I don't think that's what he was looking for.
>
> John, please no bad feelings, you are wrong. Stings are not in their
> original form. Those addresses will look like this: 7F.00 and 02.00 and
> 2.0 will be put before 127.0
Oh, yeah! wups... :-)
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Fri, 2 Oct 1998 07:05:53 -0300
From: Arved Sandstrom <Arved_37@chebucto.ns.ca>
Subject: Passing Array and/or List to XSUB function
Message-Id: <Pine.GSO.3.95.iB1.0.981002064658.21673A-100000@halifax>
I'm just now starting to dabble with serious XSUBs, and in one test
function the argument should match an array and/or a list. That is, the
Perl subroutine is called as
do_stuff( @my_array );
My first guess is that in the XSUB the function sees this arg as an AV *,
and I can see in the .c file produced by xsubpp where it's testing for an
AVPtr, but when I build the library, and use my subroutine, Perl complains
that theArray (the arg name in the XSUB) is not an AVPtr.
Which I'll buy. :-) However, what would it be? I suppose I could not
initially declare it at all, and just refer to it as ST[0], but i'll still
want to know what it is...
The docs pertaining to XS have examples that seem to stick with very basic
datatypes - nary an array or hash to be seen - and I'll be more than happy
just to be pointed to a bunch of example XSUbs that do lots of processing
on arrays, hashes, array and hash refs, or have just variable length lists
passed in.
Thanks. Arved
------------------------------
Date: Fri, 2 Oct 1998 21:43:45 -0400
From: "Craig Bandon" <cbandon_nospam@tiac.net>
Subject: Perl Bug???
Message-Id: <6v2lc7$h8h@news-central.tiac.net>
Well I have played around with this long enough. Does any body have any idea
why I get the following output from the script that follows that:
output
Perl Version 5.00307
PERLXS='PerlIS'
ENV{"REQUEST_METHOD"}='GET'
REQUEST_METHOD='GET'
PERLXS='PerlIS'
script file.
#!/usr/local/bin/perl5
$| = 1;
print "Content-Type: text/html\n\n";
print "Perl Version " . $] . "<br><br>\n";
foreach $var ( keys %ENV )
{
print $var . "='" . $ENV{$var} . "'<br>\n";
}
print "<br>\n";
print "ENV{\"REQUEST_METHOD\"}='". $ENV{"REQUEST_METHOD"} . "'<br>\n";
print "<br>\n";
foreach $var ( keys %ENV )
{
print $var . "='" . $ENV{$var} . "'<br>\n";
}
Other helpful information. I run this locally and get all of the environment
variables. I run it on an NT host and a Unix host and everything seems to be
OK. I run it on my host at www.imconline.net (NT server) and it don't work.
I have changed variable names added () around %ENV. I have tried values
instead of keys. My host provider says they have checked everything out on
their end and everything is OK.
What am I missing????
Any help would be greatly appreciated.
Craig
--
Craig
to reply remove _nospam
------------------------------
Date: Fri, 02 Oct 1998 09:54:08 GMT
From: grueni@stuttgart.netsurf.de (Andreas Grueninger)
Subject: Re: Premature end of script headers
Message-Id: <36133fc4.5195650@news.lf.net>
Let all scripts start with this two lines
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
....
---------------------------
Andreas Grueninger
PRIVATE: grueni@stuttgart.netsurf.de
OFFICE: grueninger@lfl.bwl.de
---------------------------
------------------------------
Date: Fri, 02 Oct 1998 11:14:43 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Problem with readdir
Message-Id: <3614afc8.686989498@news.mmc.org>
[ posted to comp.lang.perl.misc and a courtesy copy was mailed to the cited
author ]
On Fri, 2 Oct 1998 09:54:19 +0100, "Steven Primrose-Smith" <smith@avl.com>
wrote:
>Hi,
>
>Here's hoping someone can help. Is there some reason why readdir does
>not work with a root directory (running on NT with administrator
>permissions) ?
>
>I tried this...
>
>opendir (TEST, "u:\\test\\");
>@files = readdir(TEST);
>closedir(TEST);
>foreach $file (@files)
>{
> print "$s\n";
>}
>
>...and I get a list of all files in the test directory, but this...
>
>opendir (TEST, "u:\\");
How do you know whether opendir succeeds?
opendir (TEST, "u:\\") or die "Crap. $!\n";
ALWAYS test for failure on opendir (and, of course, open).
>@files = readdir(TEST);
>closedir(TEST);
>foreach $file (@files)
>{
> print "$s\n";
Where did $s come from? Do you mean $file in the print statement?
>}
>
>...gives me nothing.
>
>Stupid mistake on my part or some restriction?
Well, I've already pointed out at least one stupid mistake. :-)
I tested the following on my system:
#!perl -w
my @dirs = qw(c:/ h:/ k:/);
# Yes, those are forward slashes. They work just fine in operations that don't
# involve shelling out to CMD.EXE or COMMAND.COM.
foreach (@dirs)
{
opendir DIR, $_ or die "Oh, bother . . . $_: $!\n";
print "Listing for $_\n";
print '-' x 15,"\n";
print join "\n",readdir DIR,"\n";
closedir DIR;
}
C: is local, H: is a Netware server, and K: is an NT server. I got the expected
results from each drive . . . so I think you've got some sort of permissions
problem. FWIW, I'm using GSAR's port of Perl 5.004_02.
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: Fri, 02 Oct 1998 09:21:07 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Problems Using a Compare Subroutine with Sort
Message-Id: <3614D343.BFFB8CB4@min.net>
Michal Rutka wrote:
>
> John Porter <jdporter@min.net> writes:
> > But I'll tell you this: my dotted_to_int() subroutine is more
> > correct -- although a lot slower -- than your pack/split method.
>
> More correct??
More correct in the sense that it handles all valid dotted
numeric representations of IP addresses. And by "valid" I mean
specified by the RFC and implemented by inet_aton.
> Do you dont understand that it overflows? Thats mean it
> gives different result on your Spark than on mine. Does this not worry
> you? At least it worries me.
Are you sure it overflows? I have a hard time believing that your
machine, which is alsa a sparc, behaves so differently.
How did you "discover" that 255.255.255.255 gets converted to -1?
I notice that it prints -1 if I use printf("%d"); but print()
and the debugger give me 4294967295.
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Fri, 02 Oct 1998 11:57:03 GMT
From: vwstranathan <vwstranathan@home.net>
Subject: Re: sendmail.pl
Message-Id: <3614BE09.8FC9F263@home.net>
Forgive me for sending this if you've already seen it. This is straight out of
the ActivePerl documentation...
How do I send email from Perl for Win32?
You may come across scripts that send email with an external mail
program, as in:
#!/usr/bin/perl
open(MAIL, '| /usr/lib/sendmail user@there.com') or die "$!";
print MAIL <<EOF;
To: user@there.com
From: user@here.com
Hello, World!
EOF
These sort of scripts generally cause people to ask, ``is there a
sendmail equivalent on Windows?'' If you need to
send email from a Perl script, there is no need to use an external
program like sendmail. The libnet bundle includes
Net::SMTP, a module that can be used to send mail. Here is an example:
use Net::SMTP;
$smtp = Net::SMTP->new('here.com'); # connect to an SMTP server
$smtp->mail( 'user@here.com' ); # use the sender's address
here
$smtp->to('user@there.com'); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
#
$smtp->datasend("To: user@there.com\n");
$smtp->datasend("From: user@here.com\n");
$smtp->datasend("\n");
# Send the body.
#
$smtp->datasend("Hello, World!\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
A Perl script for sending mail without using an external program is also
available on Robin Chatterjee's Perl for
Win32 page (see Are there information sources available on Perl for Win32
on the World Wide Web?).
If you really need a sendmail equivalent for Windows, several such
equivalents exist:
Blat
Blat is a public domain program for sending email from the Windows NT
command-line. Although it is reputed
to work under Windows 95, the Blat authors have not tested it under
Windows 95. The Blat home page is
located at http://gepasi.dbs.aber.ac.uk/softw/Blat.html
sendmail
Microsoft has a port of sendmail available on their FTP site at
ftp://ftp.microsoft.com/developr/drg/unix-to-windows/ports/sendmail/
A commercial sendmail product is available from MetaInfo, Inc. An
evaluation version is available at
http://www.metainfo.com/
wrmail
Another commercial mail product is wrmail, part of the slmail product
from Seattle Labs. A free version is
available at http://www.seattlelab.com/
Will Stranathan
vwstranathan@home.net
francesx@my-dejanews.com wrote:
> I want to call up the sendmail.pl program from a perl script on NT. To send
> input of a form via email.
>
> I have called it up on Unix by using the line:
>
> open(MAIL,"|/usr/sbin/sendmail -t");
>
> Can I call this up from my cgi-bin on NT or do I need an NT version of the
> sendmail program?
>
> I can call up my perl scripts by the following:
>
> http://www.myserver.com.au/cgi-bin/perlscript.pl
>
> So I was wondering if I can call up sendmail by using a similar line, such as:
>
> open(MAIL,"http://www.myserver.com.au/sbin/sendmail -t");
>
> Thankyou
>
> Frances
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 02 Oct 1998 09:59:50 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: string from array
Message-Id: <8cogrve12j.fsf@gadget.cscaper.com>
>>>>> "Bart" == Bart Lateur <bart.mediamind@ping.be> writes:
Bart> Apart from
Bart> $string = join ('',@ary);
Bart> there's also
Bart> undef $"; $string = "@ary";
Although leaving $" that way will most certainly break larger programs.
So, let's try that as:
{ local $"; $string = "@ary" }
and then we have some safety.
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Fri, 2 Oct 1998 05:48:31 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: string from array
Message-Id: <MPG.107e6b7b7c3153f4989894@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <8cogrve12j.fsf@gadget.cscaper.com> on Fri, 02 Oct 1998
09:59:50 GMT, Randal Schwartz <merlyn@stonehenge.com> says...
...
> Although leaving $" that way will most certainly break larger programs.
> So, let's try that as:
>
> { local $"; $string = "@ary" }
>
> and then we have some safety.
Although leaving $" that way will most certainly cause a warning from '-
w'. So, let's try that as:
{ local $" = ""; $string = "@ary" }
and then we have some quiet also.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 02 Oct 1998 13:49:17 GMT
From: droby@copyright.com
Subject: Re: URL not working in Eudora via perl script
Message-Id: <6v2lkt$57a$1@nnrp1.dejanews.com>
In article <EqXQ1.168$fd1.6677@nsw.nnrp.telstra.net>,
mgjv@comdyn.com.au (Martien Verbruggen) wrote:
>
> > <HTML>
> > <HEAD>
> > <TITLE>Test</TITLE>
> > </HEAD>
> > <BODY>
> >
> > .... and the two hyperlinks go here which are 112 characters long.
>
> That would be invalid HTML.
>
Sorry to continue off-topic thread, but do you mean the absence of the
!DOCTYPE header and some end tags or is there a length limit on links?
I think 112 is a bit excessive, but I didn't know it was illegal.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 2 Oct 1998 11:45:42 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: What is HFB?
Message-Id: <3614BCE6.A63D4F8B@inlink.com>
Elaine -HappyFunBall- Ashton wrote:
>
> Jeffrey R. Drumm wrote:
>
> > Whew. Thank God. All along I was thinking it was simply some thinly-veiled
> > sexual innuendo thing.
>
> Well, I used to be nicknamed Miss Emma Peel. The leather cat suit just
> never really worked for me though. *mwaahaahaa* (/me wonders how HFB was
> misconstrued as sexual)
Elaine,
You obviously don't understand men.
EVERYTHING is /(mis)?construed/ as sexual to us. You could have been
"Elaine -CardBoardBox- Ashton" and we'd think it was sexual somehow!
;-)
Brent
--
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Fri, 2 Oct 1998 11:41:35 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Win32::AdminMisc UserChangePassword Quesiton
Message-Id: <3614BBEF.97E1A611@inlink.com>
Ok, I've exhausted ALL resources I can think of but __still__ can't get
it to work! I need to find a way to allow users to change their
passwords via a Perl CGI.
Here is the basic code:
if(Win32::AdminMisc::UserChangePassword("","username","oldpassword","newpassword")){
print "Password Changed!\n";
} else {
print "Password NOT changed!\n";
}
The password NEVER gets changed. I have tried running this as the user
whos password I want to change and as Administrator.
Did these work on previous versions of NT or was this just a someone
with a twisted sense of humor putting a function in that didn't work?
;-) (Same goes for UserCheckPassword)
I am running on NT4.0 with SP3 and IIS 4.(whatever)
Please no slams about what I am running, it isn't MY choice.
Thanks
--
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3872
**************************************