Go Back   CP Web Hosting - reseller hosting > Server Scripting > PERL
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-10-2007, 10:10 AM
Junior Member
 
Join Date: Apr 2007
Posts: 13
Default Whether a number or a string is needed

Perl automatically converts between numbers to strings as needed. How does it know whether a number or a string is needed?
Reply With Quote
  #2 (permalink)  
Old 07-10-2007, 10:12 AM
Junior Member
 
Join Date: May 2007
Posts: 15
Default

It all depends upon the operator being used on the scalar value. If an operator expects a number (like + does), Perl will see the value as a number. If an operator expects a string (like . does), Perl will see the value as a string. So you don't need to worry about the difference between numbers and strings, just use the proper operators, and Perl will make it all work.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:59 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0