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

Re: [MacPerl] Re: OT dot files



At 14.33 -0500 1999.01.12, Doug McNutt wrote:
>What really bugs me though is filenames that include a return character like
>"icon\n' for folders and disks with a special icon. I haven't seen a
>filename with a null character in it, but I believe it's perfectly possible
>so long as you don't insist on C strings. Can one work with a null in a
>regular expression in Perl?

  $_ = "\0";
  print "yep, and " if /./;
  print "yep" if /\0/;

I sometimes, when dealing with files in a directory, filter out:

  next if $file eq "Icon\n";

Or:

  @files = grep !/^Icon\n$/, readdir(D);

etc.  Unix users have to deal with something similar:

  next if $file =~ /^\.\.?$/;

etc.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

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