[11156] in Perl-Users-Digest
Perl-Users Digest, Issue: 4755 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 26 21:07:32 1999
Date: Tue, 26 Jan 99 18:00:26 -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 Tue, 26 Jan 1999 Volume: 8 Number: 4755
Today's topics:
Re: Anyone know of a stock quote script? dturley@pobox.com
Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus <mbaime@gte.net>
Re: Date actions using flatfile database (Abigail)
re: dupes in Perl dturley@pobox.com
re: glob and ARGV halxd2@my-dejanews.com
Help a newbie with a custom shipping script? mfrey@my-dejanews.com
Help a newbie with a custom shipping script? <8_maf_8@usa.net>
Re: Help on Change Case Susbtitution <staffan@ngb.se>
Re: help with DBD-ODBC and MSAccess <metcher@spider.herston.uq.edu.au>
Re: help with HTML FORMS to ARRAYS, PLEASE? (Abigail)
help with make test in perl brownie@foonet.com
Re: How do I expand a variable within `'s (Abigail)
Re: How long would the Unixes last without Perl? <emschwar@mail.uccs.edu>
Re: how to return multiple values in perl? ankadakia@hotmail.com
Input to a running Perl Program (Darren Greer)
Re: Input to a running Perl Program <tchrist@mox.perl.com>
IO::Socket on Win32 <kangas@anlon.com>
Re: loops (Karlon West)
Re: Newbie question: writing file <kangas@anlon.com>
Re: Newbie question: writing file <eugene@snailgem.org>
Re: Number manipulation and time formats (Tad McClellan)
Re: ok please don't shoot me for this question (Martien Verbruggen)
Re: perl and linux scraig@my-dejanews.com
perl and make test flyboy1111@my-dejanews.com
perl and make test flyboy1111@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 27 Jan 1999 01:34:10 GMT
From: dturley@pobox.com
Subject: Re: Anyone know of a stock quote script?
Message-Id: <78lqei$rna$1@nnrp1.dejanews.com>
In article <78kjlg$64o$0@205.211.154.11>,
cypher5@yahoo.die.spammers.com (Cypher) wrote:
> Hi,
> I'm looking for a stock quoting script that would send thw output to
> email. Does anyone know of such a script?
> All I need is the ticker symbol and the current value (Last traded at)
> to be sent to an email message.
Check out the Finance::YahooQuote and MoneyNetSymbolLookup modules. They will
probably give you the info you need, extract it and email it. I've used them
to both loo up symbols and get quotes.
Hopefully this answer is acceptable to Mr. Larry "I led the standardization
of the C language" Rosler. I would hate to get anymore of his snotty,
holier-than- thou email correcting honest oversights.
cheers,
--
____________________________________
David Turley
dturley@pobox.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 26 Jan 1999 23:28:47 GMT
From: "Marc Baime" <mbaime@gte.net>
Subject: Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus!
Message-Id: <78lj3f$4eh$2@news-1.news.gte.net>
We're all climbing the same hill towards the same crest...it's just so
damned important to some people that they get there first or that other
people who don't think like they do don't get there at all....that they
lose their way.
Regards...Marc Baime
Is life too short to take any shit or is it too short to mind it?
Joe Mama <joemama@roundtrip.net> wrote in article
<369FDD21.163D@roundtrip.net>...
> JLenn wrote:
>
> > Yeah.......I'm sure Jesus would have aproved of a fanatical Christian
> > (MC) shooting John Lennon for saying he was bigger than Jesus.
>
> I really doubt this, since Yeshua taught a message of love, patience,
> understanding and tolerance toward all mankind, including one's enemies.
>
>
> > No....MC will rot in HELL for what he did....and John Lennon will be
> > singing in Heaven for all of the good things he did for humanity. If
> > there even are such places (Heaven and Hell).
>
> And just what of any consequence did John Lennon do for humanity, write
> and sing the song "Imagine," which depicted the godless totaliarian
> global dictatorship of the pending one-world government that the United
> Nations will spring on us soon after the so-called "New Millenium?"
>
> Verses of "Imagine." Parallel teachings of Marx/Illuminism
>
> "Imagine there's no heaven The attack on and abolition of all
> It's easy if you try forms of organised religion
> No hell below us
> Above us only sky
>
> "Imagine all the people The "do your own thing" today
> Living for today philosophy: do not worry about tomorrow
>
> "Imagine there's no countries The attack on and forced abolition
> of nationalism and sovereignty of
> nations
>
> "It isn't hard to do The attack on and abolition of all forms
> Nothing to kill or die for of organised religion
> and no religion too
>
> "Imagine all the people Under the authority of the masters who
> Living life in peace claim the appointment by Providence
> to the absolute oversight of mankind,
> and
> right to choose who is worthy to exist
>
> "Imagine no possessions The confiscation and abolition of
> privately owned property
>
> "I wonder if you can The establishment of a
> No need for greed or hunger "new international order"
> A brotherhood of man
> Imagine all the people
> Sharing all the world
>
> "You man say I'm a dreamer A one world government aka
> But I'm not the only one The "New World Order"
> I hope someday you'll join us
> And the world well be as one"
>
>
> > WWS wrote in message <369C977C.25D4A95B@tyler.net>...
> > >
> > >eric wrote:
> > >>
> > >> John Lennon said so, so there!
> > >
> > >BANG, BANG, BANG, BANG! That's what he gets for saying he's
> > >bigger than Jesus. Although the holes were rather small,
> > >they had to count them all. - Deacon
> > >
> > >peep
>
> --
> -jm
> ---
> To reply no spam, change "roundtrip" to "rarebird"
> cuz for the spam it's gonna be a literal round trip..
>
------------------------------
Date: 27 Jan 1999 00:56:43 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Date actions using flatfile database
Message-Id: <78lo8b$ch9$6@client2.news.psi.net>
Steve (me@me.com) wrote on MCMLXXIV September MCMXCIII in
<URL:news:78l3gh$m2q$1@news6.svr.pol.co.uk>:
??
?? Hmm yeah, I forgot about 2000 compliancy. I changed the date format to
?? DDMMYYYY - do you know how can I do it with this?
Assuming you don't have dates beyond Dec 31, 1999, or before Jan 1, 1:
@sorted = map {/(....)(..)(..)/; "$3$2$1"} sort
map {/(..)(..)(....)/; "$3$2$1"} @unsorted;
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: Wed, 27 Jan 1999 01:00:06 GMT
From: dturley@pobox.com
Subject: re: dupes in Perl
Message-Id: <78loeh$q23$1@nnrp1.dejanews.com>
Larry Rosler send in email:
In reply to your message entitled "Re: Deleting dupes with Perl":
>[Posted and a courtesy copy mailed.]
>
>In article <78l8t4$dbh$1@nnrp1.dejanews.com> on Tue, 26 Jan 1999
>20:34:45 GMT, dturley@pobox.com <dturley@pobox.com> says...
>> In article <78km8q$ss6$1@nnrp1.dejanews.com>,
>> jxdub@my-dejanews.com wrote:
>> > but now I need to delete the
>> > duplicates... Could anyone tell me a good way to do this? The file would
>>
>> here's one way. put the file into @out, sort it, then print it.
>>
>> @sorted = sort @out;
>> $prev = 'nonesuch';
>> @n_out = grep($_ ne $prev && ($prev = $_), @sorted); #remove duplicates
>
>This also deletes entries whose value is false, such as '0', as is
>mentioned in the FAQ you copied this from. Why not simply aim the
>questioner to the FAQ (as two of us have already), so he can get the
>whole story?
>
>--
>(Just Another Larry) Rosler
>Hewlett-Packard Company
>http://www.hpl.hp.com/personal/Larry_Rosler/
>lr@hpl.hp.com
Well, excuse the fuck out of me. I didn't realize that the great Larry Rosler
could see all the way to VA to know where I got that. I pulled it out of a
piece of code I've been using in project for 2 years. I have no idea where I
originally got it. Also, dickhead, when I posted my answer no other replies
had made it to the news service I was looking at. I certainly would have
never replied had I known the great Larry Rosler would have such a fit. I
have no problem with you correcting the code, since I didn't realized the
problem, but don't cop such a holier-than-thou attitude. Or are you such an
asshole all the time?
--
____________________________________
David Turley
dturley@pobox.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 26 Jan 1999 23:33:20 GMT
From: halxd2@my-dejanews.com
To: ben.glazer@mail.utexas.edu
Subject: re: glob and ARGV
Message-Id: <78ljc0$m1s$1@nnrp1.dejanews.com>
passing files with wild cards like *.txt is fine. Just use
my @file = glob "@ARGV";
perl seems to need a array for glob. If you need to give other args
(not files) just use shift to get those out of your way.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 27 Jan 1999 00:50:20 GMT
From: mfrey@my-dejanews.com
Subject: Help a newbie with a custom shipping script?
Message-Id: <78lnsa$pjq$1@nnrp1.dejanews.com>
Have set up a shopping cart for my churches web site and I am trying
to add a custom shipping script. It works great except when the weight
is greater than or equal 125 for Canada or Mexico or greater than or
equal to 100 for all other non-US countries. If you look at the
script, it seems to ignore my last "else" statement in each section.
See the comments in the script.
I just started learning Perl last week in order to do this so go easy
on me. Running Perl -w doesn't give me any real info--I know I'm not
really using all the variables. What am I really doing wrong?
Thanks,
Mark
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
#!/usr/bin/perl5.003
$ConfigFile="boutique.cfg";
######################################################################
#########
#
# NOTE: The following subroutine may be customized to calculate
shipping
# costs. The following values are passed in:
#
# 1) Total Qty Ordered
# Newly we added :
# 2) Total Items
# 3) Total Weight
# The rest remains the same
# 4) Two-Character Abbreviation of State to be shipped to
# 5) Name of country being shipped to (if available)
# 6) Subtotal of Cost (aside from shipping and tax)
# 7) An array of product numbers ordered
# 8) A corresponding array of quantites ordered
#
# You should have the subroutine calculate and return
# $custom_shipping_cost. Feel free to declare any additional
# local variables you may need.
#
#
######################################################################
#########
sub CalculateCustomShippingCost
{
local( $totalQty, $totalItems, $totalWeight,
$state, $country, $subtotal, *prodnos, *qtys ) = @_;
local( $customShippingCost );
#######################################################################
# PLUG YOUR CUSTOM SHIPPING COST ROUTINE IN HERE
if( $totalItems > 0 ) {
if( $country =~ /US/i ) {
if( $totalWeight < 33 )
$customShippingCost = 4;
} else {
$customShippingCost =
( ( ($totalWeight - 32) * .1 ) + 4 ); }
} elsif( $country =~ /CA/i ) {
if( $totalWeight < 30 ) { $customShippingCost = 6; }
elsif( $totalWeight >= 30 && $totalWeight < 125 )
{ $customShippingCost =
( $totalWeight * .16 ); }
# When I test this script with country = CA, it calculates shipping
# fine for all weights less than 125. When the totalWeight is 125
# or more, it returns a customShippingCost of 0. It seems to skip
# the line below which is supposed to calculate the shipping for
# any totalWeight over 124 (ounces).
else { $customerShippingCost =
( $totalWeight * .13 ); }
} elsif( $country =~ /MX/i ) {
if( $totalWeight < 30 ) { $customShippingCost = 6; }
elsif( $totalWeight >= 30 && $totalWeight < 125 )
{ $customShippingCost =
( $totalWeight * .26 ); }
# Same thing happens if country = MX
else { $customerShippingCost =
( $totalWeight * .22 ); }
} else {
if( $totalWeight < 19 ) { $customShippingCost = 10; }
elsif( $totalWeight >= 19 && $totalWeight < 100 )
{ $customShippingCost =
( $totalWeight * .55 ); }
# Similar here, if country is other and totalWeight is 100 or more.
else { $customerShippingCost =
( $totalWeight * .45 ); }
}
} else {
$customShippingCost = 0;
}
return $customShippingCost;
}
1;
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 26 Jan 1999 18:45:31 -0600
From: "maf" <8_maf_8@usa.net>
Subject: Help a newbie with a custom shipping script?
Message-Id: <78lqhi$19g$1@remarQ.com>
Have set up a shopping cart for my churches web site and I am trying
to add a custom shipping script. It works great except when the weight
is greater than or equal 125 for Canada or Mexico or greater than or
equal to 100 for all other non-US countries. If you look at the
script, it seems to ignore my last "else" statement in each section.
See the comments in the script.
I just started learning Perl last week in order to do this so go easy
on me. Running Perl -w doesn't give me any real info--I know I'm not
really using all the variables. What am I really doing wrong?
Thanks,
Mark
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
#!/usr/bin/perl5.003
$ConfigFile="boutique.cfg";
######################################################################
#########
#
# NOTE: The following subroutine may be customized to calculate
shipping
# costs. The following values are passed in:
#
# 1) Total Qty Ordered
# Newly we added :
# 2) Total Items
# 3) Total Weight
# The rest remains the same
# 4) Two-Character Abbreviation of State to be shipped to
# 5) Name of country being shipped to (if available)
# 6) Subtotal of Cost (aside from shipping and tax)
# 7) An array of product numbers ordered
# 8) A corresponding array of quantites ordered
#
# You should have the subroutine calculate and return
# $custom_shipping_cost. Feel free to declare any additional
# local variables you may need.
#
#
######################################################################
#########
sub CalculateCustomShippingCost
{
local( $totalQty, $totalItems, $totalWeight,
$state, $country, $subtotal, *prodnos, *qtys ) = @_;
local( $customShippingCost ); #######################################################################
# PLUG YOUR CUSTOM SHIPPING COST ROUTINE IN HERE
if( $totalItems > 0 ) {
if( $country =~ /US/i ) {
if( $totalWeight < 33 )
$customShippingCost = 4;
} else {
$customShippingCost =
( ( ($totalWeight - 32) * .1 ) + 4 ); }
} elsif( $country =~ /CA/i ) {
if( $totalWeight < 30 ) { $customShippingCost = 6; }
elsif( $totalWeight >= 30 && $totalWeight < 125 )
{ $customShippingCost =
( $totalWeight * .16 ); }
# When I test this script with country = CA, it calculates shipping
# fine for all weights less than 125. When the totalWeight is 125
# or more, it returns a customShippingCost of 0. It seems to skip
# the line below which is supposed to calculate the shipping for
# any totalWeight over 124 (ounces).
else { $customerShippingCost =
( $totalWeight * .13 ); }
} elsif( $country =~ /MX/i ) {
if( $totalWeight < 30 ) { $customShippingCost = 6; }
elsif( $totalWeight >= 30 && $totalWeight < 125 )
{ $customShippingCost =
( $totalWeight * .26 ); }
# Same thing happens if country = MX
else { $customerShippingCost =
( $totalWeight * .22 ); }
} else {
if( $totalWeight < 19 ) { $customShippingCost = 10; }
elsif( $totalWeight >= 19 && $totalWeight < 100 )
{ $customShippingCost =
( $totalWeight * .55 ); }
# Similar here, if country is other and totalWeight is 100 or more.
else { $customerShippingCost =
( $totalWeight * .45 ); }
}
} else {
$customShippingCost = 0;
}
return $customShippingCost;
}
1;
------------------------------
Date: Wed, 27 Jan 1999 02:36:44 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Help on Change Case Susbtitution
Message-Id: <36AE6DAC.F3067D34@ngb.se>
Larry Rosler wrote:
> I fixed your pattern match regex to deal with 'P76r' and 'p76R', which
> yours woud not have.
But it still only matches english alphabet characters. And if you don't
care too much about that, why not do
$var =~ s/(\w\d\d\w)/\L$1\E/;
Staffan
------------------------------
Date: Wed, 27 Jan 1999 10:06:24 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: help with DBD-ODBC and MSAccess
Message-Id: <36AE5880.176502D@spider.herston.uq.edu.au>
You really aren't giving enough information. It could be anything - a
coding error, bad SQL, a misconfigured database, file permissions....
--
Jaime Metcher
bcs_webnet@my-dejanews.com wrote:
>
> Is anyone using the DBD-ODBC mod. with MS Access? I can select data this way
> with a CGI scripts, but I can't seem to insert new records. I get an error
> saying that I must use and updatable query. I have tried executing a prepared
> statement, and I tried the "do" method of the connection object.
>
> Please help.
> Brian
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 27 Jan 1999 00:16:27 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: help with HTML FORMS to ARRAYS, PLEASE?
Message-Id: <78llsr$ch9$1@client2.news.psi.net>
Danny Paxton (paxtond@ix.netcom.com) wrote on MCMLXXIII September
MCMXCIII in <URL:news:36ACF652.C2C6FB38@ix.netcom.com>:
?? I want to take a string of letters from an HTML form say:
?? ABCBBBDCEADAAAEC...etc and put them in an array with each individual
?? letter taking up a single location. What would the code be?
split
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
------------------------------
Date: Tue, 26 Jan 1999 23:06:10 GMT
From: brownie@foonet.com
Subject: help with make test in perl
Message-Id: <78lhos$km1$1@nnrp1.dejanews.com>
just installed PERL 5.0005 on AIX 4.2.1 machine, but make test only produced
an 81% success rate... i tried running some of those scripts alone and they
core dumpded... the "harness" program also core-dumped.. anyone have any
ideas that might help?? any help is appreciated..
here are the tests that failed:
op/assignwarn......FAILED at test 0
op/goto_xs.........FAILED at test 0
pragma/locale......FAILED at test 0
pragma/overload....FAILED at test 0
lib/anydbm.........FAILED at test 0
lib/complex........FAILED at test 158
lib/dumper-ovl.....FAILED at test 0
lib/dumper.........FAILED at test 0
lib/filecopy.......FAILED at test 6
lib/filehand.......FAILED at test 0
lib/io_dup.........FAILED at test 0
lib/io_pipe........FAILED at test 0
lib/io_sock........FAILED at test 0
lib/io_taint.......FAILED at test 0
lib/io_tell........FAILED at test 0
lib/io_udp.........FAILED at test 0
lib/io_xs..........FAILED at test 0
lib/ipc_sysv.......FAILED at test 0
lib/ndbm...........FAILED at test 0
lib/odbm...........FAILED at test 0
lib/opcode.........FAILED at test 0
lib/open2..........FAILED at test 0
lib/open3..........FAILED at test 0
lib/ops............FAILED at test 0
lib/ph.............FAILED at test 0
lib/posix..........FAILED at test 0
lib/safe1..........FAILED at test 0
lib/safe2..........FAILED at test 0
lib/sdbm...........FAILED at test 0
lib/socket.........FAILED at test 0
thanks!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 27 Jan 1999 00:17:20 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How do I expand a variable within `'s
Message-Id: <78llug$ch9$2@client2.news.psi.net>
John Morse (john.morse@symbios.com) wrote on MCMLXXIV September MCMXCIII
in <URL:news:36ad36a7.3136990@news.ks.symbios.com>:
[] What I'm trying to do is expand a command line argument within
[] back-tics. Below is not my actual code but an example of what I'm
[] trying to do. With supplying only one command line argument, then
[] expand it within back-tics, as an argument to a command.
What makes you think it doesn't work?
Abigail
--
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
------------------------------
Date: 26 Jan 1999 17:53:51 -0700
From: "Eric The Read" <emschwar@mail.uccs.edu>
Subject: Re: How long would the Unixes last without Perl?
Message-Id: <xkfyamph6xs.fsf@valdemar.col.hp.com>
fl_aggie@thepentagon.com (I R A Aggie) writes:
> In article <78i4so$o5h$1@client2.news.psi.net>, abigail@fnx.com wrote:
> + What's your definition of a commercial Unix then?
>
> Something you pay money for and can't download over the net. Last I looked,
> I could still make my own RH CD's.
But I can download (and pay money for!) Opera over the net. It's pretty
darn commercial.
Or does that only apply to unices?
-=Eric
------------------------------
Date: Tue, 26 Jan 1999 22:54:16 GMT
From: ankadakia@hotmail.com
Subject: Re: how to return multiple values in perl?
Message-Id: <78lh2k$k31$1@nnrp1.dejanews.com>
Hi there, when you return the value, in the main, %items_hash is looking
for even number of elements so, @eachline gets either 0 or 1 element.
$items_hash{"one"} will get value "two" which is in your array and not in
hash.
Nice way is to use references.
ANKadakia.
In article <78l7v7$cge$1@nnrp1.dejanews.com>,
tariq.ahmed@usa.net wrote:
> Hi there.
>
> I want to return multiple values. And for simple types, I have no problem.
> But I want to return a number, hash, and an array.
>
> { # main routine
>
> local %items_hash;
> local @eachline;
> ($a,%items_hash,@eachline)=doit();
> print @eachline;
> print "\n";
> print $items_hash{"a"};
> print "\n$a\n";
> }
>
> sub doit
> {
> local %myhash;
> $myhash{"a"}="b";
> $myhash{"b"}="c";
> @array=("one","two","three");
> return(1,%myhash,@array);
>
> }
>
> So the output should be:
> one two three
> b
> 1
>
> But somehow the one and two dissapear:
> three
> b
> 1
>
> Ideas? Thanks.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
=======================
Beautify Your Existance
=======================
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 26 Jan 1999 23:31:38 GMT
From: drgreer@qtiworld.com (Darren Greer)
Subject: Input to a running Perl Program
Message-Id: <36ae4eb7.362046765@news.qgraph.com>
Hello all. First some pre-question information. I have a program
which will be running from a unix shell. This program is going to
display a list of options to the screen. The people access this
program are using "DEC" keyboards, and will have the option to use the
NEXT,PREV, and PF4 keys. "ESC [6~" "ESC [5~" and "ESC OS"
respectively. Up to this point when retrieving user input I have
always done something similiar to:
$var = <STDIN>;
And taken there input from that. But that would require the user to
"hit enter" for the input to take. Now with this new program that I
am writing I would liek to have the user just hit the fore mentioned
keys and have that input take "right away". Im sure there is a way to
do this....but can find nothing in the man pages. Any info on that
would be apreciated.
But before I end....heres another little twist to the scenerio. The
data they will be entering will also include choosing a number from a
list. So I am going to need the fore mentioned keys to be the only
ones that take "right away", and have everything else take effect
after the user hits the enter key.
Thanks for any info.
Cheers
Darren
------------------------------
Date: 26 Jan 1999 17:54:58 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Input to a running Perl Program
Message-Id: <36ae63e2@csnews>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, drgreer@qtiworld.com (Darren Greer) writes:
:program are using "DEC" keyboards, and will have the option to use the
:NEXT,PREV, and PF4 keys. "ESC [6~" "ESC [5~" and "ESC OS"
:respectively.
You should look into the Curses module, or perlmenu, both on CPAN.
--tom
--
"We are starting a movement in the state legislatures...to forbid the
installation of clinics that dispense contraceptives."
--Phyllis Schlafly, President, Eagle Forum
------------------------------
Date: Tue, 26 Jan 1999 18:19:49 -0600
From: Michael Kangas <kangas@anlon.com>
Subject: IO::Socket on Win32
Message-Id: <36AE5BA5.58D89A93@anlon.com>
i can't get my client to print the packets sent from the server.
**********************************************
i have a book which shows ....
print scalar <$socket>;
.... but prints nothing and "blocks" the messages
**********************************************
if i use ....
print scalar $socket;
-- or --
print $socket;
...i get
IO::Socket::INET=GLOB(0xbeaf10)
.... for messages from the server
**********************************************
any help would be appreciated.
Michael Kangas
kangas@anlon.com
------------------------------
Date: 26 Jan 1999 23:29:36 GMT
From: karlon@bnr.ca (Karlon West)
Subject: Re: loops
Message-Id: <78lj50$e83$1@crchh14.us.nortel.com>
Daniel Grisinger (dgris@moiraine.dimensional.com) wrote:
> Ying Hu <yhu@mail.nih.gov> writes:
> > Alastair wrote:
> >
> > > Ying Hu <yhu@mail.nih.gov> wrote:
> > > >How to use loops to print an array (@stuff) as the following:
> > > >$stuff[0]
> > > >$stuff[1]
> > > >$stuff[2]
> >> Almost too basic to answer. You should try and learn a little
> >> more. Look for 'foreach'.
> > Do you know the answer? I did not think so!
> Just like he said, use for (or foreach, they're synonymous).
> $ perl -le '@a=(1..2);print for @a'
> 1
> 2
> $
Actually, based on his example of how he wanted the
data, I'm assuming he meant something like this:
#!/usr/bin/perl -w
use strict;
my @stuff=qw'$stuff[0] $stuff[1] $stuff[2] $stuff[3] $stuff[4] $stuff[n]';
foreach my $len (0..$#stuff)
{
my $prefix="@stuff[0..$len-1]";
$prefix .= " " if $len;
foreach my $out ($len..$#stuff)
{
print "$prefix$stuff[$out]\n"
}
}
Karlon
------------------------------
Date: Tue, 26 Jan 1999 18:13:38 -0600
From: Michael Kangas <kangas@anlon.com>
Subject: Re: Newbie question: writing file
Message-Id: <36AE5A32.1C4FC724@anlon.com>
try
open(token, ">token_file_name") || die ("Can't open...");
print token_file "$token\n";
close(token_file);
"Kevin D. Chester" wrote:
> Hello Perl Group,
>
> What am I doing wrong here?
>
> #! /usr/local/bin/perl5.003
> ...
> open(token_file, ">$token_file_name") || &err_trap("Cannot open
> $token_file_name for writing\n");
> print(token_file "$token\n");
> close token_file;
> ...
>
> All I get is "Cannot open tokens/262805729 for writing ".
>
> Thanks for your help!
>
> Kevin
------------------------------
Date: Tue, 26 Jan 1999 19:29:12 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
Subject: Re: Newbie question: writing file
Message-Id: <36AE5DD8.716C9234@snailgem.org>
Kevin D. Chester wrote:
>
> Hello Tom,
>
> Thank you for your reply!!! This little "x" has solved the problem and it seems to be
> working.
And it created another problem: you now have a directory wide open for
anybody to write to.
At the least you should use the -T switch in your CGI script.
> Best regards,
>
> Kevin
>
> Tom Briles wrote:
>
> > Kevin D. Chester wrote:
> >
> > > Hello Again,
> > >
> > > I guess maybe I have not furnished enough info. Here is the tokens dir.
> > > permissions:
> > >
> > > drw-rw-rw- 2 beanbag wheel 512 Jan 23 02:36 tokens
> > >
> >
> > You're misunderstanding how permissions work.
> >
> > You must have execute (x) permissions for a directory to create or modify files in
> > the directory.
> >
> > - Tom
--
Eugene
"I have an Apache Web Server that uses CGI forms written in COBOL."
Post in clpm
------------------------------
Date: Tue, 26 Jan 1999 18:23:13 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Number manipulation and time formats
Message-Id: <h9ml87.f91.ln@magna.metronet.com>
End User (kimntodd@dontspamus.execpc.com) wrote:
: This did the job:
: if ($d < 10){
: $d = "0$d";}
That will produce an amusing result if $d == -1 ...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 27 Jan 1999 01:02:00 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: ok please don't shoot me for this question
Message-Id: <cAtr2.104$7o2.5573@nsw.nnrp.telstra.net>
In article <78h0qd$eh1$1@news3.belgium.eu.net>,
"Familie Elst" <elst.fels@nospam.ping.be> writes:
> Ok all thanks for your help ;)
> Any good perl resources on the web ?
> Please post the URL to me ...
I suggested a few places for scripts in my previous message. For Perl
issues, you should probably start at http://www.perl.com.
> P.S. You know Maartien Verbruggen, your name sounds very dutch for someone
> in Australia ...
Only one 'a' in my first name, and yes, I am Dutch.
> Please don't send me crapy scripts like that
Crappy? It took me so much work to write that. How can you say it's
crappy?
Martien
--
Martien Verbruggen |
Interactive Media Division | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: Tue, 26 Jan 1999 23:48:49 GMT
From: scraig@my-dejanews.com
Subject: Re: perl and linux
Message-Id: <78lk8u$mlk$1@nnrp1.dejanews.com>
In article <help-2501991528100001@144.92.124.107>,
help@doit.wisc.edu (Fernando) wrote:
> I'm lerning perl.
>
> I tried a couple of simple programs on unix. I have the line
> "#!usr/bin/perl" as the very first line in my scripts.
This should be
#!/usr/bin/perl
( Note the beginning slash -- indicating the root directory )
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 26 Jan 1999 23:05:20 GMT
From: flyboy1111@my-dejanews.com
Subject: perl and make test
Message-Id: <78lhnb$kkv$1@nnrp1.dejanews.com>
just installed PERL 5.0005 on AIX 4.2.1 machine, but make test only produced
an 81% success rate... i tried running some of those scripts alone and they
core dumpded... the "harness" program also core-dumped.. anyone have any
ideas that might help?? any help is appreciated..
here are the tests that failed:
op/assignwarn......FAILED at test 0
op/goto_xs.........FAILED at test 0
pragma/locale......FAILED at test 0
pragma/overload....FAILED at test 0
lib/anydbm.........FAILED at test 0
lib/complex........FAILED at test 158
lib/dumper-ovl.....FAILED at test 0
lib/dumper.........FAILED at test 0
lib/filecopy.......FAILED at test 6
lib/filehand.......FAILED at test 0
lib/io_dup.........FAILED at test 0
lib/io_pipe........FAILED at test 0
lib/io_sock........FAILED at test 0
lib/io_taint.......FAILED at test 0
lib/io_tell........FAILED at test 0
lib/io_udp.........FAILED at test 0
lib/io_xs..........FAILED at test 0
lib/ipc_sysv.......FAILED at test 0
lib/ndbm...........FAILED at test 0
lib/odbm...........FAILED at test 0
lib/opcode.........FAILED at test 0
lib/open2..........FAILED at test 0
lib/open3..........FAILED at test 0
lib/ops............FAILED at test 0
lib/ph.............FAILED at test 0
lib/posix..........FAILED at test 0
lib/safe1..........FAILED at test 0
lib/safe2..........FAILED at test 0
lib/sdbm...........FAILED at test 0
lib/socket.........FAILED at test 0
thanks!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 26 Jan 1999 23:05:19 GMT
From: flyboy1111@my-dejanews.com
Subject: perl and make test
Message-Id: <78lhn9$kkg$1@nnrp1.dejanews.com>
just installed PERL 5.0005 on AIX 4.2.1 machine, but make test only produced
an 81% success rate... i tried running some of those scripts alone and they
core dumpded... the "harness" program also core-dumped.. anyone have any
ideas that might help?? any help is appreciated..
here are the tests that failed:
op/assignwarn......FAILED at test 0
op/goto_xs.........FAILED at test 0
pragma/locale......FAILED at test 0
pragma/overload....FAILED at test 0
lib/anydbm.........FAILED at test 0
lib/complex........FAILED at test 158
lib/dumper-ovl.....FAILED at test 0
lib/dumper.........FAILED at test 0
lib/filecopy.......FAILED at test 6
lib/filehand.......FAILED at test 0
lib/io_dup.........FAILED at test 0
lib/io_pipe........FAILED at test 0
lib/io_sock........FAILED at test 0
lib/io_taint.......FAILED at test 0
lib/io_tell........FAILED at test 0
lib/io_udp.........FAILED at test 0
lib/io_xs..........FAILED at test 0
lib/ipc_sysv.......FAILED at test 0
lib/ndbm...........FAILED at test 0
lib/odbm...........FAILED at test 0
lib/opcode.........FAILED at test 0
lib/open2..........FAILED at test 0
lib/open3..........FAILED at test 0
lib/ops............FAILED at test 0
lib/ph.............FAILED at test 0
lib/posix..........FAILED at test 0
lib/safe1..........FAILED at test 0
lib/safe2..........FAILED at test 0
lib/sdbm...........FAILED at test 0
lib/socket.........FAILED at test 0
thanks!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 4755
**************************************