sorry i wasn't more clear, the ; in perl ends a statement but the or on the next line means it's still going. perl is getting confused cause there is stop but there is still more.

if you remove the ; from the end of the first line of code to or will continue and end at the ; on the second line and will work as desired. the benefit to drm's version is that it has an error check, that is what the or is for. ie: if it can't open apt-cache dump, it's run the or part of the statement and at least tell you something and stop trying to continue the rest of the script.
---
TS
http://southofheaven.org
Chaos is the beginning and end, try dealing with the rest.


On 26-Feb-05, at 9:13 AM, Robert T Wyatt wrote:

I finally realized I had picked up my "typo" from Dave V's suggestion and simply replied to the wrong message.

When I tried Dave's suggestion (below), it failed with:

bash-2.05b$ fink selfupdate
syntax error at /sw/lib/perl5/Fink/Package.pm line 361, near "or"
Compilation failed in require at /sw/lib/perl5/Fink/Engine.pm line 34.
BEGIN failed--compilation aborted at /sw/lib/perl5/Fink/Engine.pm line 34.
Compilation failed in require at /sw/bin/fink line 167.
bash-2.05b$


This is with Package.pm lines 360, 361 (on 10.2):

    open APTDUMP, "-|", "$basepath/bin/apt-cache dump";
        or die "Can't run apt-cache dump: $!";

Perhaps this is where TS' comment comes in:

At 1:51 PM -0700 2/25/05, TheSin wrote:
can't have that first ;

Since the other solution (given by dmacks below) is working, I'm not going to go down the road of figuring out why Dave's isn't, but y'all probably already know why anyhow.




At 3:12 PM -0500 2/25/05, Dave Vasilevsky wrote:
On Feb 25, 2005, at 10:24 AM, Daniel Macks wrote:
open APTDUMP, "$basepath/bin/apt-cache dump |"

Perl usually discourages this form, since if someone could convince $basepath to bstart with ">" it might do bad things.


Why not stick with this?

open APTDUMP, "-|", "$basepath/bin/apt-cache dump";

Still not super (since ugly basepaths with spaces can still fail), but a bit better and it works with both perls.

Dave


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-devel





------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Fink-devel mailing list Fink-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to