In article <YHLUCHAN.95Sep12131807@cherokee>, <yhluchan@ops.raynet.com> wrote:
> Hi, just a feature request creeping up! It'll make writing portable
> scripts easier. I'd like a regexp syntax for file boundries- something
> that will match the directory seperator for the platform perl is
> running on, or beginning/end of line. If it were called '\f' then
>
> ($head, $end) = /(.*?\f)(.+)$/
>
> would break '../foo' into '../', 'foo' on a unix system
> '..\foo.dat' into '..\', 'foo.dat' on a dossish box
> ':Foo example' into ':' , 'Foo example' on a Macintosh
> 'foo' into '' , 'foo' on any system
>
> Don't know what the dirsep is on VMS, but you get the idea.
>
> I know I can write a sub to set some variable that I can use in place
> of this, or use Basename for 95% of what this would be used for-
> just an idea.
>
Interesting. Just getting Configure to record what the file separator
is would suffice. Then you could say things like:
$fs = $Config{'filesep'};
@parts = split(/\Q$fs\E/, $_);
> -yary
Tim.
> Hi, just a feature request creeping up! It'll make writing portable
> scripts easier. I'd like a regexp syntax for file boundries- something
> that will match the directory seperator for the platform perl is
> running on, or beginning/end of line. If it were called '\f' then
>
> ($head, $end) = /(.*?\f)(.+)$/
>
> would break '../foo' into '../', 'foo' on a unix system
> '..\foo.dat' into '..\', 'foo.dat' on a dossish box
> ':Foo example' into ':' , 'Foo example' on a Macintosh
> 'foo' into '' , 'foo' on any system
>
> Don't know what the dirsep is on VMS, but you get the idea.
>
> I know I can write a sub to set some variable that I can use in place
> of this, or use Basename for 95% of what this would be used for-
> just an idea.
>
Interesting. Just getting Configure to record what the file separator
is would suffice. Then you could say things like:
$fs = $Config{'filesep'};
@parts = split(/\Q$fs\E/, $_);
> -yary
Tim.