[24165] in Perl-Users-Digest
Perl-Users Digest, Issue: 6357 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 2 21:06:02 2004
Date: Fri, 2 Apr 2004 18:05:06 -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 Fri, 2 Apr 2004 Volume: 10 Number: 6357
Today's topics:
best free Perl editor for Windows? <gp@nospm.hr>
Re: best free Perl editor for Windows? <postmaster@castleamber.com>
Re: best free Perl editor for Windows? <glex_nospam@qwest.invalid>
Re: best free Perl editor for Windows? <shofner@stribmail.com>
Re: free source for bbs <webmaster@infusedlight.net>
Re: free source for bbs <ittyspam@yahoo.com>
Re: free source for bbs <kkeller-usenet@wombat.san-francisco.ca.us>
Re: free source for bbs <uri.guttman@fmr.com>
Re: free source for bbs <kirk@strauser.com>
Re: How do I do when handling the data <jtc@shell.dimensional.com>
Re: Modifying elements of an array <noreply@gunnar.cc>
Re: Modifying elements of an array <ittyspam@yahoo.com>
Re: Perl and Internet Explorer <Joe.Smith@inwap.com>
Re: Perl and Internet Explorer <matthew.garrish@sympatico.ca>
Possible to open a Berkeley 4.2 db file with DB_File? <bigal187.invalid@adexec.com>
Re: Sad experience with redirecting to /dev/null <Joe.Smith@inwap.com>
Re: Sad experience with redirecting to /dev/null <mhunter@uclink.berkeley.edu>
Re: Sad experience with redirecting to /dev/null <tony_curtis32@_SPAMTRAP_yahoo.com>
Re: Sad experience with redirecting to /dev/null (Gary E. Ansok)
Re: Sad experience with redirecting to /dev/null <mhunter@uclink.berkeley.edu>
Re: Sad experience with redirecting to /dev/null <mhunter@uclink.berkeley.edu>
Re: Tough (for me) regex case <rob_perkins@hotmail.com>
Re: Tough (for me) regex case <@>
Re: Tough (for me) regex case <rob_perkins@hotmail.com>
Re: Why dosn't this work? <ittyspam@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 3 Apr 2004 01:15:19 +0200
From: "PHP2" <gp@nospm.hr>
Subject: best free Perl editor for Windows?
Message-Id: <c4ks4f$59h$1@ls219.htnet.hr>
what is best free Perl editor for Windows?
------------------------------
Date: Fri, 02 Apr 2004 17:19:29 -0600
From: John Bokma <postmaster@castleamber.com>
Subject: Re: best free Perl editor for Windows?
Message-Id: <406df501$0$24361$58c7af7e@news.kabelfoon.nl>
PHP2 wrote:
> what is best free Perl editor for Windows?
Textpad, is "free", ie, it doesnīt limit functions when you use it
without paying for it. But I recommend registering for it, itīs cheap.
(http://www.textpad.com/ ), It has syntaxhighlighting for Perl (you only
have to add a document class), and I love the tabbed editing (you can
switch with little tabs on top between windows).
Other editors, NEdit (bit clumsy to use on Windows), Emacs, vim.
And no, I am not recommending Notepad, since that program is a joke :-D.
--
John personal page: http://johnbokma.com/
Freelance Perl / Java developer available - http://castleamber.com/
------------------------------
Date: Fri, 02 Apr 2004 17:39:52 -0600
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: best free Perl editor for Windows?
Message-Id: <cRmbc.81$dd1.29569@news.uswest.net>
PHP2 wrote:
> what is best free Perl editor for Windows?
RTFFAQ
perldoc -q "Is there an IDE or Windows Perl Editor"
------------------------------
Date: Fri, 02 Apr 2004 18:33:08 -0600
From: Dave <shofner@stribmail.com>
Subject: Re: best free Perl editor for Windows?
Message-Id: <JCnbc.2183$P45.374@fe07.usenetserver.com>
<posted & mailed>
John Bokma wrote:
> PHP2 wrote:
>
>> what is best free Perl editor for Windows?
>
> Textpad, is "free", ie, it doesnīt limit functions when you use it
> without paying for it. But I recommend registering for it, itīs cheap.
> (http://www.textpad.com/ ), It has syntaxhighlighting for Perl (you only
> have to add a document class), and I love the tabbed editing (you can
> switch with little tabs on top between windows).
>
> Other editors, NEdit (bit clumsy to use on Windows), Emacs, vim.
>
> And no, I am not recommending Notepad, since that program is a joke :-D.
>
My favorite is Crimson Editor - It has syntax highlighting, tabbed editing,
ability to edit and save files on a remote site. Plus it is truly free.
------------------------------
Date: Fri, 2 Apr 2004 12:24:58 -0800
From: "Robin" <webmaster@infusedlight.net>
Subject: Re: free source for bbs
Message-Id: <c4kjb6$cpt$1@reader2.nmix.net>
"Kirk Strauser" <kirk@strauser.com> wrote in message
news:877jwyh1o5.fsf@strauser.com...
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
At 2004-04-01T20:55:02Z, "Robin" <webmaster@infusedlight.net> writes:
> My latest bbs script written in perl is at www.infusedlight.net/bbs -
> please feel free to email me if you need help installing it or if you'd
> like to make a comment. Also, a working example is at
> www.infusedlight.net/design/bbs/bbs.pl
I particularly like the exchanges on the board, such as:
username of this user: foo
date of post: 03/17/04
name: Foo
email: foo@bar.com
post: You may wish to validate your HTML before getting to back-slappin'
happy:
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.infusedlight.net%2Fdesign
%2Fbbs%2Fbbs.pl%3Faction%3Dview%26cat%3DDesign%26topic%3DDesign%2520talk%26u
ser%3Dsysop
----------------------------------------
username of this user: sysop
date of post: 03/22/04
name: sysop
email: webmaster@infusedlight.net
post: Hmmm....validate my html, it doesn't post html.
and:
username of this user: robin
date of post: 03/18/04
name: Robin
email: robin@csf.edu
post: Don't listin to me! I don't know anything about programming!
Especially not Perl! In fact, I know so little that I left the source
code
to this board freely available - the source code that shows how insecure
this site is - the source code that shows the location of the WORLD
READABLE
password file!!! I KNOW NOTHING!!!
Robin. I speak seriously: drop this project like a hot potato. You are not
ready for what you're trying to do. Install something pre-made like phpBB
and move along. Really.
I've actually fixed the security glitches now....it's really shitty to get
hacked, but it won't happen again.
-Robin
------------------------------
Date: Fri, 2 Apr 2004 15:52:45 -0500
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: free source for bbs
Message-Id: <20040402155000.E19862@dishwasher.cs.rpi.edu>
On Fri, 2 Apr 2004, Robin wrote:
> > username of this user: robin
> > date of post: 03/18/04
> > name: Robin
> > email: robin@csf.edu
> >
> > post: Don't listin to me! I don't know anything about programming!
> > Especially not Perl! In fact, I know so little that I left the
source
> > code
> > to this board freely available - the source code that shows how
insecure
> > this site is - the source code that shows the location of the WORLD
> READABLE
> > password file!!! I KNOW NOTHING!!!
>
> > Robin. I speak seriously: drop this project like a hot potato. You
are not
> > ready for what you're trying to do. Install something pre-made like
phpBB
> > and move along. Really.
>
> I've actually fixed the security glitches now....it's really shitty to get
> hacked, but it won't happen again.
> -Robin
>
"Hacked" implies that someone used a tool to crack or to guess your
password, or that they found a backdoor to not require a password. That
post implies that you not only left that password world readable, but gave
the location of the password within the source - which was also readily
available. Bit of a difference.
Paul Lalli
------------------------------
Date: Fri, 2 Apr 2004 13:35:40 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: free source for bbs
Message-Id: <cbmk4c.qhp.ln@goaway.wombat.san-francisco.ca.us>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
On 2004-04-02, Robin <webmaster@infusedlight.net> wrote:
>
> I've actually fixed the security glitches now....it's really shitty to get
> hacked, but it won't happen again.
You took down the script?
- --keith
- --
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFAbdyrhVcNCxZ5ID8RAjVDAJ9/oInSKmvzdSxX5xDRx+vxUbgdRwCfZzNa
V7LS32laroh5Jz9WJxM1bZA=
=KzH9
-----END PGP SIGNATURE-----
------------------------------
Date: 02 Apr 2004 10:27:11 -0500
From: Uri Guttman <uri.guttman@fmr.com>
Subject: Re: free source for bbs
Message-Id: <siscisgitn74.fsf@tripoli.fmr.com>
>>>>> "DKW" == David K Wall <dwall@fastmail.fm> writes:
DKW> Uri Guttman <uri@stemsystems.com> wrote:
>>>>>>> "TM" == Tad McClellan <tadmc@augustmail.com> writes:
>>
TM> I like the comment that Uri made once:
>>
TM> delimeter: noun, scale used to weigh and price cold cuts.
TM> also the unit of length for salamis.
>>
>> i had forgotten about that one. i need to publish a dictionary :)
DKW> The Daemon's Dictionary?
there is already:
The Computer Contradictionary : 2nd Edition by Stan Kelly-Bootle
which is a hoot from the entries i have seen. the author is famous for
his column 'son of the devil's advocate' at
http://www.sarcheck.com/skb/. it used to run in the one of the unix mags
before it went under. it is an amazing tour de force of intellectual
computer writing and a challenge to anyone get all of the references and
stuff.
uri
------------------------------
Date: Fri, 02 Apr 2004 23:20:07 GMT
From: Kirk Strauser <kirk@strauser.com>
Subject: Re: free source for bbs
Message-Id: <87hdw2f58d.fsf@strauser.com>
=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
At 2004-04-02T20:24:58Z, "Robin" <webmaster@infusedlight.net> writes:
> I've actually fixed the security glitches now....it's really shitty to get
> hacked, but it won't happen again.
I well bet $$$ that if your site ever gets any amount of traffic, then your
message board *will* be compromised again. It's incredibly negligent for
you to expose that to the Internet. And no, I'm not going to point out the
remaining security flaws, since the basic lack of design is not reparable.
=2D --=20
Kirk Strauser
The Strauser Group
Open. Solutions. Simple.
http://www.strausergroup.com/
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAbdjC5sRg+Y0CpvERAut2AJ96S1MdGtUIUdujZibn0v9cwHYNhACfZvGz
7RVoGc0MyYH82XXZYsyvHc4=3D
=3DuF0A
=2D----END PGP SIGNATURE-----
------------------------------
Date: 2 Apr 2004 12:46:47 -0700
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: How do I do when handling the data
Message-Id: <slrnc6rgp7.sc7.jtc@shell.dimensional.com>
In article <c4jj3m$p0a$1@mamenchi.zrz.TU-Berlin.DE>, Anno Siegel wrote:
> CatcherInTheRye <letnomanenterhere@yahoo.co.kr> wrote in comp.lang.perl.misc:
>> Hi, How are you.
>>
>> I am a complete perl beginner.
>> So, now I don't know how to handle efficiently the raw data to any data
>> structure.
...
>> 89 ;1;148;|89 ;2;316;|89 ;3;484;|45 ;1;142;|
>> +++++++++ *********
>> 89 ;2;316;|89 ;1;149;|89 ;3;484;|101;1;120;|
>> ********* +++++++++
>
> We can help you with code you have, but we are not in the business
> of writing programs to specification.
>
> Anno
I suspect you would be if an appropriate fee were offered :-)
--
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]
------------------------------
Date: Fri, 02 Apr 2004 21:10:54 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Modifying elements of an array
Message-Id: <c4kdvm$2gaom7$1@ID-184292.news.uni-berlin.de>
fenisol3 wrote:
> I assume the last element of my array has some junk characters
> attached to it. So, how do I zap away all the junk characters after
> the very last alphabet in my array? Thanks for helping out. Lets
> assume $headings[5] is the last element of my array, I was thinking
> something like this: "$headings1[5] =~ s/[a-zA-Z].*//;" but it
> doesn't work.
This is yet another ambigous post from you.
- What do you mean by "junk characters"?
- What might the element contain before the change?
Please study the posting guidelines for this group:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
Also please understand that it's good manners to follow-up your posts
when people are trying to help, or else they won't be inclined to do
so again.
*Guessing* what it is you want, this may be one way:
$array[-1] =~ s/[^A-Za-z]*$//;
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Fri, 2 Apr 2004 14:17:02 -0500
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Modifying elements of an array
Message-Id: <20040402141216.H19862@dishwasher.cs.rpi.edu>
On Fri, 2 Apr 2004, fenisol3 wrote:
> I assume the last element of my array has some junk characters attached to
> it.
What, exactly, makes you assume this? In Perl, an array element has only
what you put into it. There are no random characters attached, like you
might expect from dealing with character arrays in C/C++.
> So, how do I zap away all the junk characters after the very last
> alphabet in my array?
Huh?
> Thanks for helping out. Lets assume $headings[5] is
> the last element of my array, I was thinking something like this:
> "$headings1[5] =~ s/[a-zA-Z].*//;" but it doesn't work.
What exactly are you trying to do? If you're trying to remove all
elements after the 6th from an array, do this:
@array = @array[0..5];
or
splice (@array, 6);
If on the other hand, your sixth array element contains letters followed
by 'junk' you want to remove, you want to do this:
$array[5] =~ s/^([a-zA-Z]*).*/$1/;
Perhaps you should try to tell us again what you're trying to do, if I
didn't understand correctly...
Paul Lalli
------------------------------
Date: Fri, 02 Apr 2004 19:57:51 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Perl and Internet Explorer
Message-Id: <3Bjbc.61671$K91.149337@attbi_s02>
akaliel wrote:
> The only solution seems to be if you click Save and then manually
> change the extension from .pl to .ppt. Which isn't a problem for me,
> but the less computer savvy people around here can't handle it.
HTML: Download <A HREF="/cgi-bin/select-file.pl/1.ppt">Project 1</A>.
CGI: Check $ENV{PATH_INFO} if no $ENV{QUERY_STRING}.
-Joe
------------------------------
Date: Fri, 2 Apr 2004 17:17:45 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Perl and Internet Explorer
Message-Id: <9Elbc.21720$j57.1219296@news20.bellglobal.com>
"akaliel" <akaliel@streamflo.com> wrote in message
news:7123bc57.0404020925.2f5f99ab@posting.google.com...
> Hi everyone, I'm having a problem with cgi perl scripts. We have a
> perl based Intranet that contains mostly pdf documents. When a user
> wants to view a file they simply click on a link and a perl script
> figures out which file they want to view and streams it to their
> browser.
Any reason why you need to "stream" the files to the browser instead of
simply redirecting to the resource? Or is it just a case of that's the way
the script works?
Matt
------------------------------
Date: Fri, 2 Apr 2004 13:24:23 -0800
From: "187" <bigal187.invalid@adexec.com>
Subject: Possible to open a Berkeley 4.2 db file with DB_File?
Message-Id: <c4klm9$2h7qo2$1@ID-196529.news.uni-berlin.de>
Is it possible to open a Berkeley 4.2 db file with DB_File?
It doesn't not seem to want to open:
unless ($st = tie %db, "DB_File", 'somedbfile.db', O_RDONLY, 0640,
$DB_HASH) {
die "Cannot open file 'somedbfile.db': $!\n";
}
This code dies when I run it.
(And curiously $! seems to be empty:
Cannot open file 'somedbfile.db':
)
I did a db dump from the db file and heres the header:
VERSION=3
format=print
database=a_test_db
type=hash
h_nelem=3
db_pagesize=4096
Is there any way to read this version of a berk db file in Perl? Thanks.
(Google didn't give mcuh help either, I kept running into posts abotu
using berk 1.* .)
------------------------------
Date: Fri, 02 Apr 2004 20:05:19 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Sad experience with redirecting to /dev/null
Message-Id: <3Ijbc.62602$JO3.38139@attbi_s04>
Mike Hunter wrote:
> I just got through with a very painful debugging expierience:
>
> ...
> system("iperf -s -D >/dev/null");
> ...
> my $var = <STDIN>;
> print "major screwage!" unless defined $var;
>
> It prints "major screwage!"...*sigh*. If I take out the ">/dev/null", it
> works fine.
The system() and exec() functions are sensitive to shell metacharacters.
system("iperf -s -D >/dev/null");
is treated like
system("/bin/sh", "-c", "iperf -s -D >/dev/null");
but the one without ">" is treated like
system("iperf", "-s", "-D");
Try debugging it from the command line:
csh% sh -c 'iperf -s -D >/dev/null'
to see if behavior is different when /bin/sh is involved.
-Joe
------------------------------
Date: Fri, 2 Apr 2004 21:27:33 +0000 (UTC)
From: Mike Hunter <mhunter@uclink.berkeley.edu>
Subject: Re: Sad experience with redirecting to /dev/null
Message-Id: <slrnc6rmif.1a7.mhunter@celeste.net.berkeley.edu>
On Fri, 02 Apr 2004 12:25:36 -0600, Tony Curtis wrote:
> >> On Fri, 2 Apr 2004 18:17:22 +0000 (UTC),
> >> Mike Hunter <mhunter@uclink.berkeley.edu> said:
>
> > I just got through with a very painful debugging
> > expierience: ...
> > system("iperf -s -D >/dev/null");
> > ...
> > my $var = <STDIN>; print "major screwage!" unless defined $var;
>
> > It prints "major screwage!"...*sigh*. If I take out the
> > ">/dev/null", it works fine.
>
> > I'm using FreeBSD 5.2.1-release with perl 5.6.1.
>
> > Please choose:
>
> > A) This is expected unix behavior; go back to windows,
> > fungus!
>
> Correct (well, the first part anyway :-). You are redirecting
> all standard output from the command into a black hole. You
> are then reading from a stdin that is completely unrelated to
> the forked command.
I *want* to be reading STDIN from the perl script, not iperf. Iperf is a
daemon that I want to be launched, and I'd rather not see any of it's
startup output. system should execute the command and return to the perl
script with STDIN intact, but I'm accusing it of breaking my connection
to STDIN for some unexplained reason.
Mike
------------------------------
Date: Fri, 02 Apr 2004 15:33:08 -0600
From: Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com>
Subject: Re: Sad experience with redirecting to /dev/null
Message-Id: <87wu4y3w17.fsf@limey.hpcc.uh.edu>
>> On Fri, 2 Apr 2004 21:27:33 +0000 (UTC),
>> Mike Hunter <mhunter@uclink.berkeley.edu> said:
>> Correct (well, the first part anyway :-). You are
>> redirecting all standard output from the command into a
>> black hole. You are then reading from a stdin that is
>> completely unrelated to the forked command.
> I *want* to be reading STDIN from the perl script, not
> iperf. Iperf is a daemon that I want to be launched, and
> I'd rather not see any of it's startup output. system
> should execute the command and return to the perl script
> with STDIN intact, but I'm accusing it of breaking my
> connection to STDIN for some unexplained reason.
Ah, well that's a different elephant altogether isn't it?
Try tracing the binary with/without stdout redirected
(truss/strace or whatver it is on FreeBSD) and see if there's
a difference in stdout behaviour.
hth
t
------------------------------
Date: Fri, 2 Apr 2004 21:38:28 +0000 (UTC)
From: ansok@alumni.caltech.edu (Gary E. Ansok)
Subject: Re: Sad experience with redirecting to /dev/null
Message-Id: <c4kmgk$dlo$1@naig.caltech.edu>
In article <slrnc6rmif.1a7.mhunter@celeste.net.berkeley.edu>,
Mike Hunter <mhunter@uclink.berkeley.edu> wrote:
>> > I just got through with a very painful debugging
>> > expierience: ...
>> > system("iperf -s -D >/dev/null");
>> > ...
>> > my $var = <STDIN>; print "major screwage!" unless defined $var;
>>
>> > It prints "major screwage!"...*sigh*. If I take out the
>> > ">/dev/null", it works fine.
>
>I *want* to be reading STDIN from the perl script, not iperf. Iperf is a
>daemon that I want to be launched, and I'd rather not see any of it's
>startup output. system should execute the command and return to the perl
>script with STDIN intact, but I'm accusing it of breaking my connection
>to STDIN for some unexplained reason.
So redirect iperf's stdin as well, that way it shouldn't touch yours:
system("iperf -s -D </dev/null >/dev/null");
Gary Ansok
--
Rule #87: If the thought of something makes me giggle for longer than 15
seconds, I am to assume that I am not allowed to do it.
-- www.skippyslist.com
------------------------------
Date: Fri, 2 Apr 2004 22:42:17 +0000 (UTC)
From: Mike Hunter <mhunter@uclink.berkeley.edu>
Subject: Re: Sad experience with redirecting to /dev/null
Message-Id: <slrnc6rquj.1fj.mhunter@celeste.net.berkeley.edu>
On Fri, 2 Apr 2004 21:38:28 +0000 (UTC), Gary E. Ansok wrote:
> In article <slrnc6rmif.1a7.mhunter@celeste.net.berkeley.edu>,
> Mike Hunter <mhunter@uclink.berkeley.edu> wrote:
> >> > I just got through with a very painful debugging
> >> > expierience: ...
> >> > system("iperf -s -D >/dev/null");
> >> > ...
> >> > my $var = <STDIN>; print "major screwage!" unless defined $var;
> >>
> >> > It prints "major screwage!"...*sigh*. If I take out the
> >> > ">/dev/null", it works fine.
> >
> >I *want* to be reading STDIN from the perl script, not iperf. Iperf is a
> >daemon that I want to be launched, and I'd rather not see any of it's
> >startup output. system should execute the command and return to the perl
> >script with STDIN intact, but I'm accusing it of breaking my connection
> >to STDIN for some unexplained reason.
>
> So redirect iperf's stdin as well, that way it shouldn't touch yours:
>
> system("iperf -s -D </dev/null >/dev/null");
Good advice. But:
1. I shouldn't need to do that...right? A command run from system if fork'd
off and should have its own file handles.
2. Doing this provided the same results:
"/usr/local/bin/iperf -s </dev/null >/dev/null &"
I didn't use -D, but -D seems to be causing me other problems (the remote
clients hang).
I am pretty convinced this is a iperf problem, but I still question what iperf
could be doing that would be allowed to screw with my <STDIN>....
Thanks.
Mike
------------------------------
Date: Fri, 2 Apr 2004 23:00:30 +0000 (UTC)
From: Mike Hunter <mhunter@uclink.berkeley.edu>
Subject: Re: Sad experience with redirecting to /dev/null
Message-Id: <slrnc6rs0p.1fj.mhunter@celeste.net.berkeley.edu>
On Fri, 02 Apr 2004 15:33:08 -0600, Tony Curtis wrote:
> >> On Fri, 2 Apr 2004 21:27:33 +0000 (UTC),
> >> Mike Hunter <mhunter@uclink.berkeley.edu> said:
>
> >> Correct (well, the first part anyway :-). You are
> >> redirecting all standard output from the command into a
> >> black hole. You are then reading from a stdin that is
> >> completely unrelated to the forked command.
>
> > I *want* to be reading STDIN from the perl script, not
> > iperf. Iperf is a daemon that I want to be launched, and
> > I'd rather not see any of it's startup output. system
> > should execute the command and return to the perl script
> > with STDIN intact, but I'm accusing it of breaking my
> > connection to STDIN for some unexplained reason.
>
>
> Ah, well that's a different elephant altogether isn't it?
>
> Try tracing the binary with/without stdout redirected
> (truss/strace or whatver it is on FreeBSD) and see if there's
> a difference in stdout behaviour.
Thanks...unfortunately I find myself not sufficently cool to follow ktrace
through iperf's fork...:(
Mike
------------------------------
Date: Fri, 02 Apr 2004 19:30:38 GMT
From: Rob Perkins <rob_perkins@hotmail.com>
Subject: Re: Tough (for me) regex case
Message-Id: <qpfr60doc82klhs014dtrgml3h17lthp65@4ax.com>
Rob Perkins <rob_perkins@hotmail.com> wrote:
>and
>replace them with calls into a hashtable which uses the English string
>as the source data for
should have been
and replace them with calls into a hashtable which uses the English
string as the source data for the hash function.
Rob
------------------------------
Date: Fri, 2 Apr 2004 16:05:51 -0500
From: "Brian Davis" <@>
Subject: Re: Tough (for me) regex case
Message-Id: <#rxSyWPGEHA.628@TK2MSFTNGP10.phx.gbl>
Does my earlier suggestion about using a named group not work?
The problem with using look-ahead/behind is that since the quotes do not
actually get consumed by the match, they remain available for the next
match. This is why " brown" appears to be a match when it is not. You must
consume the quotes with the match so they will not be re-used. Grouping
constructs can then be used to extract only the part of the match you need.
Brian Davis
http://www.knowdotnet.com
"Rob Perkins" <rob_perkins@hotmail.com> wrote in message
news:qpfr60doc82klhs014dtrgml3h17lthp65@4ax.com...
> Rob Perkins <rob_perkins@hotmail.com> wrote:
>
> >and
> >replace them with calls into a hashtable which uses the English string
> >as the source data for
>
> should have been
>
> and replace them with calls into a hashtable which uses the English
> string as the source data for the hash function.
>
> Rob
>
------------------------------
Date: Fri, 02 Apr 2004 21:32:41 GMT
From: Rob Perkins <rob_perkins@hotmail.com>
Subject: Re: Tough (for me) regex case
Message-Id: <4nmr60h82vnto36j69knmmtnspjd1fia85@4ax.com>
"Brian Davis" <@> wrote:
>
>Does my earlier suggestion about using a named group not work?
It looked like it would work, though I can't claim a lot of expertise.
I made use of
(?<!")"(?!")(.*?)(?<!")"(?!")
(offered by Steven Kuo on comp.lang.perl.misc)
...which works nicely, and then just used
Microsoft.VisualBasic.Mid(s,2,Microsoft.VisualBasic.Len(s)-2) to strip
the first and last characters, which with that regex are always
doublequotes.
Might be slow 'n' ugly, but I'm not releasing this code.
I would have tried your named group suggestion, but I had to move on
to manipulating resx files so the compiler doesn't barf on 'em, and it
came in later than the other suggestion.
Thank you, though!
Rob
------------------------------
Date: Fri, 2 Apr 2004 14:10:47 -0500
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Why dosn't this work?
Message-Id: <20040402140151.N19862@dishwasher.cs.rpi.edu>
On Fri, 2 Apr 2004, Joe wrote:
> Paul Lalli wrote:
> > On Fri, 2 Apr 2004, Joe wrote:
> >
> >>I will add the functions that access these functions. I realy don't
> >>think that that is the problem. $space is global for the package. My
> >>problem is that $space->{tile} dosn't cary from one function to another
> >>in the package. $space->{char} carries over. $space->{tile} gets
> >>filled but dosn't cary over to the fchsym function.
> >>
> >>There are the commands that access the functions:
> >>
> >> $board[$lp1][$lp2] = Space::new($map1[$lp1][$lp2]);
> >>
> >> $chr = $maze->{level}->[$lp1][$lp2]->fchsym();
> >
> >
> > My god. LISTEN TO WHAT WE'RE SAYING. Post a SHORT BUT COMPLETE program.
> > This is not difficult. Don't tell us "I really don't think that's the
> > problem". If you *knew* the problem, you wouldn't be asking for help in
> > the first place. We're telling you what you need to do to let us help
> > you. If you're unwilling to do that, then you will not be helped. It's
> > as simple as that.
> >
> > The point that $space is global to the package is likely the root cause of
> > your issue. Without seeing what's happening in the rest of your code, we
> > have no way of knowing what's happening to that global variable in between
> > method calls. POST THE WHOLE PROGRAM.
> >
> > Paul Lalli
>
> I am looking through the rest of my program. I had a simmilar problem
> with C++ simply because because I left of a & not maing an object a
> refrence. I don't know why I assign a variable in one function and it
> goes away in another. I would rather write this in C++ but I don't know
> how to write GUI in C++ and I can't book to show me how. I have borland
> but don't know how to use it. If you want it here is my whole program.
>
Do you seriously not understand the meaning of the words "short but
complete"? Frankly, no one here cares that you'd rather write in C++,
btw. In any case, now that you finally showed us what's happening, it
didn't take too long to figure out that the problem you were seeing was
(as we all expected) unrelated to the code you kept posting.
Add this line to your Space::new method:
print "No arguments!\n" unless $_[0];
You'll see when you start your program that that line prints a number of
times. And why? Because perl's better at counting than you are. In
Map::new, for some reason you've set $sizex = 17 and $sizey = 27.
You then loop from 0..$sizex and 0..sizey. In other words, you call the
Space::new constructor 18 x 28 times. Unfortunately, the grid is 19 x 26
positions long. At the end of each row, you're calling Space::new two
extra times, with no parameter (you're also then ignoring the bottom row,
but that's a separate issue). Because $Space::space is a package global,
it's reassigned in each call to the Space::new. When the last call is
done, $space->tile is the null string, because you assigned it to $_[0],
which was undef because of the faulty constructor calls. So of course
when you print it out later, it shows you that it's undef.
Replace this code in Map::new() -
for $lp1 (0 .. $sizex){
for $lp2 (0 .. $sizey){
$board[$lp1][$lp2] = Space::new($map1[$lp1][$lp2]);
}
}
with this -
foreach $lp1 (0..$#map1) {
foreach $lp2 (0..$#{$map1[$lp1]}) {
$board[$lp1][$lp2] = Space::new($map1[$lp1][$lp2]);
}
}
That will ensure you call Space::new exactly as many times as you're
supposed to.
Finally, I STRONGLY suggest you go read all the various tutorials about
object oriented Perl, not to mention the concept of lexical variables.
Paul Lalli
------------------------------
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 6357
***************************************