On Sun, 2003-12-14 at 14:52, John W. Krahn wrote:
> Josimar Nunes De Oliveira wrote:
> > 
> > From: "Perl" <[EMAIL PROTECTED]>
> > >
> > >   @temp = split(/#/, "abc#def#ghi#jkl") ;
> > >
> > > doesn't seem to work.
> > >
> > > am i doing anything wrong here ?
> > 
> > Try this:
> > 
> > @temp = split('\#', "abc#def#ghi#jkl") ;
> > foreach (@temp){
> >  print "\n", $_;
> > }
> 
> The first argument to split is converted to a regular expression and the
> '#' character is not special in a regular expression so split/#/ and
> split'\#' do exactly the same thing.

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...

j

> 
> 
> John
> -- 
> use Perl;
> program
> fulfillment
-- 
"Not all those who wander are lost."  - JRR Tolkien


-- 
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