[16243] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3655 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 13 18:05:48 2000

Date: Thu, 13 Jul 2000 15:05:30 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963525929-v9-i3655@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 13 Jul 2000     Volume: 9 Number: 3655

Today's topics:
        "perl by examples" <pepe@pepe.asi.pwr.wroc.pl>
    Re: "Perl by examples" (Tad McClellan)
    Re: "perl by examples" <care227@attglobal.net>
    Re: *** Shared access to global variables !!! *** (Clinton A. Pierce)
    Re: Activestate PPM not working for Windows? <archulee@pebio.com>
    Re: As The Perl Turns [Was Re: ATTENTION PERL     MACHO <elaine@chaos.wustl.edu>
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! (Craig Berry)
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! (David H. Adler)
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! <elaine@chaos.wustl.edu>
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! (Craig Berry)
        Beginer with question on simple perl/cgi form <fattahipourNOfaSPAM@usa.net.invalid>
    Re: Beginer with question on simple perl/cgi form (Mads Orbesen Troest)
    Re: Beginer with question on simple perl/cgi form <care227@attglobal.net>
    Re: Beginer with question on simple perl/cgi form <care227@attglobal.net>
    Re: Beginner Question <nospam@nospam.com>
    Re: Beginner Question <bart.lateur@skynet.be>
    Re: Beyond perl? Need advice... <phil.rennert@ioip.com>
    Re: Bizarre BEGIN block problem (Tad McClellan)
        cgi and back button? <james@kcnet.com>
    Re: cgi and back button? (Clinton A. Pierce)
    Re: Check Processes In An Unix Environment (Clinton A. Pierce)
        convert perl code to c++ <playa786NOplSPAM@excite.com.invalid>
    Re: convert perl code to c++ (Craig Berry)
    Re: convert perl code to c++ <bcaligari@shipreg.com>
    Re: Creating an ordered HoH <mjcarman@home.com>
    Re: Delayed HTML Output in PERL richardstands@my-deja.com
    Re: detecting promiscuous mode (Clinton A. Pierce)
    Re: Does file locking in perl on rh6.2 linux just not w <fwslsm@cnsp.must.fight.spam.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 13 Jul 2000 20:20:46 +0200
From: =?X-UNKNOWN?Q?Adam_Sk=F3ra?= <pepe@pepe.asi.pwr.wroc.pl>
Subject: "perl by examples"
Message-Id: <Pine.BSF.4.21.0007132015250.597-100000@pepe.asi.pwr.wroc.pl>

pleas send this book to: ventuno@gmx.de



------------------------------

Date: Thu, 13 Jul 2000 13:10:52 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: "Perl by examples"
Message-Id: <slrn8mru0s.bar.tadmc@magna.metronet.com>

On Thu, 13 Jul 2000 19:19:26 +0200, =?X-UNKNOWN?Q?Adam_Sk=F3ra?= <pepe@pepe.asi.pwr.wroc.pl> wrote:

>Could anyone send me book: "perl by examples" in HTML ?


That sounds like theft to me.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 13 Jul 2000 14:28:52 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: "perl by examples"
Message-Id: <396E0A64.4CF8305A@attglobal.net>

Adam Skóra wrote:
> 
> pleas send this book to: ventuno@gmx.de


Excuse me?


------------------------------

Date: Thu, 13 Jul 2000 21:22:04 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: *** Shared access to global variables !!! ***
Message-Id: <0qqb5.35526$fR2.325812@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <8kir4k$c5p$1@pacifica.access.ch>,
	"Werner Hofer" <whofer@access.ch> writes:
> Hi
> how can i access from 2 Perl Scripts  to shared global variables ????
> Is it possible ?  ( i need it, when i will show n entries from a web
> database,
> the use click NEXT and now i have to show the next n entries ...and so on )

The answer to your question is in "perldoc perlipc" (SysV IPC).  

However, you're probably going about solving your problem the wrong way.
You need to learn about how state is handled in CGI programs, but 
a Perl newsgroup is not the place for that discussion.

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


------------------------------

Date: Thu, 13 Jul 2000 16:01:42 -0600
From: Eric Archuleta <archulee@pebio.com>
Subject: Re: Activestate PPM not working for Windows?
Message-Id: <396E3C46.E95801D9@pebio.com>

You may be able to download a ppd file for that module and run ppm locally.
Here is a link to some zipped up module ppd's

http://www.ActiveState.com/ppmpackages/5.005/zips

I had NO luck trying to build any modules myself. Also the latest version
of Perl from ActiveSate is a bit flakey. You may want to use an older
version. That is what I had to do after a week of struggleing with the new
version.

Good Luck
Eric

Jerry Leventer wrote:

> I have also had problems with the ActiveState PPM on Windows NT4 & 95.
> I tried,
>
>        ppm> search Net::SMTP
>   and, ppm> install Net::SMTP
>
> but, module could not be found (no error msg just blank line with
> prompt).  Looks like I'll have to download the Net:SMTP module from
> ActiveState & use makefiles to build it.
>
> In article <3964EE89.ADAE143F@in.tum.de>,
>   Gerhard Popp <popp@in.tum.de> wrote:
> > Hello,
> >
> > I downloaded a up to date version of perl from www.activate.com.
> > Furtermore I downloaded some Modules, e.g DBI.zip, Win32-ODBC.zip,...
> > After I had extracted the zip-files, I wanted to install the
> ppd-modules.
> >
> > Now my problem:
> > How could I install this module packages with my Perl Packet Manager
> > unter WinNT bzw. Win2000?
> > If I start the ppm with e.g.
> >
> >     ppm install Win32-ODBC.ppd
> >     (Win32-ODBC is in the current directory)
> >
> > I got the following error-message:
> >
> >     Error installing package 'Win32-ODBC.ppd': Could not locate a PPM
> >     binary of Win32-ODBC.ppd for this platform.
> >
> > I know, there are several binary for different platforms, but
> Win32-ODBC
> > doesn't work under NT4.0 or Win2000 too.
> >
> > Knows anybody a solution for this problem or a server, where I could
> get
> > a other perl-distribution, which is complete or easier to install?
> >
> > Greetings,
> >     Gerhard
> >
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



------------------------------

Date: Thu, 13 Jul 2000 20:17:48 GMT
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: As The Perl Turns [Was Re: ATTENTION PERL     MACHOES!!!!!!!!!!!!!!!!!!!]
Message-Id: <396E23EC.B59EB61A@chaos.wustl.edu>

"Godzilla!" wrote:
> Although well recognized and well understood symbology by a handful
> of us academics, these people remind me of a mythical snake little
> known by commoners, a philosophical snake serving as an appropriate
> icon of humanity; a snake consuming its own tail.

Probably a bit more common these days with Scully having a Ouroboros
tattoo as well as the whole Python crowd :)

History repeating itself for all eternity. Indeed.

e.


------------------------------

Date: Thu, 13 Jul 2000 18:10:17 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <sms1g96qnd673@corp.supernews.com>

Bart Lateur (bart.lateur@skynet.be) wrote:
: p3rlc0dr@my-deja.com wrote:
: 
: >And never forget: MATT RULER!
: 
: Maybe if you use it for some spanking.

I was actually trying to picture a Matt Ruler.  I came up with a piece of
wood labeled as inches but actually marked in centimeters, though not
quite *exactly* centimeters, and with the '7' and '9' labels swapped.  Oh,
and it's poorly finished, so you tend to get splinters from it.  People
would try to use it on carpentry projects, then complain bitterly when
readers of the carpentry newsgroups wouldn't help them recover from the
resulting construction disasters.

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Beauty and strength, leaping laughter and delicious
   |   languor, force and fire, are of us." - Liber AL II:20


------------------------------

Date: 13 Jul 2000 18:31:02 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <slrn8ms2n6.3j9.dha@panix2.panix.com>

On 12 Jul 2000 13:33:55 GMT, Young H Lee <yhlee@mail.med.upenn.edu> wrote:
>But her post is not entirely false.. I mean, I am not stupid but when it 
>comes to programming, it is like trying to learn math (i'm bad at math 
>too).  I have difficulty even understanding the perldocs and it gets 
>really old when you ask someone a question and they say "look at perldoc 
>this or that."

(Note: I'm not directing this comment at you, per se, but making a
general observation)

Unfortunately, many, if not most, people who have this difficulty
appear to show up and not point that out.  They merely ask the same
question that is answered in the docs instead of saying "I've read the
docs and don't understand [insert specific point of misunderstanding
here]".

People are usually happy to help with specific problems, but not with
reading the documentation to people or writing other people's programs
for them, which often appears to be what they're asking for.  In fact,
there have been many cases where it was quite clear that that *is*
what they're asking for and, as a result, many people's patience has
worn thin.

Hopefully this distinction will help people in getting reasonable
assistance.

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"I'll keep him as an insurance policy, since, unfortunately, I can't
kill him twice." - Scaroth


------------------------------

Date: Thu, 13 Jul 2000 20:27:08 GMT
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <396E261C.D9DA801B@chaos.wustl.edu>

Craig Berry wrote:

> would try to use it on carpentry projects, then complain bitterly when
> readers of the carpentry newsgroups wouldn't help them recover from the
> resulting construction disasters.

Yes, because absolutely noone here in clpm has ever been a victim of
their own poor judgement. Nope, noneayousguys were ever beginners and
never asked stupid questions.

When all you can do is bitch about someone else and their shortcomings
you had best be flawless and superior in every way.

Everyone gripes about Matt Wright yet I see noone making a replacement
collection publicly available on the net anywhere. With all the energy
spent bitching one could only imagine some of the stuff that might have
been made with that energy instead.

e.


------------------------------

Date: Thu, 13 Jul 2000 21:11:53 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <smsc4ppqnd615@corp.supernews.com>

Elaine -HFB- Ashton (elaine@chaos.wustl.edu) wrote:
: Craig Berry wrote:
: > would try to use it on carpentry projects, then complain bitterly when
: > readers of the carpentry newsgroups wouldn't help them recover from the
: > resulting construction disasters.
: 
: Yes, because absolutely noone here in clpm has ever been a victim of
: their own poor judgement. Nope, noneayousguys were ever beginners and
: never asked stupid questions.

Hey, I object.  The most typical pattern of correspondence I see is:

Newbie: "I'm using Matt's script X, and everything is going wrong.  What
         should I do???"
Oldbie: "Matt's scripts are evil.  Use something else."
Newbie: "But I like Matt's scripts!  You're not being helpful at all!"

What can you do in this situation?

: When all you can do is bitch about someone else and their shortcomings
: you had best be flawless and superior in every way.

Quite true.  I, on the other hand, bitch about people who get showered
with good advice and refuse to listen, but rather continue whining for
advice. 

: Everyone gripes about Matt Wright yet I see noone making a replacement
: collection publicly available on the net anywhere. With all the energy
: spent bitching one could only imagine some of the stuff that might have
: been made with that energy instead.

So do it, please!

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Beauty and strength, leaping laughter and delicious
   |   languor, force and fire, are of us." - Liber AL II:20


------------------------------

Date: Thu, 13 Jul 2000 11:17:49 -0700
From: blue_haulic <fattahipourNOfaSPAM@usa.net.invalid>
Subject: Beginer with question on simple perl/cgi form
Message-Id: <062fbe57.38f89055@usw-ex0109-068.remarq.com>

I have a perl/cgi form that inputs as one of its values the
user's email address and area code.  The problem is that I'm
trying to route the form's contents depending on what area
code is inputed.  That is, if the area code is 619, I need
it to go to john@anywhere.com.  If the area code is 858, I
need it to go to amy@mars.net.  And so on...  I'm really
stumped on how to do this.  I've tried a bunch of different
things but they just aren't getting me anywhere.  Any help
would be greatly appreciated.  Thanks.


* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


------------------------------

Date: Thu, 13 Jul 2000 19:29:21 GMT
From: mads@troest.NEVERMORE.dk (Mads Orbesen Troest)
Subject: Re: Beginer with question on simple perl/cgi form
Message-Id: <k6fk2tedC4v7-pn2-j3UW7PZfqWY6@mads.lokal.net>

On Thu, 13 Jul 2000 18:17:49, blue_haulic 
<fattahipourNOfaSPAM@usa.net.invalid> wrote:

> I have a perl/cgi form that inputs as one of its values the
> user's email address and area code.  The problem is that I'm
> trying to route the form's contents depending on what area
> code is inputed.

OK, I'm not sure whether your problem is the actual matching of area 
code to email address, or whether it's getting the form sent. For the 
former, a hash seems a perfect solution:

%hDestinations =3D (
 619 =3D> 'john@anywhere.com',
 858 =3D> 'amy@mars.net',
 # ... etc
);

$AreaCode =3D 858; # Whatever user filled in
$Destination =3D $hDestinations{$AreaCode} || 'Nowhere at all!';
print "Seems I should mail this form to: $Destination\n";

BUT, if it's the form's mailto-destination you want to alter, you 
should (well, could, more efficiently) really be doing this in 
JavaScript (almost the exact same structure; JavaScript also has 
associatetive arrays); if you don't, you will have to let your script 
send the mail rather than the form sending it directly.

Hope this was of any help to you at all. :-)

      ... /\/\\ads Orbesen Troest <mads@troest.NEVERMORE.dk>

(Please remove NEVERMORE from address when replying via email...)


------------------------------

Date: Thu, 13 Jul 2000 15:30:42 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Beginer with question on simple perl/cgi form
Message-Id: <396E18E2.DB15DB6E@attglobal.net>

blue_haulic wrote:
> 
> I have a perl/cgi form that inputs as one of its values the
> user's email address and area code.  The problem is that I'm
> trying to route the form's contents depending on what area
> code is inputed.  That is, if the area code is 619, I need
> it to go to john@anywhere.com.  If the area code is 858, I
> need it to go to amy@mars.net.  And so on...  I'm really
> stumped on how to do this.  I've tried a bunch of different
> things but they just aren't getting me anywhere.  Any help
> would be greatly appreciated.  Thanks.

Use a hash. ( perldata documentation)

my %route = (
		619 => 'john@anywhere.com',
		858 => 'amy@mars.net',
		.
		.
		.
);

Then you can extract the info rather easily, maybe using something 
like: 

foreach $key (keys %route) {
    if ($key eq $areacode)
    {
        $email = $route{$key};
    }
}


------------------------------

Date: Thu, 13 Jul 2000 15:33:27 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Beginer with question on simple perl/cgi form
Message-Id: <396E1987.C4B3A054@attglobal.net>

Drew Simonis wrote:
> 

Mads' way is better than the foreach I suggested.  

Mads => $AreaCode = 858; # Whatever user filled in
Mads => $Destination = $hDestinations{$AreaCode} || 'Nowhere at all!';
Mads => print "Seems I should mail this form to: $Destination\n";


------------------------------

Date: 13 Jul 2000 19:27:34 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Beginner Question
Message-Id: <8kl576$5j8$1@216.155.33.87>

In article <ekcrmscoc7cerk6vo51p8oeqp15ksf33vr@4ax.com>, Bart Lateur 
<bart.lateur@skynet.be> wrote:

 | The WebDragon wrote:
 | 
 | >The data structure of complex HOHOHOL's is quite pretty (IMHO) :
 | >
 | >my %complextable = (
 | >    'key1' => {
 | >        'subkeyA' => [ 'value1a', 'value2a', 'value3a', 'value4a' ],
 | >        'subkeyB' => [ 'value1b', 'value2b', 'value3b', 'value4b' ],
 | >        'subkeyC' => [ 'value1c', 'value2c', 'value3c', 'value4c' ]
 | >    },
 | ...
 | >);
 | 
 | That rather looks like a HoHoL to me, not a HoHoHoL.

oh? I read it as 

%complextable = ( #hash of a
    'key1' => { #hash of a
        'subkeyA' => #hash of a
                     [ ] #list

i.e. HoHoHoL :)

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


------------------------------

Date: Thu, 13 Jul 2000 22:58:52 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Beginner Question
Message-Id: <76bsms0rgeg5g9ihr6jksvc8hfg66n33eb@4ax.com>

The WebDragon wrote:

>oh? I read it as 
>
>%complextable = ( #hash of a
>    'key1' => { #hash of a
>        'subkeyA' => #hash of a
>                     [ ] #list
>
>i.e. HoHoHoL :)

Yet, there are only 2 levels of keys.

	$complextable{key1}{subkeyA}[0];

Note that your third "hash of a" comes between a key and it's value,
which isn't a hash. It's like saying:

	%hash = ( # hash of a 
	   'key' => # hash of a 
	     'value'  # scalar
	)

which looks like this wouldbe a hash of hashes of scalars. Yet, it's
just a simple hash. So the comments go wrong, somewhere.

-- 
	Bart.


------------------------------

Date: Thu, 13 Jul 2000 16:03:44 -0400
From: Philip Rennert <phil.rennert@ioip.com>
Subject: Re: Beyond perl? Need advice...
Message-Id: <396E20A0.18617E70@ioip.com>

> Well the results from the C program look right, but I think something
> isn't right with the perl. Here's my results on a Sun S20 which is a bit
> slower than that HP.  Perl 5.005_03 and gcc 2.29.2.
>
> /usr/bin/time ./csort
>
> real       37.5
> user       35.2
> sys         0.0
>
> /usr/bin/time ./perlsort.pl
>
> real    19:03.1
> user    18:39.5
> sys         0.0

Yeah, I ran your code on a Pentium III/500 with Linux, and got 6 seconds for
C,
320 for Perl.  That's an amazing difference, and reason enough to translate
everything
if it shows up with my code; I'll test & see.  Anyone know why it's that
different?



------------------------------

Date: Thu, 13 Jul 2000 13:24:03 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Bizarre BEGIN block problem
Message-Id: <slrn8mrupj.bc5.tadmc@magna.metronet.com>

On Thu, 13 Jul 2000 17:53:05 GMT, Ed Foy <ed@nospam.com> wrote:
>
>Tad McClellan wrote in message ...

>>You cannot be reached by email.
>>
>>I have a hard and fast rule about such situations.
>>
>>I gotta give you your own personal killfile entry.
>
>I also have a hard and fast rule: never put private email addresses in
>newsgroups. This policy keeps the SPAM to a low roar so I spend much
>less time wading through junk mail and updating TWIT filters. It's
>called an ounce of prevention.


OK.

I retract the "wait" part of what I said then. You've been "upgraded"  :-)


>>I (and probably everybody else) have no interest in potential bugs
>>in two year old software.
>>
>>Sticking with 5.004 is volunteering for support problems.
>
>That is what my ISP provides. 


Ask _them_ about the bug then.

They have volunteered for support problems, so they'll be expecting you.


>Does this comment mean SGML Consulting will only work with the "Latest
>and Greatest" implementation of something or reinvents the wheel because
>the original wheel doesn't use the latest set of bugs?


Ad hominem attack.

I'm not feeling sorry anymore.

*plonk*


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 13 Jul 2000 14:24:58 -0500
From: "James Nelson" <james@kcnet.com>
Subject: cgi and back button?
Message-Id: <8kl527$j2k$1@news3.kcnet.com>

Is there a quick or easy way to configure a perl script to trigger the back
button on your browser?

I have a script that you can search on a query then update some the records,
the problems after the submit it returns to a default view which is a
brosable view of all records, I want it to return to the current query
search.

Please help :)




------------------------------

Date: Thu, 13 Jul 2000 20:58:19 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: cgi and back button?
Message-Id: <L3qb5.35487$fR2.325812@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <8kl527$j2k$1@news3.kcnet.com>,
	"James Nelson" <james@kcnet.com> writes:
> Is there a quick or easy way to configure a perl script to trigger the back
> button on your browser?

In Perl, no.

It's possible to do this indirectly in Javascript (retrieve the last page
from the proper place in the DOM, and then use another method to go back
to that page) but this is not the place to discuss that.

Followups redirected to comp.lang.javascript

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


------------------------------

Date: Thu, 13 Jul 2000 21:16:33 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Check Processes In An Unix Environment
Message-Id: <Rkqb5.35523$fR2.325812@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <M0db5.7$wv3.323@nreader1.kpnqwest.net>,
	"Christoph Schmutz" <christoph.schmutz@fw.oebb.at> writes:
> hi out there
> 
> please help me to find a way to check and/or control processes running in
> (digital) unix.
> maybe there is a special one to check the services of an oracle database.

"check and/or control".  Wow.  Can you be any more vague?

Try asking this question with a little more meat in it.  What exactly 
are you trying to do?  Stop a process?  Kill it?  See if it's running?
Do you have the pid?  Do you need to find the pid?  Do these processes
have special control mechanisms (SIGHUP and such)?  What does the 
documentation say about these specific processes if they're vendor-supplied?


-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


------------------------------

Date: Thu, 13 Jul 2000 11:24:25 -0700
From: Beta Version <playa786NOplSPAM@excite.com.invalid>
Subject: convert perl code to c++
Message-Id: <0c7d378a.6e8a2403@usw-ex0105-035.remarq.com>

Is it possible to convert perl code into c++ code? If so, how?


-----------------------------------------------------------

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



------------------------------

Date: Thu, 13 Jul 2000 18:59:31 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: convert perl code to c++
Message-Id: <sms4cjcand6116@corp.supernews.com>

Beta Version (playa786NOplSPAM@excite.com.invalid) wrote:
: Is it possible to convert perl code into c++ code? If so, how?

Only the old-fashioned, labor-intensive way:  Pay (or become) a programmer
to do the port.  It would almost certainly be easier to capture the design
and reimplement from a blank sheet of paper.

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Beauty and strength, leaping laughter and delicious
   |   languor, force and fire, are of us." - Liber AL II:20


------------------------------

Date: Thu, 13 Jul 2000 22:14:51 +0200
From: "Brendon Caligari" <bcaligari@shipreg.com>
Subject: Re: convert perl code to c++
Message-Id: <8kl7ce$ih4$1@news.news-service.com>


"Beta Version" <playa786NOplSPAM@excite.com.invalid> wrote in message
news:0c7d378a.6e8a2403@usw-ex0105-035.remarq.com...
> Is it possible to convert perl code into c++ code? If so, how?
>
>
yes, by rewriting the programme




------------------------------

Date: Thu, 13 Jul 2000 14:02:32 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Creating an ordered HoH
Message-Id: <396E1248.E563E4A6@home.com>

karger@fermi2.chem.yale.edu wrote:
> 
> Why not $foo{$bar}{"index"} = scalar(keys %foo); # after you create it
> 
> Then you can sort based on index.

Ug. That's a lot of duct tape, and there's an extra key in there. I'd
have to create $foo{key1}{key2}{index} as well as
$foo{key1}{key2}{data}, then extract and sort the keys (at level 2) by
their index attribute. At that point I could just sort the keys
themselves without bothering to keep track of the index -- indeed,
that's what I had been doing. But it's very messy, and makes maintenance
difficult. I've been going back into some of my own code trying to
generalize it for use elsewhere and I had to stare at it for half an
hour to figure out how it was working. (And that's when I already knew
what it was doing and why.)

> Admittedly, this seems like kludgily turning a hash into a 
> semi-array, but that *is* sort of what you're asking to do.

No, what I want is for keys() to return things in a known order. Having
gotten Tie::IxHash to work, I'm happy now, and my code is cleaner.

-mjc


------------------------------

Date: Thu, 13 Jul 2000 18:05:48 GMT
From: richardstands@my-deja.com
Subject: Re: Delayed HTML Output in PERL
Message-Id: <8kl0dd$psv$1@nnrp1.deja.com>

In article <39614564.8A25B068@bookmarc.com>,
  marc@bookmarc.com wrote:
>
> I have a PERL  program that I wrote which is slow to output a html
data
> file to the screen.  I would like to print a warning that it may take
> time so the user does not give up on the output and surf the web
> elsewhere..  However, The html page does not print until it has the
> entire output in the buffer.  So the user does not see the gentle
> warning that he/she may have to wait a couple of minutes before the
> output is delivered to his browser.
>
> Does anyone have a straight forward trick to printing out part of a
page
> to an html browser before the entire output is ready to be printed?

I have the same problem as you have/did.

If you have the pleasure of running your script on an O/S that supports
Perl's fork() function then this should be easy( there is at least one
reply post that has a link to such a script ). As Microsoft's Internet
Explorer does not support server push I don't suggest that as an
option.

If, however, you are running the script under Windows then it is a
different issue. For this O/S I had to use the Perl system() function
to call the Windows "start" command to start another script process
that could create the file that the first call could "refresh" as it
was being created. I could *not* get this to work with Apache server
but, thankfully, was able to get it to work using Microsoft's IIS. Here
is my code FWIW:

#!perl -w

use strict;
use CGI qw(:standard);

import_names;

my $dat = 'foo.dat';
my $html = "temp.html";
my $script = 'spawn.pl';
my $temp = "temp.dat";

unlink( $temp ) if ( -e $temp );

if ( ( $#ARGV + 1 ) <= 0 ) {    # works from both CGI and command line
    # create the inital html doc
    open( H, ">c:\\inetpub\\wwwroot\\$html" ) or die( $! );
    print( H start_html );
    print( H "<META HTTP-EQUIV='refresh' CONTENT=\"5;
URL=http://mydomain.com/temp.html\">" );
    print( H hr );
    print( H "No data yet...<BR>\n" );
    print( H hr );
    print( H end_html );
    close( H );
    # try spawning
    system( "start /MIN perl.exe $script foo" ) == 0 || die( "spawn
failed" );
    print redirect( "http://mydomain.com/$html" );
} else {
    make_output();
}

exit( 1 );


########################################################################
####
sub make_output     #07/13/00 11:59:AM
########################################################################
####
{
    open( D, "<$dat" ) or die( $! );
    while( <D> ) {
        # add the next line to the temp file
        open( T, ">>$temp" ) or die( $! );
        print( T );
        close( T );
        # recreate the entire doc for each line(conflicts?)
        open( H, ">c:\\inetpub\\wwwroot\\$html" ) or die( $! );
        print( H start_html );
        print( H "<META HTTP-EQUIV='refresh' CONTENT=\"5;
URL=http://mydomain.com/$html\">" );
        print( H hr );
        # dump contents of temp file
        open( T, "<$temp" ) or die( $! );
        while( <T> ) {
            print( H "$_<BR>\n" );
        }
        close( T );
        # finish doc
        print( H hr );
        print( H end_html );
        close( H );
        sleep( 1 );
    }
    close( D );
}   ##make_output

-Rich


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 13 Jul 2000 21:04:29 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: detecting promiscuous mode
Message-Id: <x9qb5.35515$fR2.325812@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <8kkrgn$ljf$1@nnrp1.deja.com>,
	sp00fD <sp00fD@yahoo.com> writes:
> Can anyone tell me how I might go about using perl to discover if any
> ethernet interfaces are in promiscuous mode (Solaris), without using
> external programs (i.e. ifstatus and the like)??

The only hope you would have would be to open the ethernet device
and find an ioctl query that could tell you this.

This is very, very device and operating system dependant.

A good starting point to read about this would be the ioctl(2) manpage,
sys/ioctl.h and ioctl_list(2).  

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


------------------------------

Date: Thu, 13 Jul 2000 13:26:55 -0500
From: Frank Samuelson <fwslsm@cnsp.must.fight.spam.com>
Subject: Re: Does file locking in perl on rh6.2 linux just not work?
Message-Id: <396E09EF.77BD5E13@cnsp.must.fight.spam.com>

nobull@mail.com wrote:
> 
> Frank Samuelson <fwslsm@cnsp.com> writes:
> 
> > I have read the man page several times and surfed the net over on
> > file locking in perl, but I can't get it to work.
> 
> >     open(FTEMP,"bucko") || die "Couldn't open bucko\n";
> >     $gg=flock(FTEMP,LOCK_EX);
> 
> As it happens you are looking in the wrong place.  This has nothing to
> do with Perl.  To prevent denial of service attacks Linux (like most
> (all?) Unicies (OSes?)) will not grant you an exclusive lock on a file
> that you have opened in read-only mode.
> 

Nope, still doesn't work when I use 
	open(FTEMP,">bucko") || die "Couldn't open bucko\n";
or
        open(FTEMP,"+<bucko") || die "Couldn't open bucko\n";


> Perhaps this may be considered a documentation bug in "perldoc -f
> flock" or more likely in Linux's "man 2 flock".  I trust that you did
> notice that "perldoc -f flock" told you to read "man 2 flock" for
> details.

I read the system flock documentation.  There is no mention of 
exclusive locks only on files being written.

Frank


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 3655
**************************************


home help back first fref pref prev next nref lref last post