Re: Split question
From: R. Joseph Newton (rjnewton_at_efn.org)
Date: 12/15/03
- Next message: Alan Perry: "RE: Split question"
- Previous message: Laurent Coudeur: "Re: pass vars to sub via TK/Button"
- In reply to: John W. Krahn: "Re: Split question"
- Next in thread: Rob Dixon: "Re: Split question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 15 Dec 2003 06:59:30 -0800 To: "John W. Krahn" <krahnj@acm.org>
"John W. Krahn" wrote:
> "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 code as it is? Nope. Knew the likely result:
Greetings! E:\d_drive\perlStuff\JPEG>perl -le'
Can't find string terminator "'" anywhere before EOF at -e line 1.
>
>
> > 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.
I see:
[portable--semi, anyway, takes ^D to finish in 'nix]
Greetings! E:\d_drive\perlStuff\JPEG>perl -l
@temp = split(/#/, "abc#def#ghi#jkl");
print for @temp;
^Z
abc
def
ghi
jkl
>
>
> > 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 ?
Wasn't. Runs in the Perl interpreter. That way, I'm not struggling to cram
disparate concepts into one line.
Greetings! E:\d_drive\perlStuff\giffy>perl -w
> > @temp = split(/#/, "abc#def#ghi#jkl");
> > print "$_\n" for @temp;
> > ^Z #^D for 'nix
> > abc
> > def
> > ghi
> > jkl
Joseph
- Next message: Alan Perry: "RE: Split question"
- Previous message: Laurent Coudeur: "Re: pass vars to sub via TK/Button"
- In reply to: John W. Krahn: "Re: Split question"
- Next in thread: Rob Dixon: "Re: Split question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]