At 02:44 PM 8/15/00 -0700, Nathan Wiger wrote:
> > Better yet, DWIM.  If I write
> >
> >   print "[EMAIL PROTECTED]";
> >
> > and no array @southern exists, I probably mean I want it to print
> >
> >   [EMAIL PROTECTED]
> >
> > I'd say, if the variable exists, interpolate it.  If not, print it as
> > it stands.

Less DWIM, please.

>I initially was thinking this too, but there's a major problem:
>
>    print "Your stuff is: @stuff\n";
>
>I want this to *always* print out the _value_ of @stuff, even if it's
>unititalized.

Arrays aren't uninitialized.  They contain zero or more scalars, some of 
which may be uninitialized.

>Perl's already smart enough. I think getting in the habit
>of writing:
>
>    $email = '[EMAIL PROTECTED]';
>
>Is the better thing to do.

Yes!  I think of the quotes as:

' - for strings not doing any variable interpolation
" - for strings doing interpolation, or including digraphs

I have often wished that digraphs were not bundled with variables in this 
respect, i.e., I wanted to put a string containing \n inside single quotes 
just 'cuz it didn't contain variables to be interpolated.  Whether there's 
a way of improving this behavior or not I don't know.

--
Peter Scott
Pacific Systems Design Technologies

Reply via email to