[23790] in Perl-Users-Digest
Perl-Users Digest, Issue: 5993 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 29 18:08:07 2004
Date: Thu, 29 Jan 2004 15:07:19 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 29 Jan 2004 Volume: 10 Number: 5993
Today's topics:
Всё. Приехали. <Peter.Kopeliovich@f873.n5020.z2.fidonet.org>
Postal Lottery: Turn $6 into $60,000 in 90 days, GUARA <nafltstx@mafksrsv.com>
"Simple Database Program" help! (Mark Creelman)
Re: "Simple Database Program" help! <uri@stemsystems.com>
Re: "Simple Database Program" help! <jwillmore@remove.adelphia.net>
Re: "Simple Database Program" help! <tadmc@augustmail.com>
Re: "Simple Database Program" help! <uri@stemsystems.com>
Re: "Simple Database Program" help! (Jay Tilton)
"system" commands don't work on my Windows machine <john@aster.com>
Re: "system" commands don't work on my Windows machine (Walter Roberson)
Re: "system" commands don't work on my Windows machine <john@aster.com>
Re: "system" commands don't work on my Windows machine (Mikevh2)
Re: "system" commands don't work on my Windows machine <matthew.garrish@sympatico.ca>
Re: "system" commands don't work on my Windows machine <gnari@simnet.is>
Re: "system" commands don't work on my Windows machine <tadmc@augustmail.com>
Re: "system" commands don't work on my Windows machine <tadmc@augustmail.com>
Re: "system" commands don't work on my Windows machine <john@aster.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 28 Jan 2004 07:09:38 +0300
From: Peter Kopeliovich <Peter.Kopeliovich@f873.n5020.z2.fidonet.org>
Subject: Всё. Приехали.
Message-Id: <1075273888@f873.n5020.z2.ftn>
Hi Michael! Приколимся?
Была тёмная ночь. Старуха пряла свою пряжу. Разбойники пили вино.
Атаманша гадала на картах. Michael Filatov писал к Peter Kopeliovich
27/01/2032:
RL>>> Открыли они капот и светили под него фонариком с... правильно! с
RL>>> СИHЕЙ лампочкой!!!
PK>> Пропала планета... (c) :( Зато я сегодня ноаборот из синей
PK>> подсветки приборки делал красную. :-)
MF> Гламурный красный цвет. (ц)
Где бы красный приборный тюнинг взять... Меняю на синий габаритный тюнинг. :-)
А ешё задние светодиодные габариты зачётны. :)
Best wishes!
Peter.
... Иж 2126-020 ODA 1.7e, http://peter873.narod.ru/, http://izh.auto.ru/
------------------------------
Date: Mon, 26 Jan 2004 05:56:14 GMT
From: "Kate" <nafltstx@mafksrsv.com>
Subject: Postal Lottery: Turn $6 into $60,000 in 90 days, GUARANTEED
Message-Id: <2_1Rb.168549$7JB1.38008@news04.bloor.is.net.cable.rogers.com>
Postal Lottery: Turn $6 into $60,000 in 90 days, GUARANTEED
I found this in a news group and decided to try it. A little while
back, I was browsing through newsgroups, just like you are now and
came across a message just like this that said you could make
thousands of dollars within weeks with only an initial investment of
$6.00!!!
So I thought yeah right, this must be a scam!!! But like most of us, I
was curious, so I kept reading. Anyway, it said that you send $1.00 to
each of the 6 names and addresses stated in the message. You then
place your own name and address at the bottom of the list at #6 and
post the message in at least 200 news groups. (There are thousands to
choose from). No catch, that was it.
So after thinking it over, and talking to a few people first. I
thought about trying it. I figured, what have I got to lose except 6
stamps and $6.00, right? So I invested the measly $6.00!!! Guess what?
Within 7 days I started getting money in the mail!!! I was shocked!!!
I figured it would end soon, but the money just kept coming in!!! In
my first week, I had made about $25.00. By the end of the second week,
I had made a total of over $1,000.00!!! In the third week, I had over
$10,000.00 and it is still growing!!! This is now my fourth week and I
have made a total of just over $42,000.00 and it is still coming in
rapidly!!! It's certainly worth $6.00 and 6 stamps!!! I have spent
more than that on the lottery!!!
Let me tell you how this works and most importantly, why it works!!!
Also, make sure you print a copy of this message now. So you can get
the information off of it as you need it. I promise you that if you
follow the directions exactly, that you will start making more money
than you thought possible by doing something so easy!!!
Suggestion: Read this entire message carefully!!! (Print it out or
download it.) Follow the simple directions and watch the money come
in!!! It's easy!!! It's legal!!! Your investment is only $6.00 (plus
postage).
IMPORTANT: This is not a rip-off!!! It is not illegal!!! ? It is
almost entirely risk free and it really works!!! If all of the
following instructions are adhered to, you will receive extraordinary
dividends!!!
Please note: Follow these directions EXACTLY, and $60,000.00 or more
can be yours in 20 to 90 days!!! This program remains successful
because of the honesty and the integrity of the participants!!! Please
continue its success by carefully adhering to the instructions.
You will now become part of the mail order business. In this business
your product is not solid or tangible, it is a service. You are in the
business of developing mailing lists. Many large corporations are
happy to pay big bucks for quality lists. However, the money made from
a mailing list is secondary to the income which is made from people
like you and me asking to be included on your mailing list!!!
Here are the 4 easy steps to success:-
Step 1:- Get 6 separate pieces of paper and write the following on
each piece of paper.
PLEASE PUT ME ON YOUR MAILING LIST
Now get 6 U.S. dollar bills and place ONE inside each of the 6 pieces
of paper so the bills will not be seen through the envelopes (to
prevent mail theft). Next, place one paper in each of the 6 envelopes
and seal them, you should now have 6 sealed envelopes. Each with a
piece of paper stating the above phrase, your name and address, and a
$1.00 bill.
THIS IS ABSOLUTELY LEGAL!!! YOU ARE REQUESTING A LEGITIMATE SERVICE
AND YOU ARE PAYING FOR IT!!!
Like most of us, I was a little skeptical and a little worried about
the legal aspect of it all. So I checked it out with the U.S. Postal
Service and they confirmed that it is indeed legal!!!
Mail the 6 envelopes to the following addresses:-
D. Kumar
Room 2.36 Burkhardt House
Oxford Place, Victoria Park
M14 5RR Manchester
ENGLAND
T. Perce
11505 Headley Avenue
Cleveland, Oh 44111
T. Beckers
Rijksweg 46
6267AH Cadier en Keer
The Netherlands
J. Eddolls
144 Pursey Drive
Bradley Stoke
Bristol
BS32 8DP
United Kingdom
Louis Joseph
1933 Highway 35, #104
Wall, NJ 07719-3502
S. Guitard
55 Erskine Ave #1202
Toronto, Ontario
Canada M4P-1Y7
Step 2:- Now take the #1 name off the list that you see above, move
the other names up (6 becomes 5, 5 becomes 4, etc.) and add your name
as number 6 on the list.
Step 3:- Change anything you need to, but try to keep this message as
close to what you see as possible. Now, post your amended message to
at least 200 news groups. I think there are close to 24,000 groups!!!
All you need is 200, but remember, the more you post, the more money
you make!!! This is perfectly legal!! If you have any doubts, refer to
Title18 Sec. 1302 & 1341 of the postal lottery laws. Keep a copy of
these steps for yourself and whenever you need money, you can use it
again.
Please remember that this program remains successful because of the
honesty and the integrity of the participants and by their carefully
adhering to the directions!!!
Look at it this way. If you are of integrity, the program will
continue and the money that so many others have received will come
your way!!!
Note: - You may want to retain every name and address sent to you,
either on your computer or hard copy and keep the notes people send
you. This verifies that you are truly providing a service. Also, it
might be a good Idea to wrap the $1 bills in dark paper to reduce the
risk of mail theft.
So, as each post is downloaded and the directions carefully followed,
six members will be reimbursed for their participation as a list
developer with one dollar each. Your name will move up the list
geometrically so that when your name reaches the #1 position, you will
be receiving thousands of dollars in cash!!! What an opportunity for
only $6.00!!! ($1.00 for each of the first six people listed above).
Send it now, add your own name to the list and your in business!!!
DIRECTIONS FOR HOW TO POST TO A NEWS GROUP!!!
Step 1:- You do not need to re-type this entire message to do your own
posting. Simply put your cursor at the beginning of this message and
drag your cursor to the bottom of this message and select copy from
the edit menu. This will copy the entire message into the computer
memory.
Step 2:- Open a blank note pad file and place your cursor at the top
of the blank page. From the edit menu select paste. This will paste a
copy of the message into notepad so that you can add your name to the
list.
Step 3:- Save your new notepad file as a txt file. If you want to do
your posting in a different setting, you'll always have this file to
go back to.
Step 4:- Use Netscape or Internet Explorer and try searching for
various news groups (on-line forums, message boards, chat sites,
discussions, etc.)
Step 5:- Visit these message boards and post this message as a new
message by highlighting the text of this message from your notepad and
selecting paste from the edit menu. Fill in the subject, this will be
the header that everybody sees as they scroll through the list of
postings in a particular group. Click the post message button. You've
done your first one! Congratulations!!! All you have to do is jump to
different news groups and post away, after you get the hang of it, it
will take about 30 seconds for each news group!
REMEMBER, THE MORE NEWS GROUPS YOU POST IN, THE MORE MONEY YOU WILL
MAKE!!! (But you have to post a minimum of 200).
That's it!!! You will begin receiving money from around the world
within days!!! You may eventually want to rent a P.O. Box due to the
large amount of mail you will receive. If you wish to stay anonymous,
you can invent a name to use, as long as the postman will deliver it.
JUST MAKE SURE ALL THE ADDRESSES ARE CORRECT!!!
Now the why part. Out of 200 postings, say you receive only 5 replies
(a very low example). So then you made $5.00 with your name at #6 on
the letter. Now, each of the 5 persons who sent you $1.00 make the
minimum 200 postings, each with your name at #5 and only 5 persons
respond to each of the original 5, that is another $25.00 for you. Now
those 25 each make 200 MINIMUM posts with your name at #4 and only 5
replies each, you will bring in an additional $125.00!!! Now, those
125 persons turn around and post the minimum 200 with your name at #3
and only receive 5 replies each, you will make an additional
$625.00!!! OK, now here is the fun part, each of those 625 persons
post a minimum 200 messages with your name at #2 and they each only
receive 5 replies, that
just made you $3,125.00!!! Those 3,125 persons will all deliver this
message to 200 news groups. If just 5 more reply you will receive
$15,625.00!!! All with an original investment of only $6.00!!! Amazing
isn't it!!!! When your name is no longer on the list, you just take
the latest posting in the news groups and send out another $6.00 to
the names on the list, putting your name at number 6 again.
You must realize that thousands of people all over the world are
joining the internet and reading these messages every day!!! Just like
you are now!!! So, can you afford $6.00 and see if it really works?
I'm glad I did!!! People have said, "what if the plan is played out
and no one sends you the money?" So what!!! What are the chances of
that happening, when there are tons of new honest users and new honest
people who are joining the internet and news groups everyday and are
willing to give it a try? Estimates are at 20,000 to 50,000 new users,
every day!!!
REMEMBER PLAY HONESTLY AND FAIRLY AND THIS WILL REALLY WORK!!!
-- Comments/Feedback (please post your feedback/experiences here) --
Not bad for 1 hr's work....made me around $5320 in roughly 35 days
Anthony M - TX
Hello, I rcvd 269 bucks in the post in 2 weeks.
Dan Miami - FL
I had to wait around 10 days before I had any results - $13,450 as of
3rd Jan 2003 to date (14th Feb 2003).Am gonna re-post it again for
more money!!
Del from Alberta - Canada
Only received around ё588 in the post the last 2 months since I
started the program but I'd posted to approx. 100 newsgroups.
James P - Manchester, UK
Cool....didn't expect much out of this "scam" initially but I have pay
my credit card bill
Mustafa - Jordan
For $6,I made $246 in 2 weeks
ROMEO2326 - Little Rock, AR -US of A
Hey, just droppin a line to say that after posting to well over 820
newsgroups on google and my ISP newsgroup server over a period of 4
1/2 months ,Ive raked in $54280 . Mucho dinero baby!!!! Peace...
Drew Dallas - TX
------------------------------
Date: Thu, 22 Jan 2004 03:25:37 GMT
From: rdcomp@sympatico.ca (Mark Creelman)
Subject: "Simple Database Program" help!
Message-Id: <400f3e0f.46908370@news1.sympatico.ca>
Hello all:
I am attempting to use a database program that I downloaded from
http://www.thescripts.com/serversidescripting/perl/tutorials/asimpledatabaseprogram/database.txt
with good success. I have already modified it heavily with good results. I am however stuck on something that I feel should have been built into it,
but for some reason wasn't. During the search routine of the script that searches the database for a match based on the entered query, there is no
subroutine to return all records. (aka entering the equivalent wildcard of *.* and having it return all records) ditto for the modify and delete
functions.
I've scoured it up, down and inside out, and I can see where the search and return results subroutines are, but the syntac gets a little bit
over my head at that point..I'm sure its simple, but I can't see it.
I've e-mailed the author on this, but no response.
Thankyou to anyone who can help me out.
Mark
------------------------------
Date: Thu, 22 Jan 2004 04:25:44 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: "Simple Database Program" help!
Message-Id: <x7llo0a9tj.fsf@mail.sysarch.com>
comp.lang.perl doesn't exist. any newsservers that have it are poorly
admined.
>>>>> "MC" == Mark Creelman <rdcomp@sympatico.ca> writes:
MC> I am attempting to use a database program that I downloaded from
MC> http://www.thescripts.com/serversidescripting/perl/tutorials/asimpledatabaseprogram/database.txt
you got what you paid for. pay $0, get crap code.
MC> with good success. I have already modified it heavily with good
MC> results. I am however stuck on something that I feel should have
MC> been built into it, but for some reason wasn't. During the search
MC> routine of the script that searches the database for a match based
MC> on the entered query, there is no subroutine to return all
MC> records. (aka entering the equivalent wildcard of *.* and having
MC> it return all records) ditto for the modify and delete functions.
then write it yourself. i won't go near that pile of poo code.
MC> I've e-mailed the author on this, but no response.
quality support is common for free crap scripts
MC> Thankyou to anyone who can help me out.
hire a real programmer next time. that script is so bad but you
obviously can't tell as you were blinded by its cost.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 22 Jan 2004 04:52:17 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: "Simple Database Program" help!
Message-Id: <pan.2004.01.22.04.52.15.714623@remove.adelphia.net>
On Thu, 22 Jan 2004 03:25:37 +0000, Mark Creelman wrote:
> I am attempting to use a database program that I downloaded from
<snip>
> I've e-mailed the author on this, but no response.
You have a few options:
1) email the author again
2) write your own - this may be the best option, because a lot of the
script that you can download have been written by those with little or no
programming experience ... and even less experience with secure
programming (for example: does the script have taint checking enabled
('-T' on the first line).
3) pay someone else to do it for you - and make sure you get your money's
worth out of it ;-)
> Thankyou to anyone who can help me out.
You're welcome.
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
You are only young once, but you can stay immature indefinitely.
------------------------------
Date: Wed, 21 Jan 2004 23:00:51 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: "Simple Database Program" help!
Message-Id: <slrnc0um83.8o0.tadmc@magna.augustmail.com>
Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "MC" == Mark Creelman <rdcomp@sympatico.ca> writes:
>
> MC> I am attempting to use a database program that I downloaded from
[ "the web" ]
> i won't go near that pile of poo code.
I thought this line of code was quite telling:
$delimeter = "|";
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 22 Jan 2004 05:55:34 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: "Simple Database Program" help!
Message-Id: <x74quoa5nu.fsf@mail.sysarch.com>
>>>>> "TM" == Tad McClellan <tadmc@augustmail.com> writes:
TM> Uri Guttman <uri@stemsystems.com> wrote:
>>>>>>> "MC" == Mark Creelman <rdcomp@sympatico.ca> writes:
>>
MC> I am attempting to use a database program that I downloaded from
TM> [ "the web" ]
>> i won't go near that pile of poo code.
TM> I thought this line of code was quite telling:
TM> $delimeter = "|";
delimeter: noun, scale used to weigh and price cold cuts.
also the unit of length for salamis.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Fri, 23 Jan 2004 02:27:49 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: "Simple Database Program" help!
Message-Id: <4010864e.245699984@news.erols.com>
James Willmore <jwillmore@remove.adelphia.net> wrote:
: On Thu, 22 Jan 2004 03:25:37 +0000, Mark Creelman wrote:
:
: > I am attempting to use a database program that I downloaded from
:
: <snip>
:
: > I've e-mailed the author on this, but no response.
:
: You have a few options:
:
: 1) email the author again
Not worth the time. The author commits so many novice mistakes in the
program that you have to doubt his competence.
: 2) write your own - this may be the best option, because a lot of the
: script that you can download have been written by those with little or no
: programming experience ... and even less experience with secure
: programming (for example: does the script have taint checking enabled
: ('-T' on the first line).
This one doesn't. And the program uses some of the unlaundered data in
string evals. Scary stuff.
: 3) pay someone else to do it for you - and make sure you get your money's
: worth out of it ;-)
That option sounds pretty good. The program is really about maintaining
a CSV database. Rewriting the whole thing to use DBI would take no
time, would provide the extensibility the OP wants, and would allow
transparent migration to a more robust database when the needs outgrow
CSV.
------------------------------
Date: Fri, 23 Jan 2004 21:21:42 -0800
From: "John" <john@aster.com>
Subject: "system" commands don't work on my Windows machine
Message-Id: <busvdd$e7e$1@daisy.noc.ucla.edu>
Hello folks,
Apologies in advance from this newbie if the problem that I am about to
mention has been written about before.
I'm using ActivePerl 5.6.1 on a Windows 2000 machine. However, I can't get
perl to execute any "system" command whatsover. Any perl line of the form:
system "dir" && die "didn't work";
always returns the error condition "didn't work" in the MS-DOS command
prompt window. Is it my machine, or is something else going on? Thanks.
-John
------------------------------
Date: 24 Jan 2004 05:34:30 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: "system" commands don't work on my Windows machine
Message-Id: <but056$k3g$1@canopus.cc.umanitoba.ca>
In article <busvdd$e7e$1@daisy.noc.ucla.edu>, John <john@aster.com> wrote:
:Apologies in advance from this newbie if the problem that I am about to
:mention has been written about before.
:I'm using ActivePerl 5.6.1 on a Windows 2000 machine. However, I can't get
:perl to execute any "system" command whatsover. Any perl line of the form:
:system "dir" && die "didn't work";
:always returns the error condition "didn't work" in the MS-DOS command
:prompt window. Is it my machine, or is something else going on? Thanks.
The && operator only examines the second part if the first part is true.
So you're dying because the first part *did* work. Try instead
system "dir" or die "didn't work";
--
If a troll and a half can hook a reader and a half in a posting and a half,
how many readers can six trolls hook in six postings?
------------------------------
Date: Fri, 23 Jan 2004 22:38:42 -0800
From: "John" <john@aster.com>
Subject: Re: "system" commands don't work on my Windows machine
Message-Id: <but3tu$gcc$1@daisy.noc.ucla.edu>
Thanks for the reply. Hmmm, I thought the correct syntax was && instead of
"or" for the example:
system "dir" && die "didn't work";
because the "system" command returns 0 if everything is OK, else if it fails
then the "die" command is executed. Or am I reading it wrong? (I've taken
a modified version of the example straight from section 14.1 of the book
"Learning Perl on Win32 Systems"). In any case something like:
system "dir >out.txt"
should produce a text file with the output. That doesn't work for me
either. So I'm still stumped :-(
-John
In article <busvdd$e7e$1@daisy.noc.ucla.edu>, John <john@aster.com> wrote:
:Apologies in advance from this newbie if the problem that I am about to
:mention has been written about before.
:I'm using ActivePerl 5.6.1 on a Windows 2000 machine. However, I can't get
:perl to execute any "system" command whatsover. Any perl line of the form:
:system "dir" && die "didn't work";
:always returns the error condition "didn't work" in the MS-DOS command
:prompt window. Is it my machine, or is something else going on? Thanks.
The && operator only examines the second part if the first part is true.
So you're dying because the first part *did* work. Try instead
system "dir" or die "didn't work";
------------------------------
Date: 24 Jan 2004 06:59:00 GMT
From: mikevh2@aol.com (Mikevh2)
Subject: Re: "system" commands don't work on my Windows machine
Message-Id: <20040124015900.22006.00000434@mb-m22.aol.com>
>Subject: Re: "system" commands don't work on my Windows machine
>From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
>Date: 1/24/2004 12:34 AM Eastern Standard Time
>Message-id: <but056$k3g$1@canopus.cc.umanitoba.ca>
>
>In article <busvdd$e7e$1@daisy.noc.ucla.edu>, John <john@aster.com> wrote:
>:Apologies in advance from this newbie if the problem that I am about to
>:mention has been written about before.
>
>:I'm using ActivePerl 5.6.1 on a Windows 2000 machine. However, I can't get
>:perl to execute any "system" command whatsover. Any perl line of the form:
>
>:system "dir" && die "didn't work";
>
>:always returns the error condition "didn't work" in the MS-DOS command
>:prompt window. Is it my machine, or is something else going on? Thanks.
>
>The && operator only examines the second part if the first part is true.
>So you're dying because the first part *did* work. Try instead
>
>system "dir" or die "didn't work";
>--
>If a troll and a half can hook a reader and a half in a posting and a half,
>how many readers can six trolls hook in six postings?
>
On my machine (ActivePerl 5.8.0 on WinXP), system(dir) returns 0 for success.
However, your example as posted prints "didn't work" for me too.
Using parens fixed it, i.e.,
system("dir") && die "didn't work";
My guess is that without the parens, it's the string "dir" that's being eval'ed
as true and
causing the die to happen.
As a general rule, I've found it's always best to store the result of a system
call in a
variable, and then proceed based on that, e.g.
$result = system("dir");
die qq(system("dir") returned $result\n) if $result;
------------------------------
Date: Sat, 24 Jan 2004 02:48:24 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: "system" commands don't work on my Windows machine
Message-Id: <8rpQb.20914$U77.1895560@news20.bellglobal.com>
"John" <john@aster.com> wrote in message
news:but3tu$gcc$1@daisy.noc.ucla.edu...
> Thanks for the reply. Hmmm, I thought the correct syntax was && instead
of
> "or" for the example:
>
> system "dir" && die "didn't work";
>
> because the "system" command returns 0 if everything is OK, else if it
fails
> then the "die" command is executed. Or am I reading it wrong?
No, you just got some bad advice. You should use the lower precedence "and"
or wrap your command in parens:
system 'dir' and die "didn't work";
system('dir') && die "didn't work";
Matt
------------------------------
Date: Sat, 24 Jan 2004 10:25:32 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: "system" commands don't work on my Windows machine
Message-Id: <buthcd$klt$1@news.simnet.is>
"Mikevh2" <mikevh2@aol.com> wrote in message
news:20040124015900.22006.00000434@mb-m22.aol.com...
[snipped precedence problem]
>
> As a general rule, I've found it's always best to store the result of a
system
> call in a
> variable, and then proceed based on that, e.g.
> $result = system("dir");
> die qq(system("dir") returned $result\n) if $result;
this may be OK for a beginner while he is figuring out
how things work, but he should really rathet try to
understand how precedence works, or else it will bite him
sooner or later.
gnari
------------------------------
Date: Sat, 24 Jan 2004 09:01:03 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: "system" commands don't work on my Windows machine
Message-Id: <slrnc1525f.4hc.tadmc@magna.augustmail.com>
Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca> wrote:
> In article <busvdd$e7e$1@daisy.noc.ucla.edu>, John <john@aster.com> wrote:
>:system "dir" && die "didn't work";
>
>:always returns the error condition "didn't work" in the MS-DOS command
> The && operator only examines the second part if the first part is true.
> So you're dying because the first part *did* work. Try instead
>
> system "dir" or die "didn't work";
system() returns what Perl considers a _true_ value on failure
and a false value (zero) on success.
ie. it is "backwards" from nearly every other Perl function.
So the answer above will not work.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 24 Jan 2004 08:56:41 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: "system" commands don't work on my Windows machine
Message-Id: <slrnc151t9.4hc.tadmc@magna.augustmail.com>
John <john@aster.com> wrote:
> Apologies in advance from this newbie if the problem that I am about to
> mention has been written about before.
You have a precedence problem.
Precedence bites even experienced programmers, so don't feel bad.
> system "dir" && die "didn't work";
Perl parses that as:
system ("dir" && die "didn't work");
due the high precedence of &&.
Since the string 'dir' will always be true, perl proceeds to
evaluating the 2nd part, and the die() is executed.
> Is it my machine, or is something else going on?
Something else (precedence).
system("dir") && die "didn't work"; # parens to override higher precedence
or
system "dir" and die "didn't work"; # use low precedence operator instead
or (my preference)
!system "dir" or die "didn't work"; # "not" the system() so you can
# use the familiar "... or die" form
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 25 Jan 2004 07:46:38 -0800
From: "John" <john@aster.com>
Subject: Re: "system" commands don't work on my Windows machine
Message-Id: <bv0oct$567$1@daisy.noc.ucla.edu>
Thank you! The suggested solutions work like a charm.
--John
>>system("dir") && die "didn't work"; # parens to override higher precedence
>>or
>>system "dir" and die "didn't work"; # use low precedence operator instead
>>or (my preference)
>>!system "dir" or die "didn't work"; # "not" the system() so you can
>> # use the familiar "... or die"
form
>>--
>> Tad McClellan SGML consulting
>> tadmc@augustmail.com Perl programming
>> Fort Worth, Texas
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 5993
***************************************