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

Re: [PBML] Dumb Question that is driving me nuts.

Expand Messages
  • Kul
    Franki, try this: (I have split the origional print onto mutiple lines - for readability only, and I know the one-programmers wont like it :-( ) print LOGFILE
    Message 1 of 14 , Jan 4, 2001
    • 0 Attachment
      Franki,

      try this: (I have split the origional print onto mutiple lines - for readability only, and I know the one-programmers wont like it :-( )

      print LOGFILE "\$CHECKOUT_PATH=\"$CHECKOUT_PATH\"\n";
      print LOGFILE "\$HASHKEY_PASSWORD=\"$HASHKEY_PASSWORD\"\n";
      ....
      ....
      and so on

      explanation:
      the \ infront of the $ (\$CHECKOUT_PATH) tells it to print this literally, ie not interpret it
      the \ infront of the " (same as above) or it will think this is the end of the PRINT command - cause errors.

      Regards
      Kul
      --
      +------- ------ ----- ---- --- -- - - - - - - - -
      "Scientia est Potentia" - "Knowledge is Power" ...... if you ain't got it, then blag it!
      +------- ------ ----- ---- --- -- - - - - - - - -
      Any Syntax or Spelling Errors are nothing to do with me,
      They must be Transmission Errors !
      +------- ------ ----- ---- --- -- - - - - - - - -


      Franki wrote:

      > Hi all,
      >
      > I am new and not terribly good a perl yet and I have a problem that is
      > making me pull my hair out.
      >
      > I have an auto config script that is supposed to offer a way for people to
      > configure another script via their browser.
      >
      > There is a section in this script that is supposed to add variables to a
      > config file, it looks like the following.
      >
      > print LOGFILE "$CHECKOUT_PATH\n
      > $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
      > E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
      > ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
      > T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
      > GOCART_FORM_COLOUR1\n" ;
      >
      > This just puts the values of the above variables in the file. Like so:
      >
      > /home/httpd/cgi-bin/checkout/
      > YourPassword
      > Your IP Address
      > E-Pay Server Address
      > franki@...
      > Mail Server IP Address.
      > http://www.yourdomain.com.au
      > TEST_SERVER
      > CHECKOUT
      > http://www.yourdomain.com.au/your_cart_address
      > http://www.yourdomain.com.au/images/title.jpg
      > My Stores Name
      > #008000
      > #008000
      > http://www.yourdomain.com.au/cgi-bin/checkout/GoCart.pl
      > http://www.yourdomain.com.au/cgi-bin/checkout/Checkout.pl
      > http://www.yourdomain.com.au/images/title.jpg
      > My Stores Name
      > #008000
      > #008000
      >
      > I need it to print out the following,. ( I'll just do it for the first one,
      > there is no need to do them all.)
      >
      > $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout/"
      > I need it to print out as above instead of just the variables value.
      >
      > But no matter what I do, it doesn't print it out properly.
      >
      > Any anyone help me in how to setup the:
      >
      > print LOGFILE "$CHECKOUT_PATH\n
      > $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
      > E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
      > ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
      > T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
      > GOCART_FORM_COLOUR1\n" ;
      >
      > line so that it prints out the lot in the correct format?
      >
      > Thankyou all,
      >
      > Kindest regards
      >
      > Frank Hauptle
      > http://www.gshop.com.au/
      > franki@...
    • Franki
      Excellent, you re a legend, works great. One last thing, :) The line $CHECKOUT_PATH= /home/httpd/cgi-bin/checkout needs to be changed to
      Message 2 of 14 , Jan 4, 2001
      • 0 Attachment
        Excellent, you're a legend, works great.


        One last thing, :)

        The line $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout" needs to be changed
        to $CHECKOUT_PATH="//home//httpd//cgi-bin//checkout"

        Is it possible to add a line to the script that takes the value of
        $CHECKOUT_PATH (which is always a local server path) and add the second /'s
        to it?

        I love this mailing list, can't believe I got an answer less then 10 minutes
        after I wrote the question, that's excellent.



        regards

        Frank Hauptle
        http://www.gshop.com.au/
        franki@...

        -----Original Message-----
        From: Kul [mailto:aka.Kul@...]
        Sent: Friday, 5 January 2001 3:31 PM
        To: perl-beginner@egroups.com
        Subject: Re: [PBML] Dumb Question that is driving me nuts.

        Franki,

        try this: (I have split the origional print onto mutiple lines - for
        readability only, and I know the one-programmers wont like it :-( )

        print LOGFILE "\$CHECKOUT_PATH=\"$CHECKOUT_PATH\"\n";
        print LOGFILE "\$HASHKEY_PASSWORD=\"$HASHKEY_PASSWORD\"\n";
        ....
        ....
        and so on

        explanation:
        the \ infront of the $ (\$CHECKOUT_PATH) tells it to print this literally,
        ie not interpret it
        the \ infront of the " (same as above) or it will think this is the end of
        the PRINT command - cause errors.

        Regards
        Kul
        --
        +------- ------ ----- ---- --- -- - - - - - - - -
        "Scientia est Potentia" - "Knowledge is Power" ...... if you ain't got it,
        then blag it!
        +------- ------ ----- ---- --- -- - - - - - - - -
        Any Syntax or Spelling Errors are nothing to do with me,
        They must be Transmission Errors !
        +------- ------ ----- ---- --- -- - - - - - - - -


        Franki wrote:

        > Hi all,
        >
        > I am new and not terribly good a perl yet and I have a problem that is
        > making me pull my hair out.
        >
        > I have an auto config script that is supposed to offer a way for people to
        > configure another script via their browser.
        >
        > There is a section in this script that is supposed to add variables to a
        > config file, it looks like the following.
        >
        > print LOGFILE "$CHECKOUT_PATH\n
        >
        $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
        >
        E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
        >
        ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
        >
        T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
        > GOCART_FORM_COLOUR1\n" ;
        >
        > This just puts the values of the above variables in the file. Like so:
        >
        > /home/httpd/cgi-bin/checkout/
        > YourPassword
        > Your IP Address
        > E-Pay Server Address
        > franki@...
        > Mail Server IP Address.
        > http://www.yourdomain.com.au
        > TEST_SERVER
        > CHECKOUT
        > http://www.yourdomain.com.au/your_cart_address
        > http://www.yourdomain.com.au/images/title.jpg
        > My Stores Name
        > #008000
        > #008000
        > http://www.yourdomain.com.au/cgi-bin/checkout/GoCart.pl
        > http://www.yourdomain.com.au/cgi-bin/checkout/Checkout.pl
        > http://www.yourdomain.com.au/images/title.jpg
        > My Stores Name
        > #008000
        > #008000
        >
        > I need it to print out the following,. ( I'll just do it for the first
        one,
        > there is no need to do them all.)
        >
        > $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout/"
        > I need it to print out as above instead of just the variables value.
        >
        > But no matter what I do, it doesn't print it out properly.
        >
        > Any anyone help me in how to setup the:
        >
        > print LOGFILE "$CHECKOUT_PATH\n
        >
        $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
        >
        E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
        >
        ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
        >
        T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
        > GOCART_FORM_COLOUR1\n" ;
        >
        > line so that it prints out the lot in the correct format?
        >
        > Thankyou all,
        >
        > Kindest regards
        >
        > Frank Hauptle
        > http://www.gshop.com.au/
        > franki@...
      • Kul
        $CHECKOUT_PATH =~ s/ // / //g; then print it as per before
        Message 3 of 14 , Jan 4, 2001
        • 0 Attachment
          $CHECKOUT_PATH =~ s/\//\/\//g;
          then print it as per before

          Franki wrote:

          > Excellent, you're a legend, works great.
          >
          > One last thing, :)
          >
          > The line $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout" needs to be changed
          > to $CHECKOUT_PATH="//home//httpd//cgi-bin//checkout"
          >
          > Is it possible to add a line to the script that takes the value of
          > $CHECKOUT_PATH (which is always a local server path) and add the second /'s
          > to it?
          >
          > I love this mailing list, can't believe I got an answer less then 10 minutes
          > after I wrote the question, that's excellent.
          >
          > regards
          >
          > Frank Hauptle
          > http://www.gshop.com.au/
          > franki@...
          >
          > -----Original Message-----
          > From: Kul [mailto:aka.Kul@...]
          > Sent: Friday, 5 January 2001 3:31 PM
          > To: perl-beginner@egroups.com
          > Subject: Re: [PBML] Dumb Question that is driving me nuts.
          >
          > Franki,
          >
          > try this: (I have split the origional print onto mutiple lines - for
          > readability only, and I know the one-programmers wont like it :-( )
          >
          > print LOGFILE "\$CHECKOUT_PATH=\"$CHECKOUT_PATH\"\n";
          > print LOGFILE "\$HASHKEY_PASSWORD=\"$HASHKEY_PASSWORD\"\n";
          > ....
          > ....
          > and so on
          >
          > explanation:
          > the \ infront of the $ (\$CHECKOUT_PATH) tells it to print this literally,
          > ie not interpret it
          > the \ infront of the " (same as above) or it will think this is the end of
          > the PRINT command - cause errors.
          >
          > Regards
          > Kul
          > --
          > +------- ------ ----- ---- --- -- - - - - - - - -
          > "Scientia est Potentia" - "Knowledge is Power" ...... if you ain't got it,
          > then blag it!
          > +------- ------ ----- ---- --- -- - - - - - - - -
          > Any Syntax or Spelling Errors are nothing to do with me,
          > They must be Transmission Errors !
          > +------- ------ ----- ---- --- -- - - - - - - - -
          >
          > Franki wrote:
          >
          > > Hi all,
          > >
          > > I am new and not terribly good a perl yet and I have a problem that is
          > > making me pull my hair out.
          > >
          > > I have an auto config script that is supposed to offer a way for people to
          > > configure another script via their browser.
          > >
          > > There is a section in this script that is supposed to add variables to a
          > > config file, it looks like the following.
          > >
          > > print LOGFILE "$CHECKOUT_PATH\n
          > >
          > $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
          > >
          > E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
          > >
          > ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
          > >
          > T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
          > > GOCART_FORM_COLOUR1\n" ;
          > >
          > > This just puts the values of the above variables in the file. Like so:
          > >
          > > /home/httpd/cgi-bin/checkout/
          > > YourPassword
          > > Your IP Address
          > > E-Pay Server Address
          > > franki@...
          > > Mail Server IP Address.
          > > http://www.yourdomain.com.au
          > > TEST_SERVER
          > > CHECKOUT
          > > http://www.yourdomain.com.au/your_cart_address
          > > http://www.yourdomain.com.au/images/title.jpg
          > > My Stores Name
          > > #008000
          > > #008000
          > > http://www.yourdomain.com.au/cgi-bin/checkout/GoCart.pl
          > > http://www.yourdomain.com.au/cgi-bin/checkout/Checkout.pl
          > > http://www.yourdomain.com.au/images/title.jpg
          > > My Stores Name
          > > #008000
          > > #008000
          > >
          > > I need it to print out the following,. ( I'll just do it for the first
          > one,
          > > there is no need to do them all.)
          > >
          > > $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout/"
          > > I need it to print out as above instead of just the variables value.
          > >
          > > But no matter what I do, it doesn't print it out properly.
          > >
          > > Any anyone help me in how to setup the:
          > >
          > > print LOGFILE "$CHECKOUT_PATH\n
          > >
          > $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
          > >
          > E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
          > >
          > ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
          > >
          > T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
          > > GOCART_FORM_COLOUR1\n" ;
          > >
          > > line so that it prints out the lot in the correct format?
          > >
          > > Thankyou all,
          > >
          > > Kindest regards
          > >
          > > Frank Hauptle
          > > http://www.gshop.com.au/
          > > franki@...
        • Rahul Jain
          What I understood from your problem is as follows: $CHECKOUT_PATH = /home/httpd/cgi-bin/checkout/ ; you want to print the whole statement intoa file(LOGFILE).
          Message 4 of 14 , Jan 4, 2001
          • 0 Attachment
            What I understood from your problem is as follows:

            $CHECKOUT_PATH = "/home/httpd/cgi-bin/checkout/";

            you want to print the whole statement intoa file(LOGFILE). However, when you
            give a print statement like
            print LOGFILE "$CHECKOUT_PATH" ;
            it prints only the variable value ie
            /home/httpd/cgi-bin/checkout/

            This is because $ has a special meaning in Perl. To override this special
            meaning, give a '\' before '$'. ie
            rewrite your print statement as follows:

            print LOGFILE "\$CHECKOUT_PATH = $CHECKOUT_PATH";

            The output will be
            $CHECKOUT_PATH = /home/httpd/cgi-bin/checkout/

            The special meaning of the first $ sign has been overridden by the '\'. thus
            this is treated as a normal string.
            However, when perl encounters the second $ sign ( wich does not have a
            preceding '\'), it knows that you
            are trying o print the value of a scalar represented by $CHECKOUT_PATH.

            Please note that it is important to use double quotes instead of single quotes
            for this print statement to work.

            The $ sign loses its special meaning inside single quotes. ie

            print LOGFILE '\$CHECKOUT_PATH = $CHECKOUT_PATH'

            will print

            \$CHECKOUT_PATH = $CHECKOUT_PATH

            Hope this helps,

            Rahul


            Franki wrote:

            > Hi all,
            >
            > I am new and not terribly good a perl yet and I have a problem that is
            > making me pull my hair out.
            >
            > I have an auto config script that is supposed to offer a way for people to
            > configure another script via their browser.
            >
            > There is a section in this script that is supposed to add variables to a
            > config file, it looks like the following.
            >
            > print LOGFILE "$CHECKOUT_PATH\n
            > $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
            > E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
            > ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
            > T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
            > GOCART_FORM_COLOUR1\n" ;
            >
            > This just puts the values of the above variables in the file. Like so:
            >
            > /home/httpd/cgi-bin/checkout/
            > YourPassword
            > Your IP Address
            > E-Pay Server Address
            > franki@...
            > Mail Server IP Address.
            > http://www.yourdomain.com.au
            > TEST_SERVER
            > CHECKOUT
            > http://www.yourdomain.com.au/your_cart_address
            > http://www.yourdomain.com.au/images/title.jpg
            > My Stores Name
            > #008000
            > #008000
            > http://www.yourdomain.com.au/cgi-bin/checkout/GoCart.pl
            > http://www.yourdomain.com.au/cgi-bin/checkout/Checkout.pl
            > http://www.yourdomain.com.au/images/title.jpg
            > My Stores Name
            > #008000
            > #008000
            >
            > I need it to print out the following,. ( I'll just do it for the first one,
            > there is no need to do them all.)
            >
            > $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout/"
            > I need it to print out as above instead of just the variables value.
            >
            > But no matter what I do, it doesn't print it out properly.
            >
            > Any anyone help me in how to setup the:
            >
            > print LOGFILE "$CHECKOUT_PATH\n
            > $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
            > E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
            > ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
            > T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
            > GOCART_FORM_COLOUR1\n" ;
            >
            > line so that it prints out the lot in the correct format?
            >
            > Thankyou all,
            >
            > Kindest regards
            >
            > Frank Hauptle
            > http://www.gshop.com.au/
            > franki@...
            >
            > -----Original Message-----
            > From: Kul [mailto:aka.Kul@...]
            > Sent: Friday, 5 January 2001 3:00 PM
            > To: perl-beginner@egroups.com
            > Subject: Re: [PBML] Sendmail problem
            >
            > Hi Alan,
            > When I cut'n'pasted your first example and uploaded it to my server, it ran
            > straight away (after changing the email address and adding a print
            > content-type header).
            > Now for a dumb question: Have you got any scripts working before?
            > Are you sure that sendmail is in that location?
            > try locating sendmail via telnet/ssh etc ("whereis sendmail")
            > or if you dont have access to telnet/ssh, try this baby script:
            >
            > #!/bin/perl
            > print "Content-type: text/plain", "\n\n";
            > $sendmail =`whereis sendmail`;
            > @mailloc = split(" ", $sendmail);
            > foreach $loc (@mailloc) { print "$loc\n"; }
            >
            > Regards
            > Kul
            >
            > Alan Mackenzie wrote:
            >
            > > I have tried this mini e-mail script two ways and can't get it to send
            > > mail. The scripts check out under -c and -wc but don't send mail. Any
            > ideas
            > > what the problem is?
            > > (permissions are okay, digiweb site; Solaris system; Apache server)
            > >
            > > 1.
            > > #!/bin/perl
            > > $from_address = "asm\@...";
            > > $to_address = "asm\@...";
            > > $subject='test';
            > > $body='test sent 8:40';
            > > open(MAIL, "|/usr/lib/sendmail -oi -t") or die "Can't open sendmail:
            > $!\n";
            > > print MAIL <<"EOF";
            > > From: $from_address
            > > To: $to_address
            > > Subject: $subject
            > > sendmail worked
            > > $body
            > > EOF
            > > close(MAIL) or die $! ? "sendmail didn't close nicely: $!\n":
            > > "sendmail exit code $?";
            > >
            > > 2.
            > > #!/bin/perl
            > > $from_address="asm/@...";
            > > $to_address="alan/@...";
            > > $subject="test";
            > > $body="test sent 12:00";
            > > use Mail::Mailer;
            > >
            > > $mailer = Mail::Mailer->new();
            > > $mailer->open({ From => $from_address,
            > > To => $to_address,
            > > Subject => $subject,
            > > })
            > > or die "Can't open: $!\n";
            > > print $mailer $body;
            > > $mailer->close();
            > >
            > > =============================================
            > > ***** DEVELOPING AUTONOMY *****
            > > The 2nd CUE mini-conference
            > > @
            > > Shimizu, Shizuoka. May 12-13th 2001.
            > > Proposals deadline is January 25th 2001
            > > Need more information?
            > > http://www.wild-e.org/cue/conferences/autonomy.html
            > > or contact Eamon McCafferty eamon@...
            > >
            > > ============================================
            > > Alan Mackenzie
            > > CUE Coordinator
            > > College and University Educators Special Interest Group of
            > > JALT (the Japan Association for Language Teaching)
          • Franki
            That worked too !!!!!!!! I am young and have sooooooo much to learn. :) Thankyou again... Frank Hauptle http://www.gshop.com.au/ franki@gshop.com.au ...
            Message 5 of 14 , Jan 5, 2001
            • 0 Attachment
              That worked too !!!!!!!!

              I am young and have sooooooo much to learn. :)

              Thankyou again...

              Frank Hauptle
              http://www.gshop.com.au/
              franki@...

              -----Original Message-----
              From: Kul [mailto:aka.Kul@...]
              Sent: Friday, 5 January 2001 3:52 PM
              To: perl-beginner@egroups.com
              Subject: Re: [PBML] Dumb Question that is driving me nuts.


              $CHECKOUT_PATH =~ s/\//\/\//g;
              then print it as per before

              Franki wrote:

              > Excellent, you're a legend, works great.
              >
              > One last thing, :)
              >
              > The line $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout" needs to be
              changed
              > to $CHECKOUT_PATH="//home//httpd//cgi-bin//checkout"
              >
              > Is it possible to add a line to the script that takes the value of
              > $CHECKOUT_PATH (which is always a local server path) and add the second
              /'s
              > to it?
              >
              > I love this mailing list, can't believe I got an answer less then 10
              minutes
              > after I wrote the question, that's excellent.
              >
              > regards
              >
              > Frank Hauptle
              > http://www.gshop.com.au/
              > franki@...
              >
              > -----Original Message-----
              > From: Kul [mailto:aka.Kul@...]
              > Sent: Friday, 5 January 2001 3:31 PM
              > To: perl-beginner@egroups.com
              > Subject: Re: [PBML] Dumb Question that is driving me nuts.
              >
              > Franki,
              >
              > try this: (I have split the origional print onto mutiple lines - for
              > readability only, and I know the one-programmers wont like it :-( )
              >
              > print LOGFILE "\$CHECKOUT_PATH=\"$CHECKOUT_PATH\"\n";
              > print LOGFILE "\$HASHKEY_PASSWORD=\"$HASHKEY_PASSWORD\"\n";
              > ....
              > ....
              > and so on
              >
              > explanation:
              > the \ infront of the $ (\$CHECKOUT_PATH) tells it to print this literally,
              > ie not interpret it
              > the \ infront of the " (same as above) or it will think this is the end of
              > the PRINT command - cause errors.
              >
              > Regards
              > Kul
              > --
              > +------- ------ ----- ---- --- -- - - - - - - - -
              > "Scientia est Potentia" - "Knowledge is Power" ...... if you ain't got it,
              > then blag it!
              > +------- ------ ----- ---- --- -- - - - - - - - -
              > Any Syntax or Spelling Errors are nothing to do with me,
              > They must be Transmission Errors !
              > +------- ------ ----- ---- --- -- - - - - - - - -
              >
              > Franki wrote:
              >
              > > Hi all,
              > >
              > > I am new and not terribly good a perl yet and I have a problem that is
              > > making me pull my hair out.
              > >
              > > I have an auto config script that is supposed to offer a way for people
              to
              > > configure another script via their browser.
              > >
              > > There is a section in this script that is supposed to add variables to a
              > > config file, it looks like the following.
              > >
              > > print LOGFILE "$CHECKOUT_PATH\n
              > >
              >
              $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
              > >
              >
              E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
              > >
              >
              ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
              > >
              >
              T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
              > > GOCART_FORM_COLOUR1\n" ;
              > >
              > > This just puts the values of the above variables in the file. Like so:
              > >
              > > /home/httpd/cgi-bin/checkout/
              > > YourPassword
              > > Your IP Address
              > > E-Pay Server Address
              > > franki@...
              > > Mail Server IP Address.
              > > http://www.yourdomain.com.au
              > > TEST_SERVER
              > > CHECKOUT
              > > http://www.yourdomain.com.au/your_cart_address
              > > http://www.yourdomain.com.au/images/title.jpg
              > > My Stores Name
              > > #008000
              > > #008000
              > > http://www.yourdomain.com.au/cgi-bin/checkout/GoCart.pl
              > > http://www.yourdomain.com.au/cgi-bin/checkout/Checkout.pl
              > > http://www.yourdomain.com.au/images/title.jpg
              > > My Stores Name
              > > #008000
              > > #008000
              > >
              > > I need it to print out the following,. ( I'll just do it for the first
              > one,
              > > there is no need to do them all.)
              > >
              > > $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout/"
              > > I need it to print out as above instead of just the variables value.
              > >
              > > But no matter what I do, it doesn't print it out properly.
              > >
              > > Any anyone help me in how to setup the:
              > >
              > > print LOGFILE "$CHECKOUT_PATH\n
              > >
              >
              $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
              > >
              >
              E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
              > >
              >
              ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
              > >
              >
              T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
              > > GOCART_FORM_COLOUR1\n" ;
              > >
              > > line so that it prints out the lot in the correct format?
              > >
              > > Thankyou all,
              > >
              > > Kindest regards
              > >
              > > Frank Hauptle
              > > http://www.gshop.com.au/
              > > franki@...
            • Franki
              Can you explain this line to me? How does it do it? I want to modify it to add a / in front of an @ in an email address... Frank Hauptle
              Message 6 of 14 , Jan 5, 2001
              • 0 Attachment
                Can you explain this line to me? How does it do it?

                I want to modify it to add a / in front of an @ in an email address...

                Frank Hauptle
                http://www.gshop.com.au/
                franki@...

                -----Original Message-----
                From: Kul [mailto:aka.Kul@...]
                Sent: Friday, 5 January 2001 3:52 PM
                To: perl-beginner@egroups.com
                Subject: Re: [PBML] Dumb Question that is driving me nuts.


                $CHECKOUT_PATH =~ s/\//\/\//g;
                then print it as per before

                Franki wrote:

                > Excellent, you're a legend, works great.
                >
                > One last thing, :)
                >
                > The line $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout" needs to be
                changed
                > to $CHECKOUT_PATH="//home//httpd//cgi-bin//checkout"
                >
                > Is it possible to add a line to the script that takes the value of
                > $CHECKOUT_PATH (which is always a local server path) and add the second
                /'s
                > to it?
                >
                > I love this mailing list, can't believe I got an answer less then 10
                minutes
                > after I wrote the question, that's excellent.
                >
                > regards
                >
                > Frank Hauptle
                > http://www.gshop.com.au/
                > franki@...
                >
                > -----Original Message-----
                > From: Kul [mailto:aka.Kul@...]
                > Sent: Friday, 5 January 2001 3:31 PM
                > To: perl-beginner@egroups.com
                > Subject: Re: [PBML] Dumb Question that is driving me nuts.
                >
                > Franki,
                >
                > try this: (I have split the origional print onto mutiple lines - for
                > readability only, and I know the one-programmers wont like it :-( )
                >
                > print LOGFILE "\$CHECKOUT_PATH=\"$CHECKOUT_PATH\"\n";
                > print LOGFILE "\$HASHKEY_PASSWORD=\"$HASHKEY_PASSWORD\"\n";
                > ....
                > ....
                > and so on
                >
                > explanation:
                > the \ infront of the $ (\$CHECKOUT_PATH) tells it to print this literally,
                > ie not interpret it
                > the \ infront of the " (same as above) or it will think this is the end of
                > the PRINT command - cause errors.
                >
                > Regards
                > Kul
                > --
                > +------- ------ ----- ---- --- -- - - - - - - - -
                > "Scientia est Potentia" - "Knowledge is Power" ...... if you ain't got it,
                > then blag it!
                > +------- ------ ----- ---- --- -- - - - - - - - -
                > Any Syntax or Spelling Errors are nothing to do with me,
                > They must be Transmission Errors !
                > +------- ------ ----- ---- --- -- - - - - - - - -
                >
                > Franki wrote:
                >
                > > Hi all,
                > >
                > > I am new and not terribly good a perl yet and I have a problem that is
                > > making me pull my hair out.
                > >
                > > I have an auto config script that is supposed to offer a way for people
                to
                > > configure another script via their browser.
                > >
                > > There is a section in this script that is supposed to add variables to a
                > > config file, it looks like the following.
                > >
                > > print LOGFILE "$CHECKOUT_PATH\n
                > >
                >
                $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
                > >
                >
                E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
                > >
                >
                ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
                > >
                >
                T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
                > > GOCART_FORM_COLOUR1\n" ;
                > >
                > > This just puts the values of the above variables in the file. Like so:
                > >
                > > /home/httpd/cgi-bin/checkout/
                > > YourPassword
                > > Your IP Address
                > > E-Pay Server Address
                > > franki@...
                > > Mail Server IP Address.
                > > http://www.yourdomain.com.au
                > > TEST_SERVER
                > > CHECKOUT
                > > http://www.yourdomain.com.au/your_cart_address
                > > http://www.yourdomain.com.au/images/title.jpg
                > > My Stores Name
                > > #008000
                > > #008000
                > > http://www.yourdomain.com.au/cgi-bin/checkout/GoCart.pl
                > > http://www.yourdomain.com.au/cgi-bin/checkout/Checkout.pl
                > > http://www.yourdomain.com.au/images/title.jpg
                > > My Stores Name
                > > #008000
                > > #008000
                > >
                > > I need it to print out the following,. ( I'll just do it for the first
                > one,
                > > there is no need to do them all.)
                > >
                > > $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout/"
                > > I need it to print out as above instead of just the variables value.
                > >
                > > But no matter what I do, it doesn't print it out properly.
                > >
                > > Any anyone help me in how to setup the:
                > >
                > > print LOGFILE "$CHECKOUT_PATH\n
                > >
                >
                $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
                > >
                >
                E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
                > >
                >
                ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
                > >
                >
                T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
                > > GOCART_FORM_COLOUR1\n" ;
                > >
                > > line so that it prints out the lot in the correct format?
                > >
                > > Thankyou all,
                > >
                > > Kindest regards
                > >
                > > Frank Hauptle
                > > http://www.gshop.com.au/
                > > franki@...
              • Randall Hobbs
                It s somewhat tough to see what s going on with all of the leaning tooth pick syndrome going on... Here s a little bit easier example to follow:
                Message 7 of 14 , Jan 5, 2001
                • 0 Attachment
                  It's somewhat tough to see what's going on with all of the "leaning tooth pick syndrome" going on... Here's a little bit easier example to follow:
                   
                  $CHECKOUT_PATH =~ s#\/#\/\/#g;
                   
                  This statement is a substitution... When it encounters a slash (here it has to be escaped, so \/), it replaces it with TWO slashes (here again, escaped, so \/\/).... The g means "global", so make this substitution through out the entire $CHECKOUT_PATH scalar...
                   
                  BTW ~ Using the pound sign like this works too, and it makes it easier when trying to decipher all the slash marks... LOL.
                   
                  Hope this helps...
                   
                  Take care...
                  Randall
                   
                  ----- Original Message -----
                  From: Franki
                  Sent: Friday, January 05, 2001 2:20 AM
                  Subject: RE: [PBML] Dumb Question that is driving me nuts. explain ??

                  Can you explain this line to me?  How does it do it?

                  I want to modify it to add a / in front of an @ in an email address...

                  Frank Hauptle
                  http://www.gshop.com.au/
                  franki@...

                  -----Original Message-----
                  From: Kul [mailto:aka.Kul@...]
                  Sent: Friday, 5 January 2001 3:52 PM
                  To: perl-beginner@egroups.com
                  Subject: Re: [PBML] Dumb Question that is driving me nuts.


                  $CHECKOUT_PATH =~ s/\//\/\//g;
                  then print it as per before

                  Franki wrote:

                  > Excellent, you're a legend, works great.
                  >
                  > One last thing,  :)
                  >
                  > The line $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout"  needs to be
                  changed
                  > to $CHECKOUT_PATH="//home//httpd//cgi-bin//checkout"
                  >
                  > Is it possible to add a line to the script that takes the value of
                  > $CHECKOUT_PATH (which is always a local server path) and add the second
                  /'s
                  > to it?
                  >
                  > I love this mailing list, can't believe I got an answer less then 10
                  minutes
                  > after I wrote the question, that's excellent.
                  >
                  > regards
                  >
                  > Frank Hauptle
                  > http://www.gshop.com.au/
                  > franki@...
                  >
                  > -----Original Message-----
                  > From: Kul [mailto:aka.Kul@...]
                  > Sent: Friday, 5 January 2001 3:31 PM
                  > To: perl-beginner@egroups.com
                  > Subject: Re: [PBML] Dumb Question that is driving me nuts.
                  >
                  > Franki,
                  >
                  > try this: (I have split the origional print onto mutiple lines - for
                  > readability only, and I know the one-programmers wont like it :-(  )
                  >
                  > print LOGFILE "\$CHECKOUT_PATH=\"$CHECKOUT_PATH\"\n";
                  > print LOGFILE "\$HASHKEY_PASSWORD=\"$HASHKEY_PASSWORD\"\n";
                  > ....
                  > ....
                  > and so on
                  >
                  > explanation:
                  > the \ infront of the $ (\$CHECKOUT_PATH) tells it to print this literally,
                  > ie not interpret it
                  > the \ infront of the " (same as above) or it will think this is the end of
                  > the PRINT command - cause errors.
                  >
                  > Regards
                  > Kul
                  > --
                  > +------- ------ ----- ---- --- -- - - -  -   -    -     -      -
                  > "Scientia est Potentia" - "Knowledge is Power" ...... if you ain't got it,
                  > then blag it!
                  > +------- ------ ----- ---- --- -- - - -  -   -    -     -      -
                  >  Any Syntax or Spelling Errors are nothing to do with me,
                  >       They must be Transmission Errors !
                  > +------- ------ ----- ---- --- -- - - -  -   -    -     -      -
                  >
                  > Franki wrote:
                  >
                  > > Hi all,
                  > >
                  > > I am new and not terribly good a perl yet and I have a problem that is
                  > > making me pull my hair out.
                  > >
                  > > I have an auto config script that is supposed to offer a way for people
                  to
                  > > configure another script via their browser.
                  > >
                  > > There is a section in this script that is supposed to add variables to a
                  > > config file, it looks like the following.
                  > >
                  > > print LOGFILE "$CHECKOUT_PATH\n
                  > >
                  >
                  $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
                  > >
                  >
                  E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
                  > >
                  >
                  ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
                  > >
                  >
                  T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
                  > > GOCART_FORM_COLOUR1\n" ;
                  > >
                  > > This just puts the values of the above variables in the file. Like so:
                  > >
                  > > /home/httpd/cgi-bin/checkout/
                  > > YourPassword
                  > > Your IP Address
                  > > E-Pay Server Address
                  > > franki@...
                  > > Mail Server IP Address.
                  > > http://www.yourdomain.com.au
                  > > TEST_SERVER
                  > > CHECKOUT
                  > > http://www.yourdomain.com.au/your_cart_address
                  > > http://www.yourdomain.com.au/images/title.jpg
                  > > My Stores Name
                  > > #008000
                  > > #008000
                  > > http://www.yourdomain.com.au/cgi-bin/checkout/GoCart.pl
                  > > http://www.yourdomain.com.au/cgi-bin/checkout/Checkout.pl
                  > > http://www.yourdomain.com.au/images/title.jpg
                  > > My Stores Name
                  > > #008000
                  > > #008000
                  > >
                  > > I need it to print out the following,. ( I'll just do it for the first
                  > one,
                  > > there is no need to do them all.)
                  > >
                  > > $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout/"
                  > > I need it to print out as above instead of just the variables value.
                  > >
                  > > But no matter what I do, it doesn't print it out properly.
                  > >
                  > > Any anyone help me in how to setup the:
                  > >
                  > > print LOGFILE "$CHECKOUT_PATH\n
                  > >
                  >
                  $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
                  > >
                  >
                  E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
                  > >
                  >
                  ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
                  > >
                  >
                  T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
                  > > GOCART_FORM_COLOUR1\n" ;
                  > >
                  > > line so that it prints out the lot in the correct format?
                  > >
                  > > Thankyou all,
                  > >
                  > > Kindest regards
                  > >
                  > > Frank Hauptle
                  > > http://www.gshop.com.au/
                  > > franki@...






                • Franki
                  Yeah, I know about the scalar variable, I was just wondering how to have it print as the variable name as well. I got that side of it working now, just have to
                  Message 8 of 14 , Jan 5, 2001
                  • 0 Attachment
                    Yeah, I know about the scalar variable, I was just wondering how to have it
                    print as the variable name as well.

                    I got that side of it working now, just have to figure out how to add a / to
                    the front of the @ symbol when it prints the email address.

                    Frank Hauptle
                    http://www.gshop.com.au/
                    franki@...

                    -----Original Message-----
                    From: Rahul Jain [mailto:rahul_jain@...]
                    Sent: Friday, 5 January 2001 3:53 PM
                    To: perl-beginner@egroups.com
                    Subject: Re: [PBML] Dumb Question that is driving me nuts.

                    What I understood from your problem is as follows:

                    $CHECKOUT_PATH = "/home/httpd/cgi-bin/checkout/";

                    you want to print the whole statement intoa file(LOGFILE). However, when you
                    give a print statement like
                    print LOGFILE "$CHECKOUT_PATH" ;
                    it prints only the variable value ie
                    /home/httpd/cgi-bin/checkout/

                    This is because $ has a special meaning in Perl. To override this special
                    meaning, give a '\' before '$'. ie
                    rewrite your print statement as follows:

                    print LOGFILE "\$CHECKOUT_PATH = $CHECKOUT_PATH";

                    The output will be
                    $CHECKOUT_PATH = /home/httpd/cgi-bin/checkout/

                    The special meaning of the first $ sign has been overridden by the '\'. thus
                    this is treated as a normal string.
                    However, when perl encounters the second $ sign ( wich does not have a
                    preceding '\'), it knows that you
                    are trying o print the value of a scalar represented by $CHECKOUT_PATH.

                    Please note that it is important to use double quotes instead of single
                    quotes
                    for this print statement to work.

                    The $ sign loses its special meaning inside single quotes. ie

                    print LOGFILE '\$CHECKOUT_PATH = $CHECKOUT_PATH'

                    will print

                    \$CHECKOUT_PATH = $CHECKOUT_PATH

                    Hope this helps,

                    Rahul


                    Franki wrote:

                    > Hi all,
                    >
                    > I am new and not terribly good a perl yet and I have a problem that is
                    > making me pull my hair out.
                    >
                    > I have an auto config script that is supposed to offer a way for people to
                    > configure another script via their browser.
                    >
                    > There is a section in this script that is supposed to add variables to a
                    > config file, it looks like the following.
                    >
                    > print LOGFILE "$CHECKOUT_PATH\n
                    >
                    $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
                    >
                    E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
                    >
                    ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
                    >
                    T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
                    > GOCART_FORM_COLOUR1\n" ;
                    >
                    > This just puts the values of the above variables in the file. Like so:
                    >
                    > /home/httpd/cgi-bin/checkout/
                    > YourPassword
                    > Your IP Address
                    > E-Pay Server Address
                    > franki@...
                    > Mail Server IP Address.
                    > http://www.yourdomain.com.au
                    > TEST_SERVER
                    > CHECKOUT
                    > http://www.yourdomain.com.au/your_cart_address
                    > http://www.yourdomain.com.au/images/title.jpg
                    > My Stores Name
                    > #008000
                    > #008000
                    > http://www.yourdomain.com.au/cgi-bin/checkout/GoCart.pl
                    > http://www.yourdomain.com.au/cgi-bin/checkout/Checkout.pl
                    > http://www.yourdomain.com.au/images/title.jpg
                    > My Stores Name
                    > #008000
                    > #008000
                    >
                    > I need it to print out the following,. ( I'll just do it for the first
                    one,
                    > there is no need to do them all.)
                    >
                    > $CHECKOUT_PATH="/home/httpd/cgi-bin/checkout/"
                    > I need it to print out as above instead of just the variables value.
                    >
                    > But no matter what I do, it doesn't print it out properly.
                    >
                    > Any anyone help me in how to setup the:
                    >
                    > print LOGFILE "$CHECKOUT_PATH\n
                    >
                    $HASHKEY_PASSWORD\n$IP_ADDRESS\n$SERVER_IP\n$ADMIN_EMAIL\n$MAIL_SERVER\n$SIT
                    >
                    E_ADDRESS\n$SERVER_TYPE\n$RETURN_POST\n$POST_URL\n$BANNER_ADDRESS\n$TITLE_NA
                    >
                    ME\n$BACKGROUND_COLOUR\n$TEXT_COLOUR\n$GO_CART_ADDRESS\n$POST_PATH_FOR_GOCAR
                    >
                    T\n$GOCART_BANNER_ADDRESS\n$GOCART_STORE_NAME\n$GOCART_BACKGROUND_COLOUR1\n$
                    > GOCART_FORM_COLOUR1\n" ;
                    >
                    > line so that it prints out the lot in the correct format?
                    >
                    > Thankyou all,
                    >
                    > Kindest regards
                    >
                    > Frank Hauptle
                    > http://www.gshop.com.au/
                    > franki@...
                    >
                    > -----Original Message-----
                    > From: Kul [mailto:aka.Kul@...]
                    > Sent: Friday, 5 January 2001 3:00 PM
                    > To: perl-beginner@egroups.com
                    > Subject: Re: [PBML] Sendmail problem
                    >
                    > Hi Alan,
                    > When I cut'n'pasted your first example and uploaded it to my server, it
                    ran
                    > straight away (after changing the email address and adding a print
                    > content-type header).
                    > Now for a dumb question: Have you got any scripts working before?
                    > Are you sure that sendmail is in that location?
                    > try locating sendmail via telnet/ssh etc ("whereis sendmail")
                    > or if you dont have access to telnet/ssh, try this baby script:
                    >
                    > #!/bin/perl
                    > print "Content-type: text/plain", "\n\n";
                    > $sendmail =`whereis sendmail`;
                    > @mailloc = split(" ", $sendmail);
                    > foreach $loc (@mailloc) { print "$loc\n"; }
                    >
                    > Regards
                    > Kul
                    >
                    > Alan Mackenzie wrote:
                    >
                    > > I have tried this mini e-mail script two ways and can't get it to send
                    > > mail. The scripts check out under -c and -wc but don't send mail. Any
                    > ideas
                    > > what the problem is?
                    > > (permissions are okay, digiweb site; Solaris system; Apache server)
                    > >
                    > > 1.
                    > > #!/bin/perl
                    > > $from_address = "asm\@...";
                    > > $to_address = "asm\@...";
                    > > $subject='test';
                    > > $body='test sent 8:40';
                    > > open(MAIL, "|/usr/lib/sendmail -oi -t") or die "Can't open sendmail:
                    > $!\n";
                    > > print MAIL <<"EOF";
                    > > From: $from_address
                    > > To: $to_address
                    > > Subject: $subject
                    > > sendmail worked
                    > > $body
                    > > EOF
                    > > close(MAIL) or die $! ? "sendmail didn't close nicely: $!\n":
                    > > "sendmail exit code $?";
                    > >
                    > > 2.
                    > > #!/bin/perl
                    > > $from_address="asm/@...";
                    > > $to_address="alan/@...";
                    > > $subject="test";
                    > > $body="test sent 12:00";
                    > > use Mail::Mailer;
                    > >
                    > > $mailer = Mail::Mailer->new();
                    > > $mailer->open({ From => $from_address,
                    > > To => $to_address,
                    > > Subject => $subject,
                    > > })
                    > > or die "Can't open: $!\n";
                    > > print $mailer $body;
                    > > $mailer->close();
                    > >
                    > > =============================================
                    > > ***** DEVELOPING AUTONOMY *****
                    > > The 2nd CUE mini-conference
                    > > @
                    > > Shimizu, Shizuoka. May 12-13th 2001.
                    > > Proposals deadline is January 25th 2001
                    > > Need more information?
                    > > http://www.wild-e.org/cue/conferences/autonomy.html
                    > > or contact Eamon McCafferty eamon@...
                    > >
                    > > ============================================
                    > > Alan Mackenzie
                    > > CUE Coordinator
                    > > College and University Educators Special Interest Group of
                    > > JALT (the Japan Association for Language Teaching)
                  • Gerrit P. Haase
                    ... Hash: SHA1 ... Hi beginners, why to escape? if you use
                    Message 9 of 14 , Jan 5, 2001
                    • 0 Attachment
                      -----BEGIN PGP SIGNED MESSAGE-----
                      Hash: SHA1

                      <Den 5 Jan 2001, 2:36 Uhr, hat Randall Hobbs geschrieben:>
                      < Re: [PBML] Dumb Question that is dr >

                      > It's somewhat tough to see what's going on with all of the "leaning tooth pick syndrome"
                      > going on... Here's a little bit easier example to follow:
                      >
                      > $CHECKOUT_PATH =~ s#\/#\/\/#g;
                      >
                      > This statement is a substitution... When it encounters a slash (here it has to be escaped,
                      > so \/), it replaces it with TWO slashes (here again, escaped, so \/\/).... The g means
                      > "global", so make this substitution through out the entire $CHECKOUT_PATH scalar...
                      >
                      > BTW ~ Using the pound sign like this works too, and it makes it easier when trying to
                      > decipher all the slash marks... LOL.
                      >

                      Hi beginners,

                      why to escape? if you use pound sign as above, you need not to escape
                      slashes, only if you use slashes instead of the pound, slashes need to
                      be escaped!

                      Try out:

                      #!/usr/local/bin/perl

                      $file = "/hello/there/beginners";

                      #$file =~ s/\//\/\//g;
                      $file =~ s#/#//#g;

                      print $file;


                      -----BEGIN PGP SIGNATURE-----
                      Version: PGP 6.5.8 -- QDPGP 2.61c

                      iQA/AwUBOlW2laMmDzzIydaaEQKpkgCg0Apf3bbcNsLaYRWlnKiijMeDJmcAoP6O
                      9ck4w0MV+lcalL2A84qRvA0o
                      =p6T6
                      -----END PGP SIGNATURE-----
                      gph
                      --
                      gerrit.haase@...
                      PGP Version: 6.5.8 Public Key Information
                      KeyID: 0xC8C9D69A, Type/Size: DH/DSS 2048/1024bit
                      Key fingerprint = 57C8 1B1D CFE4 8515 AA3E 4499 A326 0F3C C8C9 D69A
                    • Randall Hobbs
                      Ahhhh.... Thanks Gerrit! I m still learning myself. I ve been programming about 6 months in Perl, but discover something new every day. I think that s what
                      Message 10 of 14 , Jan 5, 2001
                      • 0 Attachment
                        Ahhhh.... Thanks Gerrit! I'm still learning myself. I've been programming about 6 months in Perl, but discover something new every day. I think that's what makes Perl so great - There's ALWAYS more than one way to do something.... It just depends on how advanced you are as to how simple it is....
                         
                        Thanks again...
                        Randall
                        ----- Original Message -----
                        Sent: Friday, January 05, 2001 6:57 AM
                        Subject: Re: [PBML] Dumb Question that is driving me nuts. explain ??

                        -----BEGIN PGP SIGNED MESSAGE-----
                        Hash: SHA1

                        <Den 5 Jan 2001, 2:36 Uhr, hat Randall Hobbs geschrieben:>
                        < Re: [PBML] Dumb Question that is dr >

                        > It's somewhat tough to see what's going on with all of the "leaning tooth pick syndrome"
                        > going on... Here's a little bit easier example to follow:
                        >
                        > $CHECKOUT_PATH =~ s#\/#\/\/#g;
                        >
                        > This statement is a substitution... When it encounters a slash (here it has to be escaped,
                        > so \/), it replaces it with TWO slashes (here again, escaped, so \/\/).... The g means
                        > "global", so make this substitution through out the entire $CHECKOUT_PATH scalar...
                        >
                        > BTW ~ Using the pound sign like this works too, and it makes it easier when trying to
                        > decipher all the slash marks... LOL.
                        >

                        Hi beginners,

                        why to escape? if you use pound sign as above, you need not to escape
                        slashes, only if you use slashes instead of the pound, slashes need to
                        be escaped!

                        Try out:

                        #!/usr/local/bin/perl

                        $file = "/hello/there/beginners";

                        #$file =~ s/\//\/\//g;
                        $file =~ s#/#//#g;

                        print $file;


                        -----BEGIN PGP SIGNATURE-----
                        Version: PGP 6.5.8 -- QDPGP 2.61c

                        iQA/AwUBOlW2laMmDzzIydaaEQKpkgCg0Apf3bbcNsLaYRWlnKiijMeDJmcAoP6O
                        9ck4w0MV+lcalL2A84qRvA0o
                        =p6T6
                        -----END PGP SIGNATURE-----
                        gph
                        --
                        gerrit.haase@...
                        PGP Version: 6.5.8 Public Key Information
                        KeyID: 0xC8C9D69A, Type/Size: DH/DSS 2048/1024bit
                        Key fingerprint = 57C8 1B1D CFE4 8515 AA3E  4499 A326 0F3C C8C9 D69A



                      • Sheldon Smith
                        Look at the quotemeta function: $var = quotemeta $emailaddress; or $var = Q$emailaddress ;
                        Message 11 of 14 , Jan 5, 2001
                        • 0 Attachment
                          Look at the "quotemeta" function:

                          $var = quotemeta $emailaddress;
                          or
                          $var = "\Q$emailaddress";

                          > -----Original Message-----
                          > From: Franki [mailto:frankieh@...]
                          > Sent: Friday, January 05, 2001 5:06 AM
                          > To: perl-beginner@egroups.com
                          > Subject: RE: [PBML] Dumb Question that is driving me nuts.
                          >
                          >
                          > Yeah, I know about the scalar variable, I was just wondering
                          > how to have it
                          > print as the variable name as well.
                          >
                          > I got that side of it working now, just have to figure out
                          > how to add a / to
                          > the front of the @ symbol when it prints the email address.
                        • Franki
                          Ok, I have been playing with this for ages, and I can t seem to get This print LOGFILE $ADMIN_EMAIL= $ADMIN_EMAIL ; n ; which basically prints out the
                          Message 12 of 14 , Jan 5, 2001
                          • 0 Attachment
                            Ok,

                            I have been playing with this for ages, and I can't seem to get
                            This
                            print LOGFILE "\$ADMIN_EMAIL=\"$ADMIN_EMAIL\";\n";

                            which basically prints out the scalar $ADMIN_EMAIL="franki@..."
                            (the email address is an example obviously.)

                            I need it to add a \ in front of the @

                            And because my perl books haven't been delivered, I am forever trying stuff
                            till it works, but this isn't.

                            I need $ADMIN_EMAIL="franki\@..." to be the result, basically I
                            need the value of $ADMIN_EMAIL (which is always an email address) to have
                            the @ replaced with \@

                            I get errors with everything I try. :(

                            Can anyone spare a sec or two to help me out?


                            Regards,

                            Frank Hauptle
                            http://www.gshop.com.au/
                            franki@...

                            -----Original Message-----
                            From: Gerrit P. Haase [mailto:gerrit@...]
                            Sent: Friday, 5 January 2001 8:57 PM
                            To: Randall Hobbs; perl-beginner@egroups.com
                            Subject: Re: [PBML] Dumb Question that is driving me nuts. explain ??

                            -----BEGIN PGP SIGNED MESSAGE-----
                            Hash: SHA1

                            <Den 5 Jan 2001, 2:36 Uhr, hat Randall Hobbs geschrieben:>
                            < Re: [PBML] Dumb Question that is dr >

                            > It's somewhat tough to see what's going on with all of the "leaning tooth
                            pick syndrome"
                            > going on... Here's a little bit easier example to follow:
                            >
                            > $CHECKOUT_PATH =~ s#\/#\/\/#g;
                            >
                            > This statement is a substitution... When it encounters a slash (here it
                            has to be escaped,
                            > so \/), it replaces it with TWO slashes (here again, escaped, so \/\/)....
                            The g means
                            > "global", so make this substitution through out the entire $CHECKOUT_PATH
                            scalar...
                            >
                            > BTW ~ Using the pound sign like this works too, and it makes it easier
                            when trying to
                            > decipher all the slash marks... LOL.
                            >

                            Hi beginners,

                            why to escape? if you use pound sign as above, you need not to escape
                            slashes, only if you use slashes instead of the pound, slashes need to
                            be escaped!

                            Try out:

                            #!/usr/local/bin/perl

                            $file = "/hello/there/beginners";

                            #$file =~ s/\//\/\//g;
                            $file =~ s#/#//#g;

                            print $file;


                            -----BEGIN PGP SIGNATURE-----
                            Version: PGP 6.5.8 -- QDPGP 2.61c

                            iQA/AwUBOlW2laMmDzzIydaaEQKpkgCg0Apf3bbcNsLaYRWlnKiijMeDJmcAoP6O
                            9ck4w0MV+lcalL2A84qRvA0o
                            =p6T6
                            -----END PGP SIGNATURE-----
                            gph
                            --
                            gerrit.haase@...
                            PGP Version: 6.5.8 Public Key Information
                            KeyID: 0xC8C9D69A, Type/Size: DH/DSS 2048/1024bit
                            Key fingerprint = 57C8 1B1D CFE4 8515 AA3E 4499 A326 0F3C C8C9 D69A
                          • Franki
                            I am sorry, I don t understand what format to use this in.... I am new to this.... Frank Hauptle http://www.gshop.com.au/ franki@gshop.com.au ... From:
                            Message 13 of 14 , Jan 5, 2001
                            • 0 Attachment
                              I am sorry, I don't understand what format to use this in.... I am new to
                              this....




                              Frank Hauptle
                              http://www.gshop.com.au/
                              franki@...

                              -----Original Message-----
                              From: Sheldon Smith [mailto:sesmith@...]
                              Sent: Friday, 5 January 2001 11:12 PM
                              To: 'perl-beginner@egroups.com'
                              Subject: RE: [PBML] Dumb Question that is driving me nuts.

                              Look at the "quotemeta" function:

                              $var = quotemeta $emailaddress;
                              or
                              $var = "\Q$emailaddress";

                              > -----Original Message-----
                              > From: Franki [mailto:frankieh@...]
                              > Sent: Friday, January 05, 2001 5:06 AM
                              > To: perl-beginner@egroups.com
                              > Subject: RE: [PBML] Dumb Question that is driving me nuts.
                              >
                              >
                              > Yeah, I know about the scalar variable, I was just wondering
                              > how to have it
                              > print as the variable name as well.
                              >
                              > I got that side of it working now, just have to figure out
                              > how to add a / to
                              > the front of the @ symbol when it prints the email address.
                            • Sheldon Smith
                              In addition to putting a backslash before the at-sign ( @ ), if you are going to do any further manipulation in Perl, you may need backslashes ahead of the
                              Message 14 of 14 , Jan 5, 2001
                              • 0 Attachment
                                In addition to putting a backslash before the at-sign ("@"), if you are
                                going to do any further manipulation in Perl, you may need backslashes ahead
                                of the periods ("."). Try

                                print LOGFILE "\$ADMIN_EMAIL=\"\Q$ADMIN_EMAIL\E\";\n";

                                and see what happens.... Note the \Q and \E (both uppercase) in the string.
                                (\Q starts the quotemeta function.)

                                LOGFILE will now have
                                $ADMIN_EMAIL="franki\@gshop\.com\.au";

                                Until your books arrive, you can use the built-in documentation that should
                                have come with your Perl distribution, or (on the web):
                                http://velocity.activestate.com/docs/ActivePerl

                                Hope this helps....

                                > -----Original Message-----
                                > From: Franki [mailto:frankieh@...]
                                > Sent: Friday, January 05, 2001 9:13 AM
                                > To: perl-beginner@egroups.com
                                > Subject: RE: [PBML] Dumb Question that is driving me nuts. explain ??
                                >
                                >
                                > Ok,
                                >
                                > I have been playing with this for ages, and I can't seem to get
                                > This
                                > print LOGFILE "\$ADMIN_EMAIL=\"$ADMIN_EMAIL\";\n";
                                >
                                > which basically prints out the scalar
                                > $ADMIN_EMAIL="franki@..."
                                > (the email address is an example obviously.)
                                >
                                > I need it to add a \ in front of the @
                                >
                                > And because my perl books haven't been delivered, I am
                                > forever trying stuff
                                > till it works, but this isn't.
                                >
                                > I need $ADMIN_EMAIL="franki\@..." to be the result,
                                > basically I
                                > need the value of $ADMIN_EMAIL (which is always an email
                                > address) to have
                                > the @ replaced with \@
                                >
                                > I get errors with everything I try. :(
                                >
                                > Can anyone spare a sec or two to help me out?
                              Your message has been successfully submitted and would be delivered to recipients shortly.