[23531] in Perl-Users-Digest
Perl-Users Digest, Issue: 5740 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 1 21:05:52 2003
Date: Sat, 1 Nov 2003 18:05:08 -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 Sat, 1 Nov 2003 Volume: 10 Number: 5740
Today's topics:
Re: Aps and Linux <bik.mido@tiscalinet.it>
Devel::Leak usage question <stanb@panix.com>
Re: Export of environment variables <yevgen.r@web.de>
Re: Export of environment variables (Malcolm Dew-Jones)
extracting properties of companies with a tag for compa (Vumani Dlamini)
Re: extracting properties of companies with a tag for c <invalid-email@rochester.rr.com>
Re: extracting properties of companies with a tag for c <noreply@gunnar.cc>
Re: How to find a word in wordlist ctcgag@hotmail.com
Re: is there the simplest way to do this: logon to my e <davido@pacifier.com>
Re: is there the simplest way to do this: logon to my e <mizhael@yahoo.com>
Re: is there the simplest way to do this: logon to my e <mizhael@yahoo.com>
Re: is there the simplest way to do this: logon to my e (Tad McClellan)
Re: is there the simplest way to do this: logon to my e <yevgen.r@web.de>
Re: is there the simplest way to do this: logon to my e <spam@thecouch.homeip.net>
Re: neuronal pattern / network ctcgag@hotmail.com
Re: neuronal pattern / network <sm-ml@mediascape.de>
Newbie to perl, need help <wizdum.unspam@no-spam.hotmail.com>
Re: Rounding a float in Perl? <nospam-abuse@ilyaz.org>
Unable to acces "$?" environment variable <yevgen.r@web.de>
Re: Unable to acces "$?" environment variable <tony_curtis32@_SPAMTRAP_yahoo.com>
Re: Unable to acces "$?" environment variable <grazz@pobox.com>
Re: Unable to acces "$?" environment variable <yevgen.r@web.de>
Re: Unable to acces "$?" environment variable <REMOVEsdnCAPS@comcast.net>
Re: Unable to acces "$?" environment variable <yevgen.r@web.de>
Re: UNIX domain sockets <bruce@pomegranate.ltd.uk>
Re: Uploading multiple files ctcgag@hotmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 01 Nov 2003 20:05:28 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Aps and Linux
Message-Id: <f257qv41m7u4c7h5nu7mouhnqoiq2l4sha@4ax.com>
On Fri, 31 Oct 2003 17:10:11 GMT, James Willmore
<jwillmore@remove.adelphia.net> wrote:
>> > This is ASP code, not Perl.
>> >
>> > Wrong group :-(
>>
>> Nope, it's "Aps" code. The OP said so.
>
>Sorry, but I believe the OP is mistaken. It appears, to me, to be
A smiley may have helped making it clear it was a joke...
Michele
--
# This prints: Just another Perl hacker,
seek DATA,15,0 and print q... <DATA>;
__END__
------------------------------
Date: Sat, 1 Nov 2003 22:10:26 +0000 (UTC)
From: Stan Brown <stanb@panix.com>
Subject: Devel::Leak usage question
Message-Id: <bo1b0i$hpo$1@reader2.panix.com>
I'm trying to diagnose a memory leak in a script I'm writing Here's what I'm doing:
my $count = Devel::Leak::NoteSV($handle);
while(1)
{
# code
my $new_count = Devel::Leak::CheckSV($handle);
}
But this eventualluy causes teh script to core dump :-(
What am I doing wrong?
--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin
------------------------------
Date: Sat, 01 Nov 2003 18:47:53 +0100
From: Yevgen Reznichenko <yevgen.r@web.de>
Subject: Re: Export of environment variables
Message-Id: <bo0rko$17567m$1@ID-198732.news.uni-berlin.de>
Am 01.11.2003 15:29 schrieb Tad McClellan:
> Have a look at the Posting Guidelines when you have time:
>
> http://mail.augustmail.com/~tadmc/clpmisc.shtml
done
> You appear to want to use an env var for persistence. That is
> a bad choice as it will go away on a reboot. Use a file instead.
Thanks, it works now fine (almost, see the another thread).
Yevgen
------------------------------
Date: 1 Nov 2003 14:17:12 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Export of environment variables
Message-Id: <3fa430e8@news.victoria.tc.ca>
Tad McClellan (tadmc@augustmail.com) wrote:
: For this case i want to create a
: > environment variable and export it.
: If I understand you correctly, you cannot do that on any sensible
: operating system.
Sure you can, just not on unix like systems.
VMS is a very sensible system that comes to mind. Various ways for a
child to set things into the parent's "environment", though the term
environment does not translate directly. Global variables and job
logicals are the two that spring to mind.
------------------------------
Date: 1 Nov 2003 14:39:28 -0800
From: dvumani@hotmail.com (Vumani Dlamini)
Subject: extracting properties of companies with a tag for company number
Message-Id: <4b35f3c9.0311011439.4f71b946@posting.google.com>
I would like to extract properties of companies from a huge text data
set. The data is structured as follows;
##### data #########
Area=3706
Company=101
PROPdes1=1 # description/type of property
PROPpri1=2 # public/private
PROPemp1=54 # number of employees
PROPdes2=6
PROPpri2=2
PROPemp2=23
###################
I would like to create data like,
3706|101|1|1|2|54
3706|101|2|6|2|23
where column 3 corresponds to the property tag, attached to each
variable corresponding to a particular property.
There are a lot more properties per company in my data set and thus I
opted to loop over that tag; but my code gives errors where those tags
are. Am not sure what I am missing.
##### Perl script ######
use strict;
open DATA, "c:/../properties.txt" or die "Unable to open file:$\n";
my ($Area , $Comp, $i, $Pdes, $Ppri, $Pemp);
open PRIVATE, ">c:/.../private.txt";
while (<DATA>){
if (/Area=(\d+)/) {
$Area = $1;
}
elsif (/Company=(\d+)/) {
$Comp = $1;
}
# Loop over properties by the same company (not more than 5 in
this data set)
for ($i = 1; $i<= 5;$i++){
# Each of the variable has a postfix for the property
number
elsif (/PROPdes($i)=(\d+)/) { # ERROR OCCURS
$Pdes = $1;
}
elsif (/PROPpri($i)=(\d+)/) { # ERROR OCCURS
$Ppri = $1;
}
elsif (/PROPemp(\d+)c=(\d+)/) {
print PRIVATE "$Area$Comp$i$Pdes$Ppri$1\n";
}
}
}
##### Perl script ######
Thanks, Vumani
------------------------------
Date: Sat, 01 Nov 2003 23:52:26 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: extracting properties of companies with a tag for company number
Message-Id: <3FA44662.1060507@rochester.rr.com>
Vumani Dlamini wrote:
> I would like to extract properties of companies from a huge text data
> set. The data is structured as follows;
>
> ##### data #########
> Area=3706
> Company=101
> PROPdes1=1 # description/type of property
> PROPpri1=2 # public/private
> PROPemp1=54 # number of employees
> PROPdes2=6
> PROPpri2=2
> PROPemp2=23
> ###################
>
> I would like to create data like,
> 3706|101|1|1|2|54
> 3706|101|2|6|2|23
>
> where column 3 corresponds to the property tag, attached to each
> variable corresponding to a particular property.
>
> There are a lot more properties per company in my data set and thus I
> opted to loop over that tag; but my code gives errors where those tags
> are. Am not sure what I am missing.
>
> ##### Perl script ######
> use strict;
> open DATA, "c:/../properties.txt" or die "Unable to open file:$\n";
> my ($Area , $Comp, $i, $Pdes, $Ppri, $Pemp);
> open PRIVATE, ">c:/.../private.txt";
> while (<DATA>){
> if (/Area=(\d+)/) {
> $Area = $1;
> }
> elsif (/Company=(\d+)/) {
> $Comp = $1;
> }
> # Loop over properties by the same company (not more than 5 in
> this data set)
> for ($i = 1; $i<= 5;$i++){
> # Each of the variable has a postfix for the property
> number
> elsif (/PROPdes($i)=(\d+)/) { # ERROR OCCURS
> $Pdes = $1;
> }
> elsif (/PROPpri($i)=(\d+)/) { # ERROR OCCURS
> $Ppri = $1;
> }
> elsif (/PROPemp(\d+)c=(\d+)/) {
> print PRIVATE "$Area$Comp$i$Pdes$Ppri$1\n";
> }
> }
> }
> ##### Perl script ######
...
Well, for starters, the code you supplied doesn't compile, even after
the wrapped commentary is fixed (hint: fix that too). Fix the
compilation problem up and try again. Most folks here don't like to
waste their time guessing at what your real code might have been. It
would also be helpful to place your sample input data after a __END__
line and omit the open DATA,..., and, instead of opening an output file,
set the PRIVATE filehandle so it outputs to STDOUT. That way anyone can
cut/paste/run your code with no further fussing, and you'll get more and
better responses :-).
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Sun, 02 Nov 2003 01:19:41 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: extracting properties of companies with a tag for company number
Message-Id: <bo1ipk$16r4pg$1@ID-184292.news.uni-berlin.de>
Vumani Dlamini wrote:
>
> elsif (/PROPdes($i)=(\d+)/) { # ERROR OCCURS
Should be:
if (/PROPdes$i=(\d+)/) { # ERROR OCCURS
You may not start a conditional construct with 'elsif'.
No parentheses surrounding the $i variable, or else you capture the
value of $i at the next line, which is not what you want.
Your code includes a couple of other bugs, but this should be enough
to help you fix them by yourself.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 01 Nov 2003 18:24:37 GMT
From: ctcgag@hotmail.com
Subject: Re: How to find a word in wordlist
Message-Id: <20031101132437.471$o6@newsreader.com>
VP <VP@yahoo.com> wrote:
> Thomas Widmann wrote:
> > VP <VP@yahoo.com> writes:
> >
> >
> >>[...]
> >>Any suggestion will be welcome.
> >
> >
> > E.g.,
> >
> > #!/usr/local/bin/perl -w
> >
> > use strict;
> >
> > my $s = shift @ARGV or die "Please specify a search term!\n";
> >
> > my $prev = '<BEGINNING>';
> > while (<>) {
> > chomp;
> > if ($_ eq $s) {
> > print "OK\n";
> > exit 0;
> > } elsif ($_ le $s) {
> > $prev = $_;
> > } else {
> > print "$prev $_\n";
> > exit 0;
> > }
> > }
> > print "$prev <END>\n";
> >
> > /Thomas
>
> thank you for your reply so quickly.
> With your script, if i look for a word "z***" (at the end of my 70,000
> words list) so the script should parse all terms from a->y, right?
> Is there another method for quick search in this case?
What, a tenth of a second isn't fast enough for you?
Since your program is being started afresh each time, it is going
to have to re-read the list each time. You can't do a binary search
(or hash lookup) on the data unless you actually have the data.
A simple binary search will require the entire file to be slurped into
memory. On my system, just slurping the file into an array
(in preparation for a binary search, but without actually doing the
binary search) takes 66% more time the worst-case performance of the linear
search.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
Date: Sat, 01 Nov 2003 16:33:37 GMT
From: "Dave Oswald" <davido@pacifier.com>
Subject: Re: is there the simplest way to do this: logon to my email account and delete bulk emails?
Message-Id: <BfRob.18112$YO5.9136976@news3.news.adelphia.net>
"walala" <mizhael@yahoo.com> wrote:
> I got too many spam email every day...
>
> Is there such a utility/program, or can I do some programming in the
> simplest way, to do the following:
>
> 1) automatically logon to my mail.yahoo.com account with my account
username
> and password;
>
> 2) click on the "empty bulk email folder" link to empty the folder;
> 3) then log out the account;
>
> I only know a little programming on Windows, such as VC++, etc. Very
little
> about Perl. Let me know
> if I can write several lines to do the above task...
You've misunderstood the charter of this newsgroup.
The c.l.p.m Usenet newsgroup isn't here to provide scripts of various
descriptions to non-programmers. One of the frequent and acceptible
purposes of this group is to answer Perl-specific questions. You haven't
asked one. No, it's not a Perl-specific question to ask, "How do I, with no
programming experience, write a script that does XXX?"
I can, however, offer a few suggestions to get you started, keeping in mind
that learning enough Perl to reliably accomplish your task is no trivial
matter. If you're not committed to learning Perl, you needn't dabble
backstage while there's a play going on.
If you actually want to learn Perl, pick up a copy of the Llama book,
"Learning Perl." Also begin reading through the "plain old documentation"
(PODs) that came with your Perl installation. Then once you've begun
learning Perl, feel free to ask questions here related to Perl, after first
examining the FAQ's.
------------------------------
Date: Sat, 1 Nov 2003 14:19:32 -0500
From: "walala" <mizhael@yahoo.com>
Subject: Re: is there the simplest way to do this: logon to my email account and delete bulk emails?
Message-Id: <bo10vh$is4$1@mozo.cc.purdue.edu>
"Dave Oswald" <davido@pacifier.com> wrote in message
news:BfRob.18112$YO5.9136976@news3.news.adelphia.net...
> "walala" <mizhael@yahoo.com> wrote:
>
> > I got too many spam email every day...
> >
> > Is there such a utility/program, or can I do some programming in the
> > simplest way, to do the following:
> >
> > 1) automatically logon to my mail.yahoo.com account with my account
> username
> > and password;
> >
> > 2) click on the "empty bulk email folder" link to empty the folder;
> > 3) then log out the account;
> >
> > I only know a little programming on Windows, such as VC++, etc. Very
> little
> > about Perl. Let me know
> > if I can write several lines to do the above task...
>
> You've misunderstood the charter of this newsgroup.
>
> The c.l.p.m Usenet newsgroup isn't here to provide scripts of various
> descriptions to non-programmers. One of the frequent and acceptible
> purposes of this group is to answer Perl-specific questions. You haven't
> asked one. No, it's not a Perl-specific question to ask, "How do I, with
no
> programming experience, write a script that does XXX?"
>
> I can, however, offer a few suggestions to get you started, keeping in
mind
> that learning enough Perl to reliably accomplish your task is no trivial
> matter. If you're not committed to learning Perl, you needn't dabble
> backstage while there's a play going on.
>
> If you actually want to learn Perl, pick up a copy of the Llama book,
> "Learning Perl." Also begin reading through the "plain old documentation"
> (PODs) that came with your Perl installation. Then once you've begun
> learning Perl, feel free to ask questions here related to Perl, after
first
> examining the FAQ's.
>
>
I don't even have time to combat your opinion.
I just want to say don't learn any language because you want to learn it.
All languages are designed for applications.
One of the purpose of the BBS is that people discuss ideas, and let people
know that "oh, things can be done in this way conviniently and simply"...
Actually that's the purpose of Internet. I believe you have also learned a
lot from the web.
I have urgent need for this application, and I believe Perl can help me and
I am learning through applications. Though my major job is not to combating
bulk email, nor to learn Perl. Actually I work on some other areas.
Let other people appreciate the beauty of Perl, and the beauty of using Perl
to solve practical applications, and appreciate the beauty of helping each
other!
-Walala
------------------------------
Date: Sat, 1 Nov 2003 14:23:25 -0500
From: "walala" <mizhael@yahoo.com>
Subject: Re: is there the simplest way to do this: logon to my email account and delete bulk emails?
Message-Id: <bo116q$j1t$1@mozo.cc.purdue.edu>
"Yevgen Reznichenko" <yevgen.r@web.de> wrote in message
news:bo0i3t$16o8oj$3@ID-198732.news.uni-berlin.de...
> Hi,
>
> Am 01.11.2003 15:08 schrieb walala:
> > I got too many spam email every day...
>
> If you want delete SWEN's from your account you can take a look here:
> http://www.hashref.com/prj/swendeleter/
>
> You can modify the script to solve your problem.
>
> > Thanks,
> >
> > -Walala
>
>
> Yevgen
>
Dear Yevgen,
I've looked into the script and it was a great work. I think it partially
fulfill my need.
One thing is that it works on one kind of spam-email: SWEN. In order to
expand it to other spam emials, a filter needs to be designed and actually
collecting filter "key word" is troublesom work. (actually I am using
MailWasher currently and every day there are 100+ more spam emails with new
keywords than those already in my filter in MailWasher)...
Fortunately Yahoo mail account already has a "bulk-mail" folder, it just
does not empty the folder often. So I just want to delete all spam-emails in
that folder without any interaction, without any hesitance...
Do you have more suggestions?
Thanks a lot,
-Walalal
------------------------------
Date: Sat, 1 Nov 2003 18:29:28 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: is there the simplest way to do this: logon to my email account and delete bulk emails?
Message-Id: <slrnbq8jv8.21n.tadmc@magna.augustmail.com>
walala <mizhael@yahoo.com> wrote:
> One of the purpose of the BBS is that people discuss ideas,
This is not a BBS.
> I have urgent need for this application,
If you have a job opening to fill, then post it to a newsgroup
with "jobs" in its name.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 01 Nov 2003 22:39:36 +0100
From: Yevgen Reznichenko <yevgen.r@web.de>
Subject: Re: is there the simplest way to do this: logon to my email account and delete bulk emails?
Message-Id: <bo1984$158j0s$1@ID-198732.news.uni-berlin.de>
It is here wrong place for communication about spam. Further
communication please via pm.
Am 01.11.2003 20:23 schrieb walala:
> Fortunately Yahoo mail account already has a "bulk-mail" folder, it just
> does not empty the folder often. So I just want to delete all spam-emails in
> that folder without any interaction, without any hesitance...
>
> Do you have more suggestions?
Yes i have, but via pm.
> Thanks a lot,
>
> -Walalal
Yevgen
------------------------------
Date: Sat, 01 Nov 2003 16:46:52 -0500
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: is there the simplest way to do this: logon to my email account and delete bulk emails?
Message-Id: <iRVob.27602$RG1.1564666@wagner.videotron.net>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
walala wrote:
>
> Fortunately Yahoo mail account already has a "bulk-mail" folder, it just
> does not empty the folder often. So I just want to delete all spam-emails in
> that folder without any interaction, without any hesitance...
>
> Do you have more suggestions?
When you say "folders" I'm assuming you either mean folders accessible via the IMAP protocol, or
Yahoo's proprietary webmail interface.
If it's the first scenario, use Mail::IMAPClient or Net::IMAP or any other appropriate modules
listed in http://search.cpan.org/search?query=IMAP&mode=all
If it's the second scenario, use WWW::Mechanize to automate a GUI-less web browser that can simulate
anything you (a human) do with a GUI web browser.
Either cases will require you to do some reading and programming to end up with what you need, or
hire a programmer to do it for you.
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/pCnReS99pGMif6wRAsizAKDPkuVM6pfi99mBl0IKuQBarHT2kACeIF9f
N1j1aJpdbjP4jHCEQ5bJn5s=
=tlt/
-----END PGP SIGNATURE-----
------------------------------
Date: 01 Nov 2003 18:39:51 GMT
From: ctcgag@hotmail.com
Subject: Re: neuronal pattern / network
Message-Id: <20031101133951.496$dL@newsreader.com>
"Stefan Mohr" <sm-ml@mediascape.de> wrote:
> hello,
>
> does anybody of you have had the opportunity to program a neuronal
> pattern / network in perl? has anybody some hints for me where to find
> some info about that?
Your first stop for finding such info should be CPAN,
http://search.cpan.org.
http://search.cpan.org/~jbryan/AI-NeuralNet-BackProp-0.77/BackProp.pm
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
Date: Sat, 1 Nov 2003 20:43:03 +0100
From: "Stefan Mohr" <sm-ml@mediascape.de>
Subject: Re: neuronal pattern / network
Message-Id: <bo12c7$fjc$1@news1.transmedia.de>
hi,
i have seen that in the meantime - you know about somewhat newer?
thanks, stefan
<ctcgag@hotmail.com> schrieb im Newsbeitrag
news:20031101133951.496$dL@newsreader.com...
> "Stefan Mohr" <sm-ml@mediascape.de> wrote:
> > hello,
> >
> > does anybody of you have had the opportunity to program a neuronal
> > pattern / network in perl? has anybody some hints for me where to find
> > some info about that?
>
> Your first stop for finding such info should be CPAN,
> http://search.cpan.org.
>
> http://search.cpan.org/~jbryan/AI-NeuralNet-BackProp-0.77/BackProp.pm
>
> Xho
>
> --
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
Date: Sat, 1 Nov 2003 19:33:14 -0500
From: "Samurai Jesus" <wizdum.unspam@no-spam.hotmail.com>
Subject: Newbie to perl, need help
Message-Id: <bo1jcb$12fv$1@netnews.upenn.edu>
Hi. I was hoping that someone with more experience in perl could help me
out.
I'm trying to come up with a perl script that will reside on one of my
systems to change the names of directories on a NetApp Filer. I connect to
the filer using rsh.
I have to be able to change the names of directories on the filer.
Currently the directories have names that are totally useless, and I have to
change them to something useful, using the access time stamp as the name of
the directory. As it is, I know that the $atime component of
stat($filename) should give me the access time of the directory, and the
command to change the directory name is "snap rename <volume name>
<directory name> <new directory name>"
I'm hoping that someone can help point me in the correct direction.
Thanks in advance.
------------------------------
Date: Sat, 1 Nov 2003 23:22:30 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Rounding a float in Perl?
Message-Id: <bo1f7m$ivo$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Anno Siegel
<anno4000@lublin.zrz.tu-berlin.de>], who wrote in article <bntfci$gjv$3@mamenchi.zrz.TU-Berlin.DE>:
> > On my machine (EMX on 850MHz Athlon) your version takes 5.03 us per
> > iteration (when non-scaling). sprintf takes 0.15 us per iteration.
> > Apparently your CRT implementation is completely broken speedwise...
> > Enough said.
> If so, that appears to be the case on more than one machine. I'm
> getting consistent results (i.e. Perl rounding beats sprintf rounding)
> on several machines. I'm appending the benchmarks i used for reference.
My bad. My test had sprintf() constant-folded. After modifying it, I
get results similar to what you describe.
Which means: it makes sense to special-case several formats before
they are handled to
perl -V:d_Gconvert
Any takers?
Ilya
------------------------------
Date: Sat, 01 Nov 2003 18:57:45 +0100
From: Yevgen Reznichenko <yevgen.r@web.de>
Subject: Unable to acces "$?" environment variable
Message-Id: <bo0s75$16o9pj$1@ID-198732.news.uni-berlin.de>
Hello,
i want to use kdialog from my perl script. The return code of kdialog is
stored in the variable $?, but i an unable to access this:
my $result = $ENV{'\?'};
print "--> $result";
cause following warning:
Use of uninitialized value in concatenation (.) or string at
programs/mails_pop3.pl line 49, <FILE> line 1.
-->
if i print all available env variables, with:
foreach $key (sort(keys %ENV)) {
print "$key = $ENV{$key}\n";
}
so $? will not be listed. Do you know how i can get access to this variable?
Regards,
Yevgen
------------------------------
Date: Sat, 01 Nov 2003 12:08:07 -0600
From: Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com>
Subject: Re: Unable to acces "$?" environment variable
Message-Id: <874qxox8qg.fsf@limey.hpcc.uh.edu>
>> On Sat, 01 Nov 2003 18:57:45 +0100,
>> Yevgen Reznichenko <yevgen.r@web.de> said:
> Hello, i want to use kdialog from my perl script. The
> return code of kdialog is stored in the variable $?, but
> i an unable to access this:
> my $result = $ENV{'\?'}; print "--> $result";
$? is not an environment variable. It's a variable
maintained by various shells to record the exit behaviour
of sub-processes.
You want to fork into the command and then examine the
exit status of the child process.
perldoc -f system
shows you how.
hth
t
------------------------------
Date: Sat, 01 Nov 2003 18:09:20 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: Unable to acces "$?" environment variable
Message-Id: <kFSob.63304$1C5.30611@nwrdny02.gnilink.net>
Yevgen Reznichenko <yevgen.r@web.de> wrote:
> i want to use kdialog from my perl script. The return code of
> kdialog is stored in the variable $?, but i an unable to access
> this:
>
> my $result = $ENV{'\?'};
> print "--> $result";
It's not an environment variable.
print "--> $?";
Check "perlvar" and the docs for system() or backticks or whatever
you were using to invoke kdialog.
--
Steve
------------------------------
Date: Sat, 01 Nov 2003 19:24:10 +0100
From: Yevgen Reznichenko <yevgen.r@web.de>
Subject: Re: Unable to acces "$?" environment variable
Message-Id: <bo0too$15pff8$1@ID-198732.news.uni-berlin.de>
Am 01.11.2003 19:09 schrieb Steve Grazzini:
> It's not an environment variable.
>
> print "--> $?";
Many thanks, it works now fine.
Regards,
Yevgen
------------------------------
Date: Sat, 01 Nov 2003 13:52:54 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Unable to acces "$?" environment variable
Message-Id: <Xns9426975CEA4E1sdn.comcast@216.196.97.136>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Yevgen Reznichenko <yevgen.r@web.de> wrote in
news:bo0s75$16o9pj$1@ID-198732.news.uni-berlin.de:
> Hello,
>
> i want to use kdialog from my perl script. The return code of kdialog
> is stored in the variable $?, but i an unable to access this:
>
> my $result = $ENV{'\?'};
> print "--> $result";
Others have explained to you that $? is not an environment variable as
such, and therefore cannot be accessed via %ENV.
However: Why did you put a backslash before the question mark above?
That, combined with the single quotes, means you were trying to look up an
environment variable called \? -- two characters, a backslash and a
question mark.
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP6QPC2PeouIeTNHoEQL3gACcCZSz2P+W+g0Oz4iHMjo56goGCIYAoII+
9S+tLbopxhUHTOd7c8JwMzr8
=QwPV
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 01 Nov 2003 21:37:56 +0100
From: Yevgen Reznichenko <yevgen.r@web.de>
Subject: Re: Unable to acces "$?" environment variable
Message-Id: <bo15jm$16obeu$1@ID-198732.news.uni-berlin.de>
Am 01.11.2003 20:52 schrieb Eric J. Roode:
>> my $result = $ENV{'\?'};
>> print "--> $result";
[...]
> However: Why did you put a backslash before the question mark above?
It was an error, i was trying to escape "?" in the hope that it will
then works, but i doesn't and i forgot to delete them.
Regards,
Yevgen
------------------------------
Date: Sun, 02 Nov 2003 00:43:23 +0000
From: Bruce James <bruce@pomegranate.ltd.uk>
Subject: Re: UNIX domain sockets
Message-Id: <021120030043236968%bruce@pomegranate.ltd.uk>
Hi,
Just out of interest, is /sckt writable? IE do you have permission to
write to / ?
Perhaps /tmp/sckt would be a better location.
Good luck
Bruce
In article <3fa2ca69_2@127.0.0.1>, Jim Gibson
<jgibson@mail.arc.nasa.gov> wrote:
> Erik Anderson wrote:
> > I'm trying to implement IPC using IO::Socket::UNIX, but have come into
> > significant difficulty. I've searched groups.google.com, and have been
> > able to find very few examples of the proper use of IO::Socket::UNIX.
> >
> > I have written a very simple client and server system to test this. The
> > code is below. The client sends some data to the server, which should
> > display it...it's not working though. Any ideas?
>
> As Tim Heany pointed out, the main problem is that you are not sending
> any end-of-line characers from the client to the server, but the server
> is waiting for an EOL before proceeding. I have some additional comments:
>
> >
> > Client Code:
> > --------------------
> > #!/usr/bin/perl
>
> Always:
>
> use strict;
>
> >
> > use IO::Handle;
> > use IO::Socket;
> >
>
> > $socket = IO::Socket::UNIX->new( Peer => "/sckt",
> > Type => SOCK_STREAM,
> > Timeout => 10 ) or die "$!\n$@";
> >
>
> my $socket = ...
>
> > $socket->autoflush(1);
>
> Sockets are autoflush be default, but this line shouldn't hurt.
>
> >
> > $num=0;
>
> my $num = 0;
>
> > while(1) {
> > print $socket "$num";
> > $socket->flush();
> > $num++;
> > sleep(2);
> > }
>
> You are writing an infinite amount of data, but very slowly: 10
> characters total in the first 20 seconds. Is your client ever going to
> quit? Also, for consistency, use $socket->print():
>
> while( $num < 10 ) [
> $socket->print("Line $num\n");
> $socket->flush();
> $num++;
> sleep(2);
> }
>
> >
> > exit;
>
> No need to call exit as the last line in your program.
>
> > --------------------
> >
> > Server code:
> > --------------------
> > #!/usr/bin/perl
> >
> > use IO::Handle;
> > use IO::Socket;
> > unlink "/sckt";
> > my $Server = IO::Socket::UNIX->new( Local => "/sckt",
> > Type => SOCK_STREAM,
> > Listen => 5
> > ) or die $@;
>
> $@ contains the error for the last eval function call. You may want to
> check $! instead.
>
> > while($session = $Server->accept) {
> > chomp($line = <$session>);
>
> You are only reading one line from the client. You should put this in a
> while loop and read until <$session> returns undef.
>
> > print "From client: " . $line . "\n";
> > $Server->flush();
>
> There should be no need to flush the $Server socket. You are not writing
> to this socket, and flushing an input buffer should rarely be done. You
> may be dumping incoming data.
>
> >
> > sleep(1);
>
> You may want to call $session->close() here -- I am not sure if it will
> be closed automatically.
>
> > }
> >
> > exit;
> > --------------------
> >
> > Thanks!
> > -Erik Anderson
> >
>
> If you really need to read and write data without line endings, you
> should consider using syswrite and sysread instead of print and <>.
>
> I recommend getting and reading a copy of "Unix Network Programming,
> Vol. 1", by W. Richard Stevens.
>
------------------------------
Date: 01 Nov 2003 18:48:33 GMT
From: ctcgag@hotmail.com
Subject: Re: Uploading multiple files
Message-Id: <20031101134833.346$5v@newsreader.com>
"Melissa McGehee" <m-m@lcc.net> wrote:
> Hi there! Been a while...3 years... but I'm back!
>
> I have a script that uploads ONE user file. But I want to upload two.
> This seems like a simple question...but in the newsgroup messages
> downloaded, I cannot find anything that matches.
>
> Please advise what I can do to upload multiple files. I have a section
> commented out below that was SUPPOSED to allow the second file to
> upload...but never worked. ALL SUGGESTIONS WELCOMED!
>
> Many thanks! (and it's great to be back...)
I have a script that does that. I'll be glad to help you, but I'm not
going to wade through 140 lines of irrelevant code to do so. Please trim
your code to minimal necessary to show the problem. (Most likely, once
you do that the problem will be revealed, and you won't need our help
anymore.)
Thanks,
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
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.
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 5740
***************************************