[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Re: System functions



maniscsj@snyoneva.cc.oneonta.edu, mac-perl@iis.ee.ethz.ch
Subject: [MacPerl] System functions

Steven Maniscalco wrote recently:

>How would I perform the equivalent of the Unix perl function system(),
>say system("date") in MacPerl?

Even on UNIX there is no reason not to use either form of builtin:

   print(scalar(localtime());

or
  $date = scalar(localtime());

If you are shooting for cross platform ability then use perl builtins and/or 
the standard perl libraries. 
Not that you asked but here is how you do a DOS DEL:

   unlink('filename.ext');  # works on mac, unix, vms, mvs, as/400, ...

and here is how you copy files the easy way:

   use File::Copy;

   copy('filea','fileb');  # handles a mac resource fork

>Also,  can someone tell me how to access the Macperl help document
>provided with the distibution.  The error I am getting is..
>
>	Can not find helper for "pod".  Do you want to create one?  
>
>I can create the "pod" in Internet Config however I do not know what
>helper to associate it with????

'Shuck'.

Peter Prymmer


P.S. for extreme cross platform ability avoid system() as well as
back ticks and their equivalent such as qx//

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch