[18250] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 418 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 5 09:19:34 2001

Date: Mon, 5 Mar 2001 06:10:17 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <983801416-v10-i418@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 5 Mar 2001     Volume: 10 Number: 418

Today's topics:
    Re: regexp and parenthesis ... ianb@ot.com.au
        Regular Expression ERROR <fabascal@MailAndNews.com>
    Re: Regular Expression ERROR <bart.lateur@skynet.be>
    Re: Regular Expression ERROR <peb@bms.umist.ac.uk>
        RE: Regular Expression ERROR <fabascal@MailAndNews.com>
    Re: Regular Expression ERROR <bart.lateur@skynet.be>
        RE: Regular Expression ERROR <fabascal@MailAndNews.com>
        s/// and variables <sba@ocegr.fr>
    Re: statement for(list); <bart.lateur@skynet.be>
    Re: statement for(list); (Martien Verbruggen)
    Re: statement for(list); (Ilya Zakharevich)
    Re: statement for(list); <bart.lateur@skynet.be>
        What's wrong with ... <christoph.neubauer@siemens.at>
    Re: What's wrong with ... (Anno Siegel)
    Re: What's wrong with ... <bart.lateur@skynet.be>
    Re: What's wrong with ... <christoph.neubauer@siemens.at>
    Re: Why doesnt it work. The whole list deletes. (Tony L. Svanstrom)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 5 Mar 2001 09:06:06 GMT
From: ianb@ot.com.au
Subject: Re: regexp and parenthesis ...
Message-Id: <97vktu$7dc$1@news.netmar.com>

In article <eRFo6.603$SY.2534598@nnrp1.proxad.net>, ben <netben@free.fr>
writes:
>Hi.
>I'm trying to do stg that's quite hard for me now:
>my pattern is : /(.*)\((.*)\)\|/
>
>if the string is : foo(bar(b)az)
>i've got  : $1=foo(bar
>and         $2=(b)az)
>
>and what i wanted was : $1=foo , $2=(bar(b)az)

If you wanted an unparenthesised chunk followed by a parenthesised 
expression which we assume is balanced, it would be possible, but 
I gather from your only other example that this is not so.

>so i use : /(.*?)\((.*)\)\|/

Non-greedy matching is almost never the solution to any serious regex 
problem.

>but then if the string is : foo(bar)(baz)
>i get : $1=foo
>and  : $2=(bar)(baz).
>
>and what i needed was : $1=foo(bar) and $2=(baz).

So what you really want is the last balanced parenthesised expression 
preceded by everything before it in the string?

Well, you can't, I'm afraid. Not with a single regex.

There are hacks you can use, but you can't match arbitrarily deeply 
nested expressions. If you set a limit to the level of nesting 
of parentheses, you can make regexes to match such strings, but 
they're not nice to look at, and you have to ensure somehow that your limit
is not exceeded. The only way arbitrarily deep nesting can be described in a
finite space is recursively, and regexes do not allow recursive definitions.

To deal with this sort of task you need a parser, or you need to match in 
stages and balance the braces yourself.


>i also tried /(.*)\((.*?)\)\|/ , but, of course , i get the same thing that
>in my first case.

Unfortunately, non-greediness is still not the answer.

>To resume , i'd like to get the last string between parethesis before the |
>, but respecting the syntax of parenthesis!

>Hope it's not as hard for you as it is for me =)

Unfortunately, it's impossible for both of us.

Regards,


Ian


 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net


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

Date: Mon, 5 Mar 2001 05:48:01 -0500
From: Federico Abascal <fabascal@MailAndNews.com>
Subject: Regular Expression ERROR
Message-Id: <3AAB1B2C@MailAndNews.com>

What happen with this regular expression?:

/^((HYPOTHETICAL)*|(PUTATIVE)*|(POSSIBLE)*)* 
*(\d+\.*\d*\s*KD*A*\s*(LIPO)*(GLYCO)*)*
*PROTEIN *(\w{5,})*\.*(\(*FRAGMENT(S)*\)*\./

In perl version "version 5.004_04 built for irix-n32" perl gives me this 
error 
message:
"/^((HYPOTHETICAL)*|(PUTATIVE)*|(POSSIBLE)*)* 
*(\d+\.*\d*\s*KD*A*\s*(LIPO)*(GLYCO)*)*
*PROTEIN *(\w{5,})*\.*(\(*FRAGMENT(S)*\)*\./: regexp *+ operand could be 
empty 
at
miprograma.pl line 918."

But in perl version "version 5.005_03 built for sun4-solaris" no error 
message 
is given
(and it works).

It also works on "version 5.005_03 built for i586-linux" and 
"This is perl, version 5.003 with EMBED
        built under irix at Jan 23 1997 16:55:47
        + suidperl security patch".

Thanks in advance,

Federico

P.D.: Please, reply also to fabascal@bigfoot.com

------------------------------------------------------------
 Get your FREE web-based e-mail and newsgroup access at:
                http://MailAndNews.com

 Create a new mailbox, or access your existing IMAP4 or
 POP3 mailbox from anywhere with just a web browser.
------------------------------------------------------------



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

Date: Mon, 05 Mar 2001 11:03:44 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Regular Expression ERROR
Message-Id: <1es6at8paltubl5qk9icipphc7sq99h924@4ax.com>

Federico Abascal wrote:

>What happen with this regular expression?:
>
>/^((HYPOTHETICAL)*|(PUTATIVE)*|(POSSIBLE)*)* 
>*(\d+\.*\d*\s*KD*A*\s*(LIPO)*(GLYCO)*)*
>*PROTEIN *(\w{5,})*\.*(\(*FRAGMENT(S)*\)*\./
>
>In perl version "version 5.004_04 built for irix-n32" perl gives me this 
>error 
>message:
>"/^((HYPOTHETICAL)*|(PUTATIVE)*|(POSSIBLE)*)* 
>*(\d+\.*\d*\s*KD*A*\s*(LIPO)*(GLYCO)*)*
>*PROTEIN *(\w{5,})*\.*(\(*FRAGMENT(S)*\)*\./: regexp *+ operand could be 
>empty 
>at

Well, you've got:

	/^((HYPOTHETICAL)*|(PUTATIVE)*|(POSSIBLE)*)* 
	                                         ^^^
nested stars. You'll repeat, zero or more times, something that can be
empty. Don't do that. Perl's regex engine is extremely inefficient in
this, because there are countless variations on this theme, and the
regex engibne will check them all. For example, "POSSIBLE" x 6, does
that match ("POSSIBLE" x 3) two times, or ("POSSIBLE" x 2) three times?
For you it make no difference, but to perl, this means a LOT.

For a more elaborate description of this problem, you can check out
Jeffrey Friedl's book "Mastering Regular Expressions", which delves
really deep into this problem matter. IMO, there's no use at all for the
inner stars, so just make it:

	/^((HYPOTHETICAL)|(PUTATIVE)|(POSSIBLE))* ...

-- 
	Bart.


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

Date: Mon, 05 Mar 2001 11:06:41 +0000
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Regular Expression ERROR
Message-Id: <3AA37341.A3F8DC7B@bms.umist.ac.uk>

Federico Abascal wrote:
> 
> What happen with this regular expression?:
> 
> /^((HYPOTHETICAL)*|(PUTATIVE)*|(POSSIBLE)*)*
> *(\d+\.*\d*\s*KD*A*\s*(LIPO)*(GLYCO)*)*
> *PROTEIN *(\w{5,})*\.*(\(*FRAGMENT(S)*\)*\./
> 
> In perl version "version 5.004_04 built for irix-n32" perl gives me this
> error
> message:
> "/^((HYPOTHETICAL)*|(PUTATIVE)*|(POSSIBLE)*)*
> *(\d+\.*\d*\s*KD*A*\s*(LIPO)*(GLYCO)*)*
> *PROTEIN *(\w{5,})*\.*(\(*FRAGMENT(S)*\)*\./: regexp *+ operand could be
> empty
> at
> miprograma.pl line 918."

I guess it's just pointing out that the majority of your regex doesn't
require a match.

I think your regex actually simplifies to /\./ as the full-stop
character is the only element here that requires a match. and so the
string "ID=88%." would match thanks to the final character of the line.

Could you replace the * (0 or more) with a + (one or more) for some of
the expression?

Have you checked out the BioPerl modules as they may have something
there to do what you're trying to do.

Paul


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

Date: Mon, 5 Mar 2001 06:12:44 -0500
From: Federico Abascal <fabascal@MailAndNews.com>
Subject: RE: Regular Expression ERROR
Message-Id: <3AAB9585@MailAndNews.com>

>===== Original Message From Paul Boardman <peb@bms.umist.ac.uk> =====
>Federico Abascal wrote:
>>
>> What happen with this regular expression?:
>>
>> /^((HYPOTHETICAL)*|(PUTATIVE)*|(POSSIBLE)*)*
>> *(\d+\.*\d*\s*KD*A*\s*(LIPO)*(GLYCO)*)*
>> *PROTEIN *(\w{5,})*\.*(\(*FRAGMENT(S)*\)*\./
>>
>> In perl version "version 5.004_04 built for irix-n32" perl gives me this
>> error
>> message:
>> "/^((HYPOTHETICAL)*|(PUTATIVE)*|(POSSIBLE)*)*
>> *(\d+\.*\d*\s*KD*A*\s*(LIPO)*(GLYCO)*)*
>> *PROTEIN *(\w{5,})*\.*(\(*FRAGMENT(S)*\)*\./: regexp *+ operand could be
>> empty
>> at
>> miprograma.pl line 918."
>
>I guess it's just pointing out that the majority of your regex doesn't
>require a match.
>
>I think your regex actually simplifies to /\./ as the full-stop
>character is the only element here that requires a match. and so the
>string "ID=88%." would match thanks to the final character of the line.
>
>Could you replace the * (0 or more) with a + (one or more) for some of
>the expression?
>
>Have you checked out the BioPerl modules as they may have something
>there to do what you're trying to do.
>
>Paul

Thanks a lot, Paul
But it is not right everithing is optional (is a very unclear regex). For 
example, in "PROTEIN *" the optional part is the space, not the word 
"PROTEIN". And, since I put the '^' at the start, only expressions starting 
with PROTEIN or someone of the possible constructions (e.g. "HYPOTHETICAL 
PROTEIN", "HYPOTHETICAL 25 KDa PROTEIN", etc) will match (there are also 
other 
constrains as the point at the end, etc, etc). Of course, may be I'm 
missreading my own regular expression.

Fede

------------------------------------------------------------
 Get your FREE web-based e-mail and newsgroup access at:
                http://MailAndNews.com

 Create a new mailbox, or access your existing IMAP4 or
 POP3 mailbox from anywhere with just a web browser.
------------------------------------------------------------



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

Date: Mon, 05 Mar 2001 11:17:23 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Regular Expression ERROR
Message-Id: <1ct6atkgiki1m9lj32ohf7643apqv84hgj@4ax.com>

Bart Lateur wrote:

>Perl's regex engine is extremely inefficient in
>this, because there are countless variations on this theme, and the
>regex engibne will check them all.

I should have written that Perl checks them all, when there's a need to
backtrack. So if a match succeeds from the start, it'll go swiftly, but
as soon as there's something that doesn't match, it'll o over this thing
in all variation, that all amount to the same thing. So

	/(a*)*b/

will try every single combination for the "a" if your string is

	aaaaaaaaaaaaaaaaaaaaaaaaaac


-- 
	Bart.


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

Date: Mon, 5 Mar 2001 06:44:51 -0500
From: Federico Abascal <fabascal@MailAndNews.com>
Subject: RE: Regular Expression ERROR
Message-Id: <3AAC361C@MailAndNews.com>

>Could you replace the * (0 or more) with a + (one or more) for some of
>the expression?

I've found the error.
The problem was in: /((HYPOTHETICAL)*|(PUTATIVE)*|(POSSIBLE)*)*/. Changing 
to
/((HYPOTHETICAL)|(PUTATIVE)|(POSSIBLE))*/ (meaning the same for me) it 
works.

Thanks again

Federico


>Have you checked out the BioPerl modules as they may have something
>there to do what you're trying to do.

I've checked it but, even if it has modules to manage database comments, it 
doesn't apply to my case

------------------------------------------------------------
 Get your FREE web-based e-mail and newsgroup access at:
                http://MailAndNews.com

 Create a new mailbox, or access your existing IMAP4 or
 POP3 mailbox from anywhere with just a web browser.
------------------------------------------------------------



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

Date: Mon, 05 Mar 2001 14:19:00 +0100
From: Stephane Barizien <sba@ocegr.fr>
Subject: s/// and variables
Message-Id: <3AA39244.8FC5EC7C@ocegr.fr>

{Sorry folks, I haven't been able to find the answer in the myriads of
docs and FAQs I have handy...}

I have

(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d)

in $dateformat_re1 and

$1$2$3$4$5$6

in $dateformat_re2.

How do I do:

$foo =~ s/$dateformat_re1/$dateformat_re2/;

--sort of, the above does NOT work. I've tried qr'ing only
$dateformat_re1, or both $dateformat_re1 and $dateformat_re2, no
success. The 'best' I've obtained in $foo is $1$2$3$4$5$6 (so s/// does
match, but substitutes the wrong thing).

Any clue?

TIA

P.S. how do I protect myself against the situation where $dateformat_re1
and/or $dateformat_re2 would contain /'s?




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

Date: Mon, 05 Mar 2001 09:33:20 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: statement for(list);
Message-Id: <v5n6atcm9ci4hpjkl53kf4rpmj7a9gt7pe@4ax.com>

Ilya Zakharevich wrote:

>Martien Verbruggen wrote:

>> I've found myself wanting to write things like
>> 
>> $_ *= 3 for (@a) if ($some_condition);
>> 
>> quite a few times. I find the above quite legible and parseable, but I'm
>> sure that there are good reasons why the perl parser at the moment can't
>> deal with that.
>
>The fact that writers find their production legible tells very
>little.  E.g., I have no idea what the above statemetn would do.  Or
>
>  $_ *= 3 if $some_condition for @a;
>
>Do not have any mental picture of relative precedence of 'if' vs 'for'.

It's not a "for" versus "if" precedence. It's an "outer" versus "inner"
precedence. 

	$_ *= 3 if $some_condition for @a;

is like

	do { $_ *= 3 if $some_condition } for @a;

and

	$_ *= 3 for @a if $some_condition;

is like

	do { $_ *= 3 for @a } if $some_condition;

except for the nasty side effects that do in loops *may* have. I can't
remember the exact rules for those, and therefore, I'd like to stay away
from them.

-- 
	Bart.


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

Date: Mon, 5 Mar 2001 22:19:28 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: statement for(list);
Message-Id: <slrn9a6thv.9kp.mgjv@martien.heliotrope.home>

On 5 Mar 2001 07:39:18 GMT,
	Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> [A complimentary Cc of this posting was NOT sent to Martien Verbruggen
><mgjv@tradingpost.com.au>],
> who wrote in article <slrn99plmu.8ue.mgjv@martien.heliotrope.home>:
>> No. You're not. I've found myself wanting to write things like
>> 
>> $_ *= 3 for (@a) if ($some_condition);
>> 
>> quite a few times. I find the above quite legible and parseable, but I'm
>> sure that there are good reasons why the perl parser at the moment can't
>> deal with that.
> 
> The fact that writers find their production legible tells very
> little.  E.g., I have no idea what the above statemetn would do.  Or
> 
>   $_ *= 3 if $some_condition for @a;
> 
> Do not have any mental picture of relative precedence of 'if' vs 'for'.

It's easy enough to define. process from right to left. n other words,
the right statement becomes the outer loop/block. My example would
become

if ($some_condition)
{
    for (@a)
    {
        $_ *= 3;
    }
}

and yours

for (@a)
{
    if ($some_condition)
    {
        $_ *= 3;
    }
}

The fact that there are no parsing rules for such a construction right
now was exactly my point. Once they get defined (and there are other
possibilities, although I find my interpretation most logical, and have
a feeling most people would), there should be no problem parsing this.
Unless there is something that I am not aware of, which is entirely
possible.

>> I also wouldn't mind having things like:
>> 
>> do_something_with($foo) for my $foo (@a);
> 
> I'm missing it a lot too, but would hate it if it were implemented.

Why would you hate it? Perlformance?

And I still think that if multiple statement modifier are going to be
allowed, that something like that will be als\most necessary. Otherwise 

$_ *= $i for my $i (@multipliers) while <STDIN>;

wouldn't be possible. 

$_ *= $_ for @multipliers while <STDIN>;

would hide the outer assignment to $_ (by the while) from the inner loop
(inside the for).

> Reminds me some other posting of the last week, with a happy conclusion
> of everybody agreeing with each other, happily forgetting that the
> scope of 'my' starts on the *next* statement.  Sorry, do not remember
> any other detail...
 
I don't think I saw that.

I know that right now a statement modifier isn't equivalent to a
conditional block or a loop, but I do really wonder why not.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd.   | from a rich salesperson.
NSW, Australia                  | 


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

Date: 5 Mar 2001 11:25:13 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: statement for(list);
Message-Id: <97vt2p$c5h$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Bart Lateur 
<bart.lateur@skynet.be>],
who wrote in article <v5n6atcm9ci4hpjkl53kf4rpmj7a9gt7pe@4ax.com>:
> >The fact that writers find their production legible tells very
> >little.  E.g., I have no idea what the above statemetn would do.  Or
> >
> >  $_ *= 3 if $some_condition for @a;
> >
> >Do not have any mental picture of relative precedence of 'if' vs 'for'.
> 
> It's not a "for" versus "if" precedence. It's an "outer" versus "inner"
> precedence. 
> 
> 	$_ *= 3 if $some_condition for @a;
> 
> is like
> 
> 	do { $_ *= 3 if $some_condition } for @a;

LOL!  Since to decide what is "outer" and what is "inner" you *need*
to know precedence!  E.g., with

  $_ *= 3 if do { $some_condition for @a };

'if' becomes outer, and 'for' inner.

Hope this helps,
Ilya


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

Date: Mon, 05 Mar 2001 11:36:31 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: statement for(list);
Message-Id: <u8u6at41g60a4tn41nejicr5htm0fnghse@4ax.com>

Ilya Zakharevich wrote:

>> 	$_ *= 3 if $some_condition for @a;
>> 
>> is like
>> 
>> 	do { $_ *= 3 if $some_condition } for @a;
>
>LOL!  Since to decide what is "outer" and what is "inner" you *need*
>to know precedence!  E.g., with
>
>  $_ *= 3 if do { $some_condition for @a };
>
>'if' becomes outer, and 'for' inner.

Oh. Yes. I see.

I thought it was absolutely clear that the right side are modifiers, and
they compromise the statement on the left of it. I think Perl even
agrees with me. The BNF for statement modifiers is something like:

	STATEMENT := STATEMENT if EXPR;
	STATEMENT := STATEMENT for EXPR;

etc.

That's how I interpret the text in perlsyn, anyway.

Note: "STATEMENT", *not* "EXPR". Thus such a modified statement can
never be used as an expression. Thus, you alternative for interpretation
can never fly.

Besides, ( EXPR for @array ) doesn't have a value.

	print foo(qw(a b c));
	sub foo {
	    1 for @_;
	}
-->
	
Nada.

-- 
	Bart.


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

Date: Mon, 05 Mar 2001 10:08:09 +0100
From: Christoph Neubauer <christoph.neubauer@siemens.at>
Subject: What's wrong with ...
Message-Id: <3AA35779.447C4AC1@siemens.at>

Hi Folks !

I tried several variations, but ...


my @ima_list = glob "$ENV{SESO_IMAGES}/*";
(system ( "/bin/uncompress", "@ima_list" ) == 0 ) or (die "ERROR>
uncompress failed: $! <-");

 ... always gives ...

/home/sn_root/opt/seso/images/image256.Z
/home/sn_root/opt/seso/images/image512.Z: No such file or directory
ERROR> uncompress failed: Illegal seek <- at errtest.pl line 9.


It seems that 'glob' finds the files, but handling it over to 'system'
via list fails.
What's wrong with it ?

If a implement a loop around the list, it works correctly.

my @ima_list = glob "$ENV{SESO_IMAGES}/*";
foreach my $ima (@ima_list) {
  (system ( "/bin/uncompress", "$ima" ) == 0 ) or (die "ERROR>
uncompress failed for $ima: $! <-");
};


By the way, I use perl 5.004_04 for Solaris.

Best regards and many thanks for answers,
Chris



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

Date: 5 Mar 2001 10:03:56 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: What's wrong with ...
Message-Id: <97voac$bq$1@mamenchi.zrz.TU-Berlin.DE>

According to Christoph Neubauer  <christoph.neubauer@siemens.at>:
> Hi Folks !
> 
> I tried several variations, but ...
> 
> 
> my @ima_list = glob "$ENV{SESO_IMAGES}/*";
> 
> (system ( "/bin/uncompress", "@ima_list" ) == 0 ) or (die "ERROR>

The string "@ima_list" contains all your filenames separated by
blanks (or whatever is in $").  This is handed over to uncompress
as a single file.  Unless @ima_list contains exactly one element
this file won't exist.

> uncompress failed: $! <-");
> 
> ... always gives ...
> 
> /home/sn_root/opt/seso/images/image256.Z
> /home/sn_root/opt/seso/images/image512.Z: No such file or directory
> ERROR> uncompress failed: Illegal seek <- at errtest.pl line 9.

Did you set $" to "\n"?  It looks like it.  But note that uncompress
complains only once about what looks like two filenames.

> 
> It seems that 'glob' finds the files, but handling it over to 'system'
> via list fails.
> What's wrong with it ?

Just get rid of the quotes around @ima_list:

  system '/bin/uncompress', @ima_list

That way each filename is handed over as one argument to uncompress.

See perldoc -f system (which will probably point you to perldoc -f
exec) for how this works.

Anno


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

Date: Mon, 05 Mar 2001 10:18:31 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: What's wrong with ...
Message-Id: <5sp6ato6vhg9nrmdr30btakjiu45u1ljup@4ax.com>

Christoph Neubauer wrote:

>my @ima_list = glob "$ENV{SESO_IMAGES}/*";
>(system ( "/bin/uncompress", "@ima_list" ) == 0 ) or (die "ERROR>
>uncompress failed: $! <-");
>
>... always gives ...
>
>/home/sn_root/opt/seso/images/image256.Z
>/home/sn_root/opt/seso/images/image512.Z: No such file or directory
>ERROR> uncompress failed: Illegal seek <- at errtest.pl line 9.
>
>
>It seems that 'glob' finds the files, but handling it over to 'system'
>via list fails.
>What's wrong with it ?

The way you do this now, you're passing a string containing ALL image
names to the program, pretending it's one filename, containing spaces.

Either pass system() one string containing both program name and files,
or pass all file names as individual arguments, not joined in one
string. I prefer the latter, because the former relies on a shell, while
the latter bypasses it.

	system ("/bin/uncompress @ima_list");    # so so
	system ("/bin/uncompress", @ima_list);   # better!

-- 
	Bart.


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

Date: Mon, 05 Mar 2001 12:49:54 +0100
From: Christoph Neubauer <christoph.neubauer@siemens.at>
Subject: Re: What's wrong with ...
Message-Id: <3AA37D61.77FE49D5@siemens.at>



Bart Lateur wrote:

> <snip>
>         system ("/bin/uncompress", @ima_list);   # better!
>
> --
>         Bart.

Thanks, it works fine !
Chris



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

Date: Mon, 05 Mar 2001 12:49:03 GMT
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Why doesnt it work. The whole list deletes.
Message-Id: <1epsu5d.577fyx7a0mnuN%tony@svanstrom.com>

Bill Kelly <billk@cts.com> wrote:

> (By the way, is this a homework assignment of some kind?  See also the
> thread "How can I search and delete a specific name in a textfile." by
> "Fabian Thorbjörnsson", discussing the same problem.)

s/homework/business/

   Domain Name: MARKISSPECIALISTEN.COM

   Administrative Contact:
      Thorbjornsson,Fabian  (TF856-ORG)  info@TVETTSVAMP.A.SE
      Tvattsvamparna HB
      Box 179
      Ekero, - S-178 23
      SWEDEN
      +46 8 56030100


        /Tony


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

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 V10 Issue 418
**************************************


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