develooper Front page | perl.perl5.porters | Postings from September 2008

Re: chomp of qx

From:
Michael G Schwern
Date:
September 28, 2008 14:15
Subject:
Re: chomp of qx
Message ID:
48DFF3F4.4060101@pobox.com
Yitzchak Scott-Thoennes wrote:
> New subthread, just p5p.  Please reply to some other message if you want
> to comment on the "how to bundle MB" issue.
> 
> On Sun, September 28, 2008 1:16 pm, Michael G Schwern wrote:
>> my $installed_mb = `$^X "-MModule::Build" -le "print
> Module::Build->VERSION"`;
>> chomp $installed_mb;
> 
> Is there some platform that needs the -l/chomp combination?
> (Most places, leaving off the -l removes the need for the chomp.)
> VMS perhaps?

Yes, VMS likes to put newlines on the end of prints.  It's best cross-platform
practice to assume it's there.  I guess I could have done without the -l.

As a related issue, VMS likes to downcase unquoted arguments which is why
-MModule::Build is quoted.

Finally, "" is the preferred shell quoting operator on Windows, and you can
use it on Unix if you avoid anything that might interpolate which is why I use
Module::Build->VERSION rather than $Module::Build::VERSION.

That's my cheater's guide to cross-platform one-liners.  Anything slightly
complicated, stick it in a module, load it and call a function.


>> a fuckton easier than in MakeMaker.
> 
> $ units fuckton amu
> Unknown unit 'fuckton'
> 
> Massless?

I believe it's defined as the mass of an assload of trouble.


-- 
There will be snacks.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About