On Wednesday 04 February 2004 10:48 am, nancy clark wrote:
> Tom Franklyn <[EMAIL PROTECTED]> wrote:From: "Tom Franklyn"
> Subject: Is it a perl Bug?
> Date: Wed, 04 Feb 2004 12:43:56 +0200
>
> Dear all,
>
> I've following code :
>
> ==========
> #!/usr/bin/perl
>
> my $a = "ab:cd:ef";
> my @b = split(/:/,$a);
> print ("@b\n");
>
> my @c = ('/:/', $a);
> my @d = split(@c);
What exactly are you wanting to happen here?
What you're actualy doing is calling
split(/ab/,'cd','ef');
which says use 'ab' as the pattern,'cd' as the expr, and 'ef' as the limit.
split obviously can't handle this and thus returns undef.
> print ("@d\n");
> ===========
> Whats wrong with my code?
> why @b and @d give different output?
>
> Rgds,
> Tom Franklyn
> ------------------------------------------------------------
> Jesus?? Not a God!
> http://www.geocities.com/abdlfth99/jesus_not_a_god.htm
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>