RE: deprewhat?
On 13 August 2002 04:44 Janek Schleicher [mailto:[EMAIL PROTECTED]] wrote: Kirby_sarah wrote at Mon, 12 Aug 2002 23:28:44 +0200: line 344: $policyCount = split (/\t/, $violations{$vID}); Another way to count the parts is my $count = 1; while ($violations{$vID} =~ /\t/g) { $count++ } If you just want to count characters, you can use tr with an empty output list... $violations =~ tr:\t::; Richard Cox Senior Software Developer Dell Technology Online All opinions and statements mine and do not in any way (unless expressly stated) imply anything at all on behalf of my employer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: deprewhat?
When doing a split and no array present to the left of = then would go to @_ when wanted to see what you had just split. It is saying you should not do that, but provide an array reference for the split. Wags ;) ps I believe that it is what it is saying. -Original Message- From: Kirby_Sarah [mailto:[EMAIL PROTECTED]] Sent: Monday, August 12, 2002 14:29 To: '[EMAIL PROTECTED]' Subject: deprewhat? What does this mean? Use of implicit split to @_ is deprecated at UNIX_prelim.pl line 344. line 344: $policyCount = split (/\t/, $violations{$vID}); -Sarah -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: deprewhat?
'deprecated' means that in the future, this functionality is expected to be removed from the programming language. It generally implies that you should do what you are doing in a different way so that in the future your code will still work. In this case, it looks like you are trying to assign the array generated by the split command to a scalar variable, so perl is assigning it to the array @_ and then doing the scalar assignment behind the scenes. Is that what you really want? /\/\ark -Original Message- From: Kirby_Sarah [mailto:[EMAIL PROTECTED]] Sent: Monday, August 12, 2002 2:29 PM To: '[EMAIL PROTECTED]' Subject: deprewhat? What does this mean? Use of implicit split to @_ is deprecated at UNIX_prelim.pl line 344. line 344: $policyCount = split (/\t/, $violations{$vID}); -Sarah -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: deprewhat?
read: perldoc -f split split /PATTERN/,EXPR,LIMIT split /PATTERN/,EXPR split /PATTERN/ split Splits a string into a list of strings and returns that list. By default, empty leading fields are preserved, and empty trailing ones are deleted. In scalar context, returns the number of fields found and splits into the @_ array. Use of split in scalar context is deprecated, however, because it clobbers your subroutine arguments. [snip] you are using split in scalar context. Anyone know what's the solution to get around this? other than turning off warnings. -Original Message- From: Kirby_Sarah [mailto:[EMAIL PROTECTED]] Sent: Monday, August 12, 2002 5:29 PM To: '[EMAIL PROTECTED]' Subject: deprewhat? What does this mean? Use of implicit split to @_ is deprecated at UNIX_prelim.pl line 344. line 344: $policyCount = split (/\t/, $violations{$vID}); -Sarah -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: deprewhat?
On Mon, Aug 12, 2002 at 05:40:18PM -0400, Nikola Janceski wrote: you are using split in scalar context. Anyone know what's the solution to get around this? other than turning off warnings. -Original Message- Use of implicit split to @_ is deprecated at UNIX_prelim.pl line 344. line 344: $policyCount = split (/\t/, $violations{$vID}); You could use the =()= operator: $policyCount =()= split (/\t/, $violations{$vID}, -1); OK, it's not an operator. It's assigning the result of the split to an empty list. And you need to specify a negative third argument to split, which may have undesirable side effects. You might prefer = () = too. Or you might prefer to do it another way. tr for example. $policyCount = $violations{$vID} =~ tr/\t//; -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: deprewhat?
On Tue, Aug 13, 2002 at 12:06:50AM +0200, Paul Johnson wrote: $policyCount = $violations{$vID} =~ tr/\t//; Oops. I forgot the + 1. $policyCount = $violations{$vID} =~ tr/\t// + 1; Proofreading is so much easier once it's been sent. -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: deprewhat?
This works for me. Thanks for everyone's remarks and helpful advice. -Sarah -Original Message- From: Paul Johnson [mailto:[EMAIL PROTECTED]] Sent: Monday, August 12, 2002 6:14 PM To: Nikola Janceski Cc: 'Kirby_Sarah'; '[EMAIL PROTECTED]' Subject: Re: deprewhat? On Tue, Aug 13, 2002 at 12:06:50AM +0200, Paul Johnson wrote: $policyCount = $violations{$vID} =~ tr/\t//; Oops. I forgot the + 1. $policyCount = $violations{$vID} =~ tr/\t// + 1; Proofreading is so much easier once it's been sent. -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: deprewhat?
Kirby_sarah wrote at Mon, 12 Aug 2002 23:28:44 +0200: line 344: $policyCount = split (/\t/, $violations{$vID}); Another way to count the parts is my $count = 1; while ($violations{$vID} =~ /\t/g) { $count++ } Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]