[23492] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5705 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 23 18:05:47 2003

Date: Thu, 23 Oct 2003 15:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 23 Oct 2003     Volume: 10 Number: 5705

Today's topics:
        Balanced Text?? <michael.p.broida@boeing_oops.com>
    Re: Balanced Text?? <ak+usenet@freeshell.org>
    Re: Balanced Text?? <e02@removethis.toao.net>
    Re: calling Korn shell from Perl script - changing orac (Tad McClellan)
    Re: character mapping functions and UNICODE : remove ac <flavell@ph.gla.ac.uk>
    Re: Fill up HD fastest way (Roy Johnson)
        GD module <bart-news@NOSPAMtvreclames.nl>
    Re: GD module <glex_nospam@qwest.invalid>
    Re: GD module <bart-news@NOSPAMtvreclames.nl>
    Re: How to use a web broser as GUI <tzz@lifelogs.com>
    Re: my first perl script! <willema@student.ethz.ch>
        My Forking Server works in windows but not linux (nospam)
        news@tvreclames.nl <bart-news@NOSPAMtvreclames.nl>
    Re: news@tvreclames.nl <bart-news@NOSPAMtvreclames.nl>
    Re: On selecting pseudonyms (was Re: file redirect with <tassilo.parseval@rwth-aachen.de>
    Re: On selecting pseudonyms (was Re: file redirect with (Tad McClellan)
    Re: On selecting pseudonyms (was Re: file redirect with <grazz@pobox.com>
    Re: On selecting pseudonyms (was Re: file redirect with <abc@nospam.nowhere>
    Re: Oops, 5.8.1 broke my program <admin@2host-no-spam.com>
    Re: Perl 'system' Creates Program That Dies When First  <abfan34@spamworld.hotmail.com>
        Problem using Archive::Zip ! <elij@eudoramail.comNo_SPAM>
    Re: Problem using Archive::Zip ! <glex_nospam@qwest.invalid>
    Re: Regex Help rmurthy60@hotmail.com
    Re: Regex Help rmurthy60@hotmail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 23 Oct 2003 20:53:50 GMT
From: MPBroida <michael.p.broida@boeing_oops.com>
Subject: Balanced Text??
Message-Id: <3F983FDE.C47CEF95@boeing_oops.com>

Hi!
	I've seen this mentioned here before, but I can't find
	the specific messages.   It's not directly in the FAQ,
	either, though it's a "standard" response to questions
	about nested parens/etc when asked in this newsgroup.

	But I don't recall whether the package/module is:
		Text::Balanced
	or:
		Balanced::Text

	Neither is installed here, so I need the CORRECT name
	so I can request that it be acquired and installed.

		Thanks!
			Mike


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

Date: Thu, 23 Oct 2003 21:18:31 +0000 (UTC)
From: Andreas Kahari <ak+usenet@freeshell.org>
Subject: Re: Balanced Text??
Message-Id: <slrnbpghd6.ob6.ak+usenet@mx.freeshell.org>

In article <3F983FDE.C47CEF95@boeing_oops.com>, MPBroida wrote:
[cut]
> 	But I don't recall whether the package/module is:
> 		Text::Balanced
> 	or:
> 		Balanced::Text

Use search.cpan.org and search for "Balanced".

-- 
Andreas Kähäri


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

Date: Thu, 23 Oct 2003 21:21:13 GMT
From: "Experienced but Undocumented" <e02@removethis.toao.net>
Subject: Re: Balanced Text??
Message-Id: <dDXlb.160382$6C4.86438@pd7tw1no>

Hi!

Is this what you're looking for?

http://www.perldoc.com/perl5.8.0/lib/Text/Balanced.html

Good luck


"MPBroida" <michael.p.broida@boeing_oops.com> wrote in message
news:3F983FDE.C47CEF95@boeing_oops.com...
> Hi!
> I've seen this mentioned here before, but I can't find
> the specific messages.   It's not directly in the FAQ,
> either, though it's a "standard" response to questions
> about nested parens/etc when asked in this newsgroup.
>
> But I don't recall whether the package/module is:
> Text::Balanced
> or:
> Balanced::Text




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

Date: Thu, 23 Oct 2003 16:22:56 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: calling Korn shell from Perl script - changing oracle db passwords through web
Message-Id: <slrnbpghlg.7gp.tadmc@magna.augustmail.com>

TP <dbasolutions@aol.com> wrote:

> I'm trying to write a program to change oracle db user password in

> My problem is how
> can I make check to see if tom_reset script actually ran successfully.


The documentation for the function you are using describes how
to do that.

If you don't understand what the documentation says, then ask a
question about what the documentation says.

If you haven't read the documentation for the functions that you
are using, then you shouldn't be posting to Usenet until you have.

This is not a read-the-docs-to-me service...


> #!/usr/bin/perl -w
> use strict;
> use CGI qw(param);                      # Common Gateway Interface


"password" and "CGI" should never be mentioned without also
mentioning "taint checking" (-T).

   perldoc perlsec


>         #system("tom_reset($checkuser,$pwd,$pwd2)");


If you are concerned with security (and you ought to be) then
you should not be using that form of system() call because it
may invoke a shell, and shells are easy to trick.

And that isn't how you call an external program anyway, did you
instead mean:

   system("tom_reset $checkuser $pwd $pwd2");

??

   
   perldoc -f system

         The return value is the exit status of the program
         as returned by the "wait" call.  To get the actual
         exit value shift right by eight (see below).


   system 'tom_reset', $checkuser, $pwd, $pwd2 and
      die "tom_reset failed";

or

   !system 'tom_reset', $checkuser, $pwd, $pwd2 or
      die "tom_reset failed";

or

   if ( system 'tom_reset', $checkuser, $pwd, $pwd2 ) {
      my $exit_value  = $? >> 8;
      die "tom_reset failed with exit code $exit_value";
   }



> if [ "$PWD" != $PWD2  ]


Why quotes on one and no quotes on the other?


> then 
>      clear
>      echo "Passwords do no match...good-bye!"
>      echo ""
>      exit


   exit 1   # or some other non-zero value


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 23 Oct 2003 19:18:40 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: character mapping functions and UNICODE : remove accents, case, etc
Message-Id: <Pine.LNX.4.53.0310231855560.12628@ppepc56.ph.gla.ac.uk>

On Thu, 23 Oct 2003, An. Valula floated out upon a sea of TOFU:

> thank you for your answer, but, no, I do not want to remove bold or
> paragraph marks.

But that *is* what the term "rich text" format normally refers to -
whether used in the generic sense or in particular reference to
Microsoft's "RTF" interchange specification.

> I want to convert "rich" text to "poor" text.

Not really, and that's why you confused the previous respondent.  You
need some better term.  (Try a glossary of text processing if you
don't believe me).

> There must be someone else who wants to compare strings without diacritical
> signs ?!

Is there a problem?  You already know one solution.

> > does anyone out there know about perl capabilities to convert rich
> > text, such as "étrangères" to "etrangere" (remove accents)?
> > Of course, tr/éè/ee/ would do, but I look for sth better: you do not
> > tr/a-z/A-Z/ for uc(), do you?

You probably should note that your tr/// and your uc() perform
*different* operations, in general - also depending on the locale
setting.

Anyhow, I don't have an answer to your requirement, other than the
obvious one.  Well, perhaps I do: you could "do the Unicode
decomposition" thing, but it would seem distinctly inefficient
compared to a tr///

Have a look at e.g http://www.perldoc.com/perl5.8.0/pod/perlretut.html
and see whether you really want to fight this via Unicode-style regex
features.  If you want to be sure of covering accents that you've
never even heard of, then I guess that's the way to go, but if you're
just looking for the usual Western-European accents then me, I'd go
with the tr/// I reckon.  But this is all supposition - it's not a
requirement which I've needed myself.


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

Date: 23 Oct 2003 14:59:27 -0700
From: rjohnson@shell.com (Roy Johnson)
Subject: Re: Fill up HD fastest way
Message-Id: <3ee08638.0310231359.7b555097@posting.google.com>

How about
    $fmt='%c'x100;
    printf $fmt,  map(int(rand(256)), 1..100) while 1;
or (probably better)
    print pack('C100', map(int(rand(256)), 1..100)) while 1;

They're more random than just digits.


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

Date: Thu, 23 Oct 2003 20:20:58 +0200
From: "Bart van den Burg" <bart-news@NOSPAMtvreclames.nl>
Subject: GD module
Message-Id: <bn96a0$8qb$1@reader11.wxs.nl>

Hey

I'm wondering how much processor power scripts using the GD module use. I'm
currently using 2 of those:

http://dareaper.blowlands.nl/tvreclames/graphs.pl?action=poll&value=30
where value could be anything between 0 and 100
http://dareaper.blowlands.nl/tvreclames/graphs.pl?action=agesex&amp;sex=m&rid=87
where sex can be "m" or "f", and rid refers to a database entry

at this moment i have an average of 50 visitors per day at
http://www.tvreclames.nl, and everything seems well now, but i'm wondering
if it may become just too much if i get more visitors. The first image is on
every page 5 times, each time with a different value. Will this become a
problem, or is GD fast enough for it?

Thanks
Bart




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

Date: Thu, 23 Oct 2003 13:32:46 -0500
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: GD module
Message-Id: <k6Vlb.1717$4V5.24043@news.uswest.net>

Bart van den Burg wrote:
> Hey
> 
> I'm wondering how much processor power scripts using the GD module use. I'm
> currently using 2 of those:
> 
> http://dareaper.blowlands.nl/tvreclames/graphs.pl?action=poll&value=30
> where value could be anything between 0 and 100
> http://dareaper.blowlands.nl/tvreclames/graphs.pl?action=agesex&amp;sex=m&rid=87
> where sex can be "m" or "f", and rid refers to a database entry
> 
> at this moment i have an average of 50 visitors per day at
> http://www.tvreclames.nl, and everything seems well now, but i'm wondering
> if it may become just too much if i get more visitors. The first image is on
> every page 5 times, each time with a different value. Will this become a
> problem, or is GD fast enough for it?
> 
> Thanks
> Bart
> 
> 

The only way you're going to know it by stress testing your system.
If you use apache, try "ab".  There are probably many others out there 
to run a DOS type "test" on your system.



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

Date: Thu, 23 Oct 2003 20:50:02 +0200
From: "Bart van den Burg" <bart-news@NOSPAMtvreclames.nl>
Subject: Re: GD module
Message-Id: <bn980g$dv0$1@reader11.wxs.nl>


"J. Gleixner" <glex_nospam@qwest.invalid> wrote in message
news:k6Vlb.1717$4V5.24043@news.uswest.net...
> Bart van den Burg wrote:
> > Hey
> >
> > I'm wondering how much processor power scripts using the GD module use.
I'm
> > currently using 2 of those:
> >
> > http://dareaper.blowlands.nl/tvreclames/graphs.pl?action=poll&value=30
> > where value could be anything between 0 and 100
> >
http://dareaper.blowlands.nl/tvreclames/graphs.pl?action=agesex&amp;sex=m&rid=87
> > where sex can be "m" or "f", and rid refers to a database entry
> >
> > at this moment i have an average of 50 visitors per day at
> > http://www.tvreclames.nl, and everything seems well now, but i'm
wondering
> > if it may become just too much if i get more visitors. The first image
is on
> > every page 5 times, each time with a different value. Will this become a
> > problem, or is GD fast enough for it?
> >
> > Thanks
> > Bart
> >
> >
>
> The only way you're going to know it by stress testing your system.
> If you use apache, try "ab".  There are probably many others out there
> to run a DOS type "test" on your system.
>

hm thanks, i didnt even know of the app "ab"

the request for the first one takes 225 ms... imo it's a bit too much
because that will already take at least 1 second per page. I do you think it
might be smarter to just produce 101 (0..100) images instead of rendering
them realtime? I guess the other graph can stay just the way it is since it
isn't requested that much

Bart




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

Date: Thu, 23 Oct 2003 16:10:37 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: How to use a web broser as GUI
Message-Id: <4nekx3n29u.fsf@lockgroove.bwh.harvard.edu>

On Thu, 23 Oct 2003, founder@pege.org wrote:

> It's not for web sites,
> it's do develop programs to be installed at the clients.
> 
> The idea is to use a browser as the GUI
> and writing all in Perl
> 
> So what browsers have an direct Perl interface

w3m has a direct CGI interface, meaning it will execute CGI scripts
directly instead of making the webserver do it.  w3m is a very nice
text-mode browser that can display images in a xterm.  It works under
cygwin, I believe.  See:

http://w3m.sourceforge.net
http://w3m.sourceforge.net/MANUAL#LocalCGI

This does not limit you to Perl for CGI development, either - any
language can be used.

Ted


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

Date: Thu, 23 Oct 2003 21:14:48 +0200
From: "Matthias Wille" <willema@student.ethz.ch>
Subject: Re: my first perl script!
Message-Id: <pan.2003.10.23.19.14.47.48146@student.ethz.ch>

Am Thu, 23 Oct 2003 00:10:49 -0500 schrieb Tad McClellan:

>>>> $lines = join("", <OLD>);
> 
>>> However, there's a better way to slurp in a whole file:
> 
>>>     my $lines = do {
>>>         local $/;   # enable "slurp" mode
>>>         <OLD>;
>>>     };
> 
>> And why is your 'slurp'-method exactly better? is it faster?
> 
> 
>    perldoc Benchmark
> 
> :-)

OK, thanks, then I suppose it IS faster...;)

> 
>       
>> Or do you know if it is possible to match
>> the following string with a reasonable simple regexp?
> 
> 
> Sure! 
> 
> This one is pretty simple:
> 
>    /.*/s
> 
> and it will match that string.
> 
> This one is even simpler and will also match:
> 
>    //
> 
> 
> Want to rephrase your question?  :-)

OK, I admit it, my question was fairly bad and your answert of course
correct. But what I actually meant is that i have several of those Case =
CASENAME { .. } blocks in a file and want to match one with a specific
name. Obviously the following doesn't work out:

$text =~ m/Case?=?$name?\{.*?\}/s

because the second bracket would also match potential inner brackets. My
question is now if there IS a regexp to match such bracketed
expressions...?

> 
> 
>    Is it possible to match balanced/nested things like the
>    curly brackets in the following string?
> 
> 
>> Case = SOME_CASE {
>> 
>>    subcase1 = {.....}
>>    ....	
>>    subcase2 = {......}
>> 
>> ]
>   ^
>   ^ I sure hope that was supposed to be a {curly} bracket character...

Of course, but both square and curly brackets look almost the same with a
small font and anti aliasing, so I didn't notice ... :)

> 
> 
>> The whole block should be matched, but how do I tell the regexp not to
>> match the inner brackets?
> 
> 
> The inner brackets are enclosed in the "whole block" so they
> _must_ be matched if you want the whole block to be matched...
> 
> Want to rephrase that question too?  :-)  :-)

see above!


> 
> 
>    How do I tell the regex to match the _corresponding_
>    closing curly bracket?
> 
> 
> I think this Perl FAQ answers what you meant to ask:
> 
>    Can I use Perl regular expressions to match balanced text?

Yeah, exactly, that's what I want to do... thanks!

Greetings
Matthias



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

Date: Thu, 23 Oct 2003 17:48:33 -0400
From: "bob Smith" <bobsmith(nospam)@bobsmith.com>
Subject: My Forking Server works in windows but not linux
Message-Id: <bn9kfm$rtr$1@news1.usf.edu>

I stole this example from a book and it works in windows but on Linux it
shutdowns occasionally after the client connects.  Any help would be
appreciated.
Linux OP Sys is Redhat ES 3.0:

Here is the server:

#!/usr/bin/perl -w
# Forking server

use IO::Socket;
$SIG{CHLD} = sub {wait ()};
$main_sock = new IO::Socket::INET (LocalHost => '0.0.0.0',
                                   LocalPort => 5150,
                                   Listen    => 5,
                                   Proto     => 'tcp',
                                   Reuse     => 1,
                                  );
die "Socket could not be created. Reason: $!\n" unless ($main_sock);
while ($new_sock = $main_sock->accept()) {
    $pid = fork();
    die "Cannot fork: $!" unless defined($pid);
    if ($pid == 0) {
        # Child process
        while (defined ($buf = <$new_sock>)) {
           # do something with $buf ....
           print $new_sock "You said: $buf\n";
        }
        $new_sock->shutdown(0);
        $new_sock->send("000065TCP FEDI
HELLO");
        $new_sock->shutdown(2);
        exit(0);   # Child process exits when it is done.
    } # else 'tis the parent process, which goes back to accept()
}
close ($main_sock);

Here is the client:

#!/usr/bin/perl -w
use IO::Socket;
$sock = new IO::Socket::INET (PeerAddr => 'localhost',
                              PeerPort => 5150,
                              Proto    => 'tcp'
                             );
die "Socket could not be created. Reason: $!\n" unless $sock;
foreach (1 .. 10) {
    print "Hello $_: \n";
    print $sock "Msg $_: How are you?\n";
    #$sock->flush();
}
$sock->shutdown(1);
$sock->flush();
my $line;
while (defined($line = <$sock>)) {
print $line;
}
close ($sock);




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

Date: Thu, 23 Oct 2003 21:05:30 +0200
From: "Bart van den Burg" <bart-news@NOSPAMtvreclames.nl>
Subject: news@tvreclames.nl
Message-Id: <bn98tf$gf7$1@reader11.wxs.nl>

test




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

Date: Thu, 23 Oct 2003 21:07:10 +0200
From: "Bart van den Burg" <bart-news@NOSPAMtvreclames.nl>
Subject: Re: news@tvreclames.nl
Message-Id: <bn990l$gnn$1@reader11.wxs.nl>

"Bart van den Burg" <bart-news@NOSPAMtvreclames.nl> wrote in message
news:bn98tf$gf7$1@reader11.wxs.nl...
> test
>
>

ermm


oops
sorry bout that

thought I clicked new mail




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

Date: 23 Oct 2003 19:24:21 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: On selecting pseudonyms (was Re: file redirect within back ticks not working)
Message-Id: <bn99t5$nr$1@nets3.rz.RWTH-Aachen.DE>

Also sprach ktom:

> Brian McCauley wrote:
>> ktom <abc@nowhere.com> writes:
>> 
>> 
>>>Randal L. Schwartz wrote:
>> 
>> 
>>>>I'm not going to answer any question where the poster is forging
>>>>addresses of both "nowhere.com" and "billgates.com", thus
>>>>polluting those domains for more spam and making replies difficult.
>>>
>>>you have a very good point there.
>> 
>> 
>>>i have modified the reply to address with the intent of acknowledging
>>>your issues.  is it sufficient??
>> 
>> 
>> No.  Go back and read Randal's "very good point".
> 
> how do i, or anyone else, find out what other domains are set aside as 
> 'non-domains'?

Now it's ok. Brian was referring to the fact, that you used a correctly
munged reply-to address but hadn't changed your from address
accordingly.

Btw, the special domain example.com can always be used (it's not for
registration). Otherwise use a non-existing top-level domain as you have
done now with .invalid.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Thu, 23 Oct 2003 13:07:20 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: On selecting pseudonyms (was Re: file redirect within back ticks not working)
Message-Id: <slrnbpg66o.7dt.tadmc@magna.augustmail.com>

ktom <abc@nospam.nowhere> wrote:

> how do i, or anyone else, find out what other domains are set aside as 
> 'non-domains'?


How many non-domains do you need?

I cannot imagine needing more than one, and Randal already gave
more than one.


Put ".invalid" on the end of it and you're done!


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 23 Oct 2003 21:01:01 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: On selecting pseudonyms (was Re: file redirect within back ticks not working)
Message-Id: <hkXlb.17550$Fc5.10452@nwrdny01.gnilink.net>

ktom <abc@nospam.nowhere> wrote:
> Tad McClellan wrote:
> > ktom <abc@nospam.nowhere> wrote:
> >>how do i, or anyone else, find out what other domains are set aside as 
> >>'non-domains'?
> > 
> > How many non-domains do you need?
> 
> i only need one, that wasn't the reason for the question.
> 
> the reason for the question is 'what other useful/interesting 
> information would i find at the same site'

Google for RFC 2606.

-- 
Steve


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

Date: Thu, 23 Oct 2003 20:43:05 GMT
From: ktom <abc@nospam.nowhere>
Subject: Re: On selecting pseudonyms (was Re: file redirect within back ticks not working)
Message-Id: <t3Xlb.2486$rH6.1317@twister.austin.rr.com>

Tad McClellan wrote:
> ktom <abc@nospam.nowhere> wrote:
> 
> 
>>how do i, or anyone else, find out what other domains are set aside as 
>>'non-domains'?
> 
> 
> 
> How many non-domains do you need?

i only need one, that wasn't the reason for the question.

the reason for the question is 'what other useful/interesting 
information would i find at the same site'
> 
> I cannot imagine needing more than one, and Randal already gave
> more than one.
> 
> 
> Put ".invalid" on the end of it and you're done!
> 
> 



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

Date: Thu, 23 Oct 2003 13:44:25 -0700
From: "2host.com" <admin@2host-no-spam.com>
Subject: Re: Oops, 5.8.1 broke my program
Message-Id: <3F983DA9.7050505@2host-no-spam.com>

[posted and CC'ed to hostmaster@easylink.com,postmaster@mail.com]

Al MacHonahey wrote:
 ...
> 
> You know, its really ironic how you folks complain profusely if some
> goes against Usenet tradition/standards of not top-posting or quoting
> entire posts while adding one line of oc, but you feel to go against
> another, seemingly because you feel "above" everyone else who tries to
> follow the standard/ countless Usenet guidelines that you pretend to
> cherish.
> 
> You see, using > for quoting characters as been the Usenet standard
> (or plain text medium standard for that matter, i.e. email) for
> quoting text for over a decade. Many article processors use this, as
> have millions of Usenet users do, but you instead for what ever reason
> continue your own way, preventing countless article processors to miss
> parse your articles, such as stat keepers.
> 
> Maybe we should use Abigail's example and start posting using html, as
> she has shown us that Usenet tradition/guidelines/standards do not
> need to be followed.

Could you kindly not use "2Host.com" as your posting identification? 
It's bad enough your email address is 2host.com@inorbit.com, but this is 
going too far and you are clearly not associated with this company.  I'd 
appreciate it if you'd do so.

People are going to see your posts in real time and in searches (this is 
how I found your posts) and perhaps become confused into thinking you 
are associated with 2host.com.  Is there a reason why you have chosen 
this username for your email identity?

This is one of a few posts I see searching for my company's domain name 
where you were arguing on usenet with this identity and although anyone 
can post to represent themselves, this is something we'd appreciate that 
you not do for these reasons.  Please change your settings.  Thank you.

PS: http://dbforums.com/t490056.html

"savagebeaste@yahoo.com (Al MacHonahey)

aka Chris Jacobs (cbj45@aol.com, cjb45@mailNO-SPAM.com) aka Greg Jona, 
aka Manny Wilco (masen@holjar.net) aka Impalus, aka Jilla Villa 
(jillavilla@otakumail.com) aka Jim Rogers (blaza@c4.com) aka Kamitri 
(sroberon@yahoo.com) aka Harl (sroberon@y-a-h-o-o.c-o-m) aka Harl Mason 
(hmsn@prodigy.net) aka Jerad Baltimora (jbalt@no-spam.com) aka Keagen 
Miller (kmiller@dontspamme.com) aka MJ Ownes (MJOwens@email.nospam) aka 
Robin Givens (RobGv@2!s!o!n.net)"



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

Date: Thu, 23 Oct 2003 13:13:31 -0500
From: Rob Woodard <abfan34@spamworld.hotmail.com>
Subject: Re: Perl 'system' Creates Program That Dies When First C Program Dies
Message-Id: <pan.2003.10.23.18.13.14.173235@spamworld.hotmail.com>

On Sun, 19 Oct 2003 03:40:29 -0700, Christopher M. Lusardi wrote:

> My operating system is Red Hat Linux.
> 
> 
> 
> Bob Walton <invalid-email@rochester.rr.com> wrote in message news:<3F9175E7.2010601@rochester.rr.com>...
>> Christopher M. Lusardi wrote:
>> 
>> > Hello,
>> > 
>> >    What are some simple ways to run a perl script from an initial c program 
>> > which starts another C program that stays around after the first program goes
>> > away? Perl starts the second C program. 
>> > 
>> >     I've tried using "system ('executable'), but when the first program is 
>> > stopped the second stops without my intervention.  What I want to be able to do 
>> > is run my first program that starts the perl script which starts another 
>> > program that stays around after the first program ends its execution.
>> > 
>> > 
>> >                Thank you,
>> >                Christopher Lusardi
>> > 
>> 
>> Your question isn't really a Perl question, but rather an OS question -- 
>> the answer will be the same if it were another language that is kicking 
>> off your executables -- hence it is off-topic here.  And the answer will 
>> depend on your OS.  What is it?

#!/usr/bin/perl -w
system ('executable');
while (1) {
   print "infinite loops are fun!\n";
}

That is OS-independent I believe... :)


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

Date: Thu, 23 Oct 2003 19:25:30 GMT
From: Ej <elij@eudoramail.comNo_SPAM>
Subject: Problem using Archive::Zip !
Message-Id: <20ba58facd98ae03d97f81017c71951c@news.bubbanews.com>

This does not work, Why?

@fla=('/root/name/dir1','/root/name/dir2');

foreach $ia (@fla){
 
print "adding $ia<br>";
$status=$zip->addTree( "$ia","$ia" );
$status->desiredCompressionMethod( COMPRESSION_DEFLATED );
$status->desiredCompressionLevel(5);

}

I get this message:
Can't call method "desiredCompressionMethod" without a package or object 
reference at zp1.pl line 38.


however, this does work,

foreach $ia (@fla){
 
print "adding $ia<br>";
$status=$zip->addTree( "$ia","$ia" );
}

how can I fix the first code?

Thank You.





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

Date: Thu, 23 Oct 2003 14:44:04 -0500
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: Problem using Archive::Zip !
Message-Id: <99Wlb.2251$4V5.29115@news.uswest.net>

Ej wrote:
> This does not work, Why?
> 
> @fla=('/root/name/dir1','/root/name/dir2');
> 
> foreach $ia (@fla){
>  
> print "adding $ia<br>";
> $status=$zip->addTree( "$ia","$ia" );
> $status->desiredCompressionMethod( COMPRESSION_DEFLATED );
> $status->desiredCompressionLevel(5);
> 
> }
> 
> I get this message:
> Can't call method "desiredCompressionMethod" without a package or object 
> reference at zp1.pl line 38.
> 
> 
> however, this does work,
> 
> foreach $ia (@fla){
>  
> print "adding $ia<br>";
> $status=$zip->addTree( "$ia","$ia" );
> }
> 
> how can I fix the first code?

What's $status???.. hint.. it's not an object, which is what the error 
is telling you. It's what addTree returns, which, according to the 
documentation, is "AZ_OK". Use the Archive::Zip object, which, since you 
didn't show it's creation in your posted code, I assume is $zip.

$zip->desiredCompressionMethod(...);



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

Date: 23 Oct 2003 12:05:50 -0700
From: rmurthy60@hotmail.com
Subject: Re: Regex Help
Message-Id: <4da2b83e.0310231105.54f2b904@posting.google.com>

Thanks a lot. That worked.

"Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net> wrote in message news:<Xns941DA194F3484elhber1lidotechnet@62.89.127.66>...
> rmurthy60@hotmail.com wrote in news:4da2b83e.0310230545.27f025a4
> @posting.google.com:
> 
> > I tried doing the following to remove the ./ from the file listed
> > below. I am able to do it in sed but the problem is you cannot use
> > qx'sed -e"s?\([  /]\)\./?\1?g"  $filist'. It does not allow the use of
> > $filist, but if I hard code the file name in place of $filist. It
> > works.
> > 
> > next if s?\([  /]\)\./?\1?g;
> > 
> > For some reason it is not removing the ./ from the file. Any
> > suggestions are
> > welcome.
> > The file is in this format
> > 
> > a b  ./dsfj/dfl/dksl             ./ksdfl/dsld
> > 
> > c d  ./sds/dsl/dksld           ./kdf/ksd/ksdk
> 
> 
> I'm not sure I understand, but why not simply:
> 
> 
> s#\./##g;
> 
> 
> ?
> 
> 
> Cheers,
> Bernard


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

Date: 23 Oct 2003 12:16:01 -0700
From: rmurthy60@hotmail.com
Subject: Re: Regex Help
Message-Id: <4da2b83e.0310231116.7ad255b4@posting.google.com>

Thanks a lot. This worked too.

gbacon@hiwaay.net (Greg Bacon) wrote in message news:<vpfnmfid2imm2f@corp.supernews.com>...
> In article <4da2b83e.0310230545.27f025a4@posting.google.com>,
>      <rmurthy60@hotmail.com> wrote:
> 
> : I tried doing the following to remove the ./ from the file listed
> : below. I am able to do it in sed but the problem is you cannot use
> : qx'sed -e"s?\([  /]\)\./?\1?g"  $filist'. It does not allow the use of
> : $filist, but if I hard code the file name in place of $filist. It
> : works.
> 
>     $ cat try
>     #! /usr/local/bin/perl
> 
>     use warnings;
>     use strict;
> 
>     while (<DATA>) {
>         # delete the /g if you only want the first hit
>         s!(^|\s+)\./!$1!g;
>         print;
>     }
> 
>     __DATA__
>     a b  ./dsfj/dfl/dksl             ./ksdfl/dsld
>     c d  ./sds/dsl/dksld           ./kdf/ksd/ksdk
>     ./test
> 
>     $ ./try
>     a b  dsfj/dfl/dksl             ksdfl/dsld
>     c d  sds/dsl/dksld           kdf/ksd/ksdk
>     test
> 
> Hope this helps,
> Greg


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

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 5705
***************************************


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