Unknown Warning

Scott Penrose scottp at dd.com.au
Mon Oct 21 00:28:31 CDT 2002


On Monday, Oct 21, 2002, at 15:18 Australia/Melbourne, Paul Fenwick 
wrote:
>
> Split in a scalar context will split into @_ (Camel, first ed, p185).
> In Perl 4, using ?? as pattern delimiters would do the same thing in
> array context.  Perl 5 will still clobber @_ if you use split in a
> scalar context, but it's considered deprecated, hence the warning.
> Clobbering @_ probably isn't what you want, anyway.


Ahhhh.... I see my mistake.

I knew the above, but my mistake was thinking of scalar() as a 
function, ie: calling a function that returns a scalar.

But it is NOT !. It is effectively a compile time directive that says - 
do the NEXT thing in scalar context !

Doooh...

Thanks Paul.

> If you're splitting on a single character, you can use tr/// to
> count the occurances of that character, which will be faster than
> split.

yes yes of course :-) I just simplified the code so that I could grab a 
worked example.

Scott
-- 
Scott Penrose
VP in charge of Pancakes
http://linux.dd.com.au/
scottp at dd.com.au

Dismaimer: If you receive this email in error - please eat it 
immediately to prevent it from falling into the wrong hands.




More information about the Melbourne-pm mailing list