RE: perlrun -aF

"Allen, Greg" <[email protected]>
Newsgroups gmane.comp.lang.perl.golf
Message-ID <[email protected]>
You can't specify an empty -F parameter like that:

% perl5 -MO=Deparse -aF'' -ne 'print map{unpack"B8",$_}@F'
LINE: while (defined($_ = <ARGV>)) {
    our(@F) = split(" ", $_, 0);
    print map({unpack 'B8', $_;} @F);
}

Notice the split " " ...

Greg

-----Original Message-----
From: Tor Hildrum [mailto:[email protected]] 
Sent: Tuesday, November 11, 2003 5:47 PM
To: [email protected]
Subject: perlrun -aF


Hi there, I just have a little peculiarity that I am wondering about.

The following code works as expected:
#!/usr/bin/perl

while(<>)
{
     @F = split('');

     print map unpack("B8",$_),@F;
}

Test run:
tor% ./test.pl
abc
01100001011000100110001100001010*

BUT:
tor% perl -aF'' -ne 'print map{unpack"B8",$_}@F'
does not.

tor% perl -aF'' -ne 'print map{unpack"B8",$_}@F'
abc
01100001

Doesn't autosplit or -F work as described in perlrun?

Tried both Perl 5.005_03 and 5.8

Tor

* Need to add some spaces, but haven't figured out any
decent method yet. :)


------------------------------------------------------------------------------
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient of
this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information is
complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.