try

 my ($a,$b)=("apples","apples");

In the other example it was pulling values from an array of scalars.

In your example you are only providing 1 scalar for 2 scalar variables to
share.

Royce



"The right word may be effective, but no word was ever as effective as a
rightly timed pause."
                                       --Mark Twain



                                                                                       
                                          
                      Jeff Westman                                                     
                                          
                      <[EMAIL PROTECTED]        To:       beginners <[EMAIL 
PROTECTED]>                                          
                      om>                      cc:                                     
                                          
                                               Subject:  Scalars and Strict            
                                          
                      06/04/2003 01:36                                                 
                                          
                      PM                                                               
                                          
                                                                                       
                                          
                                                                                       
                                          




This may sound trivial, but I am trying to declare and assign multiple
scalars to the same variable in the same statement.  This is what I have:

 #!/bin/perl -w
 $a = $b = "apple";        # works
 use strict;
 my ($a = $b) = "apple";   # does not works
 my $a = my $b = "apple";  # works .. but looks ugly

I'm trying to get away from using multiple "my"s in the same statement.  I
looked at FTP.pm, and for *lists* it's possible:
 my ($ftp, $dir, $recurse) = @_;

Is there something I am not seeing?

Thanks

Jeff


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




------------------------------------------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to