"R. Joseph Newton" wrote:
> 
> Joel Newkirk wrote:
> 
> > Well, actually they don't, since the 'bare' # will be interpreted as
> > starting a comment, while the one in quotes won't...  ;^)
> >
> > The op's assignment was assigning 'split(/' to @temp...
> 
> Did you test.

Did YOU test?

> The only problem I see with John's code is that it addumes that
> the print statement will print a newline,

There is no such assumption, I explicitly told perl to print a newline.

> which it doesn't [at least on my
> installation of V5.8].  On the main point, he is right.
> 
> Greetings! E:\d_drive\perlStuff\giffy>perl -w

How is this supposed to run on the command line without -e ?

> @temp = split(/#/, "abc#def#ghi#jkl");
> print "$_\n" for @temp;
> ^Z
> abc
> def
> ghi
> jkl

Here is a little quiz for you beginners out there.  split() treats its
first argument as a regular expression.  There are TWO exceptions where
the first argument does not behave the same as a normal regular
expression.  What are they?


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to