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

[MacPerl] hand-edit ":" to "/": Proposed solution



En rŽponse au message du  24 aožt 1997,
	dans lequel "valere" avait Žcrit:

| By the way; if I develop on a mac, I'll have all these ":" in the paths,
| right? So to run my scripts on unix, I'll have to hand-edit all relevant
| ":" into "/", right ? Or is there a clever automatic translater (I guess
| my question reveals I'm a newbie too)

I'm only starting with MacPerl (and Mac in general ;-), but been
playing(!) with Perl for more than 2 years.  Here's a solution I would
give:

Whenever referencing to files and directories, I always set an absolute
path. Therefore, these three instructions should make the script portable:

	$sep    = ($MacPerl'Version) ? ':' : '/';
	$racine = 'dir1' . $sep . 'dir2' . $sep;
	$racine = $sep . $racine unless $MacPerl'Version;

HTH...
Any better ideas?

PS: Yes, my var names are in French ;-)

__________________________________________________________________________
   TRAN, Huu Da                                   HuuDa.Tran@risq.qc.ca
   ƒquipe NTIC                               RISQ, une division du CRIM


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