Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] Doubt on variables.

Expand Messages
  • Sreeram B S
    Rajesh, Yeah, that worked! Thanks, Sreeram ... === message truncated === __________________________________ Start your day with Yahoo! - Make it your home
    Message 1 of 7 , Nov 23, 2005
    • 0 Attachment
      Rajesh,
      Yeah, that worked!

      Thanks,
      Sreeram


      --- RAJESH PETHE <rpethe@...> wrote:

      >
      > Try this out.
      >
      > Change my $var = "\$"."time"; to
      > my $var = "time";
      >
      > Let me know if it works. :)
      >
      > Thanks
      > Rajesh
      >
      > -----Original Message-----
      > From: perl-beginner@yahoogroups.com
      > [mailto:perl-beginner@yahoogroups.com] On Behalf Of
      > Sreeram B S
      > Sent: Wednesday, November 23, 2005 4:10 PM
      > To: perl-beginner@yahoogroups.com
      > Subject: RE: [PBML] Doubt on variables.
      >
      > Hi Rajesh,
      > I tried that, but it did not work. The condition
      > fails.
      >
      > my $time = 10;
      > my $var = "\$"."time";
      >
      > if ( defined(${$var}) ) {
      > print "Defined\n";
      > } else {
      > print "Not defined\n";
      > }
      >
      > --## This produces the result as: Not defined.
      >
      > Could you please suggest any other method?
      >
      > THanks,
      > Sreeram
      >
      >
      > --- RAJESH PETHE <rpethe@...> wrote:
      >
      > >
      > > I think, defined(${$var}) should do what you want.
      > >
      > > Regards
      > > Rajesh
      > >
      > > -----Original Message-----
      > > From: perl-beginner@yahoogroups.com
      > > [mailto:perl-beginner@yahoogroups.com] On Behalf
      > Of Sreeram B S
      > > Sent: Wednesday, November 23, 2005 3:34 PM
      > > To: perl-beginner@yahoogroups.com
      > > Subject: [PBML] Doubt on variables.
      > >
      > > Hi friends,
      > >
      >
      > >
      > >
      > > I had one query regarding the variables.
      > > Suppose I want to know whether a variable is
      > defined or not, I can
      > > use "defined" function. But I would like to know
      > whether a variable is
      >
      > > defined, whose name is stored in another variable.
      > > Is this possible? If
      > > yes, kindly guide me.
      > >
      >
      > >
      > >
      > > For eg:
      > > -------
      > > #!/usr/bin/perl
      > >
      >
      > >
      > >
      > > my $time = 10;
      > > my $var;
      > >
      >
      > >
      > >
      > > $var = "\$"."time";
      > > --## Here the variable $var contains
      > $time.
      > > Now is it possible to know whether $time (which is
      > defined in $var),
      > > is defined or not, using some function on $var?
      > >
      >
      > >
      > >
      > > Kindly suggest.
      > >
      >
      > >
      > >
      > > Thanks,
      > > Sreeram
      > >
      > >
      > >
      > >
      > > __________________________________
      > > Yahoo! FareChase: Search multiple travel sites in
      > one click.
      > > http://farechase.yahoo.com
      > >
      > >
      > > ------------------------ Yahoo! Groups Sponsor
      > >
      > > Unsubscribing info is here:
      > >
      > http://help.yahoo.com/help/us/groups/groups-32.html
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      >
      *********************************************************
      > > Disclaimer:
      > >
      > > The contents of this E-mail (including the
      > contents of the
      > > enclosure(s) or attachment(s) if any) are
      > privileged and confidential
      > > material of MBT and should not be disclosed to,
      > used by or copied in
      > > any manner by anyone other than the intended
      > > addressee(s). In case you are not the desired
      > > addressee, you should delete this message and/or
      > re-direct it to the
      > > sender. The views expressed in this E-mail
      > message (including the
      > > enclosure(s) or
      > > attachment(s) if any) are those of the individual
      > sender, except where
      >
      > > the sender expressly, and with authority, states
      > them to be the views
      > > of MBT.
      > >
      > > This e-mail message including attachment/(s), if
      > any, is believed to
      > > be free of any virus. However, it is the
      > responsibility of the
      > > recipient to ensure that it is virus free and MBT
      > is not responsible
      > > for any loss or damage arising in any way from its
      > use
      > >
      > >
      >
      *********************************************************
      > >
      >
      >
      >
      >
      >
      > __________________________________
      > Yahoo! Mail - PC Magazine Editors' Choice 2005
      > http://mail.yahoo.com
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > Unsubscribing info is here:
      > http://help.yahoo.com/help/us/groups/groups-32.html
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      >
      *********************************************************
      > Disclaimer:
      >
      > The contents of this E-mail (including the contents
      > of the enclosure(s) or attachment(s) if any) are
      > privileged and confidential material of MBT and
      > should not be disclosed to, used by or copied in any
      > manner by anyone other than the intended
      > addressee(s). In case you are not the desired
      > addressee,
      === message truncated ===




      __________________________________
      Start your day with Yahoo! - Make it your home page!
      http://www.yahoo.com/r/hs
    Your message has been successfully submitted and would be delivered to recipients shortly.