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

A very little dubt..........

Expand Messages
  • kjhseka
    Hello, consider the following construct: # Strip leading and trailing whitespaces ($name, $date, $email, $message) =~ s/^ s+//; ($name, $date, $email,
    Message 1 of 5 , Jul 31, 2004
      Hello,
      consider the following construct:

      # Strip leading and trailing whitespaces
      ($name, $date, $email, $message) =~ s/^\s+//;
      ($name, $date, $email, $message) =~ s/\s+$//;

      I expect that it will apply on *each* variable on the list. Either in
      $name, $date, $email and $message, the leading and trailing
      whitespaces should be stripped.

      But, when I execute the script I receive the following warning:

      "Useless use of private variable in void context at myscript.pl, line
      #"......

      The line numbers correspond to the lines above.

      So, perhaps, my construct is not correct... If it is wrong, there is
      some other way to get the same result in a way as compact as above?

      Thanks
      Alphonse
    • Charles K. Clarkson
      ... foreach ( $name, $date, $email, $message ) { s/^ s+//; s/ s+$//; } HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328
      Message 2 of 5 , Jul 31, 2004
        kjhseka <kjhseka@...> wrote:

        : consider the following construct:
        :
        : # Strip leading and trailing whitespaces
        : ($name, $date, $email, $message) =~ s/^\s+//;
        : ($name, $date, $email, $message) =~ s/\s+$//;
        :
        : I expect that it will apply on *each* variable on the list.
        : Either in $name, $date, $email and $message, the leading and
        : trailing whitespaces should be stripped.
        :
        : But, when I execute the script I receive the following warning:
        :
        : "Useless use of private variable in void context at
        : myscript.pl, line #"......
        :
        : The line numbers correspond to the lines above.
        :
        : So, perhaps, my construct is not correct... If it is wrong,
        : there is some other way to get the same result in a way as
        : compact as above?

        foreach ( $name, $date, $email, $message ) {
        s/^\s+//;
        s/\s+$//;
        }

        HTH,

        Charles K. Clarkson
        --
        Mobile Homes Specialist
        254 968-8328
      • jmostert@vividhost.net
        Dear Group, I m a beginner in PHP and would like to know how do I use fopen() to write to files, because of some wierd reason I have to set some flag because
        Message 3 of 5 , Aug 1, 2004
          Dear Group,

          I'm a beginner in PHP and would like to know how
          do I use 'fopen()' to write to files, because of some
          wierd reason I have to set some flag because of a permission
          problem in PHP that does not allow me to "by default" write
          files to my 'httpdocs' directory. I can read files but not
          write to them. This is kinda strange, but yeah.


          Any help would really be appreciated.
          Thanks for your time.



          -Jacques.

          ----------------------------------------------------------------
          This message was sent using IMP, the Internet Messaging Program.
        • Allan Dystrup
          http://dk.php.net/fopen btw, PHP... is Hardly Perl is Hardly Perl is Hardly Perl allan dystrup
          Message 4 of 5 , Aug 2, 2004
            http://dk.php.net/fopen

            btw,
            PHP... is Hardly Perl is Hardly Perl is Hardly Perl
            allan dystrup

            --- In perl-beginner@yahoogroups.com, jmostert@v... wrote:
            > Dear Group,
            >
            > I'm a beginner in PHP and would like to know how
            > do I use 'fopen()' to write to files, because of some
            > wierd reason I have to set some flag because of a permission
            > problem in PHP that does not allow me to "by default" write
            > files to my 'httpdocs' directory. I can read files but not
            > write to them. This is kinda strange, but yeah.
            >
            >
            > Any help would really be appreciated.
            > Thanks for your time.
            >
            >
            >
            > -Jacques.
            >
            > ----------------------------------------------------------------
            > This message was sent using IMP, the Internet Messaging Program.
          • jmostert@vividhost.net
            LOL. Uh, yeah.. OK. I GET IT! ... This message was sent using IMP, the Internet Messaging Program.
            Message 5 of 5 , Aug 2, 2004
              LOL.

              Uh, yeah.. OK. I GET IT!


              Quoting Allan Dystrup <allan_dystrup@...>:
              > http://dk.php.net/fopen
              >
              > btw,
              > PHP... is Hardly Perl is Hardly Perl is Hardly Perl
              > allan dystrup
              >
              > --- In perl-beginner@yahoogroups.com, jmostert@v... wrote:
              > > Dear Group,
              > >
              > > I'm a beginner in PHP and would like to know how
              > > do I use 'fopen()' to write to files, because of some
              > > wierd reason I have to set some flag because of a permission
              > > problem in PHP that does not allow me to "by default" write
              > > files to my 'httpdocs' directory. I can read files but not
              > > write to them. This is kinda strange, but yeah.
              > >
              > >
              > > Any help would really be appreciated.
              > > Thanks for your time.
              > >
              > >
              > >
              > > -Jacques.
              > >
              > > ----------------------------------------------------------------
              > > This message was sent using IMP, the Internet Messaging Program.
              >
              >
              >
              >
              > Unsubscribing info is here:
              > http://help.yahoo.com/help/us/groups/groups-32.html
              > Yahoo! Groups Links
              >
              >
              >
              >
              >
              >




              ----------------------------------------------------------------
              This message was sent using IMP, the Internet Messaging Program.
            Your message has been successfully submitted and would be delivered to recipients shortly.