[15879] in Perl-Users-Digest
Perl-Users Digest, Issue: 3292 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 8 14:15:50 2000
Date: Thu, 8 Jun 2000 11:15:28 -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: <960488128-v9-i3292@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 8 Jun 2000 Volume: 9 Number: 3292
Today's topics:
QUICK question on gmtime(time) and localtime(time) <campbell@coaps.fsu.edu>
SCRIPT TO SEND SMS <marcos@second.ival.es>
Re: SCRIPT TO SEND SMS (Andreas Kahari)
sending mails with perl <stefan.thaler@gmx.net>
Re: sending mails with perl <raphaelp@nr1webresource.com>
Re: Solution needed for 'simple' task. <ra_jones@my-deja.com>
Spaces <jaedma@yahoo.com>
Re: Spaces <mike.solomon@eps.ltd.uk>
Re: Spaces <mike.solomon@eps.ltd.uk>
Re: Spaces <hellbunnie@irelands-web.ie>
Re: Spaces <mike.solomon@eps.ltd.uk>
Re: Spaces (Peter J. Acklam)
Re: Spaces <aqumsieh@hyperchip.com>
Re: Spaces <raphaelp@nr1webresource.com>
Re: Spaces (Peter J. Acklam)
Re: Speed newbie@db-networks.com
test post... <cyklus@hotmail.com>
Re: test post... (Andreas Kahari)
Re: Text Sorting Question <lr@hpl.hp.com>
using hidden fields in a conditionally displayed form (Eric White)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 08 Jun 2000 11:33:10 -0400
From: Stacey Campbell <campbell@coaps.fsu.edu>
Subject: QUICK question on gmtime(time) and localtime(time)
Message-Id: <393FBCB5.3A0DD842@coaps.fsu.edu>
I need to know if gmtime(time) and localtime(time) return 0 or 00 for
midnight GMT. (And if it uses double digits for hours < 10.)
-Stacey-
------------------------------
Date: Thu, 08 Jun 2000 15:55:30 GMT
From: Marcos Lloret <marcos@second.ival.es>
Subject: SCRIPT TO SEND SMS
Message-Id: <393FD010.29B427AB@second.ival.es>
hi,
i was looking for a script that sends a sms message instead of a
email message. how can i do it??
instead of this:
mail whatever@lll.com << EOF
subject: new user
EOF
how can i make the same thing but sending a sms???
thanks in advance
marcos
marcos@ival.es
------------------------------
Date: 8 Jun 2000 18:16:45 +0100
From: andkaha@hello.to.REMOVE (Andreas Kahari)
Subject: Re: SCRIPT TO SEND SMS
Message-Id: <393fc6ed@merganser.its.uu.se>
In article <393FD010.29B427AB@second.ival.es>,
Marcos Lloret <marcos@second.ival.es> wrote:
>hi,
>
> i was looking for a script that sends a sms message instead of a
>email message. how can i do it??
>
>instead of this:
>mail whatever@lll.com << EOF
>subject: new user
>EOF
>
>how can i make the same thing but sending a sms???
>
>thanks in advance
>
>marcos
>marcos@ival.es
>
>
<offtopic>
There's currently a live virus doing this. See Slashdot at
<URL:http://slashdot.org/article.pl?sid=00/06/07/0110222> for pointers
and a discussion.
</offtopic>
Here's a commercial link to some Unix software:
<URL:http://www.nordicmessaging.se/products/> (I'm guessing that
you're on a Unix or Unix-like system).
Danish Perl-link: <URL:http://webcafe.dk/perl/artikler/103/pa103.php3>
Some Freshmeat stuff:
<URL:http://freshmeat.net/news/1999/08/16/934777625.html>
Search the web...
/A
--
# Andreas Kähäri, <URL:http://hello.to/andkaha/>
# -----------------------------------------------------------
# All junk e-mail is reported to the appropriate authorities.
# Quidquid latine dictum sit, altum viditur.
------------------------------
Date: Thu, 08 Jun 2000 16:49:43 GMT
From: "Stefan T." <stefan.thaler@gmx.net>
Subject: sending mails with perl
Message-Id: <H8Q%4.34022$yR.466116@news.chello.at>
hi everybody!
with the following lines of a perl script i can send a mail:verschicken:
-----script-----
#!/usr/bin/perl
open MAIL,"|mail nothing\@nomail.at ";
print MAIL"hello world"; #:-)
close MAIL;
------script-----
so what i now want to now is:
1. can i give this mail an subject to (at the moment there is no subject
send with this mail)
the second thing is: i would like to give this mail an other sender adress
(From Header) how can i realize this??
becaus if i send a mail the sender adress is like this:
stefan@chello192168043.surfer.tirol.at
and i would like to change it to xyz@xxx.com or somthing else
i would be glad if anybody could help me!!
best regards
stefan t.
P.S.: sorry for the crossposting!
------------------------------
Date: Thu, 8 Jun 2000 19:14:06 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: sending mails with perl
Message-Id: <8hok99$bks$1@news.online.de>
Hi Stefan!
Here's the script you want:
#!/usr/bin/perl
open MAIL,"|mail nothing\@nomail.at ";
print MAIL "From: Whatever\@whatever.com" #Type whatever you want here -
this will be the "From" person
print MAIL "Subject: This is one darn cool Subject" #Type the subject there!
print MAIL"hello world"; #:-)
close MAIL;
Regards,
Raphael Pirker
Stefan T. <stefan.thaler@gmx.net> wrote in message
news:H8Q%4.34022$yR.466116@news.chello.at...
> hi everybody!
>
> with the following lines of a perl script i can send a mail:verschicken:
>
> -----script-----
> #!/usr/bin/perl
> open MAIL,"|mail nothing\@nomail.at ";
> print MAIL"hello world"; #:-)
> close MAIL;
> ------script-----
>
> so what i now want to now is:
> 1. can i give this mail an subject to (at the moment there is no subject
> send with this mail)
> the second thing is: i would like to give this mail an other sender adress
> (From Header) how can i realize this??
> becaus if i send a mail the sender adress is like this:
> stefan@chello192168043.surfer.tirol.at
> and i would like to change it to xyz@xxx.com or somthing else
>
> i would be glad if anybody could help me!!
>
> best regards
> stefan t.
>
> P.S.: sorry for the crossposting!
>
>
------------------------------
Date: Thu, 08 Jun 2000 16:21:03 GMT
From: ra jones <ra_jones@my-deja.com>
Subject: Re: Solution needed for 'simple' task.
Message-Id: <8hoh4q$5b7$1@nnrp1.deja.com>
In article <7ahfb4qlf7.fsf@merlin.hyperchip.com>,
Ala Qumsieh <aqumsieh@hyperchip.com> wrote:
>
> ra jones <ra_jones@my-deja.com> writes:
>
> > I have a list of terms, which in practice can vary in length between
1
> > and a lot. Here is 4:
> >
> > @list = ("A","B","C","D");
> > $N = @list
> >
> > I want the script to print 'A, B, C and D'. If there were 1 item,
print
> > 'A', if 2 then print 'A and B'. If twenty, then 'A, B, C, D ... and
T'.
>
> My first thought came in two lines:
>
> @x = qw/a b c d/;
>
> print shift @x;
> print @x ? ", $_" : " and $_" while defined($_=shift @x);
>
> But here's a one-liner (provided you didn't play with $[):
>
> print @x == 1 ? $x[0] : join (' and ' =>
> join (', ' => @x[0 .. $#x-1]),
> $x[-1]);
>
> Golf, anyone?
>
> --Ala
>
>
It works, by God it works! Many thanks Ala - BTW, what's golf got to do
with it?
--
ra jones (posted via deja.com)
address for e-mail reply:
ra(dot)jones(at)cwcom(dot)net
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 8 Jun 2000 11:05:14 -0500
From: "Jim" <jaedma@yahoo.com>
Subject: Spaces
Message-Id: <393fc47f$0$16245$7f8943f3@newsreader.visi.com>
I need to drop white spaces out of a string So:
here i am to save the day becomes
hereiamtosavetheday
Any help is appreciated
Thanks
Jim
------------------------------
Date: Thu, 8 Jun 2000 17:10:10 +0100
From: "Mike Solomon" <mike.solomon@eps.ltd.uk>
Subject: Re: Spaces
Message-Id: <8hoglb$596$1@news6.svr.pol.co.uk>
$foo =~ s/ //g;
will remove all spaces from the variable $foo
Jim <jaedma@yahoo.com> wrote in message
news:393fc47f$0$16245$7f8943f3@newsreader.visi.com...
> I need to drop white spaces out of a string So:
> here i am to save the day becomes
> hereiamtosavetheday
>
> Any help is appreciated
>
> Thanks
> Jim
>
>
------------------------------
Date: Thu, 8 Jun 2000 17:17:26 +0100
From: "Mike Solomon" <mike.solomon@eps.ltd.uk>
Subject: Re: Spaces
Message-Id: <8hoh2v$5fi$1@news6.svr.pol.co.uk>
please ignore my earlier reply
it should read :
$foo =~ s/ //g;
Outlook was playing formatting games !
Jim <jaedma@yahoo.com> wrote in message
news:393fc47f$0$16245$7f8943f3@newsreader.visi.com...
> I need to drop white spaces out of a string So:
> here i am to save the day becomes
> hereiamtosavetheday
>
> Any help is appreciated
>
> Thanks
> Jim
>
>
------------------------------
Date: Thu, 08 Jun 2000 16:32:27 GMT
From: Kathryn Cassidy <hellbunnie@irelands-web.ie>
Subject: Re: Spaces
Message-Id: <393FCA52.53892383@irelands-web.ie>
Or if you want to catch tab characters and other whitespace, try:
$foo =~ s/\s//g;
Mike Solomon wrote:
>
> please ignore my earlier reply
>
> it should read :
>
> $foo =~ s/ //g;
------------------------------
Date: Thu, 8 Jun 2000 17:30:25 +0100
From: "Mike Solomon" <mike.solomon@eps.ltd.uk>
Subject: Re: Spaces
Message-Id: <8hohra$5s5$1@news6.svr.pol.co.uk>
This is a multi-part message in MIME format.
------=_NextPart_000_009F_01BFD16F.3B0C4C60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
outlook is being a pain !
the file: should not be in=20
$foo =3D~ s/ file://g;
to relace spaces the _ you would use
$foo =3D~ s/ /_/g;
Jim <jaedma@yahoo.com> wrote in message =
news:393fc47f$0$16245$7f8943f3@newsreader.visi.com...
> I need to drop white spaces out of a string So:
> here i am to save the day becomes
> hereiamtosavetheday =20
> =20
> Any help is appreciated
> =20
> Thanks =20
> Jim
> =20
>=20
------=_NextPart_000_009F_01BFD16F.3B0C4C60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2722.2800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>outlook is being a pain !</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>the file: should not be in =
</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>$foo =3D~ s/ <A=20
href=3D"file://g">file://g</A>;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>to relace spaces the _ you would =
use</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>$foo =3D~ s/ /_/g;</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Jim <<A=20
href=3D"mailto:jaedma@yahoo.com">jaedma@yahoo.com</A>> wrote in =
message <A=20
href=3D"news:393fc47f$0$16245$7f8943f3@newsreader.visi.com">news:393fc47f=
$0$16245$7f8943f3@newsreader.visi.com</A>...</FONT></DIV><FONT=20
face=3DArial size=3D2>> I need to drop white spaces out of a =
string =20
So:<BR>> here i am to save the=20
day &nbs=
p;=20
becomes<BR>> =20
hereiamtosavetheday =
=20
<BR>> <BR>>=20
&=
nbsp; =20
Any help is appreciated<BR>> <BR>> Thanks =
<BR>>=20
Jim<BR>> <BR>> </FONT></BODY></HTML>
------=_NextPart_000_009F_01BFD16F.3B0C4C60--
------------------------------
Date: 08 Jun 2000 18:45:01 +0200
From: jacklam@math.uio.no (Peter J. Acklam)
Subject: Re: Spaces
Message-Id: <cxc66rk6s1e.fsf@masterblaster.uio.no>
"Mike Solomon" <mike.solomon@eps.ltd.uk> writes:
> outlook is being a pain !
Firstly, it seems like you didn't get rid of the pain. You posted in
HTML and you put the new stuff _after_ the quoted stuff.
Secondly,
$foo =~ s/ +//g;
is probably better, although it works without the `+'.
Peter
--
$\="\n";$_='The quick brown fox jumps over the lazy dog';print +(split
//)[20,5,24,31,3,36,14,12,31,1,2,11,9,23,33,29,35,15,32,36,7,8,28,29];
------------------------------
Date: Thu, 08 Jun 2000 17:27:18 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Spaces
Message-Id: <7abt1cqe14.fsf@merlin.hyperchip.com>
"Jim" <jaedma@yahoo.com> writes:
> I need to drop white spaces out of a string So:
> here i am to save the day becomes
> hereiamtosavetheday
The fastest approach is to use tr///:
$variable =~ tr/ //d;
--Ala
------------------------------
Date: Thu, 8 Jun 2000 19:36:34 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: Spaces
Message-Id: <8holjh$d41$1@news.online.de>
Just another perl hacker, right? (your sig)
Peter J. Acklam <jacklam@math.uio.no> wrote in message
news:cxc66rk6s1e.fsf@masterblaster.uio.no...
> "Mike Solomon" <mike.solomon@eps.ltd.uk> writes:
>
> > outlook is being a pain !
>
> Firstly, it seems like you didn't get rid of the pain. You posted in
> HTML and you put the new stuff _after_ the quoted stuff.
>
> Secondly,
>
> $foo =~ s/ +//g;
>
> is probably better, although it works without the `+'.
>
> Peter
>
> --
> $\="\n";$_='The quick brown fox jumps over the lazy dog';print +(split
>
file://)[20,5,24,31,3,36,14,12,31,1,2,11,9,23,33,29,35,15,32,36,7,8,28,29];
------------------------------
Date: 08 Jun 2000 19:55:32 +0200
From: jacklam@math.uio.no (Peter J. Acklam)
Subject: Re: Spaces
Message-Id: <cxcu2f45a7f.fsf@masterblaster.uio.no>
Peter J. Acklam <jacklam@math.uio.no> writes:
> [snip]
>
> --
> $\="\n";$_='The quick brown fox jumps over the lazy dog';print +(split
> //)[20,5,24,31,3,36,14,12,31,1,2,11,9,23,33,29,35,15,32,36,7,8,28,29];
"Raphael Pirker" <raphaelp@nr1webresource.com> writes:
> Just another perl hacker, right? (your sig)
Right.
Peter
--
$\="\n";$_='The quick brown fox jumps over the lazy dog';print +(split
//)[20,5,24,31,3,36,14,12,31,1,2,11,9,23,33,29,35,15,32,36,7,8,28,29];
------------------------------
Date: Thu, 08 Jun 2000 15:08:22 GMT
From: newbie@db-networks.com
Subject: Re: Speed
Message-Id: <1fdvjs8q1cbla2rde235qovcs2r4najgui@4ax.com>
On Sat, 03 Jun 2000 04:10:06 GMT, "Bill" <bill@billcampbell.com>
wrote:
|I hope the original poster will post a brief note when he is done. I'd be
|interested in knowing how much he was able to reduce the 2.5 hours.
|
With a few improvements, when running the program against 7.35
million rows, it has been reduced from 137 minutes down to 20 minutes.
Thanks to the help from: Abigail and Abe Timmerman
Thanks for the tremendous help.
Syv
|Bart Lateur wrote in message <393910e1.16089180@news.skynet.be>...
|>newbie@db-networks.com wrote:
|>
|>>How can I speed it up? Help will be appreciated.
|>
|
|
------------------------------
Date: Thu, 8 Jun 2000 16:42:22 +0200
From: "news.sektornet.dk" <cyklus@hotmail.com>
Subject: test post...
Message-Id: <8hoide$p46$1@news.net.uni-c.dk>
------------------------------
Date: 8 Jun 2000 19:03:15 +0100
From: andkaha@hello.to.REMOVE (Andreas Kahari)
Subject: Re: test post...
Message-Id: <393fd1d3@merganser.its.uu.se>
In article <8hoide$p46$1@news.net.uni-c.dk>,
news.sektornet.dk <cyklus@hotmail.com> wrote:
>
>
>
Test failed. Try a local test group or alt.test instead.
/A
--
# Andreas Kähäri, <URL:http://hello.to/andkaha/>
# -----------------------------------------------------------
# All junk e-mail is reported to the appropriate authorities.
# Quidquid latine dictum sit, altum viditur.
------------------------------
Date: Thu, 8 Jun 2000 10:58:55 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Text Sorting Question
Message-Id: <MPG.13a97ebbb72fe69698ab44@nntp.hpl.hp.com>
In article <0koujsk47qsqnbdlc92puv25ain0ig0p8q@4ax.com> on Thu, 08 Jun
2000 11:10:51 +0200, Abe Timmerman <abe@ztreet.demon.nl> says...
> On Wed, 7 Jun 2000 17:27:23 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
>
> > In article <s8ftjsgu8nns8jppavechqke610l9r8th2@4ax.com> on Wed, 07 Jun
> > 2000 23:58:27 +0200, Abe Timmerman <abe@ztreet.demon.nl> says...
> >
> > ...
> >
> > > If sorting this thing is the main objective, use Schwartzian-Transform
> > > or Rosler/Guttman-Transform.
> >
> > That's Guttman-Rosler Transform, as in GReaT!
> Sorry about that, I wasn't sure. But I'll remember now!
> (Or do you prefer 'packed-default sort'?)
That was where we started, but it certainly lacks pizzazz. Abigail came
up with the winner.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 08 Jun 2000 16:11:47 GMT
From: ewhite@ssc.wisc.edu (Eric White)
Subject: using hidden fields in a conditionally displayed form
Message-Id: <8hogg6$b8q$1@news.doit.wisc.edu>
Hello,
I'm trying to write a multi-page form and I'm running into a snag. Part of
what I'd like to do is ask follow-up questions about things I learned on an
earlier page. E.g. if at page 2 I learned that you liked ice cream and soda
(but not chips) then on page 3 I'd ask more about ice cream and soda, but not
chips. My code for this would like:
sub print_form3 {
print header,
start_html('more about snacks'),
print start_form,
"More questions about the snacks you like."
end_form;
#if likes ice cream
if (param ('ice_cream') eq '1') {
print start_form,
h3("ICE CREAM"),
p,
"<BLOCKQUOTE>",
"What's your favorite flavor?",
p,
radio_group(-name=>'flavors', -linebreak=>1,
-values=>['1', '2'], -labels=>{'1'=>'chocolate', '2'=>'vanilla'}),
end_form;
}
#if likes soda
if (param ('soda') eq '1') {
print start_form,
h3("SODA"),
p,
"<BLOCKQUOTE>",
"What's your favorite sodar?",
p,
radio_group(-name=>'favsoda', -linebreak=>1,
-values=>['1', '2'], -labels=>{'1'=>'jolt', '2'=>'sprite'}),
end_form;
}
#this is always displayed
print start_form,
"What's your favorite color?",
p,
radio_group(-name=>'color', -linebreak=>1, -values=>['1',' 2'],
-labels=>{'1'=>'blue', '2'=>'green'}),
p,
hidden(-name=>'flavors'),
hidden(-name=>'favsoda'),
hidden(-name=>'color'),
submit(-name=>'move', -value=>'page 4'),
end_form;
}
When I do this the value for 'color' is passed in the hidden field,
but 'flavors' and 'favsoda' are not. Can I not use hidden fields for
the conditionally displayed forms?
Thanks a lot,
Eric
------------------------------
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 3292
**************************************