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

Re: [MacPerl] print chars to STDOUT without \n?



At 14.12 97/2/18, Yoichi Goto wrote:
>$yourText = 'your text';
>@yourText = $yourText;

This does not do what you apparently want it to do.  This makes $yourText
the first element of @yourText.

Let's take a stroll down debugger lane for the following script:

#---
$yourText = 'your text';
@yourText = $yourText;
@yourText = split(//,$yourText);
exit;
#---

Loading DB routines from perl5db.pl patch level 0.94
Emacs support available.

Enter h or `h h' for help.

main::(Dev:Pseudo:1):   $yourText = 'your text';
  DB<1> s
main::(Dev:Pseudo:2):   @yourText = $yourText;
  DB<1> X yourText
$yourText = 'your text'
  DB<2> s
main::(Dev:Pseudo:3):   @yourText = split(//,$yourText);
  DB<2> X yourText
$yourText = 'your text'
@yourText = (
   0  'your text'                                       #array is one element
)
  DB<3> s
main::(Dev:Pseudo:4):   exit;
  DB<3> X yourText
$yourText = 'your text'
@yourText = (                                           #array is many elements
   0  'y'
   1  'o'
   2  'u'
   3  'r'
   4  ' '
   5  't'
   6  'e'
   7  'x'
   8  't'
)
  DB<4> s


#================================================================
Chris Nandor                                      pudge@pobox.com
PGP Key 1024/B76E72AD                           http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6