dusk has asked for the wisdom of the Perl Monks concerning the following question:
The napster.pl client included with MP3::Napster uses a similar sub to the one below to recieve a list of names in the channel:
However, this returns: Argument "DSL" isn't numeric in printf at perl/duskster/test.pl line 116. I was informed that printf is unecessary in perl, and that there are far better ways to do it. Any suggestions/fixes will be greatly appreciated :)109 sub names 110 { 111 unless ($nap_object->channel){ 112 print qq-No current channel\n-; 113 return; 114 } 115 foreach ($nap_object->users) { 116 printf "\t([ %-20s ]) (%-9s)(%4d)\n",$_,$_->s +haring,$_->link; 117 } 118 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: printf confusion
by AgentM (Curate) on Feb 21, 2001 at 07:23 UTC | |
|
Re: printf confusion
by BlueLines (Hermit) on Feb 21, 2001 at 07:25 UTC |