At 23.51 -0400 1999.06.01, Scott Prince wrote: >Hello all, > >I've run across a few things recently and am just wondering if anyone >else has been bitten by these... > >$^O - I have a script and need to know if the platform is Mac or other: > >if ($^O =~ /mac/) { #.... } ># then later on... >$z = eval {/$x/}; ># but wait, eval no longer works! ># removing the ($^O =~ /mac/) verified this. /mac/ won't match $^O on MacPerl. It might match some other OS's, like machten. $^O for MacPerl is "MacOS". See perlport.pod (on http://pudge.net/macperl/ and in perl5.004_05 and higher). >scalar - counting array elements: > >$_ = "a\tb\tc\t\t\t\n"; # read in from a database file >@x = split (/\t/, $_); >if (scalar (@x) == 6) { #... } ># for Unix the number of elements is 6 (as expected) ># for the Mac it is 3 ># MacPerl will not see the empty elements. I wonder what version you have? Using the 5.2.0r4 (the latest), I try: $_ = "a\tb\tc\t\t\t\n"; # read in from a database file @x = split (/\t/, $_); print scalar @x; It prints "6". -- 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 macperl-request@macperl.org