Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: ActivePERL is the devil?

by ferreira (Chaplain)
on Jun 07, 2007 at 21:55 UTC ( [id://619912]=note: print w/replies, xml ) Need Help??


in reply to ActivePERL is the devil?

As the (yet non-official) maintainer of Shell as a CPAN distribution, I would like to defend there are good uses for Shell. But this does not seem one of them: all of the external programs you are calling have Perl builtins or core libraries to do it portably and faster.
use Shell qw( perl ); # { local @ARGV = (...); do $filename; } use Shell qw( dir ); # glob() seems enough use Shell qw( copy ); # File::Copy use Shell qw( del ); # unlink use Shell qw( cd ); # chdir

All the advices of the monks who replied to this node still apply. Some refactoring and moving filenames and tasks to configuration metadata driving the script could produce a much more robust and useful tool. But probably this isn't a priority or a need. So just two suggestions: (1) use / everywhere because Perl at Windows understand it very well unlike Windows itself; (2) maybe the Perl scripts "d:/perl/macc1" and "d:/perl/mmac3" can be converted to Perl modules with advantages to maintenance.

Replies are listed 'Best First'.
Re^2: ActivePERL is the devil?
by ikegami (Patriarch) on Jun 08, 2007 at 13:22 UTC

    use / everywhere because Perl at Windows understand it very well unlike Windows itself

    I've been told (on PerlMonks) that Windows system calls understand / just fine. It's the individual tools and shell commands that don't.

    In fact, it seems the shell tools understand / just fine if it's in quotes:

    G:\>md /test The syntax of the command is incorrect. G:\>md "/test" G:\>copy nul /test/file The syntax of the command is incorrect. G:\>copy nul "/test/file" 1 file(s) copied. G:\>dir /test Invalid switch - "". G:\>dir "/test" Volume in drive G is CLFS01-USR-N Volume Serial Number is 5C24-AC1F Directory of G:\test 2007/06/08 09:21 AM <DIR> . 2007/06/08 09:21 AM <DIR> .. 2007/06/08 09:21 AM 0 file 1 File(s) 0 bytes 2 Dir(s) 81,590,624,256 bytes free
Re^2: ActivePERL is the devil?
by naikonta (Curate) on Jun 08, 2007 at 15:24 UTC
    use Shell qw( perl ); # { local @ARGV = (...); do $filename; }
    Or,
    system $^X, 'otherscript', 'someargs';
    to ensure the use of the exact same copy of perl.

    Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://619912]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-19 22:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found